4 * This Entry records the abort sent by a given machine.
5 * @author Ali Younis <ayounis@uci.edu>
10 class NewKey extends Entry {
11 private IoTString key;
12 private int64_t machineid;
14 public NewKey(Slot slot, IoTString _key, int64_t _machineid) {
17 machineid = _machineid;
20 public int64_t getMachineID() {
24 public IoTString getKey() {
28 public void setSlot(Slot s) {
32 static Entry decode(Slot slot, ByteBuffer bb) {
33 int keylength = bb.getInt();
34 char[] key = new char[keylength];
36 int64_t machineid = bb.getLong();
38 return new NewKey(slot, IoTString.shallow(key), machineid);
41 public void encode(ByteBuffer bb) {
42 bb.put(Entry.TypeNewKey);
43 bb.putInt(key.length());
44 bb.put(key.internalBytes());
45 bb.putLong(machineid);
48 public int getSize() {
49 return sizeof(int64_t) + sizeof(char) + sizeof(int32_t) + key.length();
52 public char getType() {
53 return Entry.TypeNewKey;
56 public Entry getCopy(Slot s) {
57 return new NewKey(s, key, machineid);