Skip to content

Commit

Permalink
allow smart delta, enable logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunjeet committed Feb 4, 2025
1 parent bca47ee commit 4913488
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.logging.Logger;

/**
* A HollowProducer is the top-level class used by producers of Hollow data to populate, publish, and announce data states.
Expand Down Expand Up @@ -110,6 +111,8 @@
*/
public class HollowProducer extends AbstractHollowProducer {

private static final Logger LOG = Logger.getLogger(HollowProducer.class.getName());

/*
* HollowProducer and HollowProducer.Incremental extend from a package protected AbstractHollowProducer
* for sharing common functionality.
Expand Down Expand Up @@ -910,11 +913,14 @@ protected void checkArguments() {
if (allowTypeResharding == true && doIntegrityCheck == false) { // type resharding feature rollout
throw new IllegalArgumentException("Enabling type re-sharding requires integrity check to also be enabled");
}
if (allowTypeResharding == true && focusHoleFillInFewestShards == true) { // type re-sharding feature rollout
if (allowTypeResharding == true) {
LOG.info("// SNAP: TODO: type resharding for all types enabled");
}
// if (allowTypeResharding == true && focusHoleFillInFewestShards == true) { // type re-sharding feature rollout
// More thorough testing required before enabling these features to work in tandem
// simple test case for when features are allowed to work together passes, see {@code testReshardingWithFocusHoleFillInFewestShards}
throw new IllegalArgumentException("Producer does not yet support using both re-sharding and focusHoleFillInFewestShards features in tandem");
}
// SNAP: TODO: throw new IllegalArgumentException("Producer does not yet support using both re-sharding and focusHoleFillInFewestShards features in tandem");
// }
if (stager != null && compressor != null) {
throw new IllegalArgumentException(
"Both a custom BlobStager and BlobCompressor were specified -- please specify only one of these.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void calculateSnapshot() {
}

public void writeSnapshot(DataOutputStream os) throws IOException {
LOG.log(Level.FINE, String.format("Writing snapshot with num shards = %s, revNumShards = %s, max shard ordinals = %s", numShards, revNumShards, Arrays.toString(maxShardOrdinal)));
LOG.log(Level.INFO, String.format("Writing snapshot with num shards = %s, revNumShards = %s, max shard ordinals = %s", numShards, revNumShards, Arrays.toString(maxShardOrdinal)));
/// for unsharded blobs, support pre v2.1.0 clients
if(numShards == 1) {
writeSnapshotShard(os, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,13 @@ public void calculateReverseDelta() {
}

public void writeDelta(DataOutputStream dos) throws IOException {
LOG.log(Level.FINE, String.format("Writing delta with num shards = %s, max shard ordinals = %s", numShards, Arrays.toString(maxShardOrdinal)));
// SNAP: TODO: remove
LOG.log(Level.INFO, String.format("Writing delta with num shards = %s, max shard ordinals = %s", numShards, Arrays.toString(maxShardOrdinal)));
writeCalculatedDelta(dos, false, maxShardOrdinal);
}

public void writeReverseDelta(DataOutputStream dos) throws IOException {
// SNAP: TODO: remove
LOG.log(Level.FINE, String.format("Writing reversedelta with num shards = %s, max shard ordinals = %s", revNumShards, Arrays.toString(revMaxShardOrdinal)));
writeCalculatedDelta(dos, true, revMaxShardOrdinal);
}
Expand Down

0 comments on commit 4913488

Please sign in to comment.