-
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.
Added TransportActions support and removed LocalNodeResponse for exte…
…nsions (#5629) Signed-off-by: Ryan Bogan <rbogan@amazon.com> Signed-off-by: Ryan Bogan <rbogan@amazon.com>
- Loading branch information
Showing
37 changed files
with
2,297 additions
and
377 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
60 changes: 0 additions & 60 deletions
60
server/src/main/java/org/opensearch/cluster/LocalNodeResponse.java
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
89 changes: 89 additions & 0 deletions
89
server/src/main/java/org/opensearch/extensions/ExtensionDependency.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,89 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* 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.io.IOException; | ||
import java.util.Objects; | ||
|
||
import org.opensearch.Version; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
import org.opensearch.common.io.stream.StreamOutput; | ||
import org.opensearch.common.io.stream.Writeable; | ||
|
||
/** | ||
* This class handles the dependent extensions information | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class ExtensionDependency implements Writeable { | ||
private String uniqueId; | ||
private Version version; | ||
|
||
public ExtensionDependency(String uniqueId, Version version) { | ||
this.uniqueId = uniqueId; | ||
this.version = version; | ||
} | ||
|
||
/** | ||
* Jackson requires a no-arg constructor. | ||
* | ||
*/ | ||
@SuppressWarnings("unused") | ||
private ExtensionDependency() {} | ||
|
||
/** | ||
* Reads the extension dependency information | ||
* | ||
* @throws IOException if an I/O exception occurred reading the extension dependency information | ||
*/ | ||
public ExtensionDependency(StreamInput in) throws IOException { | ||
uniqueId = in.readString(); | ||
version = Version.readVersion(in); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(uniqueId); | ||
Version.writeVersion(version, out); | ||
} | ||
|
||
/** | ||
* The uniqueId of the dependency extension | ||
* | ||
* @return the extension uniqueId | ||
*/ | ||
public String getUniqueId() { | ||
return uniqueId; | ||
} | ||
|
||
/** | ||
* The minimum version of the dependency extension | ||
* | ||
* @return the extension version | ||
*/ | ||
public Version getVersion() { | ||
return version; | ||
} | ||
|
||
public String toString() { | ||
return "ExtensionDependency:{uniqueId=" + uniqueId + ", version=" + version + "}"; | ||
} | ||
|
||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
if (obj == null || getClass() != obj.getClass()) return false; | ||
ExtensionDependency that = (ExtensionDependency) obj; | ||
return Objects.equals(uniqueId, that.uniqueId) && Objects.equals(version, that.version); | ||
} | ||
|
||
public int hashCode() { | ||
return Objects.hash(uniqueId, version); | ||
} | ||
} |
Oops, something went wrong.