Skip to content

Commit

Permalink
Ryan's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Nov 22, 2023
1 parent 1c043e9 commit 378d406
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,9 @@ public static long callDataSnapshotFunction(
* <p>
* If the supplied {@link SnapshotControl} provides a null {@link SnapshotControl#getUpdateGraph UpdateGraph}, then
* this method will perform a static snapshot without locks or retrying. In this case, the {@link SnapshotControl}'s
* {@link SnapshotControl#usePreviousValues usePreviousValues} must return {@code false}, and
* {@link SnapshotControl#snapshotCompletedConsistently snapshotCompletedConsistently} must return {@code true}.
* {@link SnapshotControl#usePreviousValues usePreviousValues} must return {@code false},
* {@link SnapshotControl#snapshotCompletedConsistently snapshotCompletedConsistently} must return {@code true}, and
* the clock step returned by this method will be the {@link LogicalClock#NULL_CLOCK_VALUE NULL_CLOCK_VALUE}.
*
*
* @param logPrefix A prefix for our log messages
Expand All @@ -1202,10 +1203,14 @@ public static long callDataSnapshotFunction(
if (updateGraph == null) {
// This is a snapshot of static data. Just call the function with no frippery.
final boolean controlUsePrev = control.usePreviousValues(LogicalClock.NULL_CLOCK_VALUE);
Assert.eqFalse(controlUsePrev, "controlUsePrev");
if (controlUsePrev) {
throw new SnapshotUnsuccessfulException("Static snapshot requested previous values");
}

final boolean functionSuccessful = function.call(false, LogicalClock.NULL_CLOCK_VALUE);
Assert.assertion(functionSuccessful, "functionSuccessful");
if (!functionSuccessful) {
throw new SnapshotUnsuccessfulException("Static snapshot failed to execute snapshot function");
}
if (log.isDebugEnabled()) {
final long duration = System.currentTimeMillis() - overallStart;
log.debug().append(logPrefix)
Expand All @@ -1215,7 +1220,9 @@ public static long callDataSnapshotFunction(
// notify control of successful snapshot
final boolean controlSuccessful =
control.snapshotCompletedConsistently(LogicalClock.NULL_CLOCK_VALUE, false);
Assert.assertion(controlSuccessful, "controlSuccessful");
if (!controlSuccessful) {
throw new SnapshotUnsuccessfulException("Static snapshot function succeeded but control failed");
}
return LogicalClock.NULL_CLOCK_VALUE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,6 @@ private void updateSubscriptionsSnapshotAndPropagate() {
.append(" growing subscriptions; scheduling next snapshot immediately.").endl();
}
updatePropagationJob.scheduleImmediately();
updatePropagationJob.scheduleImmediately();
}

lastUpdateTime = scheduler.currentTimeMillis();
Expand Down Expand Up @@ -2043,8 +2042,8 @@ private void finalizeSnapshotForSubscriptions(final List<Subscription> subscript
|| isBlinkTable;

if (log.isDebugEnabled()) {
log.debug().append(logPrefix).append("finalizing snapshot for subscription: ")
.append(subscription.toString()).append(", isComplete=").append(isComplete).endl();
log.debug().append(logPrefix).append("finalizing snapshot for subscription=")
.append(subscription.logPrefix).append(", isComplete=").append(isComplete).endl();
}

if (isComplete) {
Expand Down

0 comments on commit 378d406

Please sign in to comment.