Any time store fetches a long column, the value is returned as a stream. A long column is any column that at some point was longer than a page, so a long column in one table may not be long in another depending on page size.
When the column is fetched a new OverflowInputStream is created and then the datatype's stream is set using: ((StreamStorable)sColumn).setStream(OverflowInputStream);
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected long | |
| private boolean | |
| protected int | |
| protected long | |
| protected BaseContainerHandle | owner
Fields of the class |
| protected RecordHandle |
| Access | Constructor and Description |
|---|---|
| public | OverflowInputStream(ByteHolder
ByteHolder to hold buffers of bytes as the stream is
walked. Expected usage is that a page worth of
data is held in memory at a time, filled by a
calls to restorePortionLongColumn(). bh, BaseContainerHandle BaseContainerHandle used to read pages from the
container. Note this handle is closed automatically
on commit. owner, long The first overflow page of this long column. overflowPage, int The record id of 1st segment of the long column on
overflowPage. overflowId, RecordHandle RecordHandle of the owning record of the long long
column, this is the row level lock to get. recordToLock)Constructor for OverflowInputStream It is up to the caller to allocate the ByteHolder for this stream, and pass it in. |
| Modifier and Type | Method and Description |
|---|---|
| public InputStream | Returns: Copy of this stream which can be used independently.Implements org. Clone this object. |
| public void | closeStream()
Implements org. Close the Resetable stream. |
| public void | fillByteHolder()
Implements abstract org. If bytes remain in stream, insure the current buffer is not empty. |
| public int | |
| public long | |
| public void | initStream()
Implements org. Initialize a Resetable stream. |
| public void | resetStream()
Implements org. Reset the stream back to beginning of the long column. |
| public void | setOverflowId(int
Page number containing the next segment of the
long column. -1 if there are no more segments. overflowId)Set the next overflow page of the long column. |
| public void | setOverflowPage(long
Page number containing the next segment of the
long column. -1 if there are no more segments. overflowPage)Set the next overflow page of the long column. |
| firstOverflowId | back to summary |
|---|---|
| protected int firstOverflowId | |
| firstOverflowPage | back to summary |
|---|---|
| protected long firstOverflowPage | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| overflowId | back to summary |
|---|---|
| protected int overflowId | |
| overflowPage | back to summary |
|---|---|
| protected long overflowPage | |
| owner | back to summary |
|---|---|
| protected BaseContainerHandle owner Fields of the class | |
| recordToLock | back to summary |
|---|---|
| protected RecordHandle recordToLock | |
| OverflowInputStream | back to summary |
|---|---|
| public OverflowInputStream(ByteHolder bh, BaseContainerHandle owner, long overflowPage, int overflowId, RecordHandle recordToLock) Constructor for OverflowInputStream It is up to the caller to allocate the ByteHolder for this stream, and pass it in.
| |
| cloneStream | back to summary |
|---|---|
| public InputStream cloneStream() Implements org. Clone this object. Creates a deep copy of this object. The returned stream has its own working buffers and can be initialized, reset and read independently from this stream. The cloned stream is set back to the beginning of stream, no matter where the current stream happens to be positioned.
| |
| closeStream | back to summary |
|---|---|
| public void closeStream() Implements org. Close the Resetable stream. Close the container associated with this stream. (This will also free the associated IS table lock and the associated S row lock.) | |
| fillByteHolder | back to summary |
|---|---|
| public void fillByteHolder() throws IOException Implements abstract org. If bytes remain in stream, insure the current buffer is not empty. If there are bytes in current buffer than no more work necessary, else if there are no bytes available in current buffer and there are still more overflow segments then get the next buffer's worth of data. | |
| getOverflowId | back to summary |
|---|---|
| public int getOverflowId() | |
| getOverflowPage | back to summary |
|---|---|
| public long getOverflowPage() | |
| initStream | back to summary |
|---|---|
| public void initStream() throws StandardException Implements org. Initialize a Resetable stream. InitStream() must be called first before using any other of the Resetable interfaces. Reopens the container. This gets a separate intent shared locked on the table and a read lock on the appropriate row. These locks remain until the enclosing blob/clob object is closed, or until the end of the transaction in which initStream() was first called. This locking behavior protects the row while the stream is being accessed. Otherwise for instance in the case of read committed the original row lock on the row would be released when the scan went to the next row, and there would be nothing to stop another transaction from deleting the row while the client read through the stream.
| |
| resetStream | back to summary |
|---|---|
| public void resetStream() throws IOException, StandardException Implements org. Reset the stream back to beginning of the long column. Also fills in the first buffer from the stream. Throws exception if the underlying open container has been closed, for example automatically by a commit().
| |
| setOverflowId | back to summary |
|---|---|
| public void setOverflowId(int overflowId) Set the next overflow page of the long column. Used by StorePage.restorePortionLongColumn() as part of the call back process to save the state of the scan of the pieces of the long column. StorePage.restorePortionLongColumn() is called by fillByteHolder() to get the next page worth into a buffer, and in turn after those bytes are read the state of this stream is updated with then next overflow page.
| |
| setOverflowPage | back to summary |
|---|---|
| public void setOverflowPage(long overflowPage) Set the next overflow page of the long column. Used by StorePage.restorePortionLongColumn() as part of the call back process to save the state of the scan of the pieces of the long column. StorePage.restorePortionLongColumn() is called by fillByteHolder() to get the next page worth into a buffer, and in turn after those bytes are read the state of this stream is updated with then next overflow page.
| |