public class SnapshotWriter extends Object implements BufferOutput<SnapshotWriter>
Snapshot.
This class provides the primary interface for writing snapshot buffers to disk or memory.
Snapshot bytes are written to an underlying Buffer which is backed by either memory
or disk based on the configured StorageLevel.
In addition to standard BufferOutput methods, snapshot readers support writing serializable objects
to the snapshot via the writeObject(Object) method. Serializable types must be registered on the
CopycatServer serializer to be supported in snapshots.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
SnapshotWriter |
flush() |
SnapshotWriter |
write(Buffer buffer) |
SnapshotWriter |
write(byte[] bytes) |
SnapshotWriter |
write(byte[] bytes,
long offset,
long length) |
SnapshotWriter |
write(Bytes bytes) |
SnapshotWriter |
write(Bytes bytes,
long offset,
long length) |
SnapshotWriter |
writeBoolean(boolean b) |
SnapshotWriter |
writeByte(int b) |
SnapshotWriter |
writeChar(char c) |
SnapshotWriter |
writeDouble(double d) |
SnapshotWriter |
writeFloat(float f) |
SnapshotWriter |
writeInt(int i) |
SnapshotWriter |
writeLong(long l) |
SnapshotWriter |
writeMedium(int m) |
SnapshotWriter |
writeObject(Object object)
Writes an object to the snapshot.
|
SnapshotWriter |
writeShort(short s) |
SnapshotWriter |
writeString(String s) |
SnapshotWriter |
writeUnsignedByte(int b) |
SnapshotWriter |
writeUnsignedInt(long i) |
SnapshotWriter |
writeUnsignedMedium(int m) |
SnapshotWriter |
writeUnsignedShort(int s) |
SnapshotWriter |
writeUTF8(String s) |
public SnapshotWriter writeObject(Object object)
object - The object to write.public SnapshotWriter write(Bytes bytes)
write in interface BufferOutput<SnapshotWriter>public SnapshotWriter write(byte[] bytes)
write in interface BufferOutput<SnapshotWriter>public SnapshotWriter write(Bytes bytes, long offset, long length)
write in interface BufferOutput<SnapshotWriter>public SnapshotWriter write(byte[] bytes, long offset, long length)
write in interface BufferOutput<SnapshotWriter>public SnapshotWriter write(Buffer buffer)
write in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeByte(int b)
writeByte in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeUnsignedByte(int b)
writeUnsignedByte in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeChar(char c)
writeChar in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeShort(short s)
writeShort in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeUnsignedShort(int s)
writeUnsignedShort in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeMedium(int m)
writeMedium in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeUnsignedMedium(int m)
writeUnsignedMedium in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeInt(int i)
writeInt in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeUnsignedInt(long i)
writeUnsignedInt in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeLong(long l)
writeLong in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeFloat(float f)
writeFloat in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeDouble(double d)
writeDouble in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeBoolean(boolean b)
writeBoolean in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeString(String s)
writeString in interface BufferOutput<SnapshotWriter>public SnapshotWriter writeUTF8(String s)
writeUTF8 in interface BufferOutput<SnapshotWriter>public SnapshotWriter flush()
flush in interface BufferOutput<SnapshotWriter>public void close()
close in interface BufferOutput<SnapshotWriter>close in interface AutoCloseableCopyright © 2013–2016. All rights reserved.