private long machineid;
private Set<KeyValue> keyValueUpdateSet = null;
private Guard guard;
+ private Long arbitrator;
- public Transaction(Slot slot, long _seqnum, long _machineid, Set<KeyValue> _keyValueUpdateSet, Guard _guard) {
+ public Transaction(Slot slot, long _seqnum, long _machineid, Long _arbitrator, Set<KeyValue> _keyValueUpdateSet, Guard _guard) {
super(slot);
seqnum = _seqnum;
machineid = _machineid;
-
+ arbitrator = _arbitrator;
keyValueUpdateSet = new HashSet<KeyValue>();
for (KeyValue kv : _keyValueUpdateSet) {
return machineid;
}
+ public long getArbitrator() {
+ return arbitrator;
+ }
+
public long getSequenceNumber() {
return seqnum;
}
}
public int getSize() {
- int size = 2 * Long.BYTES + Byte.BYTES; // seq, machine id, entry type
+ int size = 3 * Long.BYTES + Byte.BYTES; // seq, machine id, entry type
size += Integer.BYTES; // number of KV's
// Size of each KV
bb.put(Entry.TypeTransaction);
bb.putLong(seqnum);
bb.putLong(machineid);
+ bb.putLong(arbitrator);
bb.putInt(keyValueUpdateSet.size());
for (KeyValue kv : keyValueUpdateSet) {
static Entry decode(Slot slot, ByteBuffer bb) {
long seqnum = bb.getLong();
long machineid = bb.getLong();
+ long arbitrator = bb.getLong();
int numberOfKeys = bb.getInt();
Set<KeyValue> kvSet = new HashSet<KeyValue>();
Guard guard = Guard.decode(bb);
- return new Transaction(slot, seqnum, machineid, kvSet, guard);
+ return new Transaction(slot, seqnum, machineid, arbitrator, kvSet, guard);
}
public Entry getCopy(Slot s) {
- return new Transaction(s, seqnum, machineid, keyValueUpdateSet, guard);
+ return new Transaction(s, seqnum, machineid, arbitrator, keyValueUpdateSet, guard);
}
}
\ No newline at end of file