Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonHxy committed Nov 27, 2022
1 parent 814a24c commit 8a7a7ce
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.apache.bookkeeper.mledger.ManagedLedger;
import org.apache.bookkeeper.mledger.ManagedLedgerException;
import org.apache.bookkeeper.mledger.Position;
import org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl;
import org.apache.bookkeeper.mledger.impl.PositionImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.pulsar.metadata.api.MetadataStoreException;
Expand Down Expand Up @@ -177,8 +178,6 @@ public void testMainProcess(int batchedWriteMaxRecords, int batchedWriteMaxSize,
bkc.failAfter(1, BKException.Code.NotEnoughBookiesException);
metadataStore.setAlwaysFail(new MetadataStoreException.BadVersionException(""));
}
OrderedExecutor orderedExecutor = OrderedExecutor.newBuilder()
.numThreads(5).name("txn-threads").build();
HashedWheelTimer transactionTimer = new HashedWheelTimer(new DefaultThreadFactory("transaction-timer"),
1, TimeUnit.MILLISECONDS);
JsonDataSerializer dataSerializer = new JsonDataSerializer(eachDataBytesLen);
Expand All @@ -189,7 +188,7 @@ public void testMainProcess(int batchedWriteMaxRecords, int batchedWriteMaxSize,
*/
// Create TxLogBufferedWriter.
TxnLogBufferedWriter txnLogBufferedWriter = new TxnLogBufferedWriter<Integer>(
managedLedger, orderedExecutor, transactionTimer,
managedLedger, ((ManagedLedgerImpl) managedLedger).getExecutor(), transactionTimer,
dataSerializer, batchedWriteMaxRecords, batchedWriteMaxSize,
batchedWriteMaxDelayInMillis, batchEnabled, DISABLED_BUFFERED_WRITER_METRICS);
// Store the param-context, param-position, param-exception of callback function and complete-count for verify.
Expand Down Expand Up @@ -344,7 +343,6 @@ public void addFailed(ManagedLedgerException exception, Object ctx) {
managedLedger.close();
}
transactionTimer.stop();
orderedExecutor.shutdown();
/**
* Assert all Byte Buf generated by DataSerializer has been released.
* 1. Because ManagedLedger holds write cache, some data is not actually released until ManagedLedger is
Expand Down

0 comments on commit 8a7a7ce

Please sign in to comment.