edu.unh.sdb.datasource
Class BlockCacheDataSource

java.lang.Object
  extended by edu.unh.sdb.datasource.DataCollection
      extended by edu.unh.sdb.datasource.DataSource
          extended by edu.unh.sdb.datasource.CacheDataSource
              extended by edu.unh.sdb.datasource.BlockCacheDataSource
All Implemented Interfaces:
Indexable
Direct Known Subclasses:
LRUCacheDataSource, MultiBlockCacheDataSource, ThreadedBlockCacheDataSource, ThreadedSliceCacheDataSource, UniBlockCacheDataSource

public abstract class BlockCacheDataSource
extends CacheDataSource


Field Summary
 
Fields inherited from class edu.unh.sdb.datasource.DataSource
fdlDescriptor, isActivated, name, wsName
 
Fields inherited from class edu.unh.sdb.datasource.DataCollection
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc
 
Constructor Summary
BlockCacheDataSource(java.lang.String name, DataSource ds, ISBounds iterationSpace, IndexSpaceID blockDimensions)
          Create a BlockCacheDataSource backed by the DataSource given as the second argument.
 
Method Summary
 void activate()
          This method should be overridden by child classes to create the cache object.
 ISBounds getCacheBlockBounds()
          Return an ISBounds representing the dimensions of the CacheDataBlocks used in in this BlockCacheDataSource.
 ISBounds getCacheBlockBounds(IndexSpaceID id)
          Returns a new ISBounds representing the bounds of the cacheBlock that contains the given id.
 void getCacheBlockBounds(IndexSpaceID id, ISBounds pBounds)
          Sets the ISBounds argument to the bounds of the cacheBlock that contains the given id.
 ISBoundsIterator getCacheBlockBoundsIterator()
          Returns an ISBoundsIterator that produces bounds corresponding to the cache blocks.
 void getCacheBlockBoundsIterator(ISBoundsIterator iter)
          Sets the ISBoundsIterator argument so it produces bounds corresponding to the cache blocks.
 IndexSpaceID getCacheBlockDimensions()
          Return an IndexSpaceID representing the dimensions of the CacheDataBlocks used in in this BlockCacheDataSource.
 long getCacheMemoryUsage()
          Return the number of bytes consumed by the cache when allocated.
 
Methods inherited from class edu.unh.sdb.datasource.CacheDataSource
datum, datum, datum, deactivate, getIterationSpace, getSource, subblock, subblock
 
Methods inherited from class edu.unh.sdb.datasource.DataSource
checkActivated, clearCache, copyBestID, create, create, create, createRemote, createRemote, createRemoteClient, createRemoteClient, createRemoteDataSource, createRemoteDataSource, createRemoteDataSourceUDP, createRemoteUDP, createRemoteUDP, dumpData, equals, getName, getValues, isActivated, main, toString, toString
 
Methods inherited from class edu.unh.sdb.datasource.DataCollection
byteSize, computeOffset, computeOffset, copyBounds, createDataBlock, createDataBlock, createDataBlock, createDatum, createDatum, createDatum, createDatum, createDatum, createDatum, datum, datum, datum, datum, dim, 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, getValues, getValuesByAttribute, getValuesByPoint, longVolume, setAxisOrdering, setBounds, setRecordDescriptor, size, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, useBytesOnly, volume
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockCacheDataSource

public BlockCacheDataSource(java.lang.String name,
                            DataSource ds,
                            ISBounds iterationSpace,
                            IndexSpaceID blockDimensions)
Create a BlockCacheDataSource backed by the DataSource given as the second argument. The third argument specifies the dimensions of the blocks used.

Method Detail

activate

public void activate()
This method should be overridden by child classes to create the cache object.

Overrides:
activate in class CacheDataSource

getCacheBlockBounds

public ISBounds getCacheBlockBounds()
Return an ISBounds representing the dimensions of the CacheDataBlocks used in in this BlockCacheDataSource.


getCacheBlockDimensions

public IndexSpaceID getCacheBlockDimensions()
Return an IndexSpaceID representing the dimensions of the CacheDataBlocks used in in this BlockCacheDataSource.


getCacheBlockBounds

public ISBounds getCacheBlockBounds(IndexSpaceID id)
Returns a new ISBounds representing the bounds of the cacheBlock that contains the given id.


getCacheBlockBounds

public void getCacheBlockBounds(IndexSpaceID id,
                                ISBounds pBounds)
Sets the ISBounds argument to the bounds of the cacheBlock that contains the given id.


getCacheMemoryUsage

public long getCacheMemoryUsage()
Return the number of bytes consumed by the cache when allocated. This method does not check to see if the cache has actually been allocated by the activate() method.


getCacheBlockBoundsIterator

public ISBoundsIterator getCacheBlockBoundsIterator()
Returns an ISBoundsIterator that produces bounds corresponding to the cache blocks.


getCacheBlockBoundsIterator

public void getCacheBlockBoundsIterator(ISBoundsIterator iter)
Sets the ISBoundsIterator argument so it produces bounds corresponding to the cache blocks.