Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refresh the rollup index as part of the rollup indexer actions #86992

Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove redundant 'final' modifier
  • Loading branch information
salvatore-campagna committed Jun 8, 2022
commit 2688bb143f4f7a9882425bace319c51433e674b9
Original file line number Diff line number Diff line change
@@ -309,7 +309,7 @@ public void testIndexing() throws Exception {
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
AtomicBoolean isFinished = new AtomicBoolean(false);
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null) {
@Override
@@ -365,7 +365,7 @@ public void testStateChangeMidTrigger() {
RollupJob job = new RollupJob(config, Collections.emptyMap());

final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
AtomicBoolean isFinished = new AtomicBoolean(false);
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null, spyStats) {
@Override
@@ -397,7 +397,7 @@ public void testAbortDuringSearch() throws Exception {
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ThreadPool threadPool = new TestThreadPool(getTestName());
final CountDownLatch latch = new CountDownLatch(1);
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
EmptyRollupIndexer indexer = new EmptyRollupIndexer(client, threadPool, job, state, null) {
@Override
protected void onFinish(ActionListener<Void> listener) {
@@ -444,7 +444,7 @@ public void testAbortAfterCompletion() throws Exception {

// Don't use the indexer's latch because we completely change doNextSearch()
final CountDownLatch doNextSearchLatch = new CountDownLatch(1);
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null) {
@Override
protected void onAbort() {
@@ -531,7 +531,7 @@ public void testStopIndexing() throws Exception {
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null);
final CountDownLatch latch = indexer.newLatch();
assertFalse(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
@@ -553,7 +553,7 @@ public void testAbortIndexing() throws Exception {
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
final AtomicBoolean isAborted = new AtomicBoolean(false);
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null) {
@Override
@@ -580,7 +580,7 @@ public void testAbortStarted() {
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
final AtomicBoolean isAborted = new AtomicBoolean(false);
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null) {
@Override
@@ -606,7 +606,7 @@ public void testMultipleJobTriggering() throws Exception {
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
final AtomicBoolean isAborted = new AtomicBoolean(false);
DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(client, threadPool, job, state, null) {
@Override
@@ -726,7 +726,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
};

final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {

NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(
client,
@@ -848,7 +848,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
BiConsumer<IndexerState, Map<String, Object>> doSaveStateCheck = (indexerState, position) -> { isFinished.set(true); };

final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(
client,
threadPool,
@@ -905,7 +905,7 @@ public void testSearchShardFailure() throws Exception {
};

final ThreadPool threadPool = new TestThreadPool(getTestName());
try (final Client client = new NoOpClient(getTestName())) {
try (Client client = new NoOpClient(getTestName())) {
NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(
client,
threadPool,