Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings #134

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
import java.util.List;
import java.util.Map;

import org.opensearch.extensions.OpenSearchRequest;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.common.io.stream.InputStreamStreamInput;
import org.opensearch.common.io.stream.NamedWriteable;
import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput;
import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.opensearch.common.io.stream.NamedWriteableRegistryParseRequest;
import org.opensearch.extensions.ExtensionBooleanResponse;
import org.opensearch.common.io.stream.NamedWriteableRegistryResponse;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.extensions.ExtensionBooleanResponse;
import org.opensearch.extensions.OpenSearchRequest;

/**
* API used to handle named writeable registry requests from OpenSearch
Expand Down Expand Up @@ -122,7 +121,7 @@ public ExtensionBooleanResponse handleNamedWriteableRegistryParseRequest(NamedWr
try {

// TODO : Determine how extensions utilize parsed object (https://github.com/opensearch-project/OpenSearch/issues/4067)
NamedWriteable namedWriteable = streamInput.readNamedWriteable(categoryClass);
streamInput.readNamedWriteable(categoryClass);
status = true;
} catch (UnsupportedOperationException e) {
logger.info("Failed to parse named writeable", e);
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/opensearch/sdk/SDKClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
import java.io.IOException;

import org.apache.http.HttpHost;

import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.RestClient;
import org.opensearch.client.RestClientBuilder;
import org.opensearch.client.json.jackson.JacksonJsonpMapper;
Expand All @@ -25,7 +22,6 @@
* This class creates SDKClient for an extension to make requests to OpenSearch
*/
public class SDKClient {
private final Logger logger = LogManager.getLogger(SDKClient.class);
private OpenSearchClient javaClient;
private RestClient restClient = null;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/opensearch/sdk/TransportActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class TransportActions {
public <Request extends ActionRequest, Response extends ActionResponse> TransportActions(
Map<String, Class<? extends TransportAction<Request, Response>>> transportActions
) {
this.transportActions = new HashMap(transportActions);
this.transportActions = new HashMap<>(transportActions);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ private static class Example implements NamedWriteable {
public static final String NAME = "example";
private final String message;

Example(String message) {
this.message = message;
}

Example(StreamInput in) throws IOException {
this.message = in.readString();
}
Expand Down