Skip to content

Commit

Permalink
Clean up SortedLogRecoveryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
milleruntime committed Jun 2, 2021
1 parent 4e228b7 commit 8b5b8cc
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ public boolean equals(Object obj) {
public int compareTo(KeyValue o) {
return key.compareTo(o.key);
}

@Override
public String toString() {
return "" + key + " #muts:" + value.mutations.size();
}
}

private static KeyValue createKeyValue(LogEvents type, long seq, int tid,
Expand Down Expand Up @@ -390,33 +385,6 @@ public void testSkipSuccessfulCompaction() throws IOException {
assertEquals(m, mutations.get(0));
}

@Test
public void testMutationsSameSeq() throws IOException {
// Create a test log
KeyExtent other = new KeyExtent(TableId.of("other"), null, null);
Mutation ignored = new ServerMutation(new Text("ignored"));
ignored.put(cf, cq, value);
Mutation m = new ServerMutation(new Text("row1"));
Mutation m2 = new ServerMutation(new Text("row1"));
Mutation m3 = new ServerMutation(new Text("row1"));
m.put(cf, cq, value);
m2.put(new Text("cf2"), new Text("cq2"), value);
m3.put(new Text("cf3"), new Text("cq3"), value);
KeyValue[] entries = {createKeyValue(OPEN, 0, -1, "1"),
createKeyValue(DEFINE_TABLET, 1, 1, other), createKeyValue(DEFINE_TABLET, 1, 3, extent),
createKeyValue(MUTATION, 1, 1, ignored), createKeyValue(MUTATION, 1, 3, m),
createKeyValue(MUTATION, 1, 3, m2), createKeyValue(MUTATION, 1, 3, m3)};
Map<String,KeyValue[]> logs = new TreeMap<>();
logs.put("testlog", entries);
// Recover
List<Mutation> mutations = recover(logs, extent);
// Verify recovered data
assertEquals(3, mutations.size());
assertEquals(m, mutations.get(0));
assertEquals(m2, mutations.get(1));
assertEquals(m3, mutations.get(2));
}

@Test
public void testSkipSuccessfulCompactionAcrossFiles() throws IOException {
// Create a test log
Expand Down

0 comments on commit 8b5b8cc

Please sign in to comment.