krati.store
Class StaticDataArray

java.lang.Object
  extended by krati.store.AbstractDataArray
      extended by krati.store.StaticDataArray
All Implemented Interfaces:
Array, DataArray, Persistable

public final class StaticDataArray
extends AbstractDataArray

StaticDataArray - a convenient class for creating a fixed-size data array.

Author:
jwu Sep 24, 2010

Field Summary
 
Fields inherited from class krati.store.AbstractDataArray
_addrArray, _dataArray, _homeDir, _homePath
 
Constructor Summary
StaticDataArray(int length, File homeDirectory, SegmentFactory segmentFactory)
          Constructs a static data array with the following default params.
StaticDataArray(int length, File homeDirectory, SegmentFactory segmentFactory, int segmentFileSizeMB)
          Constructs a static data array with the following default params.
StaticDataArray(int length, int batchSize, int numSyncBatches, File homeDirectory, SegmentFactory segmentFactory, int segmentFileSizeMB, double segmentCompactFactor)
          Constructs a static data array.
 
Method Summary
protected  AddressArray createAddressArray(int length, int batchSize, int numSyncBatches, File homeDirectory)
           
 
Methods inherited from class krati.store.AbstractDataArray
clear, get, get, get, getHomeDir, getHomePath, getHWMark, getLength, getLWMark, getStatus, hasData, hasIndex, length, persist, saveHWMark, set, set, sync, transferTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticDataArray

public StaticDataArray(int length,
                       File homeDirectory,
                       SegmentFactory segmentFactory)
                throws Exception
Constructs a static data array with the following default params.
   batchSize            : 10000
   numSyncBatches       : 5
   segmentCompactFactor : 0.5
   segmentFileSizeMB    : 256
 

Parameters:
length - - the array length
homeDirectory - - the home directory of data array
segmentFactory - - the segment factory
Throws:
Exception

StaticDataArray

public StaticDataArray(int length,
                       File homeDirectory,
                       SegmentFactory segmentFactory,
                       int segmentFileSizeMB)
                throws Exception
Constructs a static data array with the following default params.
   batchSize            : 10000
   numSyncBatches       : 5
   segmentCompactFactor : 0.5
 

Parameters:
length - - the array length
homeDirectory - - the home directory of data array
segmentFactory - - the segment factory
segmentFileSizeMB - - the segment size in MB
Throws:
Exception

StaticDataArray

public StaticDataArray(int length,
                       int batchSize,
                       int numSyncBatches,
                       File homeDirectory,
                       SegmentFactory segmentFactory,
                       int segmentFileSizeMB,
                       double segmentCompactFactor)
                throws Exception
Constructs a static data array.

Parameters:
length - - the array length
batchSize - - the number of updates per update batch, i.e. the redo entry size
numSyncBatches - - the number of update batches required for updating the underlying address array
homeDirectory - - the home directory of data array
segmentFactory - - the segment factory
segmentFileSizeMB - - the segment size in MB
segmentCompactFactor - - the segment load threshold, below which a segment is eligible for compaction
Throws:
Exception
Method Detail

createAddressArray

protected AddressArray createAddressArray(int length,
                                          int batchSize,
                                          int numSyncBatches,
                                          File homeDirectory)
                                   throws Exception
Specified by:
createAddressArray in class AbstractDataArray
Throws:
Exception


Copyright © 2011. All Rights Reserved.