Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
milaGGL committed Feb 9, 2023
1 parent f75e734 commit 1f34778
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public class BloomFilter {
private final int hashCount;
private final MessageDigest md5HashMessageDigest;

public BloomFilter(@NonNull byte[] bitmap, int padding, int hashCount)
throws BloomFilterException {
public BloomFilter(@NonNull byte[] bitmap, int padding, int hashCount) {
if (bitmap == null) {
throw new NullPointerException("Bitmap cannot be null.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public interface TargetMetadataProvider {
*/
private Set<Integer> pendingTargetResets = new HashSet<>();

/** The log tag to use for this class. */
private static final String LOG_TAG = "WatchChangeAggregator";

public WatchChangeAggregator(TargetMetadataProvider targetMetadataProvider) {
this.targetMetadataProvider = targetMetadataProvider;
}
Expand Down Expand Up @@ -236,9 +239,11 @@ private boolean applyBloomFilter(ExistenceFilterWatchChange watchChange, int cur
new BloomFilter(
bitmap, unchangedNames.getBits().getPadding(), unchangedNames.getHashCount());
} catch (BloomFilterException e) {
if (e instanceof BloomFilterException) {
Logger.warn("Firestore", "BloomFilter error: %s", e);
}
Logger.warn(
LOG_TAG,
"Decoding the base64 bloom filter in existence filter failed ("
+ e.getMessage()
+ "); ignoring the bloom filter and falling back to full re-query.");
return false;
}

Expand Down

0 comments on commit 1f34778

Please sign in to comment.