org.ozoneDB.core.storage.classicStore
Class Cluster
java.lang.Object
org.ozoneDB.core.storage.classicStore.Cluster
- public class Cluster
- extends java.lang.Object
- Author:
- SMB
Method Summary |
void |
appendObject(DeathObject dobj,
TransactionID tid,
boolean serialize,
boolean useClone)
|
void |
beginRecovery(byte mode)
|
void |
close()
|
ClusterID |
cluID()
|
void |
endRecovery(byte mode)
|
private long |
entrySize(DeathObject dobj)
size of a object entry:
ObjectID : 8 bytes
TransactionID : 8 bytes
streamed ObjectContainer: comes from DeathObject.stateSize
ChunkID : 1 byte
data length : 4 bytes
data itself : n bytes
-> data overhead : 21 bytes + object state |
java.io.File |
fileHandle()
|
protected void |
finalize()
|
java.io.File |
leakFileHandle()
|
long |
leakSize()
|
protected boolean |
needsCompressing()
Checks, if the specified cluster needs to be compressed. |
DxCollection |
objects()
|
void |
open()
|
private Cluster.Chunk |
readChunk(java.io.DataInputStream in,
boolean skip)
|
DxCollection |
readLeaks(TransactionID rollBackTid,
boolean ordered)
|
boolean |
readObjects(int whatToRead,
TransactionID rollBackTid)
reads all objects from the cluster, while dropping leaks in normal mode
or broken-transaction-objects in recovery mode;
returns false if any objects were dropped |
void |
removeFromDisk()
|
void |
rollBack(TransactionID rollBackTid)
|
void |
rollBackLeaks(TransactionID rollBackTid)
|
long |
size()
The cluster size has to different meanings:
- while writing it means the size of the cluster file, so that we can
limit the file's size as good as possible to the user defined
maximum cluster size
- while reading it means the sum of the sizes of all its death objects,
so that we can determine exactly the space we will need in the object
buffer of the cluster space |
private void |
writeChunk(java.io.DataOutputStream out,
Cluster.Chunk chunk)
|
void |
writeHeader()
|
void |
writeLeak(DeathObject dobj,
TransactionID tid)
|
void |
writeLeak(ObjectID oid,
TransactionID tid,
long objSize)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION
public static final int VERSION
- See Also:
- Constant Field Values
MAX_SIZE
public static int MAX_SIZE
CLUSTER_FILE_SUFF
public static final java.lang.String CLUSTER_FILE_SUFF
- See Also:
- Constant Field Values
LEAK_FILE_SUFF
public static final java.lang.String LEAK_FILE_SUFF
- See Also:
- Constant Field Values
RECOVERY_SUFF
public static final java.lang.String RECOVERY_SUFF
- See Also:
- Constant Field Values
LEAK_WEIGHT
public static final double LEAK_WEIGHT
- See Also:
- Constant Field Values
DATA
public static final int DATA
- See Also:
- Constant Field Values
STATE
public static final int STATE
- See Also:
- Constant Field Values
TRANS
public static final int TRANS
- See Also:
- Constant Field Values
CL_HEADER_CHUNK
public static final byte CL_HEADER_CHUNK
- See Also:
- Constant Field Values
DATA_OID_CHUNK
public static final byte DATA_OID_CHUNK
- See Also:
- Constant Field Values
DATA_HEADER_CHUNK
public static final byte DATA_HEADER_CHUNK
- See Also:
- Constant Field Values
DATA_CHUNK
public static final byte DATA_CHUNK
- See Also:
- Constant Field Values
NONE
public static final byte NONE
- See Also:
- Constant Field Values
OBJECTS
public static final byte OBJECTS
- See Also:
- Constant Field Values
LEAKS
public static final byte LEAKS
- See Also:
- Constant Field Values
cid
ClusterID cid
recoveryMode
byte recoveryMode
clusterSize
long clusterSize
leakSize
long leakSize
stream
java.io.DataOutputStream stream
objects
DxCollection objects
env
Env env
classicStore
ClassicStore classicStore
Cluster
public Cluster(Env _env,
ClassicStore _classicStore)
Cluster
public Cluster(Env _env,
ClassicStore _classicStore,
ClusterID _cid)
finalize
protected void finalize()
throws java.lang.Throwable
- Throws:
java.lang.Throwable
cluID
public final ClusterID cluID()
objects
public final DxCollection objects()
beginRecovery
public final void beginRecovery(byte mode)
endRecovery
public final void endRecovery(byte mode)
fileHandle
public final java.io.File fileHandle()
leakFileHandle
public final java.io.File leakFileHandle()
size
public final long size()
- The cluster size has to different meanings:
- while writing it means the size of the cluster file, so that we can
limit the file's size as good as possible to the user defined
maximum cluster size
- while reading it means the sum of the sizes of all its death objects,
so that we can determine exactly the space we will need in the object
buffer of the cluster space
open
public void open()
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
writeHeader
public void writeHeader()
throws java.io.IOException
- Throws:
java.io.IOException
entrySize
private final long entrySize(DeathObject dobj)
- size of a object entry:
ObjectID : 8 bytes
TransactionID : 8 bytes
streamed ObjectContainer: comes from DeathObject.stateSize
ChunkID : 1 byte
data length : 4 bytes
data itself : n bytes
-> data overhead : 21 bytes + object state
appendObject
public void appendObject(DeathObject dobj,
TransactionID tid,
boolean serialize,
boolean useClone)
throws java.io.IOException
- Throws:
java.io.IOException
readObjects
public boolean readObjects(int whatToRead,
TransactionID rollBackTid)
throws java.io.IOException
- reads all objects from the cluster, while dropping leaks in normal mode
or broken-transaction-objects in recovery mode;
returns false if any objects were dropped
- Throws:
java.io.IOException
leakSize
public long leakSize()
writeLeak
public void writeLeak(DeathObject dobj,
TransactionID tid)
throws java.io.IOException
- Throws:
java.io.IOException
writeLeak
public void writeLeak(ObjectID oid,
TransactionID tid,
long objSize)
throws java.io.IOException
- Throws:
java.io.IOException
readLeaks
public DxCollection readLeaks(TransactionID rollBackTid,
boolean ordered)
throws java.io.IOException
- Throws:
java.io.IOException
removeFromDisk
public void removeFromDisk()
throws java.io.IOException
- Throws:
java.io.IOException
writeChunk
private void writeChunk(java.io.DataOutputStream out,
Cluster.Chunk chunk)
throws java.io.IOException
- Throws:
java.io.IOException
readChunk
private Cluster.Chunk readChunk(java.io.DataInputStream in,
boolean skip)
throws java.io.IOException
- Throws:
java.io.IOException
rollBack
public void rollBack(TransactionID rollBackTid)
throws java.lang.Exception
- Throws:
java.lang.Exception
rollBackLeaks
public void rollBackLeaks(TransactionID rollBackTid)
throws java.lang.Exception
- Throws:
java.lang.Exception
needsCompressing
protected boolean needsCompressing()
- Checks, if the specified cluster needs to be compressed.
Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.