public static void main(String[] args) throws Exception {
- Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
- t1.rebuild();
// Bulb 1
byte[] bulbMacAdd1 = new byte[8];
System.out.println("Starting System");
int counter = 0;
+
+ Table t1 = null;
+ try {
+ t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
+ t1.rebuild();
+ } catch (Error e) {
+
+ e.printStackTrace();
+ for (int i = 0; i < 3; i++) {
+ bulbs.get(i).setColor(0, 100, 100);
+ }
+
+
+
+ while (true) {
+ for (int i = 0; i < 3; i++) {
+ bulbs.get(i).turnOff();
+ }
+ Thread.sleep(1000);
+
+ for (int i = 0; i < 3; i++) {
+ bulbs.get(i).turnOn();
+ }
+ Thread.sleep(1000);
+ }
+ }
+
+
+
+
+ // Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 400, -1);
+ // t2.rebuild();
+
+
while (true) {
try {
String pingTimer = Long.toString(System.currentTimeMillis());
IoTString ipingTimer = new IoTString(pingTimer);
- t1.update();
+ // t1.update();
t1.startTransaction();
t1.addKV(ipingTimerKey, ipingTimer);
t1.commitTransaction();
+ // // t2.update();
+ // t2.startTransaction();
+ // t2.addKV(ipingTimerKey, ipingTimer);
+ // t2.commitTransaction();
+
+
+
+
-
-
-
for (int i = 0; i < 3; i++) {
IoTString testValA1 = t1.getCommitted(keys.get(i));