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 classTempMessageDatabase.MessageKeysMarshallerprotected classTempMessageDatabase.StoredDestinationMarshaller
-
Field Summary
Fields Modifier and Type Field Description static intCLOSED_STATEprotected BTreeIndex<String,org.apache.activemq.store.kahadb.TempMessageDatabase.StoredDestination>destinationsprotected Filedirectoryprotected ObjectindexMutexprotected LinkedHashMap<TransactionId,ArrayList<org.apache.activemq.store.kahadb.TempMessageDatabase.Operation>>inflightTransactionsstatic intOPEN_STATEprotected AtomicBooleanopenedprotected PageFilepageFileprotected LinkedHashMap<TransactionId,ArrayList<org.apache.activemq.store.kahadb.TempMessageDatabase.Operation>>preparedTransactionsprotected AtomicBooleanstarted
-
Constructor Summary
Constructors Constructor Description TempMessageDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()FilegetDirectory()intgetIndexWriteBatchSize()HashSet<Integer>getJournalFilesBeingReplicated()PageFilegetPageFile()protected org.apache.activemq.store.kahadb.TempMessageDatabase.StoredDestinationgetStoredDestination(KahaDestination destination, Transaction tx)voidload()voidopen()voidprocess(KahaRemoveDestinationCommand command)voidprocess(KahaSubscriptionCommand command)voidprocessAdd(KahaAddMessageCommand command, TransactionId txid, ByteSequence data)voidprocessCommit(TransactionId key)voidprocessPrepare(TransactionId key)voidprocessRemove(KahaRemoveMessageCommand command, TransactionId txid)voidprocessRollback(TransactionId key)voidsetDirectory(File directory)voidsetEnableIndexWriteAsync(boolean enableIndexWriteAsync)voidsetIndexWriteBatchSize(int setIndexWriteBatchSize)voidstart()voidstop()voidunload()
-
-
-
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:
IOExceptionInterruptedException
-
unload
public void unload() throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
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()
-
-