com.caucho.message.journal
Class JournalFile

java.lang.Object
  extended by com.caucho.message.journal.JournalFile

public final class JournalFile
extends java.lang.Object

Interface for the transaction log. MQueueJournal is not thread safe. It is intended to be used by a single thread.


Field Summary
static int BLOCK_BITS
           
static int BLOCK_SIZE
           
static int FH_CHECKPOINT_ADDR
           
static int FH_CHECKPOINT_OFFSET
           
static int FH_END
           
static int FH_OFF_PAGE
           
static int FH_PAGE_MASK
           
static long FILE_DATA_OFFSET
           
static long FILE_HEADER_OFFSET
           
static int FILE_HEADER_SIZE
           
static long H_CODE_MASK
           
static long H_FIN
           
static long H_INIT
           
static int H_LENGTH_MASK
           
static int H_PAGE
           
static int H_PAGE_OFF
           
static int HEADER_SIZE
           
static int HOFF_CODE
           
static int HOFF_LENGTH
           
static int HOFF_MID
           
static int HOFF_QID
           
static int HOFF_XID
           
static int MIN_BLOCK_COUNT
           
static int MIN_FLIP_SIZE
           
static int OP_CHECKPOINT
           
static int OP_NULL
           
static int PAD_MASK
           
static int PAD_SIZE
           
 
Constructor Summary
JournalFile(Path path, JournalRecoverListener listener)
           
 
Method Summary
 void checkpoint(long blockAddr, int offset, int length)
           
 void close()
           
static boolean isSamePage(long addressA, long addressB)
           
 void setMinFlipSize(long size)
           
 java.lang.String toString()
           
 void write(long code, boolean isInit, boolean isFin, long xid, long qid, long mid, byte[] buffer, int offset, int length, JournalResult result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLOCK_BITS

public static final int BLOCK_BITS
See Also:
Constant Field Values

BLOCK_SIZE

public static final int BLOCK_SIZE
See Also:
Constant Field Values

FILE_HEADER_OFFSET

public static final long FILE_HEADER_OFFSET
See Also:
Constant Field Values

FILE_HEADER_SIZE

public static final int FILE_HEADER_SIZE
See Also:
Constant Field Values

MIN_BLOCK_COUNT

public static final int MIN_BLOCK_COUNT
See Also:
Constant Field Values

FILE_DATA_OFFSET

public static final long FILE_DATA_OFFSET
See Also:
Constant Field Values

FH_OFF_PAGE

public static final int FH_OFF_PAGE
See Also:
Constant Field Values

FH_PAGE_MASK

public static final int FH_PAGE_MASK
See Also:
Constant Field Values

FH_CHECKPOINT_ADDR

public static final int FH_CHECKPOINT_ADDR
See Also:
Constant Field Values

FH_CHECKPOINT_OFFSET

public static final int FH_CHECKPOINT_OFFSET
See Also:
Constant Field Values

FH_END

public static final int FH_END
See Also:
Constant Field Values

MIN_FLIP_SIZE

public static final int MIN_FLIP_SIZE
See Also:
Constant Field Values

PAD_SIZE

public static final int PAD_SIZE
See Also:
Constant Field Values

PAD_MASK

public static final int PAD_MASK
See Also:
Constant Field Values

HOFF_LENGTH

public static final int HOFF_LENGTH
See Also:
Constant Field Values

HOFF_CODE

public static final int HOFF_CODE
See Also:
Constant Field Values

HOFF_QID

public static final int HOFF_QID
See Also:
Constant Field Values

HOFF_MID

public static final int HOFF_MID
See Also:
Constant Field Values

HOFF_XID

public static final int HOFF_XID
See Also:
Constant Field Values

HEADER_SIZE

public static final int HEADER_SIZE
See Also:
Constant Field Values

H_LENGTH_MASK

public static final int H_LENGTH_MASK
See Also:
Constant Field Values

H_PAGE

public static final int H_PAGE
See Also:
Constant Field Values

H_PAGE_OFF

public static final int H_PAGE_OFF
See Also:
Constant Field Values

H_FIN

public static final long H_FIN
See Also:
Constant Field Values

H_INIT

public static final long H_INIT
See Also:
Constant Field Values

H_CODE_MASK

public static final long H_CODE_MASK
See Also:
Constant Field Values

OP_NULL

public static final int OP_NULL
See Also:
Constant Field Values

OP_CHECKPOINT

public static final int OP_CHECKPOINT
See Also:
Constant Field Values
Constructor Detail

JournalFile

public JournalFile(Path path,
                   JournalRecoverListener listener)
Method Detail

setMinFlipSize

public void setMinFlipSize(long size)

isSamePage

public static boolean isSamePage(long addressA,
                                 long addressB)
Parameters:
queueHeadAddress -
tailAddress -
Returns:

write

public final void write(long code,
                        boolean isInit,
                        boolean isFin,
                        long xid,
                        long qid,
                        long mid,
                        byte[] buffer,
                        int offset,
                        int length,
                        JournalResult result)
                 throws java.io.IOException
Throws:
java.io.IOException

checkpoint

public void checkpoint(long blockAddr,
                       int offset,
                       int length)
                throws java.io.IOException
Throws:
java.io.IOException

close

public void close()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object