use of org.apache.cassandra.service.reads.trackwarnings.WarningsSnapshot in project cassandra by apache.
the class WarningsSnapshotTest method mergeNonEmpty2.
@Test
public void mergeNonEmpty2() {
WarningsSnapshot a = builder().tombstonesAbort(ImmutableSet.of(HOME), 42).build();
WarningsSnapshot b = builder().localReadSizeWarning(ImmutableSet.of(VACATION_HOME), 12).build();
WarningsSnapshot expected = builder().tombstonesAbort(ImmutableSet.of(HOME), 42).localReadSizeWarning(ImmutableSet.of(VACATION_HOME), 12).build();
// validate builder to protect against empty = empty passing this test
assertThat(a.tombstones.aborts.instances).isEqualTo(expected.tombstones.aborts.instances).isEqualTo(ImmutableSet.of(HOME));
assertThat(a.tombstones.aborts.maxValue).isEqualTo(expected.tombstones.aborts.maxValue).isEqualTo(42);
assertThat(b.localReadSize.warnings.instances).isEqualTo(expected.localReadSize.warnings.instances).isEqualTo(ImmutableSet.of(VACATION_HOME));
assertThat(b.localReadSize.warnings.maxValue).isEqualTo(expected.localReadSize.warnings.maxValue).isEqualTo(12);
WarningsSnapshot output = a.merge(b);
assertThat(output).isEqualTo(expected).isEqualTo(expected.merge(empty()));
assertThat(output.merge(expected)).isEqualTo(expected);
}
Aggregations