edu.unh.sdb.datasource
Class PointOrderBFDS

java.lang.Object
  extended by edu.unh.sdb.datasource.DataCollection
      extended by edu.unh.sdb.datasource.DataSource
          extended by edu.unh.sdb.datasource.PhysicalDataSource
              extended by edu.unh.sdb.datasource.BinaryFileDataSource
                  extended by edu.unh.sdb.datasource.PointOrderBFDS
All Implemented Interfaces:
Indexable

public class PointOrderBFDS
extends BinaryFileDataSource

This class will read from a file of binary data, providing an n-dimensional datasource view of that file. this class represents data file that is in point order ( attributes are seperated in chunks )


Field Summary
 
Fields inherited from class edu.unh.sdb.datasource.BinaryFileDataSource
bufferIterCopy, bufferUpper, dimensions, fChannel, iniOffset, iterCopy, leastSignificantAxis, raFile, recordByteSize, recordNumFields, srcRodByteSize, srcRodSize, steps, tempDatum
 
Fields inherited from class edu.unh.sdb.datasource.PhysicalDataSource
BIG_ENDIAN, bufferBounds, bufferDimension, bufferSteps, byteBuffers, directMemoryLimit, endian, LITTLE_ENDIAN, maxBufferSize, maxGapSize, readCounter, readLength, url
 
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
PointOrderBFDS(java.lang.String name, RecordDescriptor recordDesc, ISBounds theBounds, AxisOrdering ordering, java.lang.String URL, java.nio.ByteOrder endian)
          create a PointOrderBFDS, set the initial file offset at 0
PointOrderBFDS(java.lang.String name, RecordDescriptor recordDesc, ISBounds theBounds, AxisOrdering ordering, java.lang.String URL, java.nio.ByteOrder endian, int offset)
          create a PointOrderBFDS, set the initial file offset at the given value
 
Method Summary
 void datum(Datum datum, IndexSpaceID did, FieldIDMapper mp)
          Get the Datum and fill its values in the passed Datum at positions specified by the corresponding FieldIDMapper.
 void datum(Datum datum, IndexSpaceID did, RecordSpec recSpec)
          Get the Datum and fill its values in the passed Datum at positions specified by the corresponding RecordSpec.
 Datum datum(IndexSpaceID did)
          Return the Datum corresponding to the given IndexSpaceID.
 Datum datum(IndexSpaceID did, RecordSpec spec)
          Return the Datum corresponding to the given IndexSpaceID.
 boolean equals(java.lang.Object o)
          Returns true if this BinaryFileDataSource has the same pointOrder as the argument BinaryFileDataSource, as well as meeting inherited criteria for equality.
 void old_server_subblock(byte[] subSet, ISBounds inputSrcBounds, int bytesOffset)
          Starting at the position indicated by bytesOffset, fill the byte array with the the data corresponding to the given ISBounds.
protected  void rsubblock(byte[] subSet, ISBounds inputSrcBounds)
          This function is used by SDBServer, it extracts a byte array from disk regardless the type of attributes.
 void server_subblock(byte[] bytes, ISBounds inputSrcBounds, int bytesoffset)
           
protected  void subBasicBlock(BasicBlock dstBlock, ISBounds dstBounds, ISBounds inputSrcBounds)
          This subblock method will check if gap between two neighboring rods (in data storage order) is smaller than the argument seekcost.
 java.lang.String toString()
          Print the data members of the DataSource in an easy to read fashion.
 
Methods inherited from class edu.unh.sdb.datasource.BinaryFileDataSource
activate, createBinaryFileDataSource, deactivate, getFileOffset, main, setDatum, setFileOffset
 
Methods inherited from class edu.unh.sdb.datasource.PhysicalDataSource
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, setMaxBufferSize, setMaxGapSize, subblock, subblock, subblock, toString
 
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, getName, getValues, isActivated
 
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, 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, useBytesOnly, volume
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointOrderBFDS

public PointOrderBFDS(java.lang.String name,
                      RecordDescriptor recordDesc,
                      ISBounds theBounds,
                      AxisOrdering ordering,
                      java.lang.String URL,
                      java.nio.ByteOrder endian)
create a PointOrderBFDS, set the initial file offset at 0


PointOrderBFDS

public PointOrderBFDS(java.lang.String name,
                      RecordDescriptor recordDesc,
                      ISBounds theBounds,
                      AxisOrdering ordering,
                      java.lang.String URL,
                      java.nio.ByteOrder endian,
                      int offset)
create a PointOrderBFDS, set the initial file offset at the given value

Method Detail

datum

public Datum datum(IndexSpaceID did)
Return the Datum corresponding to the given IndexSpaceID.

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

datum

public void datum(Datum datum,
                  IndexSpaceID did,
                  RecordSpec recSpec)
Get the Datum and fill its values in the passed Datum at positions specified by the corresponding RecordSpec.

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

datum

public void datum(Datum datum,
                  IndexSpaceID did,
                  FieldIDMapper mp)
Get the Datum and fill its values in the passed Datum at positions specified by the corresponding FieldIDMapper.

Specified by:
datum in interface Indexable
Specified by:
datum in class DataCollection

datum

public Datum datum(IndexSpaceID did,
                   RecordSpec spec)
Return the Datum corresponding to the given IndexSpaceID. The Datum will only contain attributes specified by the RecordSpec argument.

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

rsubblock

protected void rsubblock(byte[] subSet,
                         ISBounds inputSrcBounds)
This function is used by SDBServer, it extracts a byte array from disk regardless the type of attributes. To improve the performance, the user has to allocate the byte array in advance according to the size of the query bounds. The query block has the same axisOrdering as the datasource. In this function, we assume that the bounds of dstBlock equals the srcBounds. Therefore, we only need to copy rods from source, and put them contiguously in the dst array one rod after another, there is no gaps between rods in the dst array.


old_server_subblock

public void old_server_subblock(byte[] subSet,
                                ISBounds inputSrcBounds,
                                int bytesOffset)
Starting at the position indicated by bytesOffset, fill the byte array with the the data corresponding to the given ISBounds. Data is written to the array in a contiguous manner using the DataSource AxisOrdering.


server_subblock

public void server_subblock(byte[] bytes,
                            ISBounds inputSrcBounds,
                            int bytesoffset)

subBasicBlock

protected void subBasicBlock(BasicBlock dstBlock,
                             ISBounds dstBounds,
                             ISBounds inputSrcBounds)
This subblock method will check if gap between two neighboring rods (in data storage order) is smaller than the argument seekcost. The seek cost is messured by the number of index spaces in the grid space. If the gap is smaller than the seekcost, a long buffer is allocated and one o/s read operation is used to continuously read the two rods including the gap bwteen the two rods. This means that given a slice query, if the gaps between neighboring rods are smaller than the seekCost, a long buffer is allocated, and both rods and gaps between rods are read in the buffer using a single O/S read operation. Then only the rod data is copied from the buffer into the dst datablock. The gap data is disregarded. This method also handles n-d queries in the same fashion. The goal is to improve the I/O performance by reducing the number of O/S reads.


toString

public java.lang.String toString()
Print the data members of the DataSource in an easy to read fashion.

Overrides:
toString in class BinaryFileDataSource

equals

public boolean equals(java.lang.Object o)
Returns true if this BinaryFileDataSource has the same pointOrder as the argument BinaryFileDataSource, as well as meeting inherited criteria for equality.

Overrides:
equals in class BinaryFileDataSource