protected IndexLinkedList getItemList() {
return indexList;
}
protected synchronized IndexItem write(Object key, Object value) {
IndexItem index = null;
try {
index = indexManager.createNewIndex();
StoreLocation data = dataManager.storeDataItem(keyMarshaller, key);
index.setKeyData(data);
if (value != null) {
data = dataManager.storeDataItem(valueMarshaller, value);
index.setValueData(data);
}
IndexItem prev = indexList.getLast();
prev = prev != null ? prev : indexList.getRoot();
IndexItem next = indexList.getNextEntry(prev);
prev.setNextItem(index.getOffset());
index.setPreviousItem(prev.getOffset());
updateIndexes(prev);
if (next != null) {
next.setPreviousItem(index.getOffset());
index.setNextItem(next.getOffset());
updateIndexes(next);
}
storeIndex(index);
} catch (IOException e) {
LOG.error("Failed to write " + key + " , " + value, e);