mirror of https://github.com/apache/activemq.git
apply patch for: https://issues.apache.org/jira/browse/AMQ-3849
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1361227 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f84e41611c
commit
6b203be068
|
@ -43,9 +43,9 @@ import java.util.Set;
|
|||
/**
|
||||
* An implementation of {@link PersistenceAdapter} designed for use with
|
||||
* KahaDB - Embedded Lightweight Non-Relational Database
|
||||
*
|
||||
*
|
||||
* @org.apache.xbean.XBean element="kahaDB"
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServiceAware {
|
||||
private final KahaDBStore letter = new KahaDBStore();
|
||||
|
@ -202,7 +202,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the journalMaxFileLength
|
||||
*
|
||||
*
|
||||
* @return the journalMaxFileLength
|
||||
*/
|
||||
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
|
||||
* be used
|
||||
*
|
||||
*
|
||||
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor"
|
||||
*/
|
||||
public void setJournalMaxFileLength(int journalMaxFileLength) {
|
||||
|
@ -225,7 +225,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
public void setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack) {
|
||||
this.letter.setMaxFailoverProducersToTrack(maxFailoverProducersToTrack);
|
||||
}
|
||||
|
||||
|
||||
public int getMaxFailoverProducersToTrack() {
|
||||
return this.letter.getMaxFailoverProducersToTrack();
|
||||
}
|
||||
|
@ -237,14 +237,14 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
public void setFailoverProducersAuditDepth(int failoverProducersAuditDepth) {
|
||||
this.letter.setFailoverProducersAuditDepth(failoverProducersAuditDepth);
|
||||
}
|
||||
|
||||
|
||||
public int getFailoverProducersAuditDepth() {
|
||||
return this.letter.getFailoverProducersAuditDepth();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the checkpointInterval
|
||||
*
|
||||
*
|
||||
* @return the checkpointInterval
|
||||
*/
|
||||
public long getCheckpointInterval() {
|
||||
|
@ -253,7 +253,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Set the checkpointInterval
|
||||
*
|
||||
*
|
||||
* @param checkpointInterval
|
||||
* the checkpointInterval to set
|
||||
*/
|
||||
|
@ -263,7 +263,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the cleanupInterval
|
||||
*
|
||||
*
|
||||
* @return the cleanupInterval
|
||||
*/
|
||||
public long getCleanupInterval() {
|
||||
|
@ -272,7 +272,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Set the cleanupInterval
|
||||
*
|
||||
*
|
||||
* @param cleanupInterval
|
||||
* the cleanupInterval to set
|
||||
*/
|
||||
|
@ -282,7 +282,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the indexWriteBatchSize
|
||||
*
|
||||
*
|
||||
* @return the indexWriteBatchSize
|
||||
*/
|
||||
public int getIndexWriteBatchSize() {
|
||||
|
@ -302,7 +302,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the journalMaxWriteBatchSize
|
||||
*
|
||||
*
|
||||
* @return the journalMaxWriteBatchSize
|
||||
*/
|
||||
public int getJournalMaxWriteBatchSize() {
|
||||
|
@ -322,7 +322,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the enableIndexWriteAsync
|
||||
*
|
||||
*
|
||||
* @return the enableIndexWriteAsync
|
||||
*/
|
||||
public boolean isEnableIndexWriteAsync() {
|
||||
|
@ -331,7 +331,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Set the enableIndexWriteAsync
|
||||
*
|
||||
*
|
||||
* @param enableIndexWriteAsync
|
||||
* the enableIndexWriteAsync to set
|
||||
*/
|
||||
|
@ -341,7 +341,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the directory
|
||||
*
|
||||
*
|
||||
* @return the directory
|
||||
*/
|
||||
public File getDirectory() {
|
||||
|
@ -358,7 +358,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the enableJournalDiskSyncs
|
||||
*
|
||||
*
|
||||
* @return the enableJournalDiskSyncs
|
||||
*/
|
||||
public boolean isEnableJournalDiskSyncs() {
|
||||
|
@ -367,7 +367,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Set the enableJournalDiskSyncs
|
||||
*
|
||||
*
|
||||
* @param enableJournalDiskSyncs
|
||||
* the enableJournalDiskSyncs to set
|
||||
*/
|
||||
|
@ -377,7 +377,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the indexCacheSize
|
||||
*
|
||||
*
|
||||
* @return the indexCacheSize
|
||||
*/
|
||||
public int getIndexCacheSize() {
|
||||
|
@ -397,7 +397,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Get the ignoreMissingJournalfiles
|
||||
*
|
||||
*
|
||||
* @return the ignoreMissingJournalfiles
|
||||
*/
|
||||
public boolean isIgnoreMissingJournalfiles() {
|
||||
|
@ -406,7 +406,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
|
||||
/**
|
||||
* Set the ignoreMissingJournalfiles
|
||||
*
|
||||
*
|
||||
* @param ignoreMissingJournalfiles
|
||||
* the ignoreMissingJournalfiles to set
|
||||
*/
|
||||
|
@ -476,7 +476,7 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
public void setMaxAsyncJobs(int maxAsyncJobs) {
|
||||
letter.setMaxAsyncJobs(maxAsyncJobs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the databaseLockedWaitDelay
|
||||
*/
|
||||
|
@ -573,15 +573,15 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter, BrokerServi
|
|||
LocalTransactionId t = (LocalTransactionId) txid;
|
||||
KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId();
|
||||
kahaTxId.setConnectionId(t.getConnectionId().getValue());
|
||||
kahaTxId.setTransacitonId(t.getValue());
|
||||
rc.setLocalTransacitonId(kahaTxId);
|
||||
kahaTxId.setTransactionId(t.getValue());
|
||||
rc.setLocalTransactionId(kahaTxId);
|
||||
} else {
|
||||
XATransactionId t = (XATransactionId) txid;
|
||||
KahaXATransactionId kahaTxId = new KahaXATransactionId();
|
||||
kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier()));
|
||||
kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
|
||||
kahaTxId.setFormatId(t.getFormatId());
|
||||
rc.setXaTransacitonId(kahaTxId);
|
||||
rc.setXaTransactionId(kahaTxId);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public class MultiKahaDBPersistenceAdapter extends DestinationMap implements Per
|
|||
kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
|
||||
kahaTxId.setFormatId(t.getFormatId());
|
||||
}
|
||||
rc.setXaTransacitonId(kahaTxId);
|
||||
rc.setXaTransactionId(kahaTxId);
|
||||
return rc;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -33,8 +33,8 @@ public class TransactionIdConversion {
|
|||
LocalTransactionId t = (LocalTransactionId) tx;
|
||||
KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId();
|
||||
kahaTxId.setConnectionId(t.getConnectionId().getValue());
|
||||
kahaTxId.setTransacitonId(t.getValue());
|
||||
rc.setLocalTransacitonId(kahaTxId);
|
||||
kahaTxId.setTransactionId(t.getValue());
|
||||
rc.setLocalTransactionId(kahaTxId);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -53,20 +53,20 @@ public class TransactionIdConversion {
|
|||
kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier()));
|
||||
kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
|
||||
kahaTxId.setFormatId(t.getFormatId());
|
||||
rc.setXaTransacitonId(kahaTxId);
|
||||
rc.setXaTransactionId(kahaTxId);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static TransactionId convert(KahaTransactionInfo transactionInfo) {
|
||||
if (transactionInfo.hasLocalTransacitonId()) {
|
||||
KahaLocalTransactionId tx = transactionInfo.getLocalTransacitonId();
|
||||
if (transactionInfo.hasLocalTransactionId()) {
|
||||
KahaLocalTransactionId tx = transactionInfo.getLocalTransactionId();
|
||||
LocalTransactionId rc = new LocalTransactionId();
|
||||
rc.setConnectionId(new ConnectionId(tx.getConnectionId()));
|
||||
rc.setValue(tx.getTransacitonId());
|
||||
rc.setValue(tx.getTransactionId());
|
||||
return rc;
|
||||
} else {
|
||||
KahaXATransactionId tx = transactionInfo.getXaTransacitonId();
|
||||
KahaXATransactionId tx = transactionInfo.getXaTransactionId();
|
||||
XATransactionId rc = new XATransactionId();
|
||||
rc.setBranchQualifier(tx.getBranchQualifier().toByteArray());
|
||||
rc.setGlobalTransactionId(tx.getGlobalTransactionId().toByteArray());
|
||||
|
|
|
@ -137,14 +137,14 @@ message KahaDestination {
|
|||
}
|
||||
|
||||
message KahaTransactionInfo {
|
||||
optional KahaLocalTransactionId local_transaciton_id=1;
|
||||
optional KahaXATransactionId xa_transaciton_id=2;
|
||||
optional KahaLocalTransactionId local_transaction_id=1;
|
||||
optional KahaXATransactionId xa_transaction_id=2;
|
||||
optional KahaLocation previous_entry=3;
|
||||
}
|
||||
|
||||
message KahaLocalTransactionId {
|
||||
required string connection_id=1;
|
||||
required int64 transaciton_id=1;
|
||||
required int64 transaction_id=1;
|
||||
}
|
||||
|
||||
message KahaXATransactionId {
|
||||
|
|
Loading…
Reference in New Issue