-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:opensearch-project/OpenSearch into …
…keyword-iterator
- Loading branch information
Showing
92 changed files
with
1,540 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9a9f25c58d8d5b0fcf37ae889a50fec87e34ac08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11b6a0708e9d6c90a1a76574c7720edce47dacc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
plugins/repository-gcs/licenses/google-api-client-2.2.0.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
plugins/repository-gcs/licenses/google-api-client-2.7.0.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
59c8e5e3c03f146561a83051af3ca945d40e02c6 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9a9f25c58d8d5b0fcf37ae889a50fec87e34ac08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...s/repository-s3/src/test/java/org/opensearch/repositories/s3/S3RepositoryPluginTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.repositories.s3; | ||
|
||
import org.opensearch.common.settings.Settings; | ||
import org.opensearch.common.unit.SizeUnit; | ||
import org.opensearch.common.unit.SizeValue; | ||
import org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor; | ||
import org.opensearch.test.OpenSearchTestCase; | ||
import org.opensearch.threadpool.ExecutorBuilder; | ||
import org.opensearch.threadpool.ThreadPool; | ||
import org.opensearch.threadpool.ThreadPool.ThreadPoolType; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.List; | ||
import java.util.concurrent.Executor; | ||
|
||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.hamcrest.Matchers.equalTo; | ||
import static org.hamcrest.Matchers.notNullValue; | ||
|
||
public class S3RepositoryPluginTests extends OpenSearchTestCase { | ||
|
||
private static final String URGENT_FUTURE_COMPLETION = "urgent_future_completion"; | ||
|
||
public void testGetExecutorBuilders() throws IOException { | ||
final int processors = randomIntBetween(1, 64); | ||
Settings settings = Settings.builder().put("node.name", "test").put("node.processors", processors).build(); | ||
Path configPath = createTempDir(); | ||
ThreadPool threadPool = null; | ||
try (S3RepositoryPlugin plugin = new S3RepositoryPlugin(settings, configPath)) { | ||
List<ExecutorBuilder<?>> executorBuilders = plugin.getExecutorBuilders(settings); | ||
assertNotNull(executorBuilders); | ||
assertFalse(executorBuilders.isEmpty()); | ||
threadPool = new ThreadPool(settings, executorBuilders.toArray(new ExecutorBuilder<?>[0])); | ||
final Executor executor = threadPool.executor(URGENT_FUTURE_COMPLETION); | ||
assertNotNull(executor); | ||
assertThat(executor, instanceOf(OpenSearchThreadPoolExecutor.class)); | ||
final OpenSearchThreadPoolExecutor openSearchThreadPoolExecutor = (OpenSearchThreadPoolExecutor) executor; | ||
final ThreadPool.Info info = threadPool.info(URGENT_FUTURE_COMPLETION); | ||
int size = boundedBy((processors + 1) / 2, 1, 2); | ||
assertThat(info.getName(), equalTo(URGENT_FUTURE_COMPLETION)); | ||
assertThat(info.getThreadPoolType(), equalTo(ThreadPoolType.FIXED)); | ||
assertThat(info.getQueueSize(), notNullValue()); | ||
assertThat(info.getQueueSize(), equalTo(new SizeValue(10, SizeUnit.KILO))); | ||
assertThat(openSearchThreadPoolExecutor.getQueue().remainingCapacity(), equalTo(10_000)); | ||
|
||
assertThat(info.getMin(), equalTo(size)); | ||
assertThat(openSearchThreadPoolExecutor.getCorePoolSize(), equalTo(size)); | ||
assertThat(info.getMax(), equalTo(size)); | ||
assertThat(openSearchThreadPoolExecutor.getMaximumPoolSize(), equalTo(size)); | ||
|
||
final int availableProcessors = Runtime.getRuntime().availableProcessors(); | ||
if (processors > availableProcessors) { | ||
assertWarnings( | ||
"setting [node.processors] to value [" | ||
+ processors | ||
+ "] which is more than available processors [" | ||
+ availableProcessors | ||
+ "] is deprecated" | ||
); | ||
} | ||
} finally { | ||
if (threadPool != null) { | ||
terminate(threadPool); | ||
} | ||
} | ||
} | ||
|
||
private static int boundedBy(int value, int min, int max) { | ||
return Math.min(max, Math.max(min, value)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.