use of org.apache.geode.internal.cache.execute.data.CustId in project geode by apache.
the class FixedPartitioningTestBase method getForColocation.
public static void getForColocation(String customerRegion, String order, String shipment) {
Region region_Cust = (PartitionedRegion) cache.getRegion(customerRegion);
assertNotNull(region_Cust);
for (int i = 1; i <= 20; i++) {
CustId custid = new CustId(i);
Customer customer = new Customer("name" + i, "Address" + i);
try {
assertEquals(customer, region_Cust.get(custid));
} catch (Exception e) {
org.apache.geode.test.dunit.Assert.fail("getForColocation : failed while doing get operation in CustomerPartitionedRegion ", e);
}
}
Region region_Ord = (PartitionedRegion) cache.getRegion(order);
assertNull(region_Ord);
Region region_Ship = (PartitionedRegion) cache.getRegion(shipment);
assertNull(region_Ship);
}
use of org.apache.geode.internal.cache.execute.data.CustId in project geode by apache.
the class FixedPartitioningTestBase method putCustomerPartitionedRegion_Persistence2.
public static void putCustomerPartitionedRegion_Persistence2(String partitionedRegionName) {
assertNotNull(cache);
Region partitionedregion = cache.getRegion(Region.SEPARATOR + partitionedRegionName);
assertNotNull(partitionedregion);
for (int i = 1; i <= 20; i++) {
if (i % 2 == 1) {
CustId custid = new CustId(i);
Customer customer = new Customer("name" + i, "Address" + i);
try {
partitionedregion.put(custid, customer);
} catch (Exception e) {
org.apache.geode.test.dunit.Assert.fail("putCustomerPartitionedRegion : failed while doing put operation in CustomerPartitionedRegion ", e);
}
LogWriterUtils.getLogWriter().info("Customer :- { " + custid + " : " + customer + " }");
}
}
}
use of org.apache.geode.internal.cache.execute.data.CustId in project geode by apache.
the class FixedPartitioningTestBase method putOrderPartitionedRegion_Persistence2.
public static void putOrderPartitionedRegion_Persistence2(String partitionedRegionName) {
assertNotNull(cache);
Region partitionedregion = cache.getRegion(Region.SEPARATOR + partitionedRegionName);
assertNotNull(partitionedregion);
for (int i = 1; i <= 20; i++) {
if (i % 2 == 1) {
CustId custid = new CustId(i);
for (int j = 1; j <= 10; j++) {
int oid = (i * 10) + j;
OrderId orderId = new OrderId(oid, custid);
Order order = new Order("OREDR" + oid);
try {
partitionedregion.put(orderId, order);
} catch (Exception e) {
org.apache.geode.test.dunit.Assert.fail("putOrderPartitionedRegion : failed while doing put operation in OrderPartitionedRegion ", e);
}
LogWriterUtils.getLogWriter().info("Order :- { " + orderId + " : " + order + " }");
}
}
}
}
use of org.apache.geode.internal.cache.execute.data.CustId in project geode by apache.
the class FixedPartitioningTestBase method putCustomerPartitionedRegion_Persistence.
public static void putCustomerPartitionedRegion_Persistence(String partitionedRegionName) {
assertNotNull(cache);
Region partitionedregion = cache.getRegion(Region.SEPARATOR + partitionedRegionName);
assertNotNull(partitionedregion);
for (int i = 1; i <= 20; i++) {
CustId custid = new CustId(i);
Customer customer = new Customer("name" + i, "Address" + i);
try {
partitionedregion.put(custid, customer);
} catch (Exception e) {
org.apache.geode.test.dunit.Assert.fail("putCustomerPartitionedRegion : failed while doing put operation in CustomerPartitionedRegion ", e);
}
LogWriterUtils.getLogWriter().info("Customer :- { " + custid + " : " + customer + " }");
}
}
use of org.apache.geode.internal.cache.execute.data.CustId in project geode by apache.
the class FixedPartitioningTestBase method putCustomerPartitionedRegion_Persistence1.
public static void putCustomerPartitionedRegion_Persistence1(String partitionedRegionName) {
assertNotNull(cache);
Region partitionedregion = cache.getRegion(Region.SEPARATOR + partitionedRegionName);
assertNotNull(partitionedregion);
for (int i = 1; i <= 20; i++) {
if (i % 2 == 0) {
CustId custid = new CustId(i);
Customer customer = new Customer("name" + i, "Address" + i);
try {
partitionedregion.put(custid, customer);
} catch (Exception e) {
org.apache.geode.test.dunit.Assert.fail("putCustomerPartitionedRegion : failed while doing put operation in CustomerPartitionedRegion ", e);
}
LogWriterUtils.getLogWriter().info("Customer :- { " + custid + " : " + customer + " }");
}
}
}
Aggregations