use of org.apache.geode.internal.cache.execute.data.ShipmentId in project geode by apache.
the class PartitionedRegionSingleHopWithServerGroupDUnitTest method putIntoPartitionedRegions2Client.
public static void putIntoPartitionedRegions2Client() {
for (int i = 0; i <= 800; i++) {
CustId custid = new CustId(i);
Customer customer = new Customer("name" + i, "Address" + i);
customerRegion.put(custid, customer);
customerRegion2.put(custid, customer);
}
for (int j = 0; j <= 800; j++) {
CustId custid = new CustId(j);
OrderId orderId = new OrderId(j, custid);
Order order = new Order("OREDR" + j);
orderRegion.put(orderId, order);
orderRegion2.put(orderId, order);
}
for (int k = 0; k <= 800; k++) {
CustId custid = new CustId(k);
OrderId orderId = new OrderId(k, custid);
ShipmentId shipmentId = new ShipmentId(k, orderId);
Shipment shipment = new Shipment("Shipment" + k);
shipmentRegion.put(shipmentId, shipment);
shipmentRegion2.put(shipmentId, shipment);
}
region.put(new Integer(0), "create0");
region.put(new Integer(1), "create1");
region.put(new Integer(2), "create2");
region.put(new Integer(3), "create3");
region.put(new Integer(4), "create0");
region.put(new Integer(5), "create1");
region.put(new Integer(6), "create2");
region.put(new Integer(7), "create3");
region.put(new Integer(0), "update0");
region.put(new Integer(1), "update1");
region.put(new Integer(2), "update2");
region.put(new Integer(3), "update3");
region.put(new Integer(4), "update0");
region.put(new Integer(5), "update1");
region.put(new Integer(6), "update2");
region.put(new Integer(7), "update3");
region.put(new Integer(0), "update00");
region.put(new Integer(1), "update11");
region.put(new Integer(2), "update22");
region.put(new Integer(3), "update33");
region.put(new Integer(4), "update00");
region.put(new Integer(5), "update11");
region.put(new Integer(6), "update22");
region.put(new Integer(7), "update33");
region2.put(new Integer(0), "create0");
region2.put(new Integer(1), "create1");
region2.put(new Integer(2), "create2");
region2.put(new Integer(3), "create3");
region2.put(new Integer(4), "create0");
region2.put(new Integer(5), "create1");
region2.put(new Integer(6), "create2");
region2.put(new Integer(7), "create3");
region2.put(new Integer(0), "update0");
region2.put(new Integer(1), "update1");
region2.put(new Integer(2), "update2");
region2.put(new Integer(3), "update3");
region2.put(new Integer(4), "update0");
region2.put(new Integer(5), "update1");
region2.put(new Integer(6), "update2");
region2.put(new Integer(7), "update3");
region2.put(new Integer(0), "update00");
region2.put(new Integer(1), "update11");
region2.put(new Integer(2), "update22");
region2.put(new Integer(3), "update33");
region2.put(new Integer(4), "update00");
region2.put(new Integer(5), "update11");
region2.put(new Integer(6), "update22");
region2.put(new Integer(7), "update33");
}
use of org.apache.geode.internal.cache.execute.data.ShipmentId in project geode by apache.
the class PartitionedRegionSingleHopWithServerGroupDUnitTest method getFromPartitionedRegions2Client.
public static void getFromPartitionedRegions2Client() {
for (int i = 0; i <= 800; i++) {
CustId custid = new CustId(i);
customerRegion.get(custid);
customerRegion2.get(custid);
}
for (int j = 0; j <= 800; j++) {
CustId custid = new CustId(j);
OrderId orderId = new OrderId(j, custid);
orderRegion.get(orderId);
orderRegion2.get(orderId);
}
for (int k = 0; k <= 800; k++) {
CustId custid = new CustId(k);
OrderId orderId = new OrderId(k, custid);
ShipmentId shipmentId = new ShipmentId(k, orderId);
shipmentRegion.get(shipmentId);
shipmentRegion2.get(shipmentId);
}
region.get(new Integer(0));
region.get(new Integer(1));
region.get(new Integer(2));
region.get(new Integer(3));
region.get(new Integer(4));
region.get(new Integer(5));
region.get(new Integer(6));
region.get(new Integer(7));
region2.get(new Integer(0));
region2.get(new Integer(1));
region2.get(new Integer(2));
region2.get(new Integer(3));
region2.get(new Integer(4));
region2.get(new Integer(5));
region2.get(new Integer(6));
region.get(new Integer(7));
}
use of org.apache.geode.internal.cache.execute.data.ShipmentId in project geode by apache.
the class Shipment method getFromPartitionedRegions.
public static void getFromPartitionedRegions() {
for (int i = 0; i <= 3; i++) {
CustId custid = new CustId(i);
Customer customer = new Customer("name" + i, "Address" + i);
customerRegion.get(custid, customer);
for (int j = 1; j <= 10; j++) {
int oid = (i * 10) + j;
OrderId orderId = new OrderId(oid, custid);
Order order = new Order("OREDR" + oid);
orderRegion.get(orderId, order);
for (int k = 1; k <= 10; k++) {
int sid = (oid * 10) + k;
ShipmentId shipmentId = new ShipmentId(sid, orderId);
Shipment shipment = new Shipment("Shipment" + sid);
shipmentRegion.get(shipmentId, shipment);
}
}
}
region.get(new Integer(0), "create0");
region.get(new Integer(1), "create1");
region.get(new Integer(2), "create2");
region.get(new Integer(3), "create3");
region.get(new Integer(0), "update0");
region.get(new Integer(1), "update1");
region.get(new Integer(2), "update2");
region.get(new Integer(3), "update3");
region.get(new Integer(0), "update00");
region.get(new Integer(1), "update11");
region.get(new Integer(2), "update22");
region.get(new Integer(3), "update33");
}
use of org.apache.geode.internal.cache.execute.data.ShipmentId in project geode by apache.
the class PartitionedRegionSingleHopWithServerGroupDUnitTest method getFromPartitionedRegions.
public static void getFromPartitionedRegions() {
for (int i = 0; i <= 800; i++) {
CustId custid = new CustId(i);
customerRegion.get(custid);
}
for (int j = 0; j <= 800; j++) {
CustId custid = new CustId(j);
OrderId orderId = new OrderId(j, custid);
orderRegion.get(orderId);
}
for (int k = 0; k <= 800; k++) {
CustId custid = new CustId(k);
OrderId orderId = new OrderId(k, custid);
ShipmentId shipmentId = new ShipmentId(k, orderId);
shipmentRegion.get(shipmentId);
}
region.get(new Integer(0));
region.get(new Integer(1));
region.get(new Integer(2));
region.get(new Integer(3));
region.get(new Integer(4));
region.get(new Integer(5));
region.get(new Integer(6));
region.get(new Integer(7));
}
use of org.apache.geode.internal.cache.execute.data.ShipmentId in project geode by apache.
the class PRColocationDUnitTest method putShipmentPartitionedRegion.
public static void putShipmentPartitionedRegion(String partitionedRegionName) {
assertNotNull(basicGetCache());
Region partitionedregion = basicGetCache().getRegion(Region.SEPARATOR + partitionedRegionName);
assertNotNull(partitionedregion);
for (int i = 1; i <= 10; i++) {
CustId custid = new CustId(i);
for (int j = 1; j <= 10; j++) {
int oid = (i * 10) + j;
OrderId orderId = new OrderId(oid, custid);
for (int k = 1; k <= 10; k++) {
int sid = (oid * 10) + k;
ShipmentId shipmentId = new ShipmentId(sid, orderId);
Shipment shipment = new Shipment("Shipment" + sid);
try {
partitionedregion.put(shipmentId, shipment);
assertTrue(partitionedregion.containsKey(shipmentId));
assertEquals(shipment, partitionedregion.get(shipmentId));
} catch (Exception e) {
Assert.fail("putShipmentPartitionedRegion : failed while doing put operation in ShipmentPartitionedRegion ", e);
}
LogWriterUtils.getLogWriter().info("Shipment :- { " + shipmentId + " : " + shipment + " }");
}
}
}
}
Aggregations