Search in sources :

Example 1 with PendingAckHandleImpl

use of org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl in project pulsar by apache.

the class TransactionLowWaterMarkTest method testPendingAckLowWaterMark.

@Test
public void testPendingAckLowWaterMark() throws Exception {
    String subName = "test";
    Transaction txn = pulsarClient.newTransaction().withTransactionTimeout(5, TimeUnit.SECONDS).build().get();
    @Cleanup Producer<byte[]> producer = pulsarClient.newProducer().topic(TOPIC).sendTimeout(0, TimeUnit.SECONDS).enableBatching(false).create();
    @Cleanup Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(TOPIC).subscriptionName(subName).subscriptionInitialPosition(SubscriptionInitialPosition.Earliest).enableBatchIndexAcknowledgment(true).subscriptionType(SubscriptionType.Failover).subscribe();
    final String TEST1 = "test1";
    final String TEST2 = "test2";
    final String TEST3 = "test3";
    producer.send(TEST1.getBytes());
    producer.send(TEST2.getBytes());
    producer.send(TEST3.getBytes());
    Message<byte[]> message = consumer.receive(2, TimeUnit.SECONDS);
    assertEquals(new String(message.getData()), TEST1);
    consumer.acknowledgeAsync(message.getMessageId(), txn).get();
    LinkedMap<TxnID, HashMap<PositionImpl, PositionImpl>> individualAckOfTransaction = null;
    for (int i = 0; i < getPulsarServiceList().size(); i++) {
        Field field = BrokerService.class.getDeclaredField("topics");
        field.setAccessible(true);
        ConcurrentOpenHashMap<String, CompletableFuture<Optional<Topic>>> topics = (ConcurrentOpenHashMap<String, CompletableFuture<Optional<Topic>>>) field.get(getPulsarServiceList().get(i).getBrokerService());
        CompletableFuture<Optional<Topic>> completableFuture = topics.get("persistent://" + TOPIC);
        if (completableFuture != null) {
            Optional<Topic> topic = completableFuture.get();
            if (topic.isPresent()) {
                PersistentSubscription persistentSubscription = (PersistentSubscription) topic.get().getSubscription(subName);
                field = PersistentSubscription.class.getDeclaredField("pendingAckHandle");
                field.setAccessible(true);
                PendingAckHandleImpl pendingAckHandle = (PendingAckHandleImpl) field.get(persistentSubscription);
                field = PendingAckHandleImpl.class.getDeclaredField("individualAckOfTransaction");
                field.setAccessible(true);
                individualAckOfTransaction = (LinkedMap<TxnID, HashMap<PositionImpl, PositionImpl>>) field.get(pendingAckHandle);
            }
        }
    }
    assertTrue(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) txn).getTxnIdMostBits(), ((TransactionImpl) txn).getTxnIdLeastBits())));
    txn.commit().get();
    Field field = TransactionImpl.class.getDeclaredField("state");
    field.setAccessible(true);
    field.set(txn, TransactionImpl.State.OPEN);
    assertFalse(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) txn).getTxnIdMostBits(), ((TransactionImpl) txn).getTxnIdLeastBits())));
    message = consumer.receive();
    assertEquals(new String(message.getData()), TEST2);
    consumer.acknowledgeAsync(message.getMessageId(), txn).get();
    assertTrue(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) txn).getTxnIdMostBits(), ((TransactionImpl) txn).getTxnIdLeastBits())));
    PartitionedTopicMetadata partitionedTopicMetadata = ((PulsarClientImpl) pulsarClient).getLookup().getPartitionedTopicMetadata(TopicName.TRANSACTION_COORDINATOR_ASSIGN).get();
    Transaction lowWaterMarkTxn = null;
    for (int i = 0; i < partitionedTopicMetadata.partitions; i++) {
        lowWaterMarkTxn = pulsarClient.newTransaction().withTransactionTimeout(5, TimeUnit.SECONDS).build().get();
        if (((TransactionImpl) lowWaterMarkTxn).getTxnIdMostBits() == ((TransactionImpl) txn).getTxnIdMostBits()) {
            break;
        }
    }
    if (lowWaterMarkTxn != null && ((TransactionImpl) lowWaterMarkTxn).getTxnIdMostBits() == ((TransactionImpl) txn).getTxnIdMostBits()) {
        producer.newMessage(lowWaterMarkTxn).value(TEST3.getBytes()).send();
        message = consumer.receive(2, TimeUnit.SECONDS);
        assertEquals(new String(message.getData()), TEST3);
        consumer.acknowledgeAsync(message.getMessageId(), lowWaterMarkTxn).get();
        assertTrue(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) txn).getTxnIdMostBits(), ((TransactionImpl) txn).getTxnIdLeastBits())));
        assertTrue(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) lowWaterMarkTxn).getTxnIdMostBits(), ((TransactionImpl) lowWaterMarkTxn).getTxnIdLeastBits())));
        lowWaterMarkTxn.commit().get();
        assertFalse(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) txn).getTxnIdMostBits(), ((TransactionImpl) txn).getTxnIdLeastBits())));
        assertFalse(individualAckOfTransaction.containsKey(new TxnID(((TransactionImpl) lowWaterMarkTxn).getTxnIdMostBits(), ((TransactionImpl) lowWaterMarkTxn).getTxnIdLeastBits())));
    } else {
        fail();
    }
}
Also used : ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) Optional(java.util.Optional) HashMap(java.util.HashMap) ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) PendingAckHandleImpl(org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl) TransactionImpl(org.apache.pulsar.client.impl.transaction.TransactionImpl) Cleanup(lombok.Cleanup) PersistentSubscription(org.apache.pulsar.broker.service.persistent.PersistentSubscription) Field(java.lang.reflect.Field) TxnID(org.apache.pulsar.client.api.transaction.TxnID) CompletableFuture(java.util.concurrent.CompletableFuture) Transaction(org.apache.pulsar.client.api.transaction.Transaction) PulsarClientImpl(org.apache.pulsar.client.impl.PulsarClientImpl) Topic(org.apache.pulsar.broker.service.Topic) PartitionedTopicMetadata(org.apache.pulsar.common.partition.PartitionedTopicMetadata) Test(org.testng.annotations.Test)

