/** * Returns the object identified by id. * * @param id * The identifier for the object to be retrieved. * @return The requested object. */ public T get(long id) { long objectOffset; T data; // Get the object offset from the index store. objectOffset = indexStoreReader.get(id).getValue(); // Read the object from the object store. data = objectStoreReader.get(objectOffset); return data; }
/** * Returns the object identified by id. * * @param id * The identifier for the object to be retrieved. * @return The requested object. */ public T get(long id) { long objectOffset; T data; // Get the object offset from the index store. objectOffset = indexStoreReader.get(id).getValue(); // Read the object from the object store. data = objectStoreReader.get(objectOffset); return data; }
/** * Provides access to the contents of this store. * * @param chunk * The chunk to read objects from. * @return An iterator providing access to contents of the store. */ public ReleasableIterator<T> iterate(long chunk) { complete(); if (indexStoreReader == null) { indexStoreReader = indexStore.createReader(); } // Retrieve the file position and number of objects for the specified // chunk and iterate. return objectStore.iterate( indexStoreReader.get(chunk * 2).getValue(), indexStoreReader.get(chunk * 2 + 1).getValue() ); }
/** * Provides access to the contents of this store. * * @param chunk * The chunk to read objects from. * @return An iterator providing access to contents of the store. */ public ReleasableIterator<T> iterate(long chunk) { complete(); if (indexStoreReader == null) { indexStoreReader = indexStore.createReader(); } // Retrieve the file position and number of objects for the specified // chunk and iterate. return objectStore.iterate( indexStoreReader.get(chunk * 2).getValue(), indexStoreReader.get(chunk * 2 + 1).getValue() ); }