@@ -27,7 +27,7 @@ public class ChannelOffset {
27
27
private static final int CHANNEL_ID_INDEX = 1 ;
28
28
private static final int ORDER_HINT_INDEX = 3 ;
29
29
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 ;
31
31
private static final int WAL_RECORD_OFFSET_INDEX = 13 ;
32
32
33
33
private final ByteBuf buf ;
@@ -40,15 +40,15 @@ public static ChannelOffset of(ByteBuf buf) {
40
40
return new ChannelOffset (buf );
41
41
}
42
42
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 ,
44
44
ByteBuf walRecordOffset ) {
45
45
ByteBuf channelOffset = Unpooled .buffer (1 /* magic */ + 2 /* channelId */ + 2 /* orderHint */
46
46
+ 4 /* channelOwnerNodeId */ + 4 /* targetNodeId */ + walRecordOffset .readableBytes ());
47
47
channelOffset .writeByte (MAGIC );
48
48
channelOffset .writeShort (channelId );
49
49
channelOffset .writeShort (orderHint );
50
50
channelOffset .writeInt (channelOwnerNodeId );
51
- channelOffset .writeInt (targetNodeId );
51
+ channelOffset .writeInt (attributes );
52
52
channelOffset .writeBytes (walRecordOffset .duplicate ());
53
53
return of (channelOffset );
54
54
}
@@ -65,8 +65,8 @@ public int channelOwnerNodeId() {
65
65
return buf .getInt (CHANNEL_OWNER_NODE_ID_INDEX );
66
66
}
67
67
68
- public int targetNodeId () {
69
- return buf .getInt (TARGET_NODE_ID_INDEX );
68
+ public int attributes () {
69
+ return buf .getInt (CHANNEL_ATTRIBUTES );
70
70
}
71
71
72
72
public ByteBuf walRecordOffset () {
@@ -83,7 +83,7 @@ public String toString() {
83
83
"channelId=" + channelId () +
84
84
", orderHint=" + orderHint () +
85
85
", channelOwnerNodeId=" + channelOwnerNodeId () +
86
- ", targetNodeId =" + targetNodeId () +
86
+ ", attributes =" + attributes () +
87
87
'}' ;
88
88
}
89
89
}
0 commit comments