-
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: Zelin Hao <[email protected]>
- Loading branch information
Showing
36 changed files
with
1,719 additions
and
264 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Releases | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: GitHub App token | ||
id: github_app_token | ||
uses: tibdex/[email protected] | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
installation_id: 22958780 | ||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
- uses: actions/checkout@v2 | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
github_token: ${{ steps.github_app_token.outputs.token }} | ||
bodyFile: release-notes/opensearch.release-notes-${{steps.tag.outputs.tag}}.md |
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
68 changes: 68 additions & 0 deletions
68
server/src/main/java/org/opensearch/extensions/AcknowledgedResponse.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,68 @@ | ||
/* | ||
* 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.extensions; | ||
|
||
import org.opensearch.common.io.stream.StreamInput; | ||
import org.opensearch.common.io.stream.StreamOutput; | ||
import org.opensearch.transport.TransportResponse; | ||
import java.io.IOException; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Generic boolean response indicating the status of some previous request sent to the SDK | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class AcknowledgedResponse extends TransportResponse { | ||
|
||
private final boolean status; | ||
|
||
/** | ||
* @param status Boolean indicating the status of the parse request sent to the SDK | ||
*/ | ||
public AcknowledgedResponse(boolean status) { | ||
this.status = status; | ||
} | ||
|
||
public AcknowledgedResponse(StreamInput in) throws IOException { | ||
super(in); | ||
this.status = in.readBoolean(); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeBoolean(status); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "AcknowledgedResponse{" + "status=" + this.status + "}"; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
AcknowledgedResponse that = (AcknowledgedResponse) o; | ||
return Objects.equals(this.status, that.status); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(status); | ||
} | ||
|
||
/** | ||
* Returns a boolean indicating the success of the request sent to the SDK | ||
*/ | ||
public boolean getStatus() { | ||
return this.status; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
server/src/main/java/org/opensearch/extensions/ExtensionReader.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,45 @@ | ||
/* | ||
* 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.extensions; | ||
|
||
import java.net.UnknownHostException; | ||
import org.opensearch.cluster.node.DiscoveryNode; | ||
|
||
/** | ||
* Reference to a method that transports a parse request to an extension. By convention, this method takes | ||
* a category class used to identify the reader defined within the JVM that the extension is running on. | ||
* Additionally, this method takes in the extension's corresponding DiscoveryNode and a byte array (context) that the | ||
* extension's reader will be applied to. | ||
* | ||
* By convention the extensions' reader is a constructor that takes StreamInput as an argument for most classes and a static method for things like enums. | ||
* Classes will implement this via a constructor (or a static method in the case of enumerations), it's something that should | ||
* look like: | ||
* <pre><code> | ||
* public MyClass(final StreamInput in) throws IOException { | ||
* * this.someValue = in.readVInt(); | ||
* this.someMap = in.readMapOfLists(StreamInput::readString, StreamInput::readString); | ||
* } | ||
* </code></pre> | ||
* | ||
* @opensearch.internal | ||
*/ | ||
@FunctionalInterface | ||
public interface ExtensionReader { | ||
|
||
/** | ||
* Transports category class, and StreamInput (context), to the extension identified by the Discovery Node | ||
* | ||
* @param extensionNode Discovery Node identifying the Extension | ||
* @param categoryClass Super class that the reader extends | ||
* @param context Some context to transport | ||
* @throws UnknownHostException if the extension node host IP address could not be determined | ||
*/ | ||
void parse(DiscoveryNode extensionNode, Class categoryClass, Object context) throws UnknownHostException; | ||
|
||
} |
Oops, something went wrong.