From 527306aed0a930a9729332296ff7c78f16c05e88 Mon Sep 17 00:00:00 2001 From: Ali Younis Date: Mon, 15 May 2017 19:00:08 -0700 Subject: [PATCH] Changes --- version2/src/java/iotcloud/Table.java | 16 +++++++-- version2/src/java/iotcloud/Test.java | 36 +++++++++---------- .../LightsController.java | 3 ++ 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/version2/src/java/iotcloud/Table.java b/version2/src/java/iotcloud/Table.java index 59a12f4..735d150 100644 --- a/version2/src/java/iotcloud/Table.java +++ b/version2/src/java/iotcloud/Table.java @@ -1443,6 +1443,7 @@ final public class Table { // Process each slots data for (Slot slot : newSlots) { processSlot(indexer, slot, acceptUpdatesToLocal, machineSet); + updateExpectedSize(); } @@ -1516,16 +1517,25 @@ final public class Table { } private void initExpectedSize(long firstSequenceNumber, long numberOfSlots) { + // if (didFindTableStatus) { + // return; + // } + long prevslots = firstSequenceNumber; + + if (didFindTableStatus) { - return; + expectedsize = (prevslots < ((long) numberOfSlots)) ? (int) prevslots : expectedsize; + } else { + expectedsize = (prevslots < ((long) numberOfSlots)) ? (int) prevslots : numberOfSlots; } - long prevslots = firstSequenceNumber; - expectedsize = (prevslots < ((long) numberOfSlots)) ? (int) prevslots : numberOfSlots; + + didFindTableStatus = true; currMaxSize = numberOfSlots; } private void updateExpectedSize() { expectedsize++; + if (expectedsize > currMaxSize) { expectedsize = currMaxSize; } diff --git a/version2/src/java/iotcloud/Test.java b/version2/src/java/iotcloud/Test.java index 158dd72..403c2be 100644 --- a/version2/src/java/iotcloud/Test.java +++ b/version2/src/java/iotcloud/Test.java @@ -303,7 +303,7 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000); System.out.println("Init Table t1s"); @@ -316,7 +316,7 @@ public class Test { System.out.println("Update Table t2"); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001); while (t2.update() == false) {} // Make the Keys @@ -527,7 +527,7 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000); System.out.println("Init Table t1s"); while (true) { try { @@ -535,7 +535,7 @@ public class Test { break; } catch (Exception e) { } } - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001); while (t2.update() == false) {} t1.addLocalCommunication(351, "127.0.0.1", 6001); @@ -760,7 +760,7 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000); System.out.println("Init Table t1s"); while (true) { @@ -772,7 +772,7 @@ public class Test { System.out.println("Update Table t2"); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001); while (t2.update() == false) {} t1.addLocalCommunication(351, "127.0.0.1", 6001); @@ -916,7 +916,7 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, 6000); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000); System.out.println("Init Table t1s"); @@ -929,7 +929,7 @@ public class Test { System.out.println("Update Table t2"); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, 6001); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001); while (t2.update() == false) {} t1.addLocalCommunication(351, "127.0.0.1", 6001); @@ -1177,9 +1177,9 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1); t1.initTable(); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1); t2.update(); // Make the Keys @@ -1393,9 +1393,9 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1); t1.initTable(); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1); t2.update(); // Make the Keys @@ -1554,9 +1554,9 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1); t1.initTable(); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1); t2.update(); @@ -1771,9 +1771,9 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1); t1.initTable(); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1); t2.update(); // Make the Keys @@ -1946,9 +1946,9 @@ public class Test { List transStatusList = new ArrayList(); // Setup the 2 clients - Table t1 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321, -1); + Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1); t1.initTable(); - Table t2 = new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351, -1); + Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1); t2.update(); diff --git a/version2/src/java/light_fan_embed_benchmark/LightsController.java b/version2/src/java/light_fan_embed_benchmark/LightsController.java index 2fb3d1d..f810cf5 100644 --- a/version2/src/java/light_fan_embed_benchmark/LightsController.java +++ b/version2/src/java/light_fan_embed_benchmark/LightsController.java @@ -93,6 +93,7 @@ class LightsController { try { + System.out.println("Loop"); String pingTimer = Long.toString(System.currentTimeMillis()); IoTString ipingTimer = new IoTString(pingTimer); @@ -115,6 +116,8 @@ class LightsController { } } + + } catch (Error e) { e.printStackTrace(); -- 2.34.1