public class SparseDataSource extends BinaryFileDataSource
Modifier and Type | Class and Description |
---|---|
static class |
SparseDataSource.MapInfo |
Modifier and Type | Field and Description |
---|---|
protected ISBounds |
blockBounds |
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> |
blockMapper |
protected RegularISPartitioning |
blockPartitioning |
protected IndexSpaceID |
blockSizes |
protected long |
cacheRefTime |
protected java.util.HashMap<java.lang.Integer,edu.unh.sdb.datasource.SparseDataSource.DBCache> |
dbCache |
protected SparseDataSource.MapInfo[] |
mapInfo |
protected java.lang.String[] |
mappingStrings |
protected int |
maxCacheSize |
protected int |
maxCacheSizeDefault |
protected DataSource |
origDS |
protected int |
partitionByteSize |
protected ISBounds |
partitioningBounds |
bufferIterCopy, bufferUpper, dimensions, fChannel, iniOffset, iterCopy, leastSignificantAxis, raFile, recordByteSize, recordNumFields, srcRodByteSize, srcRodSize, steps, tempDatum
BIG_ENDIAN, bufferBounds, bufferDimension, bufferSteps, byteBuffers, directMemoryLimit, endian, LITTLE_ENDIAN, maxBufferSize, maxGapSize, readCounter, readLength, url
fdlDescriptor, isActivated, name, wsName
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc
Constructor and Description |
---|
SparseDataSource(java.lang.String name,
FDLDescriptor fdl)
This is the mechanism for creating a sparse ds from an xfdl file, but
it is not normally used by an app, which should use Datasource.create,
which calls this method.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMap(int original,
int sparse)
addMap - add another block map entry
|
protected void |
buildMapper(java.lang.String[] mapStrings)
generate the block mapping hash table
|
void |
datum(Datum dtm,
IndexSpaceID did)
Given an IndexSpaceID and FieldIDMapper, copy the values of the Datum at
that position to the argument Datum.
|
void |
datum(Datum dtm,
IndexSpaceID did,
FieldIDMapper mp)
Given an IndexSpaceID and FieldIDMapper, copy the values of the Datum at
that position to the argument Datum.
|
int |
getBlock(IndexSpaceID loc)
Return the block index (id) for the partition that contains the "loc"
IndexSpaceID.
|
int |
getMap(int original)
getMap - get the sparse block id for the specified original block
|
ISBounds |
getPart(IndexSpaceID loc)
returns an array of ISBounds representing the pieces of the input bounds
that have data in this sparse data source.
|
java.util.ArrayList<ISBounds> |
getParts(ISBounds bnds)
returns an array of ISBounds representing the pieces of the input bounds
that have data in this sparse data source.
|
Values |
getValues()
Return a Values array of all attributes in whatever type and order
they are stored internally (either attribute order or point order
for Granite-defined objects).
|
protected void |
initialize() |
protected void |
loadPartition(int partitionIndex,
Values data)
Given a partition index, read the data from the partition into a
Values object.
|
static void |
main(java.lang.String[] args) |
protected void |
setBlockBounds(ISBounds blkBounds)
set/reset the size of the blocks; only do this if the physical file
changes correspondingly -- not a public method.
|
void |
setCacheSize(int nPartitions)
Define the number of partitions to be kept in the cache memory.
|
activate, deactivate, equals, getFileOffset, hashCode, setAxisOrdering, setDatum, setFileOffset, toString
allocateBuffer, allocateBuffer, allocateBuffer, allocateBuffer, allocateBuffer, allocateBuffer, allocateBuffer, allocateBuffer, allocateBuffer, deleteBuffer, deleteBuffer, deleteBuffers, getBuffer, getBuffer, getBufferSize, getBufferSize, getByteOrder, getDataFileString, getMaxBufferSize, getReadCounter, getReadLength, getURL, initializeBuffers, isBigEndian, makeBestBuffer, resetReadCounter, setBufferByteOrder, setByteOrder, setMaxBufferSize, setMaxGapSize, subblock, subblock, subblock, toString
checkActivated, clearCache, copyBestID, create, create, create, createRemote, createRemote, createRemoteClient, createRemoteClient, createRemoteDataSource, createRemoteDataSource, createRemoteDataSourceUDP, createRemoteUDP, createRemoteUDP, dumpData, getFDLDescriptor, getMetadataCollection, getName, getStatistics, isActivated, setMetadataCollection
byteSize, computeOffset, computeOffset, copyBounds, createDataBlock, createDataBlock, createDataBlock, createDatum, createDatum, createDatum, createDatum, createDatum, createDatum, datum, datum, datum, datum, datum, dim, getAttributeNames, getAxisOrdering, getAxisWeight, getAxisWeights, getBounds, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytesByAttribute, getBytesByAttribute, getBytesByPoint, getBytesByPoint, getDataOrder, getDimensionsArray, getDouble, getDoubles, getDoubles, getDoubles, getDoubles, getDoubles, getDoubles, getDoublesByAttribute, getDoublesByAttribute, getDoublesByPoint, getDoublesByPoint, getFloat, getFloats, getFloats, getFloats, getFloats, getFloats, getFloats, getFloatsByAttribute, getFloatsByAttribute, getFloatsByPoint, getFloatsByPoint, getInt, getInts, getInts, getInts, getInts, getInts, getInts, getIntsByAttribute, getIntsByAttribute, getIntsByPoint, getIntsByPoint, getLowerBoundsArray, getNumAttributes, getRecordDescriptor, getShort, getShorts, getShorts, getShorts, getShorts, getShorts, getShorts, getShortsByAttribute, getShortsByAttribute, getShortsByPoint, getShortsByPoint, getStorageType, getUpperBoundsArray, getValues, getValuesByAttribute, getValuesByPoint, longVolume, setBounds, setRecordDescriptor, size, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, useBytesOnly, volume
protected ISBounds blockBounds
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> blockMapper
protected DataSource origDS
protected java.lang.String[] mappingStrings
protected SparseDataSource.MapInfo[] mapInfo
protected ISBounds partitioningBounds
protected RegularISPartitioning blockPartitioning
protected IndexSpaceID blockSizes
protected int partitionByteSize
protected java.util.HashMap<java.lang.Integer,edu.unh.sdb.datasource.SparseDataSource.DBCache> dbCache
protected int maxCacheSize
protected int maxCacheSizeDefault
protected long cacheRefTime
public SparseDataSource(java.lang.String name, FDLDescriptor fdl)
name
- - informal name for the dsfdl
- - fdl describing characteristics -- usually extracted from
xfdl file.public void setCacheSize(int nPartitions)
nPartitions
- protected final void initialize()
protected void setBlockBounds(ISBounds blkBounds)
protected void buildMapper(java.lang.String[] mapStrings)
protected void addMap(int original, int sparse)
public int getMap(int original)
public int getBlock(IndexSpaceID loc)
loc
- public java.util.ArrayList<ISBounds> getParts(ISBounds bnds)
public ISBounds getPart(IndexSpaceID loc)
public void datum(Datum dtm, IndexSpaceID did, FieldIDMapper mp)
datum
in interface Indexable
datum
in class DataCollection
public void datum(Datum dtm, IndexSpaceID did)
datum
in interface Indexable
datum
in class DataCollection
public Values getValues()
getValues
in class DataSource
protected void loadPartition(int partitionIndex, Values data)
public static void main(java.lang.String[] args)