git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1361227 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-07-13 14:10:31 +00:00
parent f84e41611c
commit 6b203be068
4 changed files with 36 additions and 36 deletions

View File

@ -43,9 +43,9 @@ import java.util.Set;
/** /**
* An implementation of {@link PersistenceAdapter} designed for use with * An implementation of {@link PersistenceAdapter} designed for use with
* KahaDB - Embedded Lightweight Non-Relational Database * KahaDB - Embedded Lightweight Non-Relational Database
* *
* @org.apache.xbean.XBean element="kahaDB" * @org.apache.xbean.XBean element="kahaDB"
* *
*/ */
public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServiceAware { public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServiceAware {
private final KahaDBStore letter = new KahaDBStore(); private final KahaDBStore letter = new KahaDBStore();
@ -202,7 +202,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the journalMaxFileLength * Get the journalMaxFileLength
* *
* @return the journalMaxFileLength * @return the journalMaxFileLength
*/ */
public int getJournalMaxFileLength() { public int getJournalMaxFileLength() {
@ -212,7 +212,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can
* be used * be used
* *
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor"
*/ */
public void setJournalMaxFileLength(int journalMaxFileLength) { public void setJournalMaxFileLength(int journalMaxFileLength) {
@ -225,7 +225,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
public void setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack) { public void setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack) {
this.letter.setMaxFailoverProducersToTrack(maxFailoverProducersToTrack); this.letter.setMaxFailoverProducersToTrack(maxFailoverProducersToTrack);
} }
public int getMaxFailoverProducersToTrack() { public int getMaxFailoverProducersToTrack() {
return this.letter.getMaxFailoverProducersToTrack(); return this.letter.getMaxFailoverProducersToTrack();
} }
@ -237,14 +237,14 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
public void setFailoverProducersAuditDepth(int failoverProducersAuditDepth) { public void setFailoverProducersAuditDepth(int failoverProducersAuditDepth) {
this.letter.setFailoverProducersAuditDepth(failoverProducersAuditDepth); this.letter.setFailoverProducersAuditDepth(failoverProducersAuditDepth);
} }
public int getFailoverProducersAuditDepth() { public int getFailoverProducersAuditDepth() {
return this.letter.getFailoverProducersAuditDepth(); return this.letter.getFailoverProducersAuditDepth();
} }
/** /**
* Get the checkpointInterval * Get the checkpointInterval
* *
* @return the checkpointInterval * @return the checkpointInterval
*/ */
public long getCheckpointInterval() { public long getCheckpointInterval() {
@ -253,7 +253,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Set the checkpointInterval * Set the checkpointInterval
* *
* @param checkpointInterval * @param checkpointInterval
* the checkpointInterval to set * the checkpointInterval to set
*/ */
@ -263,7 +263,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the cleanupInterval * Get the cleanupInterval
* *
* @return the cleanupInterval * @return the cleanupInterval
*/ */
public long getCleanupInterval() { public long getCleanupInterval() {
@ -272,7 +272,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Set the cleanupInterval * Set the cleanupInterval
* *
* @param cleanupInterval * @param cleanupInterval
* the cleanupInterval to set * the cleanupInterval to set
*/ */
@ -282,7 +282,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the indexWriteBatchSize * Get the indexWriteBatchSize
* *
* @return the indexWriteBatchSize * @return the indexWriteBatchSize
*/ */
public int getIndexWriteBatchSize() { public int getIndexWriteBatchSize() {
@ -302,7 +302,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the journalMaxWriteBatchSize * Get the journalMaxWriteBatchSize
* *
* @return the journalMaxWriteBatchSize * @return the journalMaxWriteBatchSize
*/ */
public int getJournalMaxWriteBatchSize() { public int getJournalMaxWriteBatchSize() {
@ -322,7 +322,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the enableIndexWriteAsync * Get the enableIndexWriteAsync
* *
* @return the enableIndexWriteAsync * @return the enableIndexWriteAsync
*/ */
public boolean isEnableIndexWriteAsync() { public boolean isEnableIndexWriteAsync() {
@ -331,7 +331,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Set the enableIndexWriteAsync * Set the enableIndexWriteAsync
* *
* @param enableIndexWriteAsync * @param enableIndexWriteAsync
* the enableIndexWriteAsync to set * the enableIndexWriteAsync to set
*/ */
@ -341,7 +341,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the directory * Get the directory
* *
* @return the directory * @return the directory
*/ */
public File getDirectory() { public File getDirectory() {
@ -358,7 +358,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the enableJournalDiskSyncs * Get the enableJournalDiskSyncs
* *
* @return the enableJournalDiskSyncs * @return the enableJournalDiskSyncs
*/ */
public boolean isEnableJournalDiskSyncs() { public boolean isEnableJournalDiskSyncs() {
@ -367,7 +367,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Set the enableJournalDiskSyncs * Set the enableJournalDiskSyncs
* *
* @param enableJournalDiskSyncs * @param enableJournalDiskSyncs
* the enableJournalDiskSyncs to set * the enableJournalDiskSyncs to set
*/ */
@ -377,7 +377,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the indexCacheSize * Get the indexCacheSize
* *
* @return the indexCacheSize * @return the indexCacheSize
*/ */
public int getIndexCacheSize() { public int getIndexCacheSize() {
@ -397,7 +397,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Get the ignoreMissingJournalfiles * Get the ignoreMissingJournalfiles
* *
* @return the ignoreMissingJournalfiles * @return the ignoreMissingJournalfiles
*/ */
public boolean isIgnoreMissingJournalfiles() { public boolean isIgnoreMissingJournalfiles() {
@ -406,7 +406,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
/** /**
* Set the ignoreMissingJournalfiles * Set the ignoreMissingJournalfiles
* *
* @param ignoreMissingJournalfiles * @param ignoreMissingJournalfiles
* the ignoreMissingJournalfiles to set * the ignoreMissingJournalfiles to set
*/ */
@ -476,7 +476,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
public void setMaxAsyncJobs(int maxAsyncJobs) { public void setMaxAsyncJobs(int maxAsyncJobs) {
letter.setMaxAsyncJobs(maxAsyncJobs); letter.setMaxAsyncJobs(maxAsyncJobs);
} }
/** /**
* @return the databaseLockedWaitDelay * @return the databaseLockedWaitDelay
*/ */
@ -573,15 +573,15 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
LocalTransactionId t = (LocalTransactionId) txid; LocalTransactionId t = (LocalTransactionId) txid;
KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId(); KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId();
kahaTxId.setConnectionId(t.getConnectionId().getValue()); kahaTxId.setConnectionId(t.getConnectionId().getValue());
kahaTxId.setTransacitonId(t.getValue()); kahaTxId.setTransactionId(t.getValue());
rc.setLocalTransacitonId(kahaTxId); rc.setLocalTransactionId(kahaTxId);
} else { } else {
XATransactionId t = (XATransactionId) txid; XATransactionId t = (XATransactionId) txid;
KahaXATransactionId kahaTxId = new KahaXATransactionId(); KahaXATransactionId kahaTxId = new KahaXATransactionId();
kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier())); kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier()));
kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId())); kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
kahaTxId.setFormatId(t.getFormatId()); kahaTxId.setFormatId(t.getFormatId());
rc.setXaTransacitonId(kahaTxId); rc.setXaTransactionId(kahaTxId);
} }
return rc; return rc;
} }

View File

@ -90,7 +90,7 @@ public class MultiKahaDBPersistenceAdapter extends DestinationMap implements Per
kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId())); kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
kahaTxId.setFormatId(t.getFormatId()); kahaTxId.setFormatId(t.getFormatId());
} }
rc.setXaTransacitonId(kahaTxId); rc.setXaTransactionId(kahaTxId);
return rc; return rc;
} }
}; };

View File

@ -33,8 +33,8 @@ public class TransactionIdConversion {
LocalTransactionId t = (LocalTransactionId) tx; LocalTransactionId t = (LocalTransactionId) tx;
KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId(); KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId();
kahaTxId.setConnectionId(t.getConnectionId().getValue()); kahaTxId.setConnectionId(t.getConnectionId().getValue());
kahaTxId.setTransacitonId(t.getValue()); kahaTxId.setTransactionId(t.getValue());
rc.setLocalTransacitonId(kahaTxId); rc.setLocalTransactionId(kahaTxId);
return rc; return rc;
} }
@ -53,20 +53,20 @@ public class TransactionIdConversion {
kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier())); kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier()));
kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId())); kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
kahaTxId.setFormatId(t.getFormatId()); kahaTxId.setFormatId(t.getFormatId());
rc.setXaTransacitonId(kahaTxId); rc.setXaTransactionId(kahaTxId);
} }
return rc; return rc;
} }
static TransactionId convert(KahaTransactionInfo transactionInfo) { static TransactionId convert(KahaTransactionInfo transactionInfo) {
if (transactionInfo.hasLocalTransacitonId()) { if (transactionInfo.hasLocalTransactionId()) {
KahaLocalTransactionId tx = transactionInfo.getLocalTransacitonId(); KahaLocalTransactionId tx = transactionInfo.getLocalTransactionId();
LocalTransactionId rc = new LocalTransactionId(); LocalTransactionId rc = new LocalTransactionId();
rc.setConnectionId(new ConnectionId(tx.getConnectionId())); rc.setConnectionId(new ConnectionId(tx.getConnectionId()));
rc.setValue(tx.getTransacitonId()); rc.setValue(tx.getTransactionId());
return rc; return rc;
} else { } else {
KahaXATransactionId tx = transactionInfo.getXaTransacitonId(); KahaXATransactionId tx = transactionInfo.getXaTransactionId();
XATransactionId rc = new XATransactionId(); XATransactionId rc = new XATransactionId();
rc.setBranchQualifier(tx.getBranchQualifier().toByteArray()); rc.setBranchQualifier(tx.getBranchQualifier().toByteArray());
rc.setGlobalTransactionId(tx.getGlobalTransactionId().toByteArray()); rc.setGlobalTransactionId(tx.getGlobalTransactionId().toByteArray());

View File

@ -137,14 +137,14 @@ message KahaDestination {
} }
message KahaTransactionInfo { message KahaTransactionInfo {
optional KahaLocalTransactionId local_transaciton_id=1; optional KahaLocalTransactionId local_transaction_id=1;
optional KahaXATransactionId xa_transaciton_id=2; optional KahaXATransactionId xa_transaction_id=2;
optional KahaLocation previous_entry=3; optional KahaLocation previous_entry=3;
} }
message KahaLocalTransactionId { message KahaLocalTransactionId {
required string connection_id=1; required string connection_id=1;
required int64 transaciton_id=1; required int64 transaction_id=1;
} }
message KahaXATransactionId { message KahaXATransactionId {