Package com.rackspacecloud.blueflood.io

Examples of com.rackspacecloud.blueflood.io.AstyanaxMetadataIO


    @Test
    public void testIOReplacement() throws Exception {
       
        // create the replacement IO.
        final MetadataIO mapIO = new InMemoryMetadataIO();
        final MetadataIO astIO = new AstyanaxMetadataIO();
       
        final MetadataCache cache = MetadataCache.createLoadingCacheInstance();
        cache.setIO(astIO);
       
        // DO NOT SET USING LOCAL IO INSTANCE!!!!
View Full Code Here


    }
   
    @Parameterized.Parameters
    public static Collection<Object[]> getIOs() {
        List<Object[]> ios = new ArrayList<Object[]>();
        ios.add(new Object[] { new AstyanaxMetadataIO() });
        ios.add(new Object[] { new InMemoryMetadataIO() });
        return ios;
    }
View Full Code Here

        // Wait until the batch timer kicks off and flushes things to disk.
        Thread.sleep(2000);

        // By pass cache and read meta from disk to make sure things got written.
        AstyanaxMetadataIO metadataIO = new AstyanaxMetadataIO();
        Map<String, String> metaForL0 = metadataIO.getAllValues(l0);
        Assert.assertTrue(metaForL0.get("foo").equals("l0_foo"));
        Assert.assertTrue(metaForL0.get("bar").equals("l0_bar"));
    }
View Full Code Here

        // Write some data to metadata cache.
        Locator l0 = Locator.createLocatorFromPathComponents("1", "a", "b");
        Locator l1 = Locator.createLocatorFromPathComponents("1", "c", "d");

        AstyanaxMetadataIO metadataIO = new AstyanaxMetadataIO();
        Table<Locator, String, String> metaToWrite = HashBasedTable.create();

        // By the pass the cache and write to disk directly.
        metaToWrite.put(l0, "foo", "l0_foo");
        metaToWrite.put(l0, "bar", "l0_bar");
        metaToWrite.put(l1, "zee", "zzzzz");
        metadataIO.putAll(metaToWrite);

        // Do a cache get on one of those locators. We should get back null immediately.
        Assert.assertNull(cache.get(l0, "foo"));

        // Wait for the cache to be populated async for that locator + meta.
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.io.AstyanaxMetadataIO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.