Skip to content

Commit

Permalink
feat: add partitionId to LogStorageAppender context
Browse files Browse the repository at this point in the history
(cherry picked from commit 93c839f)
  • Loading branch information
Zelldon authored and github-actions[bot] committed Sep 24, 2021
1 parent 926f824 commit 5f2dd6a
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -55,6 +55,7 @@ public class LogStorageAppender extends Actor implements HealthMonitorable {
private final AppenderMetrics appenderMetrics;
private final Set<FailureListener> failureListeners = new HashSet<>();
private final ActorFuture<Void> closeFuture;
private final int partitionId;

public LogStorageAppender(
final String name,
Expand All @@ -65,6 +66,7 @@ public LogStorageAppender(
appenderMetrics = new AppenderMetrics(Integer.toString(partitionId));
env = new Environment();
this.name = name;
this.partitionId = partitionId;
this.logStorage = logStorage;
this.writeBufferSubscription = writeBufferSubscription;
maxAppendBlockSize = maxBlockSize;
Expand Down Expand Up @@ -129,6 +131,13 @@ private void appendBlock(final BlockPeek blockPeek) {
}
}

@Override
protected Map<String, String> createContext() {
final var context = super.createContext();
context.put(ACTOR_PROP_PARTITION_ID, Integer.toString(partitionId));
return context;
}

@Override
public String getName() {
return name;
Expand Down

0 comments on commit 5f2dd6a

Please sign in to comment.