-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
@JsonDeserialize(as=ImmutableSweepTableResponse.class) | ||
public interface SweepTableResponse { | ||
|
||
//Optional<String> nextStartRow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DropwizardClientRule
does not use an object mapper that supports optionals so this makes all the tests fails... need to fix this
return ImmutableSweepTableResponse.builder() | ||
.numCellTsPairsExamined(results.getCellTsPairsExamined()) | ||
.staleValuesDeleted(results.getStaleValuesDeleted()) | ||
// .nextStartRow(results.getNextStartRow().map(BaseEncoding.base16()::encode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should extract the base16 encoding to a utility
@Nullable @QueryParam("candidateBatchSize") Integer candidateBatchSize, | ||
@Nullable @QueryParam("deleteBatchSize") Integer deleteBatchSize); | ||
@QueryParam("startRow") Optional<String> startRow, | ||
@QueryParam("fullSweep") @DefaultValue("true") Optional<Boolean> fullSweep, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be just Boolean now that we have a default value
@QueryParam("fullSweep") @DefaultValue("true") Optional<Boolean> fullSweep, | ||
@QueryParam("maxCellTsPairsToExamine") Optional<Integer> maxCellTsPairsToExamine, | ||
@QueryParam("candidateBatchSize") Optional<Integer> candidateBatchSize, | ||
@QueryParam("deleteBatchSize") Optional<Integer> deleteBatchSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, while we are here, can we marke these params etc. @safe for logging purposes?
Codecov Report
@@ Coverage Diff @@
## develop #2409 +/- ##
=============================================
+ Coverage 60.11% 60.15% +0.04%
- Complexity 3383 4650 +1267
=============================================
Files 857 859 +2
Lines 40037 40031 -6
Branches 4079 4076 -3
=============================================
+ Hits 24067 24081 +14
+ Misses 14500 14482 -18
+ Partials 1470 1468 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small comments, approving to allow merging after fixing them!
try { | ||
log.info("Beginning"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add more info here.. lets have beggining sweep on table x with startrow x and batchConfig x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added logging for this in SweepTaskRunner.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, we will get the info from there. This line then seems a bit unnecessary.
|
||
sweeperService.sweepTable(TABLE_REF.getQualifiedName()); | ||
|
||
startRows.forEach(row -> verify(sweepTaskRunner).run(any(), any(), eq(row))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We should verify the results are not recorded here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sweeperService.sweepTable(TABLE_REF.getQualifiedName(), Optional.empty(), Optional.of(false), | ||
Optional.empty(), Optional.empty(), Optional.empty()); | ||
|
||
verify(sweepTaskRunner, times(1)).run(any(), any(), any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We should verify the results are not recorded here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
@Override | ||
public void initialize(Bootstrap<Configuration> bootstrap) { | ||
bootstrap.getObjectMapper().registerModule(new Jdk8Module()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is non-ideal, but I couldn't think of a better way here.
08c89ed
to
e40704c
Compare
void sweepTableFromStartRow( | ||
@QueryParam("tablename") String tableName, | ||
@Nonnull @QueryParam("startRow") String startRow); | ||
default SweepTableResponse sweepTable(String tableName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we get rid of these APIs as we are no longer exposing the endpoints. This is technically a break, but probably noone will be affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mainly just added these for easier usage in java (otherwise you have to pass in 5 Optional.empty()
s
@@ -140,6 +142,10 @@ private SweepResults doRun(TableReference tableRef, | |||
byte[] startRow, | |||
RunType runType, | |||
Sweeper sweeper) { | |||
log.info("Beginning iteration of sweep for table {} starting at row {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have this logging, do we want to remove the loggings on BackgroundSweeperImpl - the ones on getTableToSweep? Otherwise we'd log the same thing twice (that we're starting to sweep table {} on row {}).
You also probably want to update the sweep-logs.rst document to keep track of where we log this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see, we already having logging there. ok, i'll just move this to the SweeperService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, going to leave this and delete the other, as otherwise we'd have to log in multiple places
Mockito.verify(priorityStore, never()).update(Mockito.any(), Mockito.any(), Mockito.any()); | ||
Mockito.verify(progressStore, never()).saveProgress(Mockito.any(), Mockito.any()); | ||
sweeperService.sweepTableFrom(TABLE_REF.getQualifiedName(), encodeStartRow(new byte[] {1, 2, 3})); | ||
verify(priorityStore, never()).update(any(), any(), any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also delete this test as we are verifying no metrics for all tests, but will not block on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinging @nziebart to update the sweep-logs.rst docs before merging this. If not on this PR, you can also do it shortly after, and you can dismiss this review.
@fsamuel-bs already done :) |
* Sweep a particular table from specified startRow with specified {@link SweepBatchConfig} parameters. | ||
* Sweeps a particular table. | ||
* | ||
* @param tableName the table to sweep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add docs for format of table and row
@fsamuel-bs are you good with the docs changes here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Goals (and why):
Fixes #2370
Implementation Description (bullets):
Concerns (what feedback would you like?):
Where should we start reviewing?:
Priority (whenever / two weeks / yesterday):
whenever
This change is