edu.unh.sdb.datasource
Class MultiBlockCacheDataSource

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
                  extended by edu.unh.sdb.datasource.MultiBlockCacheDataSource
All Implemented Interfaces:
Indexable

public class MultiBlockCacheDataSource
extends BlockCacheDataSource

The MultiBlockCacheDataSource provides caching service using a MultiBlockCache.


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
MultiBlockCacheDataSource(java.lang.String name, DataSource ds, IndexSpaceID blockDimensions, IndexSpaceID cacheDimensions)
          Creates a MultiBlockCacheDataSource that caches the specified DataSource.
MultiBlockCacheDataSource(java.lang.String name, DataSource ds, ISBounds iterationSpace, IndexSpaceID blockDimensions, IndexSpaceID cacheDimensions)
          Creates a MultiBlockCacheDataSource that caches the specified DataSource.
 
Method Summary
 void activate()
          Calls activate() for the underlying datasource, and creates the actual cache, which allocates memory for the CacheBlocks.
 void datum(Datum datum, IndexSpaceID did)
          Load the data at the given index into the provided datum.
 IndexSpaceID getCacheArrayDimensions()
           
 ISPartitioning getPartitioning()
          Return a partitioning corresponding to the manner in which the iteration space is divided into cache block regions by the cache.
static void main(java.lang.String[] args)
          For debugging.
 
Methods inherited from class edu.unh.sdb.datasource.BlockCacheDataSource
getCacheBlockBounds, getCacheBlockBounds, getCacheBlockBounds, getCacheBlockBoundsIterator, getCacheBlockBoundsIterator, getCacheBlockDimensions, getCacheMemoryUsage
 
Methods inherited from class edu.unh.sdb.datasource.CacheDataSource
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, 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

MultiBlockCacheDataSource

public MultiBlockCacheDataSource(java.lang.String name,
                                 DataSource ds,
                                 ISBounds iterationSpace,
                                 IndexSpaceID blockDimensions,
                                 IndexSpaceID cacheDimensions)
Creates a MultiBlockCacheDataSource that caches the specified DataSource. The blocks used have dimensions specified by the blockDimensions argument. The cacheDimensions argument specifies the dimensions of the array containing the blocks. Only the region specified by the iterationSpace parameter is cached when this constructor is used.


MultiBlockCacheDataSource

public MultiBlockCacheDataSource(java.lang.String name,
                                 DataSource ds,
                                 IndexSpaceID blockDimensions,
                                 IndexSpaceID cacheDimensions)
Creates a MultiBlockCacheDataSource that caches the specified DataSource. The blocks used have dimensions specified by the blockDimensions argument. The cacheDimensions argument specifies the dimensions of the array containing the blocks. The entire datasource index space is cached when this constructor is used.

Method Detail

getPartitioning

public ISPartitioning getPartitioning()
Return a partitioning corresponding to the manner in which the iteration space is divided into cache block regions by the cache.


activate

public void activate()
Calls activate() for the underlying datasource, and creates the actual cache, which allocates memory for the CacheBlocks.

Overrides:
activate in class BlockCacheDataSource

datum

public void datum(Datum datum,
                  IndexSpaceID did)
Load the data at the given index into the provided datum.

Specified by:
datum in interface Indexable
Overrides:
datum in class CacheDataSource

getCacheArrayDimensions

public IndexSpaceID getCacheArrayDimensions()

main

public static void main(java.lang.String[] args)
For debugging. Runs basic tests on the MultiBlockCacheDataSource class.