Skip to content

Commit 4139ea4

Browse files
authored
chore(zerozone2): rename channelOffset targetNodeId to attributes (#2794)
Signed-off-by: Robin Han <[email protected]>
1 parent 0ec42d6 commit 4139ea4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/main/java/kafka/automq/zerozone/ChannelOffset.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ChannelOffset {
2727
private static final int CHANNEL_ID_INDEX = 1;
2828
private static final int ORDER_HINT_INDEX = 3;
2929
private static final int CHANNEL_OWNER_NODE_ID_INDEX = 5;
30-
private static final int TARGET_NODE_ID_INDEX = 9;
30+
private static final int CHANNEL_ATTRIBUTES = 9;
3131
private static final int WAL_RECORD_OFFSET_INDEX = 13;
3232

3333
private final ByteBuf buf;
@@ -40,15 +40,15 @@ public static ChannelOffset of(ByteBuf buf) {
4040
return new ChannelOffset(buf);
4141
}
4242

43-
public static ChannelOffset of(short channelId, short orderHint, int channelOwnerNodeId, int targetNodeId,
43+
public static ChannelOffset of(short channelId, short orderHint, int channelOwnerNodeId, int attributes,
4444
ByteBuf walRecordOffset) {
4545
ByteBuf channelOffset = Unpooled.buffer(1 /* magic */ + 2 /* channelId */ + 2 /* orderHint */
4646
+ 4 /* channelOwnerNodeId */ + 4 /* targetNodeId */ + walRecordOffset.readableBytes());
4747
channelOffset.writeByte(MAGIC);
4848
channelOffset.writeShort(channelId);
4949
channelOffset.writeShort(orderHint);
5050
channelOffset.writeInt(channelOwnerNodeId);
51-
channelOffset.writeInt(targetNodeId);
51+
channelOffset.writeInt(attributes);
5252
channelOffset.writeBytes(walRecordOffset.duplicate());
5353
return of(channelOffset);
5454
}
@@ -65,8 +65,8 @@ public int channelOwnerNodeId() {
6565
return buf.getInt(CHANNEL_OWNER_NODE_ID_INDEX);
6666
}
6767

68-
public int targetNodeId() {
69-
return buf.getInt(TARGET_NODE_ID_INDEX);
68+
public int attributes() {
69+
return buf.getInt(CHANNEL_ATTRIBUTES);
7070
}
7171

7272
public ByteBuf walRecordOffset() {
@@ -83,7 +83,7 @@ public String toString() {
8383
"channelId=" + channelId() +
8484
", orderHint=" + orderHint() +
8585
", channelOwnerNodeId=" + channelOwnerNodeId() +
86-
", targetNodeId=" + targetNodeId() +
86+
", attributes=" + attributes() +
8787
'}';
8888
}
8989
}

0 commit comments

Comments
 (0)