JackieTien97 commented on code in PR #550:
URL: https://github.com/apache/tsfile/pull/550#discussion_r2224097175
##########
java/tsfile/src/main/java/org/apache/tsfile/read/TsFileSequenceReader.java:
##########
@@ -535,6 +535,82 @@ private Map<String, TimeseriesMetadata>
readDeviceMetadataFromDisk(IDeviceID dev
return deviceMetadata;
}
+ /**
+ * Find the offset of MetadataIndexNode corresponding to every device to
avoid repeated reading of
+ * internal MetadataIndexNode
+ *
+ * @param table table name, or "" for tree model
+ * @param sortedDevices devices should be sorted
+ * @param ioSizeRecorder can be null
+ * @return Each element of the outer array corresponds to the device at this
index. The inner
+ * array size is 2, the first element is the start offset, and the
second is the end offset
+ * @throws IOException io error
+ */
+ public long[][] getDeviceMetadataIndexNodeOffsets(
Review Comment:
using long[] may be better for memory consumption?
##########
java/tsfile/src/main/java/org/apache/tsfile/file/metadata/MetadataIndexNode.java:
##########
@@ -33,10 +33,12 @@
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
public class MetadataIndexNode {
+ private static final double LOG2 = Math.log(2);
Review Comment:
what's this magic number used for?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]