public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }