use of org.apache.geode.cache.client.internal.ClientMetadataService in project geode by apache.
the class Shipment method printMetadata.
public static void printMetadata() {
if (cache != null) {
ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
cache.getLogger().info("Metadata is " + cms.getClientPRMetadata_TEST_ONLY());
}
}
use of org.apache.geode.cache.client.internal.ClientMetadataService in project geode by apache.
the class Shipment method updateIntoSinglePR.
public static void updateIntoSinglePR() {
ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
cms.satisfyRefreshMetadata_TEST_ONLY(false);
region.put(new Integer(0), "update0");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(1), "update1");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(2), "update2");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(3), "update3");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(0), "update00");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(1), "update11");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(2), "update22");
assertEquals(false, cms.isRefreshMetadataTestOnly());
region.put(new Integer(3), "update33");
assertEquals(false, cms.isRefreshMetadataTestOnly());
}
use of org.apache.geode.cache.client.internal.ClientMetadataService in project geode by apache.
the class Shipment method testMetadataFetchOnlyThroughputAll.
@Test
public void testMetadataFetchOnlyThroughputAll() {
Integer port0 = (Integer) member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer(3, 4));
Integer port1 = (Integer) member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer(3, 4));
Integer port2 = (Integer) member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer(3, 4));
Integer port3 = (Integer) member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer(3, 4));
createClient(port0, port1, port2, port3);
putAll();
ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
final Map<String, ClientPartitionAdvisor> regionMetaData = cms.getClientPRMetadata_TEST_ONLY();
Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> (regionMetaData.size() == 1));
assertTrue(regionMetaData.containsKey(region.getFullPath()));
final ClientPartitionAdvisor prMetaData = regionMetaData.get(region.getFullPath());
Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> (prMetaData.getBucketServerLocationsMap_TEST_ONLY().size() == 4));
}
use of org.apache.geode.cache.client.internal.ClientMetadataService in project geode by apache.
the class Shipment method test_MetadataServiceCallAccuracy.
/**
* 2 servers, 2 clients.One client to one server. Put from c1 to s1. Now put from c2. So since
* there will be a hop at least once, fetchservice has to be triggered. Now put again from
* c2.There should be no hop at all.
*/
@Test
public void test_MetadataServiceCallAccuracy() {
Integer port0 = (Integer) member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer(1, 4));
Integer port1 = (Integer) member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer(1, 4));
member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createClient(port0));
createClient(port1);
member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.putIntoSinglePR());
member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
final ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
cms.satisfyRefreshMetadata_TEST_ONLY(false);
region.put(new Integer(0), "create0");
region.put(new Integer(1), "create1");
region.put(new Integer(2), "create2");
region.put(new Integer(3), "create3");
Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> cms.isRefreshMetadataTestOnly() == true);
// make sure all fetch tasks are completed
Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> cms.getRefreshTaskCount() == 0);
cms.satisfyRefreshMetadata_TEST_ONLY(false);
region.put(new Integer(0), "create0");
region.put(new Integer(1), "create1");
region.put(new Integer(2), "create2");
region.put(new Integer(3), "create3");
Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> cms.isRefreshMetadataTestOnly() == false);
}
use of org.apache.geode.cache.client.internal.ClientMetadataService in project geode by apache.
the class FixedPRSinglehopDUnitTest method printMetadata.
public static void printMetadata() {
if (cache != null) {
ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
((GemFireCacheImpl) cache).getLogger().info("Metadata is " + cms.getClientPRMetadata_TEST_ONLY());
}
}
Aggregations