JeetKunDoug commented on code in PR #104:
URL: https://github.com/apache/cassandra-sidecar/pull/104#discussion_r1532862150
##########
src/main/java/org/apache/cassandra/sidecar/restore/RestoreSliceTask.java:
##########
@@ -513,4 +524,48 @@ private void
logWarnIfHasHttpExceptionCauseOnCommit(Throwable throwable, Restore
LOGGER.warn("Committing slice failed with HttpException. slice={}
statusCode={} exceptionPayload={}",
slice.sliceId(), httpException.getStatusCode(),
httpException.getPayload(), httpException);
}
+
+ public long elapsedInNanos()
+ {
+ return taskStartTimeNanos == -1 ? -1 :
+ currentTimeInNanos() - taskStartTimeNanos;
+ }
+
+ public RestoreSlice slice()
+ {
+ return slice;
+ }
+
+ /**
+ * A RestoreSliceHandler that immediately fails the slice/promise.
+ * Used when the processor already knows that a slice should not be
processed for some reason
+ * as indicated in cause field.
+ */
+ public static class Failed implements RestoreSliceHandler
+ {
+ private final RestoreJobException cause;
+ private final RestoreSlice slice;
+
+ public Failed(RestoreJobException cause, RestoreSlice slice)
+ {
+ this.cause = cause;
+ this.slice = slice;
+ }
+
+ public void handle(Promise<RestoreSlice> promise)
Review Comment:
I'm doing a global "fix all the missing `@Override` annotations" on the
project as part of this PR - there were 30, and rather than piecemeal fixing
them as we go I figure I'd just fix them all :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]