use of org.apache.pulsar.transaction.coordinator.exceptions.CoordinatorException.TransactionNotFoundException in project pulsar by apache.
the class InMemTransactionMetadataStore method getTxnMeta.
@Override
public CompletableFuture<TxnMeta> getTxnMeta(TxnID txnid) {
CompletableFuture<TxnMeta> getFuture = new CompletableFuture<>();
TxnMetaImpl txn = transactions.get(txnid);
if (null == txn) {
getFuture.completeExceptionally(new TransactionNotFoundException(txnid));
} else {
getFuture.complete(txn);
}
return getFuture;
}
use of org.apache.pulsar.transaction.coordinator.exceptions.CoordinatorException.TransactionNotFoundException in project pulsar by apache.
the class MLTransactionMetadataStore method getTxnPositionPair.
private CompletableFuture<Pair<TxnMeta, List<Position>>> getTxnPositionPair(TxnID txnID) {
CompletableFuture<Pair<TxnMeta, List<Position>>> completableFuture = new CompletableFuture<>();
Pair<TxnMeta, List<Position>> txnMetaListPair = txnMetaMap.get(txnID.getLeastSigBits());
if (txnMetaListPair == null) {
completableFuture.completeExceptionally(new TransactionNotFoundException(txnID));
} else {
completableFuture.complete(txnMetaListPair);
}
return completableFuture;
}
use of org.apache.pulsar.transaction.coordinator.exceptions.CoordinatorException.TransactionNotFoundException in project pulsar by yahoo.
the class InMemTransactionMetadataStore method getTxnMeta.
@Override
public CompletableFuture<TxnMeta> getTxnMeta(TxnID txnid) {
CompletableFuture<TxnMeta> getFuture = new CompletableFuture<>();
TxnMetaImpl txn = transactions.get(txnid);
if (null == txn) {
getFuture.completeExceptionally(new TransactionNotFoundException(txnid));
} else {
getFuture.complete(txn);
}
return getFuture;
}
use of org.apache.pulsar.transaction.coordinator.exceptions.CoordinatorException.TransactionNotFoundException in project pulsar by yahoo.
the class MLTransactionMetadataStore method getTxnPositionPair.
private CompletableFuture<Pair<TxnMeta, List<Position>>> getTxnPositionPair(TxnID txnID) {
CompletableFuture<Pair<TxnMeta, List<Position>>> completableFuture = new CompletableFuture<>();
Pair<TxnMeta, List<Position>> txnMetaListPair = txnMetaMap.get(txnID.getLeastSigBits());
if (txnMetaListPair == null) {
completableFuture.completeExceptionally(new TransactionNotFoundException(txnID));
} else {
completableFuture.complete(txnMetaListPair);
}
return completableFuture;
}
use of org.apache.pulsar.transaction.coordinator.exceptions.CoordinatorException.TransactionNotFoundException in project pulsar by yahoo.
the class MLTransactionMetadataStore method getTxnMeta.
@Override
public CompletableFuture<TxnMeta> getTxnMeta(TxnID txnID) {
Pair<TxnMeta, List<Position>> txnMetaListPair = txnMetaMap.get(txnID.getLeastSigBits());
CompletableFuture<TxnMeta> completableFuture = new CompletableFuture<>();
if (txnMetaListPair == null) {
completableFuture.completeExceptionally(new TransactionNotFoundException(txnID));
} else {
completableFuture.complete(txnMetaListPair.getLeft());
}
return completableFuture;
}
Aggregations