Skip to content

Commit

Permalink
cleanup PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunjeet committed Feb 6, 2025
1 parent c0df024 commit 1edbaa4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 76 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class HollowHistoryUIServerTest {
@Test
public void test() throws Exception {
HollowHistory hh = new HollowHistory(new HollowReadStateEngine(), Long.MAX_VALUE, 10);
HollowHistoryUIServer server = new HollowHistoryUIServer(hh, 7882);
HollowHistoryUIServer server = new HollowHistoryUIServer(hh, 0);
server.start();
server.stop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,7 @@ private ReadStateHelper checkIntegrity(
HollowChecksum currentChecksum = HollowChecksum.forStateEngineWithCommonSchemas(current, pending);
log.info(" CUR " + currentChecksum);

System.out.println("Pending checksum begin --- ");
HollowChecksum pendingChecksum = HollowChecksum.forStateEngineWithCommonSchemas(pending, current);
System.out.println("Pending checksum end --- ");
log.info(" PND " + pendingChecksum);

if (artifacts.hasDelta()) {
Expand All @@ -791,7 +789,6 @@ private ReadStateHelper checkIntegrity(

// FIXME: timt: future cycles will fail unless both deltas validate
applyDelta(artifacts.delta, current);

HollowChecksum forwardChecksum = HollowChecksum.forStateEngineWithCommonSchemas(current, pending);
//out.format(" CUR => PND %s\n", forwardChecksum);
if (!forwardChecksum.equals(pendingChecksum)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,50 +553,9 @@ protected void applyToChecksum(HollowChecksum checksum, HollowSchema withSchema)
if(!(withSchema instanceof HollowObjectSchema))
throw new IllegalArgumentException("HollowObjectTypeReadState can only calculate checksum with a HollowObjectSchema: " + getSchema().getName());

// applyToChecksumTemp(checksum, withSchema);

// HollowChecksum newChecksum = new HollowChecksum();
// HollowChecksum oldChecksum = new HollowChecksum();
//
// applyToChecksumTemp(newChecksum, withSchema);

BitSet populatedOrdinals = getPopulatedOrdinals();
//if (shards.length == 8) {
// shards[0].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 0, shardNumberMask);
// shards[4].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 4, shardNumberMask);
// shards[2].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 2, shardNumberMask);
// shards[6].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 6, shardNumberMask);
// shards[1].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 1, shardNumberMask);
// shards[5].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 5, shardNumberMask);
// shards[3].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 3, shardNumberMask);
// shards[7].applyShardToChecksum(oldChecksum, withSchema, populatedOrdinals, 7, shardNumberMask);
//} else {
for (int i = 0; i < shards.length; i++) {
shards[i].applyShardToChecksum(checksum, withSchema, populatedOrdinals, i, shardNumberMask);
}
//}

// if (!newChecksum.equals(oldChecksum)) {
// System.out.println("We got checksum mismatch here, newChecksum= " + newChecksum + ", oldChecksum= " + oldChecksum);
// }

}

protected void applyToChecksumTemp(HollowChecksum checksum, HollowSchema withSchema) {
final HollowObjectTypeShardsHolder shardsHolder = this.shardsVolatile;
final HollowObjectTypeReadStateShard[] shards = shardsHolder.shards;
int shardNumberMask = shardsHolder.shardNumberMask;
if(!(withSchema instanceof HollowObjectSchema))
throw new IllegalArgumentException("HollowObjectTypeReadState can only calculate checksum with a HollowObjectSchema: " + getSchema().getName());

BitSet populatedOrdinals = getPopulatedOrdinals();
int ordinal = populatedOrdinals.nextSetBit(0);
while(ordinal != ORDINAL_NONE) {
HollowObjectTypeReadStateShard shard = shards[ordinal & shardNumberMask];
int shardOrdinal = ordinal >> shard.shardOrdinalShift;
shard.applyOrdinalToChecksum(checksum, withSchema, ordinal, shardOrdinal);

ordinal = populatedOrdinals.nextSetBit(ordinal + 1);
for (int i = 0; i < shards.length; i++) {
shards[i].applyShardToChecksum(checksum, withSchema, populatedOrdinals, i, shardNumberMask);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class HollowSetTypeReadStateTest extends AbstractHollowSetTypeDataElement
public void testResharding() throws Exception {

for (int shardingFactor : new int[]{2}) { // , 4, 8, 16, 32, 64, 128, 256, 512, 1024
for(int numRecords=1;numRecords<=1000;numRecords+=new Random().nextInt(100)) {
for(int numRecords=1;numRecords<=1000;numRecords+=new Random().nextInt(300)) {
int[][] listContents = generateSetContents(numRecords);
HollowSetTypeReadState setTypeReadState = populateTypeStateWith(listContents);
assertDataUnchanged(setTypeReadState, listContents);
Expand Down

0 comments on commit 1edbaa4

Please sign in to comment.