Skip to content

Commit

Permalink
Implement the cat.pit_segments and cat.segment_replication operat…
Browse files Browse the repository at this point in the history
…ions (opensearch-project#527)

* Implement `cat.pit_segments` and `cat.all_pit_segments`

Signed-off-by: Thomas Farr <[email protected]>

Allow body on get/head

Signed-off-by: Thomas Farr <[email protected]>

* Implement `cat.segment_replication`

Signed-off-by: Thomas Farr <[email protected]>

* Add changelog entry

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
(cherry picked from commit c3deb70)
  • Loading branch information
Xtansia committed Aug 14, 2024
1 parent 39df056 commit 119590e
Show file tree
Hide file tree
Showing 34 changed files with 2,479 additions and 211 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
restore-keys: |
${{ runner.os }}-nuget-
- run: "./build.sh integrate ${{ matrix.version }} readonly,writable random:test_only_one --report"
- run: "./build.sh integrate ${{ matrix.version }} readonly,replicatedreadonly,writable random:test_only_one --report"
name: Integration Tests
working-directory: client

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
knn_plugin: true
plugins_output_directory: ${{ env.OPENSEARCH_PLUGINS_DIRECTORY }}

- run: "./build.sh integrate $OPENSEARCH_VERSION readonly,writable random:test_only_one --report"
- run: "./build.sh integrate $OPENSEARCH_VERSION readonly,replicatedreadonly,writable random:test_only_one --report"
name: Integration Tests
working-directory: client
env:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Added support for the `Cat.PitSegments` and `Cat.SegmentReplication` APIs ([#527](https://github.com/opensearch-project/opensearch-net/pull/527))
- Added support for `MinScore` on `ScriptScoreQuery` ([#624](https://github.com/opensearch-project/opensearch-net/pull/624))
- Added support for serializing the `DateOnly` and `TimeOnly` types ([#734](https://github.com/opensearch-project/opensearch-net/pull/734))
- Added support for the `Ext` parameter on `SearchRequest` ([#738](https://github.com/opensearch-project/opensearch-net/pull/738))
Expand Down
7 changes: 4 additions & 3 deletions abstractions/src/OpenSearch.OpenSearch.Managed/ClusterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ public IDisposable Start(IConsoleLineHandler writer, TimeSpan waitForStarted)
OnBeforeStart();

var subscriptions = new Subscriptions();
foreach (var node in Nodes) subscriptions.Add(node.SubscribeLines(writer));

var waitHandles = Nodes.Select(w => w.StartedHandle).ToArray();
if (!WaitHandle.WaitAll(waitHandles, waitForStarted))
foreach (var node in Nodes)
{
subscriptions.Add(node.SubscribeLines(writer));
if (node.WaitForStarted(waitForStarted)) continue;

var nodeExceptions = Nodes.Select(n => n.LastSeenException).Where(e => e != null).ToList();
writer?.WriteError(
$"{{{GetType().Name}.{nameof(Start)}}} cluster did not start after {waitForStarted}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ private static StartArguments StartArgs(NodeConfiguration config)

private static Dictionary<string, string> EnvVars(NodeConfiguration config)
{
var environmentVariables = new Dictionary<string, string> { { "OPENSEARCH_JAVA_OPTS", "-Xms1g -Xmx1g" } };
var javaOpts = new List<string> { "-Xms1g", "-Xmx1g" };

var environmentVariables = new Dictionary<string, string> { { "OPENSEARCH_JAVA_OPTS", string.Join(" ", javaOpts) } };

if (!string.IsNullOrWhiteSpace(config.FileSystem.ConfigPath))
environmentVariables.Add(config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath);

Expand Down
3 changes: 2 additions & 1 deletion src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public static class CodeConfiguration
{
new("{create,delete}_pit"),
new("{delete,get}_all_pits"),

new("cat.{all_pit,pit}_segments"),
new("cat.segment_replication"),
new("cluster.{delete,exists,get,put}_component_template"),
new("indices.{delete,exists,get,put}_index_template")
};
Expand Down
Loading

0 comments on commit 119590e

Please sign in to comment.