@Test public void accumulateWithNextRowInOppositeOrder() { Assert.assertThat(OTHER_RESULTS.accumulateWith(RESULTS), Matchers.equalTo(COMBINED_RESULTS_AND_OTHER)); }
public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow())) .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .minSweptTimestamp(Math.min(getMinSweptTimestamp(), other.getMinSweptTimestamp())) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) .timeSweepStarted(Math.min(getTimeSweepStarted(), other.getTimeSweepStarted())) .build(); }
SweepResults { public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow())) .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .minSweptTimestamp(Math.min(getMinSweptTimestamp(), other.getMinSweptTimestamp())) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) .timeSweepStarted(Math.min(getTimeSweepStarted(), other.getTimeSweepStarted())) .build(); } }
SweepResults { public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow())) .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .minSweptTimestamp(Math.min(getMinSweptTimestamp(), other.getMinSweptTimestamp())) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) .timeSweepStarted(Math.min(getTimeSweepStarted(), other.getTimeSweepStarted())) .build(); }  }
SweepResults { public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow())) .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .minSweptTimestamp(Math.min(getMinSweptTimestamp(), other.getMinSweptTimestamp())) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) .timeSweepStarted(Math.min(getTimeSweepStarted(), other.getTimeSweepStarted())) .build(); }  @JsonIgnore Optional<byte[]> getPreviousStartRow(); @JsonIgnore Optional<byte[]> getNextStartRow(); abstract long getCellTsPairsExamined(); abstract long getStaleValuesDeleted(); abstract long getMinSweptTimestamp(); abstract long getTimeInMillis(); @Value.Auxiliary abstract long getTimeSweepStarted(); @JsonIgnore long getTimeElapsedSinceStartedSweeping(); SweepResults accumulateWith(SweepResults other); static SweepResults.Builder builder(); static SweepResults createEmptySweepResultWithMoreToSweep(); static SweepResults createEmptySweepResultWithNoMoreToSweep(); static SweepResults createEmptySweepResult(Optional<byte[]> startRow); }
SweepResults { public SweepResults accumulateWith(SweepResults other) { return SweepResults.builder() .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow())) .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined()) .staleValuesDeleted(getStaleValuesDeleted() + other.getStaleValuesDeleted()) .minSweptTimestamp(Math.min(getMinSweptTimestamp(), other.getMinSweptTimestamp())) .timeInMillis(getTimeInMillis() + other.getTimeInMillis()) .timeSweepStarted(Math.min(getTimeSweepStarted(), other.getTimeSweepStarted())) .build(); }  @JsonIgnore Optional<byte[]> getPreviousStartRow(); @JsonIgnore Optional<byte[]> getNextStartRow(); abstract long getCellTsPairsExamined(); abstract long getStaleValuesDeleted(); abstract long getMinSweptTimestamp(); abstract long getTimeInMillis(); @Value.Auxiliary abstract long getTimeSweepStarted(); @JsonIgnore long getTimeElapsedSinceStartedSweeping(); SweepResults accumulateWith(SweepResults other); static SweepResults.Builder builder(); static SweepResults createEmptySweepResultWithMoreToSweep(); static SweepResults createEmptySweepResultWithNoMoreToSweep(); static SweepResults createEmptySweepResult(Optional<byte[]> startRow);  }