You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tsfile.apache.org by "shuwenwei (via GitHub)" <gi...@apache.org> on 2025/07/21 08:00:29 UTC
[PR] Add a method to batch search for the MetadataIndexNode offset of devices [tsfile]
shuwenwei opened a new pull request, #550:
URL: https://github.com/apache/tsfile/pull/550
(no comment)
--
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: notifications-unsubscribe@tsfile.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a method to batch search for the MetadataIndexNode offset of devices [tsfile]
Posted by "shuwenwei (via GitHub)" <gi...@apache.org>.
shuwenwei commented on code in PR #550:
URL: https://github.com/apache/tsfile/pull/550#discussion_r2230491413
##########
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:
Used for calculating complexity, it will select the search method according to the complexity.
--
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: notifications-unsubscribe@tsfile.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a method to batch search for the MetadataIndexNode offset of devices [tsfile]
Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@tsfile.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org