|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.raw.log.LogCounter
public class LogCounter
A very simple log instant implementation. Within the stored log record a log counter is represented as a long, hence the getValueAsLong() method. Outside the LogFactory the instant is passed around as a LogCounter (through its LogInstant interface). The way the long is encoded is such that < == > correctly tells if one log instant is lessThan, equals or greater than another.
Field Summary | |
---|---|
static long |
DERBY_10_0_MAX_LOGFILE_NUMBER
|
private static long |
FILE_NUMBER_SHIFT
|
private static long |
FILE_POSITION_MASK
|
private long |
fileNumber
|
private long |
filePosition
|
static long |
INVALID_LOG_INSTANT
A well defined value of an invalid log instant. |
static long |
MAX_LOGFILE_NUMBER
|
static long |
MAX_LOGFILE_SIZE
|
Constructor Summary | |
---|---|
LogCounter()
Public niladic constructor needed for Formatable interface. |
|
LogCounter(long value)
|
|
LogCounter(long fileNumber,
long position)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Return true if this DatabaseInstant equals DatabaseInstant from the same database. |
long |
getLogFileNumber()
|
static long |
getLogFileNumber(long valueAsLong)
|
long |
getLogFilePosition()
|
static long |
getLogFilePosition(long valueAsLong)
|
int |
getTypeFormatId()
Get the formatID which corresponds to this class. |
long |
getValueAsLong()
These following methods are only intended to be called by an implementation of a log factory. |
int |
hashCode()
|
boolean |
lessThan(DatabaseInstant other)
LogScan methods |
static long |
makeLogInstantAsLong(long filenum,
long filepos)
Static functions that can only be used inside the RawStore's log factory which passes the log counter around encoded as a long |
DatabaseInstant |
next()
Return the next higher DatabaseInstant. |
DatabaseInstant |
prior()
Return the next lower DatabaseInstant. |
void |
readExternal(java.io.ObjectInput oi)
Read this in. |
static java.lang.String |
toDebugString(long instant)
|
java.lang.String |
toString()
Convert the database instant to a string. |
void |
writeExternal(java.io.ObjectOutput oo)
Write this out. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long INVALID_LOG_INSTANT
public static final long DERBY_10_0_MAX_LOGFILE_NUMBER
public static final long MAX_LOGFILE_NUMBER
private static final long FILE_NUMBER_SHIFT
public static final long MAX_LOGFILE_SIZE
private static final long FILE_POSITION_MASK
private long fileNumber
private long filePosition
Constructor Detail |
---|
public LogCounter(long value)
public LogCounter(long fileNumber, long position)
public LogCounter()
Method Detail |
---|
public static final long makeLogInstantAsLong(long filenum, long filepos)
public static final long getLogFilePosition(long valueAsLong)
public static final long getLogFileNumber(long valueAsLong)
public boolean lessThan(DatabaseInstant other)
lessThan
in interface DatabaseInstant
other
- a DatabaseInstant from the same database as
this.
public boolean equals(java.lang.Object other)
DatabaseInstant
equals
in interface DatabaseInstant
equals
in class java.lang.Object
other
- a DatabaseInstant from the same database as
this.
public DatabaseInstant next()
DatabaseInstant
next
in interface DatabaseInstant
public DatabaseInstant prior()
DatabaseInstant
prior
in interface DatabaseInstant
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
DatabaseInstant
toString
in interface DatabaseInstant
toString
in class java.lang.Object
public static java.lang.String toDebugString(long instant)
public long getValueAsLong()
public long getLogFilePosition()
public long getLogFileNumber()
public void readExternal(java.io.ObjectInput oi) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
- error reading from log stream
java.lang.ClassNotFoundException
- corrupted log streampublic void writeExternal(java.io.ObjectOutput oo) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
- error writing to log streampublic int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |