|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstorage.intermediateStorage.IntermediateStorageManager
This class is used to manage the operatios of the intermediate storage component. The intermediate storage component controls operations of higer level than primitive storage, partial writing or reading from pages is provided. Intermediate storage manager also uses a little buffer for improving the massive I/O instructions over the same page.
Constructor Summary | |
IntermediateStorageManager(PrimitiveStorageManager psm)
Constructs an intermediate storage manager from a primitive storage manager. |
Method Summary | |
PrimitiveStorageManager |
getPrimitiveStorageManager()
Returns the underlying primitive storage manager. |
void |
read(int chunkNumber,
long pageNumber,
int pageOffset,
byte[] b,
int off,
int length)
Reads partially a page starting from an offset and reading a specific length of bytes. |
boolean |
readBit(int chunkNumber,
long pageNumber,
long bitNumber)
Reads a specific bit from a page. |
long |
readLong(int chunkNumber,
long pageNumber,
int pageOffset)
Reads a java 8-byte long from a page. |
void |
readPage(int chunkNumber,
long pageNumber,
byte[] b,
int off)
Reads fully a page. |
void |
synchronize()
Syncronizes the local buffer with the underlying primitive storage manager. |
void |
synchronizeAndTransfer()
Syncronizes itself and the underlying primitive storage manager with secundary storage. |
void |
synchronizeTransferAndClear()
Syncronizes itself and the underlying primitive storage manager with secundary storage, also crear the buffer. |
void |
write(int chunkNumber,
long pageNumber,
int pageOffset,
byte[] b,
int off,
int length)
Writes partially a page starting from an offset and writing a specific length of bytes. |
void |
writeBit(int chunkNumber,
long pageNumber,
long bitNumber,
boolean value)
Writes a specific bit to a page. |
void |
writeLong(int chunkNumber,
long pageNumber,
int pageOffset,
long number)
Write a java 8-byte long to a page. |
void |
writePage(int chunkNumber,
long pageNumber,
byte[] b,
int off)
Writes partially a page starting from an offset and writing a specific length of bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IntermediateStorageManager(PrimitiveStorageManager psm)
Method Detail |
public PrimitiveStorageManager getPrimitiveStorageManager()
public void synchronize() throws java.io.IOException
java.io.IOException
public void synchronizeAndTransfer() throws java.io.IOException
java.io.IOException
public void synchronizeTransferAndClear() throws java.io.IOException
java.io.IOException
public void read(int chunkNumber, long pageNumber, int pageOffset, byte[] b, int off, int length) throws PrimitiveStorageException, InvalidPageOffsetException, OutOfPageException, java.io.IOException
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.pageOffset
- The position of the page from which the reading starts.b
- The byte array which the content of the readed page will be stored.off
- The offset of b
from which the readed content will be stored.length
- The number of bytes to be readed.
PrimitiveStorageException
InvalidPageOffsetException
OutOfPageException
java.io.IOException
public void write(int chunkNumber, long pageNumber, int pageOffset, byte[] b, int off, int length) throws PrimitiveStorageException, InvalidPageOffsetException, OutOfPageException, java.io.IOException
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.pageOffset
- The position of the page from which the writing starts.b
- The byte array from which the page's content will be get.off
- The offset of b
from which the page's content will be get.length
- The number of bytes to be wrote.
PrimitiveStorageException
InvalidPageOffsetException
OutOfPageException
java.io.IOException
public void readPage(int chunkNumber, long pageNumber, byte[] b, int off) throws PrimitiveStorageException, java.io.IOException
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.b
- The byte array which the content of the readed page will be stored.off
- The offset of b
from which the readed content will be stored.
PrimitiveStorageException
java.io.IOException
public void writePage(int chunkNumber, long pageNumber, byte[] b, int off) throws PrimitiveStorageException, java.io.IOException
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.b
- The byte array from which the page's content will be get.off
- The offset of b
from which the page's content will be get.
PrimitiveStorageException
java.io.IOException
public boolean readBit(int chunkNumber, long pageNumber, long bitNumber) throws PrimitiveStorageException, OutOfPageException, java.io.IOException
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.bitNumber
- The position of the bit inside the page.
There are 8*pageSize available positions.
true
If the bit value is 1
,
false
If the bit value is 0
.
PrimitiveStorageException
OutOfPageException
java.io.IOException
public void writeBit(int chunkNumber, long pageNumber, long bitNumber, boolean value) throws PrimitiveStorageException, OutOfPageException, java.io.IOException
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.bitNumber
- The position of the bit inside the page.
There are 8*pageSize available positions.value
- If value is true
writes 1
,
if it is false
writes 0
.
PrimitiveStorageException
OutOfPageException
java.io.IOException
public long readLong(int chunkNumber, long pageNumber, int pageOffset) throws PrimitiveStorageException, InvalidPageOffsetException, OutOfPageException, java.io.IOException
long
from a page.
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.pageOffset
- The position of the page from which the reading starts.
long
.
PrimitiveStorageException
InvalidPageOffsetException
OutOfPageException
java.io.IOException
public void writeLong(int chunkNumber, long pageNumber, int pageOffset, long number) throws PrimitiveStorageException, InvalidPageOffsetException, OutOfPageException, java.io.IOException
long
to a page.
chunkNumber
- The number of the chunk.pageNumber
- The number of the page inside the chunk.pageOffset
- The position of the page from which the writing starts.number
- The readed 8 bytes as a long
to be wrote in the page.
PrimitiveStorageException
InvalidPageOffsetException
OutOfPageException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |