Skip to content

Commit b67f57c

Browse files
authored
Correct the getObjectPathFromBinary method in ObjectTypeUtils (#16934)
1 parent fd7a3f2 commit b67f57c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.apache.iotdb.mpp.rpc.thrift.TReadObjectReq;
3838
import org.apache.iotdb.rpc.TSStatusCode;
3939

40-
import org.apache.tsfile.common.conf.TSFileConfig;
4140
import org.apache.tsfile.encoding.decoder.Decoder;
4241
import org.apache.tsfile.encoding.decoder.DecoderWrapper;
4342
import org.apache.tsfile.utils.Binary;
@@ -262,14 +261,10 @@ public static long getObjectLength(Binary binary) {
262261
}
263262

264263
public static Optional<File> getObjectPathFromBinary(Binary binary) {
265-
byte[] bytes = binary.getValues();
266-
String relativeObjectFilePath =
267-
new String(bytes, 8, bytes.length - 8, TSFileConfig.STRING_CHARSET);
268-
return TIER_MANAGER.getAbsoluteObjectFilePath(relativeObjectFilePath);
264+
return getObjectPathFromBinary(binary, false);
269265
}
270266

271-
public static Optional<File> getNullableObjectPathFromBinary(
272-
Binary binary, boolean needTempFile) {
267+
public static Optional<File> getObjectPathFromBinary(Binary binary, boolean needTempFile) {
273268
byte[] bytes = binary.getValues();
274269
ByteBuffer buffer = ByteBuffer.wrap(bytes, 8, bytes.length - 8);
275270
String relativeObjectFilePath =
@@ -278,7 +273,7 @@ public static Optional<File> getNullableObjectPathFromBinary(
278273
}
279274

280275
public static void deleteObjectPathFromBinary(Binary binary) {
281-
Optional<File> file = ObjectTypeUtils.getNullableObjectPathFromBinary(binary, true);
276+
Optional<File> file = ObjectTypeUtils.getObjectPathFromBinary(binary, true);
282277
if (!file.isPresent()) {
283278
return;
284279
}

0 commit comments

Comments
 (0)