Skip to content

Prune absent measurements in place with the Bloom filter - #1181

Closed
ColinLeeo wants to merge 1 commit into
apache:developfrom
ColinLeeo:perf/bloom-prune-measurements
Closed

ColinLeeo wants to merge 1 commit into
apache:developfrom
ColinLeeo:perf/bloom-prune-measurements

Conversation

@ColinLeeo

@ColinLeeo ColinLeeo commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #1183 for same-repository CI. Please continue the review there.

Summary

Add BloomFilter.removeNotExistingMeasurements(IDeviceID, Set<String>, BiConsumer<IDeviceID, String>) for callers that already have a mutable set of metadata candidates. It reuses the device prefix across probes, removes each definite miss through the set iterator, and calls the consumer once per removal. The existing mightContainBatch API uses the same path matching logic.

Example

Given candidates {temperature, pressure} for one device, if the filter rules out pressure, the callback receives the device and pressure. The caller can pass the remaining set {temperature} directly to the metadata reader. IoTDB can use the callback to record a null entry for the missing column in its query result.

This is a Java SDK operation on an in-memory candidate set. The TsFile CLI has no command that exposes a mutable metadata candidate set.

Verification

  • ./mvnw -P with-java verify
  • Covered callback timing and identity, missing and present names in the same batch, null names, the time column, and both path forms for an empty device ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant