Skip to content

Commit

Permalink
Resolve breaking changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Deng <dengjay@amazon.com>
  • Loading branch information
jed326 authored and Jay Deng committed Nov 7, 2024
1 parent b602dfd commit 7234c74
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions server/src/main/java/org/opensearch/env/NodeEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public String toString() {

private final NodeMetadata nodeMetadata;

private final IndexStoreListener indexStoreListener;
private final org.opensearch.index.store.IndexStoreListener indexStoreListener;

/**
* Maximum number of data nodes that should run in an environment.
Expand Down Expand Up @@ -299,22 +299,32 @@ public void close() {
}

public NodeEnvironment(Settings settings, Environment environment) throws IOException {
this(settings, environment, IndexStoreListener.EMPTY);
this(settings, environment, org.opensearch.index.store.IndexStoreListener.EMPTY);
}

/**
* Use {@link NodeEnvironment#NodeEnvironment(Settings, Environment, org.opensearch.index.store.IndexStoreListener)} instead.
* This constructor is kept around on 2.x to avoid breaking changes.
*/
@Deprecated(forRemoval = true, since = "2.19.0")
public NodeEnvironment(Settings settings, Environment environment, IndexStoreListener indexStoreListener) throws IOException {
this(settings, environment);
}

/**
* Setup the environment.
* @param settings settings from opensearch.yml
*/
public NodeEnvironment(Settings settings, Environment environment, IndexStoreListener indexStoreListener) throws IOException {
public NodeEnvironment(Settings settings, Environment environment, org.opensearch.index.store.IndexStoreListener indexStoreListener)
throws IOException {
if (DiscoveryNode.nodeRequiresLocalStorage(settings) == false) {
nodePaths = null;
fileCacheNodePath = null;
sharedDataPath = null;
locks = null;
nodeLockId = -1;
nodeMetadata = new NodeMetadata(generateNodeId(settings), Version.CURRENT);
this.indexStoreListener = IndexStoreListener.EMPTY;
this.indexStoreListener = org.opensearch.index.store.IndexStoreListener.EMPTY;
return;
}
boolean success = false;
Expand Down Expand Up @@ -1413,4 +1423,12 @@ private static void tryWriteTempFile(Path path) throws IOException {
}
}
}

/**
* Use {@link org.opensearch.index.store.IndexStoreListener} instead. This interface is kept around on 2.x to avoid breaking changes.
*
* @opensearch.internal
*/
@Deprecated(forRemoval = true, since = "2.19.0")
public interface IndexStoreListener extends org.opensearch.index.store.IndexStoreListener {}
}

0 comments on commit 7234c74

Please sign in to comment.