Example 2 with PendingAckHandleImpl

use of org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl in project pulsar by apache.

the class TransactionTest method testEndTPRecoveringWhenManagerLedgerDisReadable.

@Test
public void testEndTPRecoveringWhenManagerLedgerDisReadable() throws Exception {
    String topic = NAMESPACE1 + "/testEndTPRecoveringWhenManagerLedgerDisReadable";
    admin.topics().createNonPartitionedTopic(topic);
    @Cleanup Producer<String> producer = pulsarClient.newProducer(Schema.STRING).producerName("test").enableBatching(false).sendTimeout(0, TimeUnit.SECONDS).topic(topic).create();
    producer.newMessage().send();
    PersistentTopic persistentTopic = (PersistentTopic) getPulsarServiceList().get(0).getBrokerService().getTopic(topic, false).get().get();
    persistentTopic.getManagedLedger().getConfig().setAutoSkipNonRecoverableData(true);
    PersistentSubscription persistentSubscription = (PersistentSubscription) persistentTopic.createSubscription("test", CommandSubscribe.InitialPosition.Earliest, false).get();
    ManagedCursorImpl managedCursor = mock(ManagedCursorImpl.class);
    doReturn(true).when(managedCursor).hasMoreEntries();
    doReturn(false).when(managedCursor).isClosed();
    doReturn(new PositionImpl(-1, -1)).when(managedCursor).getMarkDeletedPosition();
    doAnswer(invocation -> {
        AsyncCallbacks.ReadEntriesCallback callback = invocation.getArgument(1);
        callback.readEntriesFailed(new ManagedLedgerException.NonRecoverableLedgerException("No ledger exist"), null);
        return null;
    }).when(managedCursor).asyncReadEntries(anyInt(), any(), any(), any());
    TransactionPendingAckStoreProvider pendingAckStoreProvider = mock(TransactionPendingAckStoreProvider.class);
    doReturn(CompletableFuture.completedFuture(new MLPendingAckStore(persistentTopic.getManagedLedger(), managedCursor, null))).when(pendingAckStoreProvider).newPendingAckStore(any());
    doReturn(CompletableFuture.completedFuture(true)).when(pendingAckStoreProvider).checkInitializedBefore(any());
    Class<PulsarService> pulsarServiceClass = PulsarService.class;
    Field field = pulsarServiceClass.getDeclaredField("transactionPendingAckStoreProvider");
    field.setAccessible(true);
    field.set(getPulsarServiceList().get(0), pendingAckStoreProvider);
    PendingAckHandleImpl pendingAckHandle1 = new PendingAckHandleImpl(persistentSubscription);
    Awaitility.await().untilAsserted(() -> assertEquals(pendingAckHandle1.getStats().state, "Ready"));
    doAnswer(invocation -> {
        AsyncCallbacks.ReadEntriesCallback callback = invocation.getArgument(1);
        callback.readEntriesFailed(new ManagedLedgerException.ManagedLedgerFencedException(), null);
        return null;
    }).when(managedCursor).asyncReadEntries(anyInt(), any(), any(), any());
    PendingAckHandleImpl pendingAckHandle2 = new PendingAckHandleImpl(persistentSubscription);
    Awaitility.await().untilAsserted(() -> assertEquals(pendingAckHandle2.getStats().state, "Ready"));
}
Also used : ManagedCursorImpl(org.apache.bookkeeper.mledger.impl.ManagedCursorImpl) PendingAckHandleImpl(org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl) PositionImpl(org.apache.bookkeeper.mledger.impl.PositionImpl) Cleanup(lombok.Cleanup) PersistentSubscription(org.apache.pulsar.broker.service.persistent.PersistentSubscription) MLPendingAckStore(org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStore) Field(java.lang.reflect.Field) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) PulsarService(org.apache.pulsar.broker.PulsarService) PersistentTopic(org.apache.pulsar.broker.service.persistent.PersistentTopic) AsyncCallbacks(org.apache.bookkeeper.mledger.AsyncCallbacks) TransactionPendingAckStoreProvider(org.apache.pulsar.broker.transaction.pendingack.TransactionPendingAckStoreProvider) Test(org.testng.annotations.Test)

