Skip to content

Commit

Permalink
Change
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Brooks committed Sep 5, 2024
1 parent c17c69a commit 98e0e56
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class IncrementalBulkService {
Setting.Property.Dynamic
);
private final Client client;
private final AtomicBoolean enabled = new AtomicBoolean(true);
private final AtomicBoolean enabledForTests = new AtomicBoolean(true);
private final IndexingPressure indexingPressure;
private final ThreadContext threadContext;

Expand All @@ -61,14 +61,14 @@ public Handler newBulkRequest(@Nullable String waitForActiveShards, @Nullable Ti
}

private void ensureEnabled() {
if (enabled.get() == false) {
if (enabledForTests.get() == false) {
throw new AssertionError("Unexpected incremental bulk request");
}
}

// This method only exists to tests that the feature flag works. Remove once we no longer need the flag.
public void setForTests(boolean value) {
enabled.set(value);
enabledForTests.set(value);
}

public static class Enabled implements Supplier<Boolean> {
Expand Down

0 comments on commit 98e0e56

Please sign in to comment.