Toggle navigation
Home
org.apache.pulsar.broker.service.Topic to java.util.Optional<org.apache.pulsar.broker.service.Topic>
No. of Instances - 19
No. of Commits - 2
No. of Projects - {'pulsar'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Internal -> Jdk
Mapping:
Cascading Type Change (Different)
ImmutablePair<String,CompletableFuture<Topic>>
to
ImmutablePair<String,CompletableFuture<Optional<Topic>>>
Exception
to
int
ImmutablePair<String,CompletableFuture<Topic>>
to
ImmutablePair<String,CompletableFuture<Optional<Topic>>>
Other
future.join()
to
future.join()
Add or Remove Method invocation
getManagedLedgerConfig(topicName).thenAccept(managedLedgerConfig -> { managedLedgerConfig.setCreateIfMissing(createIfMissing); managedLedgerFactory.asyncOpen(topicName.getPersistenceNamingEncoding(),managedLedgerConfig,new OpenLedgerCallback(){ @Override public void openLedgerComplete( ManagedLedger ledger, Object ctx){ try { PersistentTopic persistentTopic=new PersistentTopic(topic,ledger,BrokerService.this); CompletableFuture<Void> replicationFuture=persistentTopic.checkReplication(); replicationFuture.thenCompose(v -> { return persistentTopic.checkDeduplicationStatus(); } ).thenRun(() -> { log.info("Created topic {} - dedup is {}",topic,persistentTopic.isDeduplicationEnabled() ? "enabled" : "disabled"); long topicLoadLatencyMs=TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - topicCreateTimeMs; pulsarStats.recordTopicLoadTimeValue(topic,topicLoadLatencyMs); addTopicToStatsMaps(topicName,persistentTopic); topicFuture.complete(persistentTopic); } ).exceptionally((ex) -> { log.warn("Replication or dedup check failed. Removing topic from topics list {}, {}",topic,ex); persistentTopic.stopReplProducers().whenComplete((v,exception) -> { topics.remove(topic,topicFuture); topicFuture.completeExceptionally(ex); } ); return null; } ); } catch ( NamingException e) { log.warn("Failed to create topic {}-{}",topic,e.getMessage()); pulsar.getExecutor().execute(() -> topics.remove(topic,topicFuture)); topicFuture.completeExceptionally(e); } } @Override public void openLedgerFailed( ManagedLedgerException exception, Object ctx){ if (!createIfMissing && exception instanceof ManagedLedgerNotFoundException) { topicFuture.complete(null); } else { log.warn("Failed to create topic {}",topic,exception); pulsar.getExecutor().execute(() -> topics.remove(topic,topicFuture)); topicFuture.completeExceptionally(new PersistenceException(exception)); } } } ,null); } )
to
getManagedLedgerConfig(topicName).thenAccept(managedLedgerConfig -> { managedLedgerConfig.setCreateIfMissing(createIfMissing); managedLedgerFactory.asyncOpen(topicName.getPersistenceNamingEncoding(),managedLedgerConfig,new OpenLedgerCallback(){ @Override public void openLedgerComplete( ManagedLedger ledger, Object ctx){ try { PersistentTopic persistentTopic=new PersistentTopic(topic,ledger,BrokerService.this); CompletableFuture<Void> replicationFuture=persistentTopic.checkReplication(); replicationFuture.thenCompose(v -> { return persistentTopic.checkDeduplicationStatus(); } ).thenRun(() -> { log.info("Created topic {} - dedup is {}",topic,persistentTopic.isDeduplicationEnabled() ? "enabled" : "disabled"); long topicLoadLatencyMs=TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - topicCreateTimeMs; pulsarStats.recordTopicLoadTimeValue(topic,topicLoadLatencyMs); addTopicToStatsMaps(topicName,persistentTopic); topicFuture.complete(Optional.of(persistentTopic)); } ).exceptionally((ex) -> { log.warn("Replication or dedup check failed. Removing topic from topics list {}, {}",topic,ex); persistentTopic.stopReplProducers().whenComplete((v,exception) -> { topics.remove(topic,topicFuture); topicFuture.completeExceptionally(ex); } ); return null; } ); } catch ( NamingException e) { log.warn("Failed to create topic {}-{}",topic,e.getMessage()); pulsar.getExecutor().execute(() -> topics.remove(topic,topicFuture)); topicFuture.completeExceptionally(e); } } @Override public void openLedgerFailed( ManagedLedgerException exception, Object ctx){ if (!createIfMissing && exception instanceof ManagedLedgerNotFoundException) { topicFuture.complete(Optional.empty()); } else { log.warn("Failed to create topic {}",topic,exception); pulsar.getExecutor().execute(() -> topics.remove(topic,topicFuture)); topicFuture.completeExceptionally(new PersistenceException(exception)); } } } ,null); } )
topic.checkGC(gcIntervalInSeconds)
to
topic.get().checkGC(gcIntervalInSeconds)
t.getNow(null)
to
optionalTopic.get()
closeFutures.add(topicFuture.thenCompose(Topic::close))
to
closeFutures.add(topicFuture.thenCompose(t -> t.isPresent() ? t.get().close() : CompletableFuture.completedFuture(null)))
topic.onPoliciesUpdate(data)
to
topic.ifPresent(t -> t.onPoliciesUpdate(data))
topicFuture.get()
to
topic.get()
topicFuture.get().getName()
to
extractTopic(topicFuture)
topic.getDispatchRateLimiter()
to
persistentTopic
log
to
persistentTopic.getDispatchRateLimiter()
execute
to
execute
log
to
topic.get().getSubscriptions()
topicFuture.get()
to
topic
submit
to
submit
topicFuture.getNow(null)
to
topic.isPresent()
topicFuture.get()
to
persistentTopic
topic.getManagedLedger().getConfig()
to
persistentTopic
topic.getManagedLedger()
to
persistentTopic
topicFuture.get()
to
topic
Wrap or Un-wrap
spy
to
spy
forEach
to
forEach
execute
to
execute
forEach
to
forEach
spy
to
spy
Cascading Type Change (Similar)
Topic
to
Optional<Topic>