Skip to content

Commit ef89cca

Browse files
committed
feat: align toCodecBuffer logic with toPersistedFormat
1 parent 2655d89 commit ef89cca

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/KeyPrefixContainerCodec.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ public CodecBuffer toCodecBuffer(@Nonnull KeyPrefixContainer object, CodecBuffer
7070

7171
if (object.getKeyVersion() != -1) {
7272
totalSize += LONG_SERIALIZED_SIZE;
73-
}
74-
if (object.getContainerId() != -1) {
75-
totalSize += LONG_SERIALIZED_SIZE;
73+
74+
if (object.getContainerId() != -1) {
75+
totalSize += LONG_SERIALIZED_SIZE;
76+
}
7677
}
7778

7879
final CodecBuffer buffer = allocator.apply(totalSize);
@@ -81,11 +82,11 @@ public CodecBuffer toCodecBuffer(@Nonnull KeyPrefixContainer object, CodecBuffer
8182
if (object.getKeyVersion() != -1) {
8283
buffer.put(KEY_DELIMITER_BUFFER.duplicate());
8384
buffer.putLong(object.getKeyVersion());
84-
}
8585

86-
if (object.getContainerId() != -1) {
87-
buffer.put(KEY_DELIMITER_BUFFER.duplicate());
88-
buffer.putLong(object.getContainerId());
86+
if (object.getContainerId() != -1) {
87+
buffer.put(KEY_DELIMITER_BUFFER.duplicate());
88+
buffer.putLong(object.getContainerId());
89+
}
8990
}
9091

9192
return buffer;

0 commit comments

Comments
 (0)