-
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.
Signed-off-by: Nicholas Walter Knize <[email protected]>
- Loading branch information
Showing
3 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
server/src/main/java/org/opensearch/action/admin/indices/shrink/ShrinkAction.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,46 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.admin.indices.shrink; | ||
|
||
import org.opensearch.action.ActionType; | ||
|
||
public class ShrinkAction extends ActionType<ResizeResponse> { | ||
|
||
public static final ShrinkAction INSTANCE = new ShrinkAction(); | ||
public static final String NAME = "indices:admin/shrink"; | ||
|
||
private ShrinkAction() { | ||
super(NAME, ResizeResponse::new); | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
...r/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeRequest.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,65 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.admin.indices.upgrade.post; | ||
|
||
import org.opensearch.action.support.broadcast.BroadcastShardRequest; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
import org.opensearch.common.io.stream.StreamOutput; | ||
import org.opensearch.index.shard.ShardId; | ||
|
||
import java.io.IOException; | ||
|
||
public final class ShardUpgradeRequest extends BroadcastShardRequest { | ||
|
||
private UpgradeRequest request; | ||
|
||
public ShardUpgradeRequest(StreamInput in) throws IOException { | ||
super(in); | ||
request = new UpgradeRequest(in); | ||
} | ||
|
||
ShardUpgradeRequest(ShardId shardId, UpgradeRequest request) { | ||
super(shardId, request); | ||
this.request = request; | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
super.writeTo(out); | ||
request.writeTo(out); | ||
} | ||
|
||
public UpgradeRequest upgradeRequest() { | ||
return this.request; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
.../java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequestBuilder.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,62 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.admin.indices.upgrade.post; | ||
|
||
import org.opensearch.Version; | ||
import org.opensearch.action.support.master.AcknowledgedRequestBuilder; | ||
import org.opensearch.action.support.master.AcknowledgedResponse; | ||
import org.opensearch.client.OpenSearchClient; | ||
import org.opensearch.common.collect.Tuple; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Builder for an update index settings request | ||
*/ | ||
public class UpgradeSettingsRequestBuilder extends AcknowledgedRequestBuilder< | ||
UpgradeSettingsRequest, | ||
AcknowledgedResponse, | ||
UpgradeSettingsRequestBuilder> { | ||
|
||
public UpgradeSettingsRequestBuilder(OpenSearchClient client, UpgradeSettingsAction action) { | ||
super(client, action, new UpgradeSettingsRequest()); | ||
} | ||
|
||
/** | ||
* Sets the index versions to be updated | ||
*/ | ||
public UpgradeSettingsRequestBuilder setVersions(Map<String, Tuple<Version, String>> versions) { | ||
request.versions(versions); | ||
return this; | ||
} | ||
} |