Package org.apache.activemq.store.kahadb
Class TempMessageDatabase
- java.lang.Object
-
- org.apache.activemq.store.kahadb.TempMessageDatabase
-
- Direct Known Subclasses:
TempKahaDBStore
public class TempMessageDatabase extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TempMessageDatabase.MessageKeysMarshaller
protected class
TempMessageDatabase.StoredDestinationMarshaller
-
Field Summary
Fields Modifier and Type Field Description static int
CLOSED_STATE
protected BTreeIndex<String,org.apache.activemq.store.kahadb.TempMessageDatabase.StoredDestination>
destinations
protected File
directory
protected Object
indexMutex
protected LinkedHashMap<TransactionId,ArrayList<org.apache.activemq.store.kahadb.TempMessageDatabase.Operation>>
inflightTransactions
static int
OPEN_STATE
protected AtomicBoolean
opened
protected PageFile
pageFile
protected LinkedHashMap<TransactionId,ArrayList<org.apache.activemq.store.kahadb.TempMessageDatabase.Operation>>
preparedTransactions
protected AtomicBoolean
started
-
Constructor Summary
Constructors Constructor Description TempMessageDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
File
getDirectory()
int
getIndexWriteBatchSize()
HashSet<Integer>
getJournalFilesBeingReplicated()
PageFile
getPageFile()
protected org.apache.activemq.store.kahadb.TempMessageDatabase.StoredDestination
getStoredDestination(KahaDestination destination, Transaction tx)
void
load()
void
open()
void
process(KahaRemoveDestinationCommand command)
void
process(KahaSubscriptionCommand command)
void
processAdd(KahaAddMessageCommand command, TransactionId txid, ByteSequence data)
void
processCommit(TransactionId key)
void
processPrepare(TransactionId key)
void
processRemove(KahaRemoveMessageCommand command, TransactionId txid)
void
processRollback(TransactionId key)
void
setDirectory(File directory)
void
setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
void
setIndexWriteBatchSize(int setIndexWriteBatchSize)
void
start()
void
stop()
void
unload()
-
-
-
Field Detail
-
CLOSED_STATE
public static final int CLOSED_STATE
- See Also:
- Constant Field Values
-
OPEN_STATE
public static final int OPEN_STATE
- See Also:
- Constant Field Values
-
destinations
protected BTreeIndex<String,org.apache.activemq.store.kahadb.TempMessageDatabase.StoredDestination> destinations
-
pageFile
protected PageFile pageFile
-
directory
protected File directory
-
started
protected AtomicBoolean started
-
opened
protected AtomicBoolean opened
-
indexMutex
protected final Object indexMutex
-
inflightTransactions
protected final LinkedHashMap<TransactionId,ArrayList<org.apache.activemq.store.kahadb.TempMessageDatabase.Operation>> inflightTransactions
-
preparedTransactions
protected final LinkedHashMap<TransactionId,ArrayList<org.apache.activemq.store.kahadb.TempMessageDatabase.Operation>> preparedTransactions
-
-
Method Detail
-
open
public void open() throws IOException
- Throws:
IOException
-
load
public void load() throws IOException
- Throws:
IOException
-
close
public void close() throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
unload
public void unload() throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
processAdd
public void processAdd(KahaAddMessageCommand command, TransactionId txid, ByteSequence data) throws IOException
- Throws:
IOException
-
processRemove
public void processRemove(KahaRemoveMessageCommand command, TransactionId txid) throws IOException
- Throws:
IOException
-
process
public void process(KahaRemoveDestinationCommand command) throws IOException
- Throws:
IOException
-
process
public void process(KahaSubscriptionCommand command) throws IOException
- Throws:
IOException
-
processCommit
public void processCommit(TransactionId key) throws IOException
- Throws:
IOException
-
processPrepare
public void processPrepare(TransactionId key)
-
processRollback
public void processRollback(TransactionId key)
-
getStoredDestination
protected org.apache.activemq.store.kahadb.TempMessageDatabase.StoredDestination getStoredDestination(KahaDestination destination, Transaction tx) throws IOException
- Throws:
IOException
-
getDirectory
public File getDirectory()
-
setDirectory
public void setDirectory(File directory)
-
setIndexWriteBatchSize
public void setIndexWriteBatchSize(int setIndexWriteBatchSize)
-
getIndexWriteBatchSize
public int getIndexWriteBatchSize()
-
setEnableIndexWriteAsync
public void setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
-
getPageFile
public PageFile getPageFile()
-
-