-
Notifications
You must be signed in to change notification settings - Fork 88
Add a method to batch search for the MetadataIndexNode offset of devices #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add a method to batch search for the MetadataIndexNode offset of devices #550
Conversation
| * 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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using long[] may be better for memory consumption?
|
|
||
| public class MetadataIndexNode { | ||
|
|
||
| private static final double LOG2 = Math.log(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this magic number used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used for calculating complexity, it will select the search method according to the complexity.
For a tsfile with 80,000 devices, the time to read metadata can be reduced from 4.5s to 500ms.