4 import java.util.ArrayList;
14 public static final int NUMBER_OF_TESTS = 1000;
16 public static void main(String[] args) throws ServerException {
17 if (args[0].equals("2")) {
19 } else if (args[0].equals("3")) {
21 } else if (args[0].equals("4")) {
23 } else if (args[0].equals("5")) {
25 } else if (args[0].equals("6")) {
27 } else if (args[0].equals("7")) {
29 } else if (args[0].equals("8")) {
31 } else if (args[0].equals("9")) {
33 } else if (args[0].equals("10")) {
35 } else if (args[0].equals("11")) {
37 } else if (args[0].equals("12")) {
39 } else if (args[0].equals("13")) {
43 else if (args[0].equals("14")) {
49 static void test14() throws ServerException {
50 TimingSingleton timer = TimingSingleton.getInstance();
52 boolean foundError = false;
55 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
57 // Setup the 2 clients
58 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
60 System.out.println("T1 Ready");
62 long initTimeNet = timer.getTime();
65 System.out.println("Setting up keys");
66 startTime = System.nanoTime();
67 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
68 System.out.println(i);
70 IoTString ia = new IoTString(a);
71 t1.createNewKey(ia, 321);
73 endTime = System.nanoTime();
74 long keysDt = endTime - startTime;
75 long keysNet = timer.getTime() - initTimeNet;
77 System.out.println("Total Key Create Time: " + keysDt / 1000000);
78 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
79 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
84 static void test13() throws ServerException {
85 TimingSingleton timer = TimingSingleton.getInstance();
87 boolean foundError = false;
90 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
92 // Setup the 2 clients
93 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
95 System.out.println("T1 Ready");
97 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
99 System.out.println("T2 Ready");
103 long initTimeNet = timer.getTime();
107 System.out.println("Setting up keys");
108 startTime = System.nanoTime();
109 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
110 System.out.println(i);
115 IoTString ia = new IoTString(a);
116 IoTString ib = new IoTString(b);
117 IoTString ic = new IoTString(c);
118 IoTString id = new IoTString(d);
119 t1.createNewKey(ia, 351);
120 t1.createNewKey(ib, 351);
121 t2.createNewKey(ic, 321);
122 t2.createNewKey(id, 321);
124 endTime = System.nanoTime();
125 long keysDt = endTime - startTime;
126 long keysNet = timer.getTime() - initTimeNet;
128 // Do Updates for the keys
129 System.out.println("Setting Key-Values...");
130 startTime = System.nanoTime();
131 for (int t = 0; t < 3; t++) {
132 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
133 System.out.println(i);
134 String keyA = "a" + i;
135 String keyB = "b" + i;
136 String keyC = "c" + i;
137 String keyD = "d" + i;
138 String valueA = "a" + i;
139 String valueB = "b" + i;
140 String valueC = "c" + i;
141 String valueD = "d" + i;
143 IoTString iKeyA = new IoTString(keyA);
144 IoTString iKeyB = new IoTString(keyB);
145 IoTString iKeyC = new IoTString(keyC);
146 IoTString iKeyD = new IoTString(keyD);
147 IoTString iValueA = new IoTString(valueA);
148 IoTString iValueB = new IoTString(valueB);
149 IoTString iValueC = new IoTString(valueC);
150 IoTString iValueD = new IoTString(valueD);
153 t1.startTransaction();
154 t1.addKV(iKeyA, iValueA);
155 transStatusList.add(t1.commitTransaction());
157 t1.startTransaction();
158 t1.addKV(iKeyB, iValueB);
159 transStatusList.add(t1.commitTransaction());
161 t2.startTransaction();
162 t2.addKV(iKeyC, iValueC);
163 transStatusList.add(t2.commitTransaction());
165 t2.startTransaction();
166 t2.addKV(iKeyD, iValueD);
167 transStatusList.add(t2.commitTransaction());
171 endTime = System.nanoTime();
172 long writesDt = endTime - startTime;
173 long writesNet = timer.getTime() - keysNet - initTimeNet;
175 System.out.println("Updating Clients...");
176 startTime = System.nanoTime();
179 endTime = System.nanoTime();
180 long updatesDt = endTime - startTime;
181 long updatesNet = timer.getTime() - keysNet - writesNet - initTimeNet;
184 System.out.println("Total Key Create Time: " + keysDt / 1000000);
185 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
186 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
187 System.out.println();
188 System.out.println("Total write Time: " + writesDt / 1000000);
189 System.out.println("Total write Time Network: " + writesNet / 1000000);
190 System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
191 System.out.println();
192 System.out.println("Total updates Time: " + updatesDt / 1000000);
193 System.out.println("Total updates Time Network: " + updatesNet / 1000000);
194 System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
198 static void test12() throws ServerException {
199 TimingSingleton timer = TimingSingleton.getInstance();
201 boolean foundError = false;
204 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
206 // Setup the 2 clients
207 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
209 System.out.println("T1 Ready");
211 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
213 System.out.println("T2 Ready");
216 long initTimeNet = timer.getTime();
220 System.out.println("Setting up keys");
221 startTime = System.nanoTime();
222 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
223 System.out.println(i);
228 IoTString ia = new IoTString(a);
229 IoTString ib = new IoTString(b);
230 IoTString ic = new IoTString(c);
231 IoTString id = new IoTString(d);
232 t1.createNewKey(ia, 321);
233 t1.createNewKey(ib, 321);
234 t2.createNewKey(ic, 351);
235 t2.createNewKey(id, 351);
237 endTime = System.nanoTime();
238 long keysDt = endTime - startTime;
239 long keysNet = timer.getTime() - initTimeNet;
241 // Do Updates for the keys
242 System.out.println("Setting Key-Values...");
243 startTime = System.nanoTime();
244 for (int t = 0; t < 3; t++) {
245 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
246 System.out.println(i);
247 String keyA = "a" + i;
248 String keyB = "b" + i;
249 String keyC = "c" + i;
250 String keyD = "d" + i;
251 String valueA = "a" + i;
252 String valueB = "b" + i;
253 String valueC = "c" + i;
254 String valueD = "d" + i;
256 IoTString iKeyA = new IoTString(keyA);
257 IoTString iKeyB = new IoTString(keyB);
258 IoTString iKeyC = new IoTString(keyC);
259 IoTString iKeyD = new IoTString(keyD);
260 IoTString iValueA = new IoTString(valueA);
261 IoTString iValueB = new IoTString(valueB);
262 IoTString iValueC = new IoTString(valueC);
263 IoTString iValueD = new IoTString(valueD);
266 t1.startTransaction();
267 t1.addKV(iKeyA, iValueA);
268 transStatusList.add(t1.commitTransaction());
270 t1.startTransaction();
271 t1.addKV(iKeyB, iValueB);
272 transStatusList.add(t1.commitTransaction());
274 t2.startTransaction();
275 t2.addKV(iKeyC, iValueC);
276 transStatusList.add(t2.commitTransaction());
278 t2.startTransaction();
279 t2.addKV(iKeyD, iValueD);
280 transStatusList.add(t2.commitTransaction());
284 endTime = System.nanoTime();
285 long writesDt = endTime - startTime;
286 long writesNet = timer.getTime() - keysNet - initTimeNet;
288 System.out.println("Updating Clients...");
289 startTime = System.nanoTime();
292 endTime = System.nanoTime();
293 long updatesDt = endTime - startTime;
294 long updatesNet = timer.getTime() - keysNet - writesNet - initTimeNet;
297 System.out.println("Total Key Create Time: " + keysDt / 1000000);
298 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
299 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
300 System.out.println();
301 System.out.println("Total write Time: " + writesDt / 1000000);
302 System.out.println("Total write Time Network: " + writesNet / 1000000);
303 System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
304 System.out.println();
305 System.out.println("Total updates Time: " + updatesDt / 1000000);
306 System.out.println("Total updates Time Network: " + updatesNet / 1000000);
307 System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
311 static void test11() {
313 boolean foundError = false;
314 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
316 // Setup the 2 clients
317 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
319 System.out.println("Init Table t1s");
325 } catch (Exception e) { }
329 System.out.println("Update Table t2");
330 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
331 while (t2.update() == false) {}
334 System.out.println("Setting up keys");
335 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
336 System.out.println(i);
342 IoTString ia = new IoTString(a);
343 IoTString ib = new IoTString(b);
344 IoTString ic = new IoTString(c);
345 IoTString id = new IoTString(d);
349 t1.createNewKey(ia, 321);
351 } catch (Exception e) { }
356 t1.createNewKey(ib, 351);
358 } catch (Exception e) { }
363 t2.createNewKey(ic, 321);
365 } catch (Exception e) { }
370 t2.createNewKey(id, 351);
372 } catch (Exception e) { }
376 // Do Updates for the keys
377 System.out.println("Setting Key-Values...");
378 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
379 System.out.println(i);
380 String keyA = "a" + i;
381 String keyB = "b" + i;
382 String keyC = "c" + i;
383 String keyD = "d" + i;
384 String valueA = "a" + i;
385 String valueB = "b" + i;
386 String valueC = "c" + i;
387 String valueD = "d" + i;
389 IoTString iKeyA = new IoTString(keyA);
390 IoTString iKeyB = new IoTString(keyB);
391 IoTString iKeyC = new IoTString(keyC);
392 IoTString iKeyD = new IoTString(keyD);
393 IoTString iValueA = new IoTString(valueA);
394 IoTString iValueB = new IoTString(valueB);
395 IoTString iValueC = new IoTString(valueC);
396 IoTString iValueD = new IoTString(valueD);
399 String keyAPrev = "a" + (i - 1);
400 String keyBPrev = "b" + (i - 1);
401 String keyCPrev = "c" + (i - 1);
402 String keyDPrev = "d" + (i - 1);
403 String valueAPrev = "a" + (i - 1);
404 String valueBPrev = "b" + (i - 1);
405 String valueCPrev = "c" + (i - 1);
406 String valueDPrev = "d" + (i - 1);
408 IoTString iKeyAPrev = new IoTString(keyAPrev);
409 IoTString iKeyBPrev = new IoTString(keyBPrev);
410 IoTString iKeyCPrev = new IoTString(keyCPrev);
411 IoTString iKeyDPrev = new IoTString(keyDPrev);
412 IoTString iValueAPrev = new IoTString(valueAPrev);
413 IoTString iValueBPrev = new IoTString(valueBPrev);
414 IoTString iValueCPrev = new IoTString(valueCPrev);
415 IoTString iValueDPrev = new IoTString(valueDPrev);
418 System.out.println("t1 A");
419 t1.startTransaction();
420 t1.addKV(iKeyA, iValueA);
421 transStatusList.add(t1.commitTransaction());
423 System.out.println("t1 B");
424 t1.startTransaction();
425 t1.addKV(iKeyB, iValueB);
426 transStatusList.add(t1.commitTransaction());
428 System.out.println("t2 C");
429 t2.startTransaction();
430 t2.addKV(iKeyC, iValueC);
431 transStatusList.add(t2.commitTransaction());
433 System.out.println("t2 D");
434 t2.startTransaction();
435 t2.addKV(iKeyD, iValueD);
436 transStatusList.add(t2.commitTransaction());
439 System.out.println("Updating...");
440 while (t1.update() == false) {}
441 while (t2.update() == false) {}
442 while (t1.update() == false) {}
443 while (t2.update() == false) {}
445 System.out.println("Checking Key-Values...");
446 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
448 String keyA = "a" + i;
449 String keyB = "b" + i;
450 String keyC = "c" + i;
451 String keyD = "d" + i;
452 String valueA = "a" + i;
453 String valueB = "b" + i;
454 String valueC = "c" + i;
455 String valueD = "d" + i;
457 IoTString iKeyA = new IoTString(keyA);
458 IoTString iKeyB = new IoTString(keyB);
459 IoTString iKeyC = new IoTString(keyC);
460 IoTString iKeyD = new IoTString(keyD);
461 IoTString iValueA = new IoTString(valueA);
462 IoTString iValueB = new IoTString(valueB);
463 IoTString iValueC = new IoTString(valueC);
464 IoTString iValueD = new IoTString(valueD);
467 IoTString testValA1 = t1.getCommitted(iKeyA);
468 IoTString testValB1 = t1.getCommitted(iKeyB);
469 IoTString testValC1 = t1.getCommitted(iKeyC);
470 IoTString testValD1 = t1.getCommitted(iKeyD);
472 IoTString testValA2 = t2.getCommitted(iKeyA);
473 IoTString testValB2 = t2.getCommitted(iKeyB);
474 IoTString testValC2 = t2.getCommitted(iKeyC);
475 IoTString testValD2 = t2.getCommitted(iKeyD);
477 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
478 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
482 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
483 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
487 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
488 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
492 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
493 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
498 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
499 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
503 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
504 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
508 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
509 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
513 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
514 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
519 for (TransactionStatus status : transStatusList) {
520 if (status.getStatus() != TransactionStatus.StatusCommitted) {
526 System.out.println("Found Errors...");
528 System.out.println("No Errors Found...");
535 static void test10() {
537 boolean foundError = false;
538 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
540 // Setup the 2 clients
541 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
542 System.out.println("Init Table t1s");
547 } catch (Exception e) { }
549 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
550 while (t2.update() == false) {}
552 t1.addLocalCommunication(351, "127.0.0.1", 6001);
553 t2.addLocalCommunication(321, "127.0.0.1", 6000);
557 System.out.println("Setting up keys");
558 for (int i = 0; i < 4; i++) {
563 IoTString ia = new IoTString(a);
564 IoTString ib = new IoTString(b);
565 IoTString ic = new IoTString(c);
566 IoTString id = new IoTString(d);
569 t1.createNewKey(ia, 321);
571 } catch (Exception e) { }
576 t1.createNewKey(ib, 351);
578 } catch (Exception e) { }
583 t2.createNewKey(ic, 321);
585 } catch (Exception e) { }
590 t2.createNewKey(id, 351);
592 } catch (Exception e) { }
597 // Do Updates for the keys
598 System.out.println("B========================");
599 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
600 for (int i = 0; i < 4; i++) {
602 System.out.println(i);
604 String keyB = "b" + i;
605 String valueB = "b" + (i + t);
607 IoTString iKeyB = new IoTString(keyB);
608 IoTString iValueB = new IoTString(valueB);
610 t1.startTransaction();
611 System.out.println(t1.getSpeculativeAtomic(iKeyB));
612 t1.addKV(iKeyB, iValueB);
613 transStatusList.add(t1.commitTransaction());
616 System.out.println();
619 System.out.println("C========================");
620 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
621 for (int i = 0; i < 4; i++) {
622 System.out.println(i);
624 String keyC = "c" + i;
625 String valueC = "c" + (i + t);
627 IoTString iKeyC = new IoTString(keyC);
628 IoTString iValueC = new IoTString(valueC);
630 t2.startTransaction();
631 System.out.println(t2.getSpeculativeAtomic(iKeyC));
632 t2.addKV(iKeyC, iValueC);
633 transStatusList.add(t2.commitTransaction());
636 System.out.println();
639 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
640 for (int i = 0; i < 4; i++) {
641 String keyA = "a" + i;
642 String keyD = "d" + i;
643 String valueA = "a" + (i + t);
644 String valueD = "d" + (i + t);
646 IoTString iKeyA = new IoTString(keyA);
647 IoTString iKeyD = new IoTString(keyD);
648 IoTString iValueA = new IoTString(valueA);
649 IoTString iValueD = new IoTString(valueD);
652 t1.startTransaction();
653 t1.addKV(iKeyA, iValueA);
654 transStatusList.add(t1.commitTransaction());
657 t2.startTransaction();
658 t2.addKV(iKeyD, iValueD);
659 transStatusList.add(t2.commitTransaction());
660 System.out.println();
663 System.out.println();
665 System.out.println("Updating...");
666 System.out.println("t1 -=-=-=-=-=-=-=-");
667 while (t1.update() == false) {}
668 System.out.println("t2 -=-=-=-=-=-=-=-");
669 while (t2.update() == false) {}
670 System.out.println("t1 -=-=-=-=-=-=-=-");
671 while (t1.update() == false) {}
672 System.out.println("t2 -=-=-=-=-=-=-=-");
673 while (t2.update() == false) {}
676 System.out.println("Checking Key-Values...");
677 for (int i = 0; i < 4; i++) {
679 String keyA = "a" + i;
680 String keyB = "b" + i;
681 String keyC = "c" + i;
682 String keyD = "d" + i;
683 String valueA = "a" + (i + NUMBER_OF_TESTS - 1);
684 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
685 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
686 String valueD = "d" + (i + NUMBER_OF_TESTS - 1);
688 IoTString iKeyA = new IoTString(keyA);
689 IoTString iKeyB = new IoTString(keyB);
690 IoTString iKeyC = new IoTString(keyC);
691 IoTString iKeyD = new IoTString(keyD);
692 IoTString iValueA = new IoTString(valueA);
693 IoTString iValueB = new IoTString(valueB);
694 IoTString iValueC = new IoTString(valueC);
695 IoTString iValueD = new IoTString(valueD);
698 IoTString testValA1 = t1.getCommitted(iKeyA);
699 IoTString testValB1 = t1.getCommitted(iKeyB);
700 IoTString testValC1 = t1.getCommitted(iKeyC);
701 IoTString testValD1 = t1.getCommitted(iKeyD);
703 IoTString testValA2 = t2.getCommitted(iKeyA);
704 IoTString testValB2 = t2.getCommitted(iKeyB);
705 IoTString testValC2 = t2.getCommitted(iKeyC);
706 IoTString testValD2 = t2.getCommitted(iKeyD);
708 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
709 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
713 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
714 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
718 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
719 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
723 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
724 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
728 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
729 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
733 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
734 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
738 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
739 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
743 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
744 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
750 for (TransactionStatus status : transStatusList) {
751 if (status.getStatus() != TransactionStatus.StatusCommitted) {
753 System.out.println(counter + " Status: " + status.getStatus());
759 System.out.println("Found Errors...");
761 System.out.println("No Errors Found...");
768 static void test9() {
770 boolean foundError = false;
771 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
773 // Setup the 2 clients
774 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
776 System.out.println("Init Table t1s");
781 } catch (Exception e) { }
785 System.out.println("Update Table t2");
786 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
787 while (t2.update() == false) {}
789 t1.addLocalCommunication(351, "127.0.0.1", 6001);
790 t2.addLocalCommunication(321, "127.0.0.1", 6000);
793 System.out.println("Setting up keys");
794 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
795 System.out.println(i);
801 IoTString ia = new IoTString(a);
802 IoTString ib = new IoTString(b);
803 IoTString ic = new IoTString(c);
804 IoTString id = new IoTString(d);
808 t1.createNewKey(ia, 321);
810 } catch (Exception e) { }
815 t1.createNewKey(ib, 351);
817 } catch (Exception e) { }
822 t2.createNewKey(ic, 321);
824 } catch (Exception e) { }
829 t2.createNewKey(id, 351);
831 } catch (Exception e) { }
835 System.out.println("A, D...");
836 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
837 String keyA = "a" + i;
838 String keyD = "d" + i;
839 String valueA = "a" + i;
840 String valueD = "d" + i;
842 IoTString iKeyA = new IoTString(keyA);
843 IoTString iKeyD = new IoTString(keyD);
844 IoTString iValueA = new IoTString(valueA);
845 IoTString iValueD = new IoTString(valueD);
847 t1.startTransaction();
848 t1.addKV(iKeyA, iValueA);
849 transStatusList.add(t1.commitTransaction());
851 t2.startTransaction();
852 t2.addKV(iKeyD, iValueD);
853 transStatusList.add(t2.commitTransaction());
856 // while (t1.updateFromLocal(351) == false) {}
857 // while (t2.updateFromLocal(321) == false) {}
860 System.out.println("Updating...");
861 System.out.println("Checking Key-Values...");
863 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
865 String keyA = "a" + i;
866 String keyD = "d" + i;
867 String valueA = "a" + i;
868 String valueD = "d" + i;
871 IoTString iKeyA = new IoTString(keyA);
872 IoTString iKeyD = new IoTString(keyD);
873 IoTString iValueA = new IoTString(valueA);
874 IoTString iValueD = new IoTString(valueD);
877 IoTString testValA1 = t1.getCommitted(iKeyA);
878 IoTString testValD1 = t1.getCommitted(iKeyD);
879 IoTString testValA2 = t2.getCommitted(iKeyA);
880 IoTString testValD2 = t2.getCommitted(iKeyD);
883 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
884 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
888 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
889 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
894 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
895 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
899 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
900 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
905 for (TransactionStatus status : transStatusList) {
906 if (status.getStatus() != TransactionStatus.StatusCommitted) {
912 System.out.println("Found Errors...");
914 System.out.println("No Errors Found...");
921 static void test8() {
922 TimingSingleton timer = TimingSingleton.getInstance();
926 boolean foundError = false;
927 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
929 // Setup the 2 clients
930 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
932 System.out.println("Init Table t1s");
938 } catch (Exception e) { }
942 System.out.println("Update Table t2");
943 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
944 while (t2.update() == false) {}
946 t1.addLocalCommunication(351, "127.0.0.1", 6001);
947 t2.addLocalCommunication(321, "127.0.0.1", 6000);
950 System.out.println("Setting up keys");
951 startTime = System.nanoTime();
952 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
953 System.out.println(i);
959 IoTString ia = new IoTString(a);
960 IoTString ib = new IoTString(b);
961 IoTString ic = new IoTString(c);
962 IoTString id = new IoTString(d);
966 t1.createNewKey(ia, 321);
968 } catch (Exception e) { }
973 t1.createNewKey(ib, 351);
975 } catch (Exception e) { }
980 t2.createNewKey(ic, 321);
982 } catch (Exception e) { }
987 t2.createNewKey(id, 351);
989 } catch (Exception e) { }
992 endTime = System.nanoTime();
993 long keysDt = endTime - startTime;
994 long keysNet = timer.getTime();
997 // Do Updates for the keys
998 startTime = System.nanoTime();
999 System.out.println("Setting Key-Values...");
1000 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1001 System.out.println(i);
1002 String keyA = "a" + i;
1003 String keyB = "b" + i;
1004 String keyC = "c" + i;
1005 String keyD = "d" + i;
1006 String valueA = "a" + i;
1007 String valueB = "b" + i;
1008 String valueC = "c" + i;
1009 String valueD = "d" + i;
1011 IoTString iKeyA = new IoTString(keyA);
1012 IoTString iKeyB = new IoTString(keyB);
1013 IoTString iKeyC = new IoTString(keyC);
1014 IoTString iKeyD = new IoTString(keyD);
1015 IoTString iValueA = new IoTString(valueA);
1016 IoTString iValueB = new IoTString(valueB);
1017 IoTString iValueC = new IoTString(valueC);
1018 IoTString iValueD = new IoTString(valueD);
1021 String keyAPrev = "a" + (i - 1);
1022 String keyBPrev = "b" + (i - 1);
1023 String keyCPrev = "c" + (i - 1);
1024 String keyDPrev = "d" + (i - 1);
1025 String valueAPrev = "a" + (i - 1);
1026 String valueBPrev = "b" + (i - 1);
1027 String valueCPrev = "c" + (i - 1);
1028 String valueDPrev = "d" + (i - 1);
1030 IoTString iKeyAPrev = new IoTString(keyAPrev);
1031 IoTString iKeyBPrev = new IoTString(keyBPrev);
1032 IoTString iKeyCPrev = new IoTString(keyCPrev);
1033 IoTString iKeyDPrev = new IoTString(keyDPrev);
1034 IoTString iValueAPrev = new IoTString(valueAPrev);
1035 IoTString iValueBPrev = new IoTString(valueBPrev);
1036 IoTString iValueCPrev = new IoTString(valueCPrev);
1037 IoTString iValueDPrev = new IoTString(valueDPrev);
1039 t1.startTransaction();
1040 t1.addKV(iKeyA, iValueA);
1041 transStatusList.add(t1.commitTransaction());
1043 t1.startTransaction();
1044 t1.addKV(iKeyB, iValueB);
1045 transStatusList.add(t1.commitTransaction());
1047 t2.startTransaction();
1048 t2.addKV(iKeyC, iValueC);
1049 transStatusList.add(t2.commitTransaction());
1051 t2.startTransaction();
1052 t2.addKV(iKeyD, iValueD);
1053 transStatusList.add(t2.commitTransaction());
1055 endTime = System.nanoTime();
1056 long writesDt = endTime - startTime;
1057 long writesNet = timer.getTime() - keysNet;
1061 System.out.println("Updating...");
1062 startTime = System.nanoTime();
1063 while (t1.update() == false) {}
1064 while (t2.update() == false) {}
1065 while (t1.update() == false) {}
1066 while (t2.update() == false) {}
1067 endTime = System.nanoTime();
1068 long updatesDt = endTime - startTime;
1069 long updatesNet = timer.getTime() - keysNet - writesNet;
1072 System.out.println("Total Key Create Time: " + keysDt / 1000000);
1073 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
1074 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
1075 System.out.println();
1076 System.out.println("Total write Time: " + writesDt / 1000000);
1077 System.out.println("Total write Time Network: " + writesNet / 1000000);
1078 System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
1079 System.out.println();
1080 System.out.println("Total updates Time: " + updatesDt / 1000000);
1081 System.out.println("Total updates Time Network: " + updatesNet / 1000000);
1082 System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
1087 // System.out.println("Checking Key-Values...");
1088 // for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1090 // String keyA = "a" + i;
1091 // String keyB = "b" + i;
1092 // String keyC = "c" + i;
1093 // String keyD = "d" + i;
1094 // String valueA = "a" + i;
1095 // String valueB = "b" + i;
1096 // String valueC = "c" + i;
1097 // String valueD = "d" + i;
1099 // IoTString iKeyA = new IoTString(keyA);
1100 // IoTString iKeyB = new IoTString(keyB);
1101 // IoTString iKeyC = new IoTString(keyC);
1102 // IoTString iKeyD = new IoTString(keyD);
1103 // IoTString iValueA = new IoTString(valueA);
1104 // IoTString iValueB = new IoTString(valueB);
1105 // IoTString iValueC = new IoTString(valueC);
1106 // IoTString iValueD = new IoTString(valueD);
1109 // IoTString testValA1 = t1.getCommitted(iKeyA);
1110 // IoTString testValB1 = t1.getCommitted(iKeyB);
1111 // IoTString testValC1 = t1.getCommitted(iKeyC);
1112 // IoTString testValD1 = t1.getCommitted(iKeyD);
1114 // IoTString testValA2 = t2.getCommitted(iKeyA);
1115 // IoTString testValB2 = t2.getCommitted(iKeyB);
1116 // IoTString testValC2 = t2.getCommitted(iKeyC);
1117 // IoTString testValD2 = t2.getCommitted(iKeyD);
1119 // if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1120 // System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
1121 // foundError = true;
1124 // if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1125 // System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1126 // foundError = true;
1129 // if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1130 // System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1131 // foundError = true;
1134 // if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1135 // System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
1136 // foundError = true;
1140 // if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1141 // System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1142 // foundError = true;
1145 // if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1146 // System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1147 // foundError = true;
1150 // if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1151 // System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1152 // foundError = true;
1155 // if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1156 // System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1157 // foundError = true;
1161 // for (TransactionStatus status : transStatusList) {
1162 // if (status.getStatus() != TransactionStatus.StatusCommitted) {
1163 // foundError = true;
1167 // if (foundError) {
1168 // System.out.println("Found Errors...");
1170 // System.out.println("No Errors Found...");
1176 // System.out.println();
1177 // System.out.println();
1180 // System.out.println();
1181 // System.out.println();
1185 static void test7() throws ServerException {
1187 boolean foundError = false;
1188 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1190 // Setup the 2 clients
1191 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1193 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1197 System.out.println("Setting up keys");
1198 for (int i = 0; i < 4; i++) {
1203 IoTString ia = new IoTString(a);
1204 IoTString ib = new IoTString(b);
1205 IoTString ic = new IoTString(c);
1206 IoTString id = new IoTString(d);
1207 t1.createNewKey(ia, 321);
1208 t1.createNewKey(ib, 351);
1209 t2.createNewKey(ic, 321);
1210 t2.createNewKey(id, 351);
1213 // Do Updates for the keys
1214 System.out.println("Setting Key-Values...");
1216 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1217 for (int i = 0; i < 4; i++) {
1218 String keyB = "b" + i;
1219 String valueB = "b" + (i + t);
1221 IoTString iKeyB = new IoTString(keyB);
1222 IoTString iValueB = new IoTString(valueB);
1224 t1.startTransaction();
1225 t1.getSpeculativeAtomic(iKeyB);
1226 t1.addKV(iKeyB, iValueB);
1227 transStatusList.add(t1.commitTransaction());
1231 for (int i = 0; i < 4; i++) {
1233 String keyB = "b" + i;
1234 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1235 IoTString iKeyB = new IoTString(keyB);
1236 IoTString iValueB = new IoTString(valueB);
1238 IoTString testValB1 = t1.getSpeculative(iKeyB);
1239 IoTString testValB2 = t2.getSpeculative(iKeyB);
1241 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1242 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1246 if ((testValB2 != null)) {
1247 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1252 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1253 for (int i = 0; i < 4; i++) {
1254 String keyC = "c" + i;
1255 String valueC = "c" + (i + t);
1257 IoTString iKeyC = new IoTString(keyC);
1258 IoTString iValueC = new IoTString(valueC);
1260 t2.startTransaction();
1261 t2.getSpeculativeAtomic(iKeyC);
1262 t2.addKV(iKeyC, iValueC);
1263 transStatusList.add(t2.commitTransaction());
1267 for (int i = 0; i < 4; i++) {
1268 String keyC = "c" + i;
1269 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1270 IoTString iKeyC = new IoTString(keyC);
1271 IoTString iValueC = new IoTString(valueC);
1273 IoTString testValC1 = t1.getSpeculative(iKeyC);
1274 IoTString testValC2 = t2.getSpeculative(iKeyC);
1276 if ((testValC1 != null)) {
1277 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1281 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1282 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1287 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1288 for (int i = 0; i < 4; i++) {
1289 String keyA = "a" + i;
1290 String keyD = "d" + i;
1291 String valueA = "a" + (i + t);
1292 String valueD = "d" + (i + t);
1294 IoTString iKeyA = new IoTString(keyA);
1295 IoTString iKeyD = new IoTString(keyD);
1296 IoTString iValueA = new IoTString(valueA);
1297 IoTString iValueD = new IoTString(valueD);
1299 t1.startTransaction();
1300 t1.addKV(iKeyA, iValueA);
1301 transStatusList.add(t1.commitTransaction());
1303 t2.startTransaction();
1304 t2.addKV(iKeyD, iValueD);
1305 transStatusList.add(t2.commitTransaction());
1309 System.out.println("Updating Clients...");
1315 System.out.println("Checking Key-Values...");
1316 for (int i = 0; i < 4; i++) {
1318 String keyA = "a" + i;
1319 String keyB = "b" + i;
1320 String keyC = "c" + i;
1321 String keyD = "d" + i;
1322 String valueA = "a" + (i + NUMBER_OF_TESTS - 1);
1323 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1324 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1325 String valueD = "d" + (i + NUMBER_OF_TESTS - 1);
1327 IoTString iKeyA = new IoTString(keyA);
1328 IoTString iKeyB = new IoTString(keyB);
1329 IoTString iKeyC = new IoTString(keyC);
1330 IoTString iKeyD = new IoTString(keyD);
1331 IoTString iValueA = new IoTString(valueA);
1332 IoTString iValueB = new IoTString(valueB);
1333 IoTString iValueC = new IoTString(valueC);
1334 IoTString iValueD = new IoTString(valueD);
1337 IoTString testValA1 = t1.getCommitted(iKeyA);
1338 IoTString testValB1 = t1.getCommitted(iKeyB);
1339 IoTString testValC1 = t1.getCommitted(iKeyC);
1340 IoTString testValD1 = t1.getCommitted(iKeyD);
1342 IoTString testValA2 = t2.getCommitted(iKeyA);
1343 IoTString testValB2 = t2.getCommitted(iKeyB);
1344 IoTString testValC2 = t2.getCommitted(iKeyC);
1345 IoTString testValD2 = t2.getCommitted(iKeyD);
1347 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1348 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
1352 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1353 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1357 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1358 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1362 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1363 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
1367 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1368 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1372 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1373 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1377 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1378 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1382 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1383 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1388 for (TransactionStatus status : transStatusList) {
1389 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1395 System.out.println("Found Errors...");
1397 System.out.println("No Errors Found...");
1401 static void test6() throws ServerException {
1403 boolean foundError = false;
1404 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1406 // Setup the 2 clients
1407 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1409 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1413 System.out.println("Setting up keys");
1414 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1419 IoTString ia = new IoTString(a);
1420 IoTString ib = new IoTString(b);
1421 IoTString ic = new IoTString(c);
1422 IoTString id = new IoTString(d);
1423 t1.createNewKey(ia, 321);
1424 t1.createNewKey(ib, 351);
1425 t2.createNewKey(ic, 321);
1426 t2.createNewKey(id, 351);
1429 // Do Updates for the keys
1430 System.out.println("Setting Key-Values...");
1431 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1432 String keyA = "a" + i;
1433 String keyB = "b" + i;
1434 String keyC = "c" + i;
1435 String keyD = "d" + i;
1436 String valueA = "a" + i;
1437 String valueB = "b" + i;
1438 String valueC = "c" + i;
1439 String valueD = "d" + i;
1441 IoTString iKeyA = new IoTString(keyA);
1442 IoTString iKeyB = new IoTString(keyB);
1443 IoTString iKeyC = new IoTString(keyC);
1444 IoTString iKeyD = new IoTString(keyD);
1445 IoTString iValueA = new IoTString(valueA);
1446 IoTString iValueB = new IoTString(valueB);
1447 IoTString iValueC = new IoTString(valueC);
1448 IoTString iValueD = new IoTString(valueD);
1450 t1.startTransaction();
1451 t1.getCommittedAtomic(iKeyA);
1452 t1.addKV(iKeyA, iValueA);
1453 transStatusList.add(t1.commitTransaction());
1455 t1.startTransaction();
1456 t1.getCommittedAtomic(iKeyB);
1457 t1.addKV(iKeyB, iValueB);
1458 transStatusList.add(t1.commitTransaction());
1460 t2.startTransaction();
1461 t2.getCommittedAtomic(iKeyC);
1462 t2.addKV(iKeyC, iValueC);
1463 transStatusList.add(t2.commitTransaction());
1465 t2.startTransaction();
1466 t2.getCommittedAtomic(iKeyD);
1467 t2.addKV(iKeyD, iValueD);
1468 transStatusList.add(t2.commitTransaction());
1471 System.out.println("Updating Clients...");
1475 System.out.println("Checking Key-Values...");
1476 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1478 String keyA = "a" + i;
1479 String keyB = "b" + i;
1480 String keyC = "c" + i;
1481 String keyD = "d" + i;
1482 String valueA = "a" + i;
1483 String valueB = "b" + i;
1484 String valueC = "c" + i;
1485 String valueD = "d" + i;
1487 IoTString iKeyA = new IoTString(keyA);
1488 IoTString iKeyB = new IoTString(keyB);
1489 IoTString iKeyC = new IoTString(keyC);
1490 IoTString iKeyD = new IoTString(keyD);
1491 IoTString iValueA = new IoTString(valueA);
1492 IoTString iValueB = new IoTString(valueB);
1493 IoTString iValueC = new IoTString(valueC);
1494 IoTString iValueD = new IoTString(valueD);
1497 IoTString testValA1 = t1.getCommitted(iKeyA);
1498 IoTString testValB1 = t1.getCommitted(iKeyB);
1499 IoTString testValC1 = t1.getCommitted(iKeyC);
1500 IoTString testValD1 = t1.getCommitted(iKeyD);
1502 IoTString testValA2 = t2.getCommitted(iKeyA);
1503 IoTString testValB2 = t2.getCommitted(iKeyB);
1504 IoTString testValC2 = t2.getCommitted(iKeyC);
1505 IoTString testValD2 = t2.getCommitted(iKeyD);
1507 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1508 System.out.println("Key-Value t1 incorrect: " + keyA);
1512 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1513 System.out.println("Key-Value t1 incorrect: " + keyB);
1517 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1518 System.out.println("Key-Value t1 incorrect: " + keyC);
1522 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1523 System.out.println("Key-Value t1 incorrect: " + keyD);
1528 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1529 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1533 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1534 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1538 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1539 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1543 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1544 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1549 for (TransactionStatus status : transStatusList) {
1550 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1556 System.out.println("Found Errors...");
1558 System.out.println("No Errors Found...");
1562 static void test5() throws ServerException {
1564 boolean foundError = false;
1565 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1567 // Setup the 2 clients
1568 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1570 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1575 System.out.println("Setting up keys");
1576 for (int i = 0; i < 4; i++) {
1581 IoTString ia = new IoTString(a);
1582 IoTString ib = new IoTString(b);
1583 IoTString ic = new IoTString(c);
1584 IoTString id = new IoTString(d);
1585 t1.createNewKey(ia, 321);
1586 t1.createNewKey(ib, 351);
1587 t2.createNewKey(ic, 321);
1588 t2.createNewKey(id, 351);
1591 // Do Updates for the keys
1592 System.out.println("Setting Key-Values...");
1594 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1595 for (int i = 0; i < 4; i++) {
1596 String keyB = "b" + i;
1597 String valueB = "b" + (i + t);
1599 IoTString iKeyB = new IoTString(keyB);
1600 IoTString iValueB = new IoTString(valueB);
1602 t1.startTransaction();
1603 t1.addKV(iKeyB, iValueB);
1604 transStatusList.add(t1.commitTransaction());
1608 for (int i = 0; i < 4; i++) {
1610 String keyB = "b" + i;
1611 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1612 IoTString iKeyB = new IoTString(keyB);
1613 IoTString iValueB = new IoTString(valueB);
1615 IoTString testValB1 = t1.getSpeculative(iKeyB);
1616 IoTString testValB2 = t2.getSpeculative(iKeyB);
1618 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1619 System.out.println("Key-Value t1 incorrect: " + keyB);
1623 if ((testValB2 != null)) {
1624 System.out.println("Key-Value t2 incorrect: " + keyB);
1629 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1630 for (int i = 0; i < 4; i++) {
1631 String keyC = "c" + i;
1632 String valueC = "c" + (i + t);
1634 IoTString iKeyC = new IoTString(keyC);
1635 IoTString iValueC = new IoTString(valueC);
1637 t2.startTransaction();
1638 t2.addKV(iKeyC, iValueC);
1639 transStatusList.add(t2.commitTransaction());
1643 for (int i = 0; i < 4; i++) {
1644 String keyC = "c" + i;
1645 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1646 IoTString iKeyC = new IoTString(keyC);
1647 IoTString iValueC = new IoTString(valueC);
1649 IoTString testValC1 = t1.getSpeculative(iKeyC);
1650 IoTString testValC2 = t2.getSpeculative(iKeyC);
1652 if ((testValC1 != null)) {
1653 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1657 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1658 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1663 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1664 for (int i = 0; i < 4; i++) {
1665 String keyA = "a" + i;
1666 String keyD = "d" + i;
1667 String valueA = "a" + (i + t);
1668 String valueD = "d" + (i + t);
1670 IoTString iKeyA = new IoTString(keyA);
1671 IoTString iKeyD = new IoTString(keyD);
1672 IoTString iValueA = new IoTString(valueA);
1673 IoTString iValueD = new IoTString(valueD);
1675 t1.startTransaction();
1676 t1.addKV(iKeyA, iValueA);
1677 transStatusList.add(t1.commitTransaction());
1679 t2.startTransaction();
1680 t2.addKV(iKeyD, iValueD);
1681 transStatusList.add(t2.commitTransaction());
1685 System.out.println("Updating Clients...");
1690 System.out.println("Checking Key-Values...");
1691 for (int i = 0; i < 4; i++) {
1693 String keyA = "a" + i;
1694 String keyB = "b" + i;
1695 String keyC = "c" + i;
1696 String keyD = "d" + i;
1697 String valueA = "a" + (i + NUMBER_OF_TESTS - 1);
1698 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1699 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1700 String valueD = "d" + (i + NUMBER_OF_TESTS - 1);
1702 IoTString iKeyA = new IoTString(keyA);
1703 IoTString iKeyB = new IoTString(keyB);
1704 IoTString iKeyC = new IoTString(keyC);
1705 IoTString iKeyD = new IoTString(keyD);
1706 IoTString iValueA = new IoTString(valueA);
1707 IoTString iValueB = new IoTString(valueB);
1708 IoTString iValueC = new IoTString(valueC);
1709 IoTString iValueD = new IoTString(valueD);
1712 IoTString testValA1 = t1.getCommitted(iKeyA);
1713 IoTString testValB1 = t1.getCommitted(iKeyB);
1714 IoTString testValC1 = t1.getCommitted(iKeyC);
1715 IoTString testValD1 = t1.getCommitted(iKeyD);
1717 IoTString testValA2 = t2.getCommitted(iKeyA);
1718 IoTString testValB2 = t2.getCommitted(iKeyB);
1719 IoTString testValC2 = t2.getCommitted(iKeyC);
1720 IoTString testValD2 = t2.getCommitted(iKeyD);
1722 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1723 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
1727 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1728 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1732 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1733 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1737 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1738 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
1743 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1744 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1748 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1749 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1753 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1754 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1758 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1759 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1764 for (TransactionStatus status : transStatusList) {
1765 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1771 System.out.println("Found Errors...");
1773 System.out.println("No Errors Found...");
1777 static void test4() throws ServerException {
1779 boolean foundError = false;
1782 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1784 // Setup the 2 clients
1785 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1787 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1791 System.out.println("Setting up keys");
1792 startTime = System.currentTimeMillis();
1793 for (int i = 0; i < 4; i++) {
1798 IoTString ia = new IoTString(a);
1799 IoTString ib = new IoTString(b);
1800 IoTString ic = new IoTString(c);
1801 IoTString id = new IoTString(d);
1802 t1.createNewKey(ia, 321);
1803 t1.createNewKey(ib, 351);
1804 t2.createNewKey(ic, 321);
1805 t2.createNewKey(id, 351);
1807 endTime = System.currentTimeMillis();
1808 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
1809 System.out.println("Time Taken Per Key: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4)) );
1810 System.out.println();
1813 // Do Updates for the keys
1814 System.out.println("Setting Key-Values...");
1815 startTime = System.currentTimeMillis();
1816 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1817 for (int i = 0; i < 4; i++) {
1818 String keyA = "a" + i;
1819 String keyB = "b" + i;
1820 String keyC = "c" + i;
1821 String keyD = "d" + i;
1822 String valueA = "a" + i;
1823 String valueB = "b" + i;
1824 String valueC = "c" + i;
1825 String valueD = "d" + i;
1827 IoTString iKeyA = new IoTString(keyA);
1828 IoTString iKeyB = new IoTString(keyB);
1829 IoTString iKeyC = new IoTString(keyC);
1830 IoTString iKeyD = new IoTString(keyD);
1831 IoTString iValueA = new IoTString(valueA);
1832 IoTString iValueB = new IoTString(valueB);
1833 IoTString iValueC = new IoTString(valueC);
1834 IoTString iValueD = new IoTString(valueD);
1836 t1.startTransaction();
1837 t1.addKV(iKeyA, iValueA);
1838 transStatusList.add(t1.commitTransaction());
1840 t1.startTransaction();
1841 t1.addKV(iKeyB, iValueB);
1842 transStatusList.add(t1.commitTransaction());
1844 t2.startTransaction();
1845 t2.addKV(iKeyC, iValueC);
1846 transStatusList.add(t2.commitTransaction());
1848 t2.startTransaction();
1849 t2.addKV(iKeyD, iValueD);
1850 transStatusList.add(t2.commitTransaction());
1853 endTime = System.currentTimeMillis();
1854 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
1855 System.out.println("Time Taken Per Update: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 16)) );
1856 System.out.println();
1859 System.out.println("Updating Clients...");
1864 System.out.println("Checking Key-Values...");
1865 for (int i = 0; i < 4; i++) {
1867 String keyA = "a" + i;
1868 String keyB = "b" + i;
1869 String keyC = "c" + i;
1870 String keyD = "d" + i;
1871 String valueA = "a" + i;
1872 String valueB = "b" + i;
1873 String valueC = "c" + i;
1874 String valueD = "d" + i;
1876 IoTString iKeyA = new IoTString(keyA);
1877 IoTString iKeyB = new IoTString(keyB);
1878 IoTString iKeyC = new IoTString(keyC);
1879 IoTString iKeyD = new IoTString(keyD);
1880 IoTString iValueA = new IoTString(valueA);
1881 IoTString iValueB = new IoTString(valueB);
1882 IoTString iValueC = new IoTString(valueC);
1883 IoTString iValueD = new IoTString(valueD);
1886 IoTString testValA1 = t1.getCommitted(iKeyA);
1887 IoTString testValB1 = t1.getCommitted(iKeyB);
1888 IoTString testValC1 = t1.getCommitted(iKeyC);
1889 IoTString testValD1 = t1.getCommitted(iKeyD);
1891 IoTString testValA2 = t2.getCommitted(iKeyA);
1892 IoTString testValB2 = t2.getCommitted(iKeyB);
1893 IoTString testValC2 = t2.getCommitted(iKeyC);
1894 IoTString testValD2 = t2.getCommitted(iKeyD);
1896 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1897 System.out.println("Key-Value t1 incorrect: " + keyA);
1901 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1902 System.out.println("Key-Value t1 incorrect: " + keyB);
1906 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1907 System.out.println("Key-Value t1 incorrect: " + keyC);
1911 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1912 System.out.println("Key-Value t1 incorrect: " + keyD);
1917 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1918 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1922 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1923 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1927 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1928 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1932 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1933 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1938 for (TransactionStatus status : transStatusList) {
1939 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1945 System.out.println("Found Errors...");
1947 System.out.println("No Errors Found...");
1951 static void test3() throws ServerException {
1955 boolean foundError = false;
1957 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1959 // Setup the 2 clients
1960 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1962 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1967 System.out.println("Setting up keys");
1968 startTime = System.currentTimeMillis();
1969 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1974 IoTString ia = new IoTString(a);
1975 IoTString ib = new IoTString(b);
1976 IoTString ic = new IoTString(c);
1977 IoTString id = new IoTString(d);
1978 t1.createNewKey(ia, 321);
1979 t1.createNewKey(ib, 351);
1980 t2.createNewKey(ic, 321);
1981 t2.createNewKey(id, 351);
1983 endTime = System.currentTimeMillis();
1984 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
1985 System.out.println("Time Taken Per Key: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4)) );
1986 System.out.println();
1989 // Do Updates for the keys
1990 System.out.println("Setting Key-Values...");
1991 startTime = System.currentTimeMillis();
1993 System.out.println("B...");
1994 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1995 String keyB = "b" + i;
1996 String valueB = "b" + i;
1998 IoTString iKeyB = new IoTString(keyB);
1999 IoTString iValueB = new IoTString(valueB);
2001 t1.startTransaction();
2002 t1.addKV(iKeyB, iValueB);
2003 transStatusList.add(t1.commitTransaction());
2006 System.out.println("C...");
2007 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2008 String keyC = "c" + i;
2009 String valueC = "c" + i;
2011 IoTString iKeyC = new IoTString(keyC);
2012 IoTString iValueC = new IoTString(valueC);
2014 t2.startTransaction();
2015 t2.addKV(iKeyC, iValueC);
2016 transStatusList.add(t2.commitTransaction());
2019 System.out.println("A, D...");
2020 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2021 String keyA = "a" + i;
2022 String keyD = "d" + i;
2023 String valueA = "a" + i;
2024 String valueD = "d" + i;
2026 IoTString iKeyA = new IoTString(keyA);
2027 IoTString iKeyD = new IoTString(keyD);
2028 IoTString iValueA = new IoTString(valueA);
2029 IoTString iValueD = new IoTString(valueD);
2031 t1.startTransaction();
2032 t1.addKV(iKeyA, iValueA);
2033 transStatusList.add(t1.commitTransaction());
2035 t2.startTransaction();
2036 t2.addKV(iKeyD, iValueD);
2037 transStatusList.add(t2.commitTransaction());
2039 endTime = System.currentTimeMillis();
2040 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
2041 System.out.println("Time Taken Per Update: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4)) );
2042 System.out.println();
2045 System.out.println("Updating Clients...");
2050 System.out.println("Checking Key-Values...");
2051 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2053 String keyA = "a" + i;
2054 String keyB = "b" + i;
2055 String keyC = "c" + i;
2056 String keyD = "d" + i;
2057 String valueA = "a" + i;
2058 String valueB = "b" + i;
2059 String valueC = "c" + i;
2060 String valueD = "d" + i;
2062 IoTString iKeyA = new IoTString(keyA);
2063 IoTString iKeyB = new IoTString(keyB);
2064 IoTString iKeyC = new IoTString(keyC);
2065 IoTString iKeyD = new IoTString(keyD);
2066 IoTString iValueA = new IoTString(valueA);
2067 IoTString iValueB = new IoTString(valueB);
2068 IoTString iValueC = new IoTString(valueC);
2069 IoTString iValueD = new IoTString(valueD);
2072 IoTString testValA1 = t1.getCommitted(iKeyA);
2073 IoTString testValB1 = t1.getCommitted(iKeyB);
2074 IoTString testValC1 = t1.getCommitted(iKeyC);
2075 IoTString testValD1 = t1.getCommitted(iKeyD);
2077 IoTString testValA2 = t2.getCommitted(iKeyA);
2078 IoTString testValB2 = t2.getCommitted(iKeyB);
2079 IoTString testValC2 = t2.getCommitted(iKeyC);
2080 IoTString testValD2 = t2.getCommitted(iKeyD);
2082 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
2083 System.out.println("Key-Value t1 incorrect: " + keyA);
2087 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
2088 System.out.println("Key-Value t1 incorrect: " + keyB);
2092 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
2093 System.out.println("Key-Value t1 incorrect: " + keyC);
2097 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
2098 System.out.println("Key-Value t1 incorrect: " + keyD);
2103 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
2104 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
2108 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
2109 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
2113 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
2114 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
2118 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
2119 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
2124 for (TransactionStatus status : transStatusList) {
2125 if (status.getStatus() != TransactionStatus.StatusCommitted) {
2131 System.out.println("Found Errors...");
2133 System.out.println("No Errors Found...");
2137 static void test2() throws ServerException {
2138 TimingSingleton timer = TimingSingleton.getInstance();
2140 boolean foundError = false;
2141 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
2143 // Setup the 2 clients
2144 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
2146 System.out.println("T1 Ready");
2148 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
2150 System.out.println("T2 Ready");
2153 System.out.println("Setting up keys");
2154 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2155 System.out.println(i);
2160 IoTString ia = new IoTString(a);
2161 IoTString ib = new IoTString(b);
2162 IoTString ic = new IoTString(c);
2163 IoTString id = new IoTString(d);
2164 t1.createNewKey(ia, 321);
2165 t1.createNewKey(ib, 351);
2166 t2.createNewKey(ic, 321);
2167 t2.createNewKey(id, 351);
2170 // Do Updates for the keys
2171 System.out.println("Setting Key-Values...");
2172 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2173 System.out.println(i);
2174 String keyA = "a" + i;
2175 String keyB = "b" + i;
2176 String keyC = "c" + i;
2177 String keyD = "d" + i;
2178 String valueA = "a" + i;
2179 String valueB = "b" + i;
2180 String valueC = "c" + i;
2181 String valueD = "d" + i;
2183 IoTString iKeyA = new IoTString(keyA);
2184 IoTString iKeyB = new IoTString(keyB);
2185 IoTString iKeyC = new IoTString(keyC);
2186 IoTString iKeyD = new IoTString(keyD);
2187 IoTString iValueA = new IoTString(valueA);
2188 IoTString iValueB = new IoTString(valueB);
2189 IoTString iValueC = new IoTString(valueC);
2190 IoTString iValueD = new IoTString(valueD);
2193 t1.startTransaction();
2194 t1.addKV(iKeyA, iValueA);
2195 transStatusList.add(t1.commitTransaction());
2196 t1.startTransaction();
2197 t1.addKV(iKeyB, iValueB);
2198 transStatusList.add(t1.commitTransaction());
2200 t2.startTransaction();
2201 t2.addKV(iKeyC, iValueC);
2202 transStatusList.add(t2.commitTransaction());
2204 t2.startTransaction();
2205 t2.addKV(iKeyD, iValueD);
2206 transStatusList.add(t2.commitTransaction());
2210 System.out.println("Updating Clients...");
2217 System.out.println("Checking Key-Values...");
2218 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2220 String keyA = "a" + i;
2221 String keyB = "b" + i;
2222 String keyC = "c" + i;
2223 String keyD = "d" + i;
2224 String valueA = "a" + i;
2225 String valueB = "b" + i;
2226 String valueC = "c" + i;
2227 String valueD = "d" + i;
2229 IoTString iKeyA = new IoTString(keyA);
2230 IoTString iKeyB = new IoTString(keyB);
2231 IoTString iKeyC = new IoTString(keyC);
2232 IoTString iKeyD = new IoTString(keyD);
2233 IoTString iValueA = new IoTString(valueA);
2234 IoTString iValueB = new IoTString(valueB);
2235 IoTString iValueC = new IoTString(valueC);
2236 IoTString iValueD = new IoTString(valueD);
2239 IoTString testValA1 = t1.getCommitted(iKeyA);
2240 IoTString testValB1 = t1.getCommitted(iKeyB);
2241 IoTString testValC1 = t1.getCommitted(iKeyC);
2242 IoTString testValD1 = t1.getCommitted(iKeyD);
2244 IoTString testValA2 = t2.getCommitted(iKeyA);
2245 IoTString testValB2 = t2.getCommitted(iKeyB);
2246 IoTString testValC2 = t2.getCommitted(iKeyC);
2247 IoTString testValD2 = t2.getCommitted(iKeyD);
2249 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
2250 System.out.println("Key-Value t1 incorrect: " + keyA);
2254 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
2255 System.out.println("Key-Value t1 incorrect: " + keyB);
2259 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
2260 System.out.println("Key-Value t1 incorrect: " + keyC);
2264 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
2265 System.out.println("Key-Value t1 incorrect: " + keyD);
2270 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
2271 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
2275 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
2276 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
2280 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
2281 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
2285 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
2286 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
2291 for (TransactionStatus status : transStatusList) {
2292 if (status.getStatus() != TransactionStatus.StatusCommitted) {
2294 System.out.println(status.getStatus());
2299 System.out.println("Found Errors...");
2301 System.out.println("No Errors Found...");
2304 // System.out.println();
2305 // System.out.println();
2308 // System.out.println();
2309 // System.out.println();