Skip to content

Commit afe512f

Browse files
committed
resharding diag logs
1 parent 5035496 commit afe512f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

hollow/src/main/java/com/netflix/hollow/api/client/HollowUpdatePlanner.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public HollowUpdatePlan planUpdate(long currentVersion, HollowConsumer.VersionIn
113113
if(snapshotDestinationVersion == desiredVersion
114114
|| ((deltaDestinationVersion > desiredVersion) && (snapshotDestinationVersion < desiredVersion))
115115
|| ((snapshotDestinationVersion < desiredVersion) && (snapshotDestinationVersion > deltaDestinationVersion)))
116-
117116
return snapshotPlan;
118117
}
119118

hollow/src/main/java/com/netflix/hollow/core/write/HollowObjectTypeWriteState.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ protected int typeStateNumShards(int maxOrdinal) {
8888
projectedSizeOfType += fieldStats.getTotalSizeOfAllVarLengthData();
8989

9090
int targetNumShards = 1;
91-
while(stateEngine.getTargetMaxTypeShardSize() * targetNumShards < projectedSizeOfType)
91+
while(stateEngine.getTargetMaxTypeShardSize() * targetNumShards < projectedSizeOfType) {
92+
LOG.info("Doubling targetNumShards from " + targetNumShards + " to " + targetNumShards*2 + " for " + getSchema().getName() + " with projected size of " + projectedSizeOfType + " and target max type shard size of " + stateEngine.getTargetMaxTypeShardSize() + " and maxOrdinal of " + maxOrdinal);
9293
targetNumShards *= 2;
94+
}
95+
9396

9497
return targetNumShards;
9598
}

hollow/src/main/java/com/netflix/hollow/core/write/HollowWriteStateEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public void overrideNextStateRandomizedTag(long nextStateRandomizedTag) {
423423
* @param targetMaxTypeShardSize the target max type shard size, in bytes
424424
*/
425425
public void setTargetMaxTypeShardSize(long targetMaxTypeShardSize) {
426-
if (targetMaxTypeShardSize < 0) {
426+
if (targetMaxTypeShardSize <= 0) {
427427
throw new IllegalArgumentException("Invalid target max shard size specified: " + targetMaxTypeShardSize);
428428
}
429429
this.targetMaxTypeShardSize = targetMaxTypeShardSize;

0 commit comments

Comments
 (0)