Search in sources :

Example 6 with ProducerImpl

use of org.apache.pulsar.client.impl.ProducerImpl in project incubator-pulsar by apache.

the class PersistentReplicator method getStats.

public ReplicatorStats getStats() {
    stats.replicationBacklog = cursor.getNumberOfEntriesInBacklog();
    stats.connected = producer != null && producer.isConnected();
    stats.replicationDelayInSeconds = getReplicationDelayInSeconds();
    ProducerImpl producer = this.producer;
    if (producer != null) {
        stats.outboundConnection = producer.getConnectionId();
        stats.outboundConnectedSince = producer.getConnectedSince();
    } else {
        stats.outboundConnection = null;
        stats.outboundConnectedSince = null;
    }
    return stats;
}
Also used : ProducerImpl(org.apache.pulsar.client.impl.ProducerImpl)

Example 7 with ProducerImpl

use of org.apache.pulsar.client.impl.ProducerImpl in project incubator-pulsar by apache.

the class NonPersistentReplicator method getStats.

@Override
public NonPersistentReplicatorStats getStats() {
    stats.connected = producer != null && producer.isConnected();
    stats.replicationDelayInSeconds = getReplicationDelayInSeconds();
    ProducerImpl producer = this.producer;
    if (producer != null) {
        stats.outboundConnection = producer.getConnectionId();
        stats.outboundConnectedSince = producer.getConnectedSince();
    } else {
        stats.outboundConnection = null;
        stats.outboundConnectedSince = null;
    }
    return stats;
}
Also used : ProducerImpl(org.apache.pulsar.client.impl.ProducerImpl)

Aggregations

ProducerImpl (org.apache.pulsar.client.impl.ProducerImpl)7 Test (org.testng.annotations.Test)5 Field (java.lang.reflect.Field)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 PersistentReplicator (org.apache.pulsar.broker.service.persistent.PersistentReplicator)2 PersistentTopic (org.apache.pulsar.broker.service.persistent.PersistentTopic)2 PulsarClient (org.apache.pulsar.client.api.PulsarClient)2 TopicName (org.apache.pulsar.common.naming.TopicName)2 ExecutorService (java.util.concurrent.ExecutorService)1 ReadEntriesCallback (org.apache.bookkeeper.mledger.AsyncCallbacks.ReadEntriesCallback)1 Entry (org.apache.bookkeeper.mledger.Entry)1 ManagedCursor (org.apache.bookkeeper.mledger.ManagedCursor)1 ManagedLedgerException (org.apache.bookkeeper.mledger.ManagedLedgerException)1 CursorAlreadyClosedException (org.apache.bookkeeper.mledger.ManagedLedgerException.CursorAlreadyClosedException)1 NonPersistentTopic (org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic)1 PulsarClientException (org.apache.pulsar.client.api.PulsarClientException)1 NonPersistentPublisherStats (org.apache.pulsar.common.policies.data.NonPersistentPublisherStats)1 NonPersistentSubscriptionStats (org.apache.pulsar.common.policies.data.NonPersistentSubscriptionStats)1 NonPersistentTopicStats (org.apache.pulsar.common.policies.data.NonPersistentTopicStats)1 ZookeeperServerTest (org.apache.pulsar.zookeeper.ZookeeperServerTest)1