|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.unh.sdb.datasource.DSStencil
edu.unh.sdb.datasource.DSPartitionedStencil
edu.unh.sdb.datasource.DSBlockStencil
public class DSBlockStencil
This is an implementation of a partitioned stencil that associates a Datablock with active elements. It uses an array to maintain the record of active elements. As a result, the set and get methods are extremely fast, but iteration might be a little less efficient than the list implementation. However, it does not tax the garbage collector, so it may be more appropriate for repeated use.
Field Summary | |
---|---|
protected int |
dataBytesUsed
|
protected DataBlock[] |
inStencil
|
protected int |
lastActiveOffset
|
protected int |
lastIndexRequested
|
protected RecordDescriptor |
recordDescriptor
|
protected int |
size
|
Fields inherited from class edu.unh.sdb.datasource.DSPartitionedStencil |
---|
headerLength, partitioning, partitioningDimensionsArray, partitionListBytesLength |
Fields inherited from class edu.unh.sdb.datasource.DSStencil |
---|
dimensionality, space |
Constructor Summary | |
---|---|
DSBlockStencil(RegularISPartitioning partitioning,
RecordDescriptor recordDescriptor)
Construct a stencil that identifies areas of interest using a partitioning. |
Method Summary | |
---|---|
void |
clear()
Clear this stencil of all elements. |
boolean |
get(IndexSpaceID id)
Return true if the given id maps to an active stencil element, false otherwise. |
byte[] |
getData(byte[] data)
Fill the given byte array with the data contained in the active elements of this stencil. |
DataBlock |
getDataBlock(IndexSpaceID id)
Return true if the given id maps to an active stencil element, false otherwise. |
int |
getDataBytesUsed()
Return the number of bytes actually used in the last call to getData(). |
DataBlock |
getIndexedBlock(int index)
Return the DataBlock corresponding to the specified stencil element. |
DataBlock |
getIndexedBlockAndBounds(ISBounds stencilBounds,
int index)
Return the DataBlock corresponding to the specified stencil element. |
ISBounds |
getIndexedBounds(ISBounds stencilBounds,
int index)
Sets the argument ISBounds to the bounds of the specified stencil element. |
protected long |
getIndexedOffset(int index)
Return the partition offset corresponding to the given index. |
int |
getStorageType()
|
static void |
main(java.lang.String[] argv)
|
boolean |
set(IndexSpaceID id)
Set the stencil element containing the id to "active". |
boolean |
set(IndexSpaceID id,
DataBlock block)
Set the stencil element containing the id to "active", associating the given DataBlock with that element. |
void |
setData(byte[] data)
Populate the active elements (Datablocks) of this stencil with the data found in the given array. |
boolean |
setElement(IndexSpaceID pid)
Set the stencil element with index corresponding to id to "active. |
boolean |
setElement(IndexSpaceID pid,
DataBlock block)
Set the stencil element with index corresponding to id to "active", associating the given DataBlock with that element. |
protected void |
setElementFromOffset(int offset)
Set the element corresponding to the 1D offset to be active. |
void |
setShortData(byte[] data)
Populate the active elements (Datablocks) of this stencil with the data found in the given array. |
int |
size()
return number of active elements contained by this stencil |
java.lang.String |
toString()
Return a String representing the object. |
java.lang.String |
toString(java.lang.String indent)
|
Methods inherited from class edu.unh.sdb.datasource.DSPartitionedStencil |
---|
chooseBytesPerValue, getPartitionDimensions, getPartitionDimensionsArray, getPartitioningDimensions, getPartitionListBytes, getPartitionListBytesLength, inPartitioningBounds, inPartitioningBounds, partitionVolume, setPartitionListFromBytes, volume |
Methods inherited from class edu.unh.sdb.datasource.DSStencil |
---|
dim, getIndexedBounds, getSpaceBounds |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected DataBlock[] inStencil
protected RecordDescriptor recordDescriptor
protected int size
protected int lastIndexRequested
protected int lastActiveOffset
protected int dataBytesUsed
Constructor Detail |
---|
public DSBlockStencil(RegularISPartitioning partitioning, RecordDescriptor recordDescriptor)
Method Detail |
---|
public byte[] getData(byte[] data)
public int getDataBytesUsed()
public void setData(byte[] data)
public void setShortData(byte[] data)
public int getStorageType()
public boolean set(IndexSpaceID id)
set
in class DSStencil
public boolean setElement(IndexSpaceID pid)
setElement
in class DSStencil
public boolean set(IndexSpaceID id, DataBlock block)
public boolean setElement(IndexSpaceID pid, DataBlock block)
public boolean get(IndexSpaceID id)
get
in class DSStencil
public DataBlock getDataBlock(IndexSpaceID id)
public ISBounds getIndexedBounds(ISBounds stencilBounds, int index)
getIndexedBounds
in class DSStencil
public DataBlock getIndexedBlock(int index)
public DataBlock getIndexedBlockAndBounds(ISBounds stencilBounds, int index)
protected final long getIndexedOffset(int index)
getIndexedOffset
in class DSPartitionedStencil
protected void setElementFromOffset(int offset)
setElementFromOffset
in class DSPartitionedStencil
public int size()
size
in class DSStencil
public void clear()
clear
in class DSPartitionedStencil
public java.lang.String toString()
toString
in class DSPartitionedStencil
public java.lang.String toString(java.lang.String indent)
toString
in class DSPartitionedStencil
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |