@@ -0,0 +1,2373 @@
+/*%0A * Copyright 2014 Rackspace%0A *%0A *    Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *    you may not use this file except in compliance with the License.%0A *    You may obtain a copy of the License at%0A *%0A *        http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *    Unless required by applicable law or agreed to in writing, software%0A *    distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *    See the License for the specific language governing permissions and%0A *    limitations under the License.%0A */%0A%0Apackage com.rackspacecloud.blueflood.io;%0A%0Aimport com.google.common.collect.HashBasedTable;%0Aimport com.google.common.collect.Table;%0Aimport com.rackspacecloud.blueflood.cache.MetadataCache;%0Aimport com.rackspacecloud.blueflood.types.Locator;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Apublic class AstyanaxMetadataIOIntegrationTest extends IntegrationTestBase %7B%0A%0A    @Test%0A    public void testBatchedMetaWritesAndReads() throws Exception %7B%0A        final AstyanaxMetadataIO metadataIO = new AstyanaxMetadataIO();%0A        Table%3CLocator, String, String%3E metaTable = HashBasedTable.create();%0A        final Set%3CLocator%3E locators = new HashSet%3CLocator%3E();%0A        MetadataCache cache = MetadataCache.getInstance();%0A%0A        for (int i = 0; i %3C 10; i++) %7B%0A            Locator loc = Locator.createLocatorFromDbKey(%0A                    %2212345.rackspace.monitoring.enities.enFoo.check_type.agent.cpu.check.chBar.metric.met%22 + i);%0A            locators.add(loc);%0A            metaTable.put(loc, %22key%22, %22value%22);%0A        %7D%0A%0A        metadataIO.putAll(metaTable); // Writes batch to disk%0A%0A        Thread.sleep(2000); // wait 2s for batch timer to kick in.%0A%0A        // Read it back.%0A        Table%3CLocator, String, String%3E metaRead = AstyanaxReader.getInstance().getMetadataValues(locators);%0A%0A        // Assert that we wrote meta for 10 different locators.%0A        Assert.assertTrue(metaRead.size() == 10);%0A%0A        for (Locator locator : metaRead.rowKeySet()) %7B%0A            Map%3CString, String%3E metaMapForLocator = metaRead.row(locator);%0A%0A            Assert.assertTrue(metaMapForLocator.size() == 1);%0A            Assert.assertTrue(metaMapForLocator.get(%22key%22).equals(%22value%22));%0A        %7D%0A    %7D%0A%7D%0A

Add AstyanaxMetadataIO integration test