Example 3 with PendingAckHandleImpl

use of org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl in project pulsar by apache.

the class TransactionProduceTest method getPendingAckCount.

private int getPendingAckCount(String topic, String subscriptionName) throws Exception {
    Class<PersistentSubscription> clazz = PersistentSubscription.class;
    int pendingAckCount = 0;
    for (PulsarService pulsarService : getPulsarServiceList()) {
        for (String key : pulsarService.getBrokerService().getTopics().keys()) {
            if (key.contains(topic)) {
                Field field = clazz.getDeclaredField("pendingAckHandle");
                field.setAccessible(true);
                PersistentSubscription subscription = (PersistentSubscription) pulsarService.getBrokerService().getTopics().get(key).get().get().getSubscription(subscriptionName);
                PendingAckHandleImpl pendingAckHandle = (PendingAckHandleImpl) field.get(subscription);
                field = PendingAckHandleImpl.class.getDeclaredField("individualAckPositions");
                field.setAccessible(true);
                Map<PositionImpl, MutablePair<PositionImpl, Long>> map = (Map<PositionImpl, MutablePair<PositionImpl, Long>>) field.get(pendingAckHandle);
                if (map != null) {
                    pendingAckCount += map.size();
                }
            }
        }
    }
    log.info("subscriptionName: {}, pendingAckCount: {}", subscriptionName, pendingAckCount);
    return pendingAckCount;
}
Also used : Field(java.lang.reflect.Field) MutablePair(org.apache.commons.lang3.tuple.MutablePair) PulsarService(org.apache.pulsar.broker.PulsarService) PendingAckHandleImpl(org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl) PositionImpl(org.apache.bookkeeper.mledger.impl.PositionImpl) PersistentSubscription(org.apache.pulsar.broker.service.persistent.PersistentSubscription) Map(java.util.Map)

Example 4 with PendingAckHandleImpl

use of org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl in project pulsar by apache.

the class PersistentSubscriptionTest method setup.

