- // Arbitrate
- Map speculativeTableTmp = new HashMap<IoTString, KeyValue>(commitedTable);
- for (Transaction ut : uncommittedTransactionsList) {
-
- KeyValue keyVal = (KeyValue)(ut.getkeyValueUpdateSet().toArray())[0];
- // Check if this machine arbitrates for this transaction
- if (arbitratorTable.get( keyVal.getKey() ) != localmachineid ) {
- continue;
- }
-
- Entry newEntry = null;
-
- try {
- if ( ut.getGuard().evaluate(new HashSet<KeyValue>(speculativeTableTmp.values()))) {
- // Guard evaluated as true
-
- // update the local tmp current key set
- for (KeyValue kv : ut.getkeyValueUpdateSet()) {
- speculativeTableTmp.put(kv.getKey(), kv);
- }
-
- // create the commit
- newEntry = new Commit(s, ut.getSequenceNumber(), ut.getkeyValueUpdateSet());
- } else {
- // Guard was false
-
- // create the abort
- newEntry = new Abort(s, ut.getSequenceNumber(), ut.getMachineID());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- if ((newEntry != null) && s.hasSpace(newEntry)) {
- s.addEntry(newEntry);
- } else {
- break;
- }
- }
+ // // Arbitrate
+ // Map speculativeTableTmp = new HashMap<IoTString, KeyValue>(commitedTable);
+ // for (Transaction ut : uncommittedTransactionsList) {
+
+ // KeyValue keyVal = (KeyValue)(ut.getkeyValueUpdateSet().toArray())[0];
+ // // Check if this machine arbitrates for this transaction
+ // if (arbitratorTable.get( keyVal.getKey() ) != localmachineid ) {
+ // continue;
+ // }
+
+ // Entry newEntry = null;
+
+ // try {
+ // if ( ut.getGuard().evaluate(new HashSet<KeyValue>(speculativeTableTmp.values()))) {
+ // // Guard evaluated as true
+
+ // // update the local tmp current key set
+ // for (KeyValue kv : ut.getkeyValueUpdateSet()) {
+ // speculativeTableTmp.put(kv.getKey(), kv);
+ // }
+
+ // // create the commit
+ // newEntry = new Commit(s, ut.getSequenceNumber(), ut.getkeyValueUpdateSet());
+ // } else {
+ // // Guard was false
+
+ // // create the abort
+ // newEntry = new Abort(s, ut.getSequenceNumber(), ut.getMachineID());
+ // }
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // }
+
+ // if ((newEntry != null) && s.hasSpace(newEntry)) {
+
+ // // TODO: Remove print
+ // System.out.println("Arbitrating...");
+ // s.addEntry(newEntry);
+ // } else {
+ // break;
+ // }
+ // }