/** * Adds the specified object to the store. * * @param id * The identifier allowing the object to be retrieved. * @param data * The object to be added. */ public void add(long id, T data) { long objectOffset; // Write the object to the object store. objectOffset = objectStore.add(data); // Write the object offset keyed by the id to the index store. indexStore.write(new LongLongIndexElement(id, objectOffset)); }
/** * Adds the specified object to the store. * * @param id * The identifier allowing the object to be retrieved. * @param data * The object to be added. */ public void add(long id, T data) { long objectOffset; // Write the object to the object store. objectOffset = objectStore.add(data); // Write the object offset keyed by the id to the index store. indexStore.write(new LongLongIndexElement(id, objectOffset)); }
fileOffset = indexStore.add(element);
fileOffset = indexStore.add(element);
indexStore.add(sortIterator.next());
indexStore.add(sortIterator.next());