@BeforeMethod
public void setup() throws Exception {
    executor = OrderedExecutor.newBuilder().numThreads(1).name("persistent-subscription-test").build();
    eventLoopGroup = new NioEventLoopGroup();
    ServiceConfiguration svcConfig = spy(ServiceConfiguration.class);
    svcConfig.setBrokerShutdownTimeoutMs(0L);
    svcConfig.setTransactionCoordinatorEnabled(true);
    svcConfig.setClusterName("pulsar-cluster");
    pulsarMock = spyWithClassAndConstructorArgs(PulsarService.class, svcConfig);
    PulsarResources pulsarResources = mock(PulsarResources.class);
    doReturn(pulsarResources).when(pulsarMock).getPulsarResources();
    NamespaceResources namespaceResources = mock(NamespaceResources.class);
    doReturn(namespaceResources).when(pulsarResources).getNamespaceResources();
    doReturn(Optional.of(new Policies())).when(namespaceResources).getPoliciesIfCached(any());
    doReturn(new InMemTransactionBufferProvider()).when(pulsarMock).getTransactionBufferProvider();
    doReturn(new TransactionPendingAckStoreProvider() {

        @Override
        public CompletableFuture<PendingAckStore> newPendingAckStore(PersistentSubscription subscription) {
            return CompletableFuture.completedFuture(new PendingAckStore() {

                @Override
                public void replayAsync(PendingAckHandleImpl pendingAckHandle, ScheduledExecutorService executorService) {
                    try {
                        Field field = PendingAckHandleState.class.getDeclaredField("state");
                        field.setAccessible(true);
                        field.set(pendingAckHandle, PendingAckHandleState.State.Ready);
                    } catch (NoSuchFieldException | IllegalAccessException e) {
                        fail();
                    }
                }

                @Override
                public CompletableFuture<Void> closeAsync() {
                    return CompletableFuture.completedFuture(null);
                }

                @Override
                public CompletableFuture<Void> appendIndividualAck(TxnID txnID, List<MutablePair<PositionImpl, Integer>> positions) {
                    return CompletableFuture.completedFuture(null);
                }

                @Override
                public CompletableFuture<Void> appendCumulativeAck(TxnID txnID, PositionImpl position) {
                    return CompletableFuture.completedFuture(null);
                }

                @Override
                public CompletableFuture<Void> appendCommitMark(TxnID txnID, AckType ackType) {
                    return CompletableFuture.completedFuture(null);
                }

                @Override
                public CompletableFuture<Void> appendAbortMark(TxnID txnID, AckType ackType) {
                    return CompletableFuture.completedFuture(null);
                }
            });
        }

        @Override
        public CompletableFuture<Boolean> checkInitializedBefore(PersistentSubscription subscription) {
            return CompletableFuture.completedFuture(true);
        }
    }).when(pulsarMock).getTransactionPendingAckStoreProvider();
    doReturn(svcConfig).when(pulsarMock).getConfiguration();
    doReturn(mock(Compactor.class)).when(pulsarMock).getCompactor();
    mlFactoryMock = mock(ManagedLedgerFactory.class);
    doReturn(mlFactoryMock).when(pulsarMock).getManagedLedgerFactory();
    ZooKeeper zkMock = createMockZooKeeper();
    doReturn(createMockBookKeeper(executor)).when(pulsarMock).getBookKeeperClient();
    store = new ZKMetadataStore(zkMock);
    doReturn(store).when(pulsarMock).getLocalMetadataStore();
    doReturn(store).when(pulsarMock).getConfigurationMetadataStore();
    brokerMock = spyWithClassAndConstructorArgs(BrokerService.class, pulsarMock, eventLoopGroup);
    doNothing().when(brokerMock).unloadNamespaceBundlesGracefully();
    doReturn(brokerMock).when(pulsarMock).getBrokerService();
    ledgerMock = mock(ManagedLedgerImpl.class);
    cursorMock = mock(ManagedCursorImpl.class);
    managedLedgerConfigMock = mock(ManagedLedgerConfig.class);
    doReturn(new ManagedCursorContainer()).when(ledgerMock).getCursors();
    doReturn("mockCursor").when(cursorMock).getName();
    doReturn(new PositionImpl(1, 50)).when(cursorMock).getMarkDeletedPosition();
    doReturn(ledgerMock).when(cursorMock).getManagedLedger();
    doReturn(managedLedgerConfigMock).when(ledgerMock).getConfig();
    doReturn(false).when(managedLedgerConfigMock).isAutoSkipNonRecoverableData();
    topic = new PersistentTopic(successTopicName, ledgerMock, brokerMock);
    consumerMock = mock(Consumer.class);
    persistentSubscription = new PersistentSubscription(topic, subName, cursorMock, false);
}
Also used : NamespaceResources(org.apache.pulsar.broker.resources.NamespaceResources) Policies(org.apache.pulsar.common.policies.data.Policies) PositionImpl(org.apache.bookkeeper.mledger.impl.PositionImpl) Field(java.lang.reflect.Field) Compactor(org.apache.pulsar.compaction.Compactor) CompletableFuture(java.util.concurrent.CompletableFuture) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) PulsarService(org.apache.pulsar.broker.PulsarService) PendingAckStore(org.apache.pulsar.broker.transaction.pendingack.PendingAckStore) Consumer(org.apache.pulsar.broker.service.Consumer) PulsarResources(org.apache.pulsar.broker.resources.PulsarResources) ManagedLedgerFactory(org.apache.bookkeeper.mledger.ManagedLedgerFactory) List(java.util.List) ArrayList(java.util.ArrayList) ManagedLedgerConfig(org.apache.bookkeeper.mledger.ManagedLedgerConfig) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ManagedCursorImpl(org.apache.bookkeeper.mledger.impl.ManagedCursorImpl) PendingAckHandleImpl(org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl) ManagedLedgerImpl(org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl) TxnID(org.apache.pulsar.client.api.transaction.TxnID) AckType(org.apache.pulsar.common.api.proto.CommandAck.AckType) ZooKeeper(org.apache.zookeeper.ZooKeeper) MockedPulsarServiceBaseTest.createMockZooKeeper(org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest.createMockZooKeeper) ManagedCursorContainer(org.apache.bookkeeper.mledger.impl.ManagedCursorContainer) TransactionPendingAckStoreProvider(org.apache.pulsar.broker.transaction.pendingack.TransactionPendingAckStoreProvider) InMemTransactionBufferProvider(org.apache.pulsar.broker.transaction.buffer.impl.InMemTransactionBufferProvider) BrokerService(org.apache.pulsar.broker.service.BrokerService) ZKMetadataStore(org.apache.pulsar.metadata.impl.ZKMetadataStore) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 5 with PendingAckHandleImpl

use of org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl in project pulsar by apache.

the class PendingAckInMemoryDeleteTest method txnAckTestNoBatchAndSharedSubMemoryDeleteTest.

@Test
public void txnAckTestNoBatchAndSharedSubMemoryDeleteTest() throws Exception {
    String normalTopic = NAMESPACE1 + "/normal-topic";
    String subscriptionName = "test";
    @Cleanup Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(normalTopic).isAckReceiptEnabled(true).subscriptionName(subscriptionName).enableBatchIndexAcknowledgment(true).subscriptionType(SubscriptionType.Shared).ackTimeout(2, TimeUnit.SECONDS).acknowledgmentGroupTime(0, TimeUnit.MICROSECONDS).subscribe();
    @Cleanup Producer<byte[]> producer = pulsarClient.newProducer().topic(normalTopic).enableBatching(false).create();
    for (int retryCnt = 0; retryCnt < 2; retryCnt++) {
        int messageCnt = 1000;
        // produce normal messages
        for (int i = 0; i < messageCnt; i++) {
            producer.newMessage().value("hello".getBytes()).sendAsync();
        }
        Message<byte[]> message;
        Transaction commitTxn = getTxn();
        // send 1000 and ack 999, and test the consumer pending ack has already clear 999 messages
        for (int i = 0; i < messageCnt - 1; i++) {
            message = consumer.receive(2, TimeUnit.SECONDS);
            Assert.assertNotNull(message);
            if (i % 2 == 0) {
                consumer.acknowledgeAsync(message.getMessageId(), commitTxn).get();
                log.info("txn receive msgId: {}, count: {}", message.getMessageId(), i);
            } else {
                consumer.acknowledge(message.getMessageId());
                log.info("normal receive msgId: {}, count: {}", message.getMessageId(), i);
            }
        }
        commitTxn.commit().get();
        int count = 0;
        for (int i = 0; i < getPulsarServiceList().size(); i++) {
            Field field = BrokerService.class.getDeclaredField("topics");
            field.setAccessible(true);
            ConcurrentOpenHashMap<String, CompletableFuture<Optional<Topic>>> topics = (ConcurrentOpenHashMap<String, CompletableFuture<Optional<Topic>>>) field.get(getPulsarServiceList().get(i).getBrokerService());
            CompletableFuture<Optional<Topic>> completableFuture = topics.get("persistent://" + normalTopic);
            if (completableFuture != null) {
                Optional<Topic> topic = completableFuture.get();
                if (topic.isPresent()) {
                    PersistentSubscription persistentSubscription = (PersistentSubscription) topic.get().getSubscription(subscriptionName);
                    field = PersistentSubscription.class.getDeclaredField("pendingAckHandle");
                    field.setAccessible(true);
                    PendingAckHandleImpl pendingAckHandle = (PendingAckHandleImpl) field.get(persistentSubscription);
                    field = PendingAckHandleImpl.class.getDeclaredField("individualAckOfTransaction");
                    field.setAccessible(true);
                    LinkedMap<TxnID, HashMap<PositionImpl, PositionImpl>> individualAckOfTransaction = (LinkedMap<TxnID, HashMap<PositionImpl, PositionImpl>>) field.get(pendingAckHandle);
                    assertTrue(individualAckOfTransaction.isEmpty());
                    if (retryCnt == 0) {
                        // one message are not ack
                        assertEquals(persistentSubscription.getConsumers().get(0).getPendingAcks().size(), 1);
                    } else {
                        // two message are not ack
                        assertEquals(persistentSubscription.getConsumers().get(0).getPendingAcks().size(), 2);
                    }
                    count++;
                }
            }
        }
        // make sure the consumer is ownership for a broker server
        assertEquals(count, 1);
    }
}
Also used : ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) Optional(java.util.Optional) PendingAckHandleImpl(org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl) HashMap(java.util.HashMap) ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) PositionImpl(org.apache.bookkeeper.mledger.impl.PositionImpl) Cleanup(lombok.Cleanup) PersistentSubscription(org.apache.pulsar.broker.service.persistent.PersistentSubscription) LinkedMap(org.apache.commons.collections4.map.LinkedMap) Field(java.lang.reflect.Field) CompletableFuture(java.util.concurrent.CompletableFuture) TxnID(org.apache.pulsar.client.api.transaction.TxnID) Transaction(org.apache.pulsar.client.api.transaction.Transaction) Topic(org.apache.pulsar.broker.service.Topic) Test(org.testng.annotations.Test)

Aggregations

Field (java.lang.reflect.Field)8 PendingAckHandleImpl (org.apache.pulsar.broker.transaction.pendingack.impl.PendingAckHandleImpl)8 PositionImpl (org.apache.bookkeeper.mledger.impl.PositionImpl)7 CompletableFuture (java.util.concurrent.CompletableFuture)6 Cleanup (lombok.Cleanup)6 Test (org.testng.annotations.Test)6 PersistentSubscription (org.apache.pulsar.broker.service.persistent.PersistentSubscription)5 Transaction (org.apache.pulsar.client.api.transaction.Transaction)5 TxnID (org.apache.pulsar.client.api.transaction.TxnID)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Optional (java.util.Optional)3 ManagedCursorImpl (org.apache.bookkeeper.mledger.impl.ManagedCursorImpl)3 PulsarService (org.apache.pulsar.broker.PulsarService)3 Topic (org.apache.pulsar.broker.service.Topic)3 PersistentTopic (org.apache.pulsar.broker.service.persistent.PersistentTopic)3 MLPendingAckStore (org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStore)3 MessageId (org.apache.pulsar.client.api.MessageId)3 ConcurrentOpenHashMap (org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap)3 ExecutionException (java.util.concurrent.ExecutionException)2