Interface OWALChanges
- All Known Implementing Classes:
OWALChangesTree,OWALPageChangesPortion
public interface OWALChanges
Keep partial changes of a page for a transaction and original values of chunks of page which were
changed using this container.
use get* to access to the original content decorated with the changes. use set* to add a change.
Created by tglman on 24/12/15.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyChanges(ByteBuffer buffer) Apply the changes to a page.intfromStream(int offset, byte[] stream) Read changes from a stream.voidfromStream(ByteBuffer buffer) byte[]getBinaryValue(ByteBuffer buffer, int offset, int len) bytegetByteValue(ByteBuffer buffer, int offset) intgetIntValue(ByteBuffer buffer, int offset) longgetLongValue(ByteBuffer buffer, int offset) shortgetShortValue(ByteBuffer buffer, int offset) booleanvoidmoveData(ByteBuffer buffer, int from, int to, int len) intReturn the size of byte array is needed to serialize all data in it.voidsetBinaryValue(ByteBuffer buffer, byte[] value, int offset) voidsetByteValue(ByteBuffer buffer, byte value, int offset) voidsetIntValue(ByteBuffer buffer, int value, int offset) voidsetLongValue(ByteBuffer buffer, long value, int offset) voidsetShortValue(ByteBuffer buffer, short value, int offset) inttoStream(int offset, byte[] stream) Serialize the changes to a stream.voidtoStream(ByteBuffer byteBuffer)
-
Method Details
-
getByteValue
-
getBinaryValue
-
getShortValue
-
getIntValue
-
getLongValue
-
setLongValue
-
setIntValue
-
setShortValue
-
setByteValue
-
setBinaryValue
-
moveData
-
hasChanges
boolean hasChanges() -
applyChanges
Apply the changes to a page.- Parameters:
buffer- Presents page where apply the changes.
-
serializedSize
int serializedSize()Return the size of byte array is needed to serialize all data in it.- Returns:
- the required size.
-
toStream
int toStream(int offset, byte[] stream) Serialize the changes to a stream. needed for write the changes to the WAL- Parameters:
offset- starting writing offset for the provided buffer.stream- buffer where write the content, should be of minimal size of offset+ @{link @serializedSize()}- Returns:
- the number of written bytes + the offset, can be used as offset of the next operation.
-
toStream
-
fromStream
int fromStream(int offset, byte[] stream) Read changes from a stream. Needed from restore from WAL.- Parameters:
offset- the offset in the buffer where start to read.stream- the buffer to read.- Returns:
- the offset+read bytes.
-
fromStream
-