Quadcap Embeddable Database

com.quadcap.sql.file.SegmentManager Interface Reference

Inheritance diagram for com.quadcap.sql.file.SegmentManager:

com.quadcap.sql.file.BlockFile List of all members.

Detailed Description

Interface to be implemented by segment allocators.

Author:
Stan Bailes

Definition at line 50 of file SegmentManager.java.

Public Member Functions

RandomAccessInputStream getInputStream (long seg) throws IOException
 Return a new input stream, reading from the region with the specified root segment.

RandomAccessOutputStream getOutputStream (long seg) throws IOException
 Return a new output stream, writing to the region with the specified root segment.

RandomAccess getStream (long seg) throws IOException
 Return the random-access region with the specified root segment.

void freeSegment (long seg) throws IOException
 Destroy the stream with the specified root segment and free up the 7 * storage it was using.

long putBytes (byte[] buf) throws IOException
 Create a new segment with the specified bytes value and return its reference.

byte[] getBytes (long seg) throws IOException
 Return the segment as a byte array.

void updateBytes (long seg, byte[] buf) throws IOException
 Update a segment with new value bytes.


Member Function Documentation

void com.quadcap.sql.file.SegmentManager.freeSegment long  seg  )  throws IOException
 

Destroy the stream with the specified root segment and free up the 7 * storage it was using.

Parameters:
segment the root segment of the region
Exceptions:
IOException if the segment number isn't valid, or if another error is detected trying to access the region.

Implemented in com.quadcap.sql.file.BlockFile.

byte [] com.quadcap.sql.file.SegmentManager.getBytes long  seg  )  throws IOException
 

Return the segment as a byte array.

Parameters:
seg the segment id
Returns:
the value of the segment's bytes

Implemented in com.quadcap.sql.file.BlockFile.

RandomAccessInputStream com.quadcap.sql.file.SegmentManager.getInputStream long  seg  )  throws IOException
 

Return a new input stream, reading from the region with the specified root segment.

Parameters:
segment the root segment of the region
Returns:
an InputStream bound to the region.
Exceptions:
IOException if the segment number isn't valid, or if another error is detected trying to access the region.

Implemented in com.quadcap.sql.file.BlockFile.

RandomAccessOutputStream com.quadcap.sql.file.SegmentManager.getOutputStream long  seg  )  throws IOException
 

Return a new output stream, writing to the region with the specified root segment.

Parameters:
segment the root segment of the region
Returns:
an OutputStream bound to the region.
Exceptions:
IOException if the segment number isn't valid, or if another error is detected trying to access the region.

Implemented in com.quadcap.sql.file.BlockFile.

RandomAccess com.quadcap.sql.file.SegmentManager.getStream long  seg  )  throws IOException
 

Return the random-access region with the specified root segment.

Implemented in com.quadcap.sql.file.BlockFile.

long com.quadcap.sql.file.SegmentManager.putBytes byte[]  buf  )  throws IOException
 

Create a new segment with the specified bytes value and return its reference.

Parameters:
buf the value to write to the new segment
Returns:
the segment id

Implemented in com.quadcap.sql.file.BlockFile.

void com.quadcap.sql.file.SegmentManager.updateBytes long  seg,
byte[]  buf
throws IOException
 

Update a segment with new value bytes.

Parameters:
buf the value to write to the segment
seg the segment id

Implemented in com.quadcap.sql.file.BlockFile.