SimpleDataArray provides an array like interface to
get
and
set
raw bytes at a specified array index. This class provides the core code for implementing different sub-classes of {@link krati.store.DataStore DataStore} and {@link krati.store.DataSet DataSet}.
This class is not thread-safe by design. It is expected that the conditions below hold within one JVM.
1. There is one and only one instance of SimpleDataArray for a given home directory. 2. There is one and only one thread calling setData and transferTo methods at any given time.
It is expected that this class is used in the case of multiple readers and single writer.
@author jwu
05/09, 2011 - added support for Closeable
05/22, 2011 - fixed method close()
05/23, 2011 - sync compaction batches in method close()
05/26, 2011 - added methods for partially reading data bytes
06/22, 2011 - catch SegmentException in method set() for safety
06/03, 2012 - fixed problematic sync upon calling method close()
06/11, 2012 - Simplified compaction update
08/31, 2012 - Enabled segment index buffer
09/09, 2012 - Removed throttling as compaction is efficient with SIB