public abstract class PhysicalDataSource extends DataSource
Modifier and Type | Field and Description |
---|---|
static java.nio.ByteOrder |
BIG_ENDIAN |
protected ISBounds |
bufferBounds |
protected IntegerIndexSpaceID |
bufferDimension |
protected int[] |
bufferSteps |
protected java.nio.ByteBuffer[] |
byteBuffers |
static long |
directMemoryLimit |
protected java.nio.ByteOrder |
endian |
static java.nio.ByteOrder |
LITTLE_ENDIAN |
protected long |
maxBufferSize |
protected long |
maxGapSize |
protected long |
readCounter |
protected long |
readLength |
protected java.lang.String |
url |
fdlDescriptor, isActivated, name, wsName
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc
Constructor and Description |
---|
PhysicalDataSource(java.lang.String name,
FDLDescriptor fdl)
Create a PhysicalDataSource from an fdl
|
PhysicalDataSource(java.lang.String name,
RecordDescriptor rd,
ISBounds isb,
AxisOrdering ordering,
java.lang.String URL)
Create a Physical data source from specs
|
Modifier and Type | Method and Description |
---|---|
protected java.nio.ByteBuffer |
allocateBuffer(java.nio.ByteBuffer iobuf,
long byteSize)
This method (re)allocates the argument I/O byte buffer to the byte size
given by the second argument.
|
protected boolean |
allocateBuffer(int size)
Allocate buffer 0.
|
protected boolean |
allocateBuffer(int buf,
ISBounds queryBounds)
This method allocates a proper I/O bytebuffer for the queryBounds passed in as
an argument.
|
protected boolean |
allocateBuffer(int buf,
ISBounds queryBounds,
int unitSize)
This method allocates a proper I/O bytebuffer for the queryBounds passed in as
an argument.
|
protected boolean |
allocateBuffer(int buf,
ISBounds gridSpace,
ISBounds queryBounds,
int unitSize)
This method allocates a proper I/O bytebuffer for the specified grid space
domain (gridBounds) and queryBounds passed in as arguments.
|
protected boolean |
allocateBuffer(int buf,
long byteSize)
This method (re)allocates the specified I/O byte buffer to the byte size
given by the second argument.
|
protected boolean |
allocateBuffer(ISBounds bounds)
Allocate buffer 0.
|
protected boolean |
allocateBuffer(ISBounds bounds,
int unitSize)
Allocate buffer 0.
|
protected boolean |
allocateBuffer(ISBounds grid,
ISBounds bounds,
int unitSize)
Allocate buffer 0.
|
void |
deactivate()
The DataSource will release any resources used during the
readling or processing of data.
|
void |
deleteBuffer()
Delete all byte buffers used for data storage for this DataSource
and garbage collect.
|
protected void |
deleteBuffer(int buf)
delete a byte buffer and garbage collect.
|
void |
deleteBuffers()
Delete all byte buffers used for data storage for this DataSource
and garbage collect.
|
boolean |
equals(java.lang.Object o)
Returns true if this PhysicalDataSource has the same URL
and AxisOrdering as the argument PhsyicalDataSource, as
well as meeting inherited criteria for equality.
|
protected java.nio.ByteBuffer |
getBuffer()
Return a reference to byte buffer 0, if there is only one.
|
protected java.nio.ByteBuffer |
getBuffer(int i)
Return a reference to the specified byte buffer
|
int |
getBufferSize()
get the current length, in bytes, of the buffer used directly
with file I/O operations.
|
int |
getBufferSize(int bufNum)
get the current length, in bytes, of the buffer used directly
with file I/O operations.
|
java.nio.ByteOrder |
getByteOrder()
Return the byteOrder of this binary file
|
java.lang.String |
getDataFileString()
Return a copy of the URL for this datasource.
|
int |
getMaxBufferSize()
get the maximum length, in bytes, of the buffer used directly
with file I/O operations.
|
long |
getReadCounter() |
long |
getReadLength() |
java.lang.String |
getURL()
Return a copy of the URL for this datasource.
|
protected void |
initializeBuffers(int num)
Initialize buffers for i/o
|
boolean |
isBigEndian()
Returns true if the binary file is big-endian format or little endian
|
static void |
main(java.lang.String[] args) |
protected long |
makeBestBuffer(ISBounds spaceBounds,
ISBounds queryBounds,
int unitSize)
this method computes the best i/o buffer size.
|
void |
resetReadCounter() |
protected void |
setBufferByteOrder(java.nio.ByteBuffer buffer)
set the byte order for the given buffer
|
void |
setByteOrder(java.nio.ByteOrder newOrder)
set the byteOrder of this binary file.
|
void |
setMaxBufferSize(int numBytes)
set the maximum length, in bytes, of the buffer used directly
with file I/O operations.
|
void |
setMaxGapSize(long gap)
gap means the number of extra data, the datasource willing to read
to elimilate a read operation.
|
void |
subblock(DataBlock dstBlock,
ISBounds dstBounds,
ISBounds srcBounds)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
void |
subblock(DataBlock dstBlock,
ISBounds dstBounds,
ISBounds srcBounds,
FieldIDMapper mp)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
void |
subblock(DataBlock dstBlock,
ISBounds dstBounds,
ISBounds srcBounds,
RecordSpec recSpec)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
java.lang.String |
toString()
Return a String representing the object.
|
java.lang.String |
toString(java.lang.String indent)
Return a String representing the object indented by the argument string.
|
activate, checkActivated, clearCache, copyBestID, create, create, create, createRemote, createRemote, createRemoteClient, createRemoteClient, createRemoteDataSource, createRemoteDataSource, createRemoteDataSourceUDP, createRemoteUDP, createRemoteUDP, dumpData, getFDLDescriptor, getMetadataCollection, getName, getStatistics, getValues, isActivated, setMetadataCollection
byteSize, computeOffset, computeOffset, copyBounds, createDataBlock, createDataBlock, createDataBlock, createDatum, createDatum, createDatum, createDatum, createDatum, createDatum, datum, datum, 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, setAxisOrdering, setBounds, setRecordDescriptor, size, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, useBytesOnly, volume
public static final java.nio.ByteOrder BIG_ENDIAN
public static final java.nio.ByteOrder LITTLE_ENDIAN
protected java.nio.ByteOrder endian
public static long directMemoryLimit
protected long maxBufferSize
protected java.lang.String url
protected IntegerIndexSpaceID bufferDimension
protected ISBounds bufferBounds
protected int[] bufferSteps
protected long maxGapSize
protected java.nio.ByteBuffer[] byteBuffers
protected long readCounter
protected long readLength
public PhysicalDataSource(java.lang.String name, FDLDescriptor fdl)
name
- fdl
- public PhysicalDataSource(java.lang.String name, RecordDescriptor rd, ISBounds isb, AxisOrdering ordering, java.lang.String URL)
name
- rd
- isb
- ordering
- URL
- protected void initializeBuffers(int num)
public void deactivate()
deactivate
in class DataSource
public void setMaxGapSize(long gap)
public boolean isBigEndian()
public java.nio.ByteOrder getByteOrder()
public void setByteOrder(java.nio.ByteOrder newOrder)
protected void setBufferByteOrder(java.nio.ByteBuffer buffer)
public void setMaxBufferSize(int numBytes)
public int getMaxBufferSize()
public int getBufferSize()
public int getBufferSize(int bufNum)
protected boolean allocateBuffer(int buf, long byteSize)
protected java.nio.ByteBuffer allocateBuffer(java.nio.ByteBuffer iobuf, long byteSize)
protected final boolean allocateBuffer(int buf, ISBounds queryBounds)
protected final boolean allocateBuffer(int buf, ISBounds queryBounds, int unitSize)
protected boolean allocateBuffer(int buf, ISBounds gridSpace, ISBounds queryBounds, int unitSize)
protected final boolean allocateBuffer(int size)
protected final boolean allocateBuffer(ISBounds bounds)
protected final boolean allocateBuffer(ISBounds bounds, int unitSize)
protected final boolean allocateBuffer(ISBounds grid, ISBounds bounds, int unitSize)
protected void deleteBuffer(int buf)
public void deleteBuffers()
public void deleteBuffer()
protected final java.nio.ByteBuffer getBuffer(int i)
protected final java.nio.ByteBuffer getBuffer()
public void resetReadCounter()
public long getReadCounter()
public long getReadLength()
public void subblock(DataBlock dstBlock, ISBounds dstBounds, ISBounds srcBounds)
subblock
in interface Indexable
subblock
in class DataCollection
public void subblock(DataBlock dstBlock, ISBounds dstBounds, ISBounds srcBounds, RecordSpec recSpec)
subblock
in interface Indexable
subblock
in class DataCollection
public void subblock(DataBlock dstBlock, ISBounds dstBounds, ISBounds srcBounds, FieldIDMapper mp)
subblock
in interface Indexable
subblock
in class DataCollection
public java.lang.String getURL()
public java.lang.String getDataFileString()
public java.lang.String toString()
toString
in class DataSource
public java.lang.String toString(java.lang.String indent)
toString
in class DataSource
public boolean equals(java.lang.Object o)
equals
in class DataSource
protected long makeBestBuffer(ISBounds spaceBounds, ISBounds queryBounds, int unitSize)
public static void main(java.lang.String[] args)