@@ -39,7 +39,8 @@ public class PartitionSessionImpl {
3939
4040 private final long id ;
4141 private final String fullId ;
42- private final String path ;
42+ private final String topicPath ;
43+ private final String consumerName ;
4344 private final long partitionId ;
4445 private final PartitionSession sessionInfo ;
4546 private final Executor decompressionExecutor ;
@@ -60,17 +61,18 @@ public class PartitionSessionImpl {
6061 private PartitionSessionImpl (Builder builder ) {
6162 this .id = builder .id ;
6263 this .fullId = builder .fullId ;
63- this .path = builder .path ;
64+ this .topicPath = builder .topicPath ;
65+ this .consumerName = builder .consumerName ;
6466 this .partitionId = builder .partitionId ;
65- this .sessionInfo = new PartitionSession (id , partitionId , path );
67+ this .sessionInfo = new PartitionSession (id , partitionId , topicPath );
6668 this .lastReadOffset = builder .committedOffset ;
6769 this .lastCommittedOffset = builder .committedOffset ;
6870 this .decompressionExecutor = builder .decompressionExecutor ;
6971 this .dataEventCallback = builder .dataEventCallback ;
7072 this .commitFunction = builder .commitFunction ;
71- logger .info ("[{}] Partition session for {} is started . CommittedOffset: {}. " +
72- "Partition offsets: {}-{}" , fullId , path , lastReadOffset , builder . partitionOffsets . getStart () ,
73- builder .partitionOffsets .getEnd ());
73+ logger .info ("[{}] Partition session is started for Topic \" {} \" and Consumer \" {} \" . CommittedOffset: {}. " +
74+ "Partition offsets: {}-{}" , fullId , topicPath , consumerName , lastReadOffset ,
75+ builder .partitionOffsets .getStart (), builder . partitionOffsets . getEnd ());
7476 }
7577
7678 public static Builder newBuilder () {
@@ -89,8 +91,8 @@ public long getPartitionId() {
8991 return partitionId ;
9092 }
9193
92- public String getPath () {
93- return path ;
94+ public String getTopicPath () {
95+ return topicPath ;
9496 }
9597
9698 public PartitionSession getSessionInfo () {
@@ -216,7 +218,7 @@ public CompletableFuture<Void> commitOffsetRange(OffsetsRange rangeToCommit) {
216218 logger .info ("[{}] Offset range [{}, {}) is requested to be committed, but partition session " +
217219 "is already closed" , fullId , rangeToCommit .getStart (), rangeToCommit .getEnd ());
218220 resultFuture .completeExceptionally (new RuntimeException ("Partition session " + id + " (partition " +
219- partitionId + ") for " + path + " is already closed" ));
221+ partitionId + ") for " + topicPath + " is already closed" ));
220222 return resultFuture ;
221223 }
222224 } finally {
@@ -315,7 +317,7 @@ private void sendDataToReadersIfNeeded() {
315317 DataReceivedEvent event = new DataReceivedEventImpl (this , messagesToRead , offsetsToCommit );
316318 if (logger .isDebugEnabled ()) {
317319 logger .debug ("[{}] DataReceivedEvent callback with {} message(s) (offsets {}-{}) is about " +
318- "to be called..." , fullId , messagesToRead .size (),messagesToRead .get (0 ).getOffset (),
320+ "to be called..." , fullId , messagesToRead .size (), messagesToRead .get (0 ).getOffset (),
319321 messagesToRead .get (messagesToRead .size () - 1 ).getOffset ());
320322 }
321323 dataEventCallback .apply (event )
@@ -348,9 +350,9 @@ public void shutdown() {
348350 try {
349351 isWorking .set (false );
350352 logger .info ("[{}] Partition session for {} is shutting down. Failing {} commit futures..." , fullId ,
351- path , commitFutures .size ());
353+ topicPath , commitFutures .size ());
352354 commitFutures .values ().forEach (f -> f .completeExceptionally (new RuntimeException ("Partition session " + id +
353- " (partition " + partitionId + ") for " + path + " is closed" )));
355+ " (partition " + partitionId + ") for " + topicPath + " is closed" )));
354356 } finally {
355357 commitFuturesLock .unlock ();
356358 }
@@ -371,7 +373,8 @@ public void shutdown() {
371373 public static class Builder {
372374 private long id ;
373375 private String fullId ;
374- private String path ;
376+ private String topicPath ;
377+ private String consumerName ;
375378 private long partitionId ;
376379 private long committedOffset ;
377380 private OffsetsRange partitionOffsets ;
@@ -389,8 +392,13 @@ public Builder setFullId(String fullId) {
389392 return this ;
390393 }
391394
392- public Builder setPath (String path ) {
393- this .path = path ;
395+ public Builder setTopicPath (String topicPath ) {
396+ this .topicPath = topicPath ;
397+ return this ;
398+ }
399+
400+ public Builder setConsumerName (String consumerName ) {
401+ this .consumerName = consumerName ;
394402 return this ;
395403 }
396404
0 commit comments