org.jboss.messaging.core.journal.impl
Class JournalTransaction

java.lang.Object
  extended by org.jboss.messaging.core.journal.impl.JournalTransaction

public class JournalTransaction
extends java.lang.Object

A JournalTransaction

Author:
Clebert Suconic

Constructor Summary
JournalTransaction(long id, JournalImpl journal)
           
 
Method Summary
 void addNegative(JournalFile file, long id)
           
 void addPositive(JournalFile file, long id, int size)
           
 void clear()
           
 void commit(JournalFile file)
          The caller of this method needs to guarantee lock.acquire at the journal.
 void fillNumberOfRecords(JournalFile currentFile, MessagingBuffer bb)
           
 void forget()
          Used by load, when the transaction was not loaded correctly
 TransactionCallback getCallback(JournalFile file)
           
 int getCounter(JournalFile file)
           
 long getId()
           
 long[] getPositiveArray()
           
 void incCounter(JournalFile file)
           
 void merge(JournalTransaction other)
          This is used to merge transactions from compacting
 void prepare(JournalFile file)
          The caller of this method needs to guarantee lock.acquire before calling this method if being used outside of the lock context.
 void rollback(JournalFile file)
          The caller of this method needs to guarantee lock.acquire before calling this method if being used outside of the lock context.
 void setCompacting()
           
 void syncPreviousFiles(boolean callbacks, JournalFile currentFile)
          99.99 % of the times previous files will be already synced, since they are scheduled to be closed.
 java.lang.String toString()
           
 void waitCallbacks()
           
 void waitCompletion()
          Wait completion at the latest file only
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JournalTransaction

public JournalTransaction(long id,
                          JournalImpl journal)
Method Detail

getId

public long getId()
Returns:
the id

getCounter

public int getCounter(JournalFile file)

incCounter

public void incCounter(JournalFile file)

getPositiveArray

public long[] getPositiveArray()

setCompacting

public void setCompacting()

merge

public void merge(JournalTransaction other)
This is used to merge transactions from compacting


clear

public void clear()

fillNumberOfRecords

public void fillNumberOfRecords(JournalFile currentFile,
                                MessagingBuffer bb)
Parameters:
currentFile -
bb -

syncPreviousFiles

public void syncPreviousFiles(boolean callbacks,
                              JournalFile currentFile)
                       throws java.lang.Exception
99.99 % of the times previous files will be already synced, since they are scheduled to be closed. Because of that, this operation should be almost very fast.

Throws:
java.lang.Exception

getCallback

public TransactionCallback getCallback(JournalFile file)
                                throws java.lang.Exception
Returns:
Throws:
java.lang.Exception

addPositive

public void addPositive(JournalFile file,
                        long id,
                        int size)

addNegative

public void addNegative(JournalFile file,
                        long id)

commit

public void commit(JournalFile file)
The caller of this method needs to guarantee lock.acquire at the journal. (unless this is being called from load what is a single thread process).


waitCallbacks

public void waitCallbacks()
                   throws java.lang.Exception
Throws:
java.lang.Exception

waitCompletion

public void waitCompletion()
                    throws java.lang.Exception
Wait completion at the latest file only

Throws:
java.lang.Exception

rollback

public void rollback(JournalFile file)
The caller of this method needs to guarantee lock.acquire before calling this method if being used outside of the lock context. or else potFilesMap could be affected


prepare

public void prepare(JournalFile file)
The caller of this method needs to guarantee lock.acquire before calling this method if being used outside of the lock context. or else potFilesMap could be affected


forget

public void forget()
Used by load, when the transaction was not loaded correctly


toString

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


Copyright © 2006 JBoss Inc. All Rights Reserved.