Skip to content

Commit

Permalink
Add 2.9 release notes and fix complitation issues
Browse files Browse the repository at this point in the history
Signed-off-by: Rishav Sagar <[email protected]>
  • Loading branch information
Rishav Sagar committed Jul 11, 2023
1 parent 8945588 commit 14b4195
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Version 2.9.0.0 2023-07-18

Compatible with OpenSearch 2.9.0

### Maintenance
* Increment version to 2.9.0 ([300](https://github.com/opensearch-project/asynchronous-search/pull/300))
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public SearchResponse getSearchResponse() {
asynchronousSearchPersistenceModel.getResponse())));
try (NamedWriteableAwareStreamInput wrapperStreamInput = new NamedWriteableAwareStreamInput(bytesReference.streamInput(),
namedWriteableRegistry)) {
wrapperStreamInput.setVersion(Version.readVersion(wrapperStreamInput));
wrapperStreamInput.setVersion(wrapperStreamInput.readVersion());
return new SearchResponse(wrapperStreamInput);
} catch (IOException e) {
logger.error(() -> new ParameterizedMessage("Failed to parse search response for asynchronous search [{}] Response : [{}] ",
Expand All @@ -102,7 +102,7 @@ public Exception getSearchError() {
.decode(asynchronousSearchPersistenceModel.getError())));
try (NamedWriteableAwareStreamInput wrapperStreamInput = new NamedWriteableAwareStreamInput(bytesReference.streamInput(),
namedWriteableRegistry)) {
wrapperStreamInput.setVersion(Version.readVersion(wrapperStreamInput));
wrapperStreamInput.setVersion(wrapperStreamInput.readVersion());
return wrapperStreamInput.readException();
} catch (IOException e) {
logger.error(() -> new ParameterizedMessage("Failed to parse search error for asynchronous search [{}] Error : [{}] ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private String serializeResponse(SearchResponse response) throws IOException {
return null;
}
try (BytesStreamOutput out = new BytesStreamOutput()) {
Version.writeVersion(Version.CURRENT, out);
out.setVersion(Version.CURRENT);
response.writeTo(out);
byte[] bytes = BytesReference.toBytes(out.bytes());
return Base64.getUrlEncoder().withoutPadding().encodeToString(bytes);
Expand All @@ -68,7 +68,7 @@ private String serializeError(Exception error) throws IOException {
return null;
}
try (BytesStreamOutput out = new BytesStreamOutput()) {
Version.writeVersion(Version.CURRENT, out);
out.setVersion(Version.CURRENT);
out.writeException(error instanceof OpenSearchException ? error : new OpenSearchException(error));
byte[] bytes = BytesReference.toBytes(out.bytes());
return Base64.getUrlEncoder().withoutPadding().encodeToString(bytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.Randomness;
import org.opensearch.common.collect.ImmutableOpenMap;
import org.opensearch.common.component.AbstractLifecycleComponent;
import org.opensearch.common.inject.Inject;
import org.opensearch.common.io.stream.StreamInput;
Expand All @@ -46,6 +45,7 @@

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -196,8 +196,8 @@ public final void performCleanUp() {
try (ThreadContext.StoredContext ignore = threadContext.stashContext()) {
// we have to execute under the system context so that if security is enabled the sync is authorized
threadContext.markAsSystemContext();
ImmutableOpenMap<String, DiscoveryNode> dataNodes = clusterService.state().nodes().getDataNodes();
List<DiscoveryNode> nodes = Stream.of(dataNodes.values().toArray(DiscoveryNode.class))
final Map<String, DiscoveryNode> dataNodes = clusterService.state().nodes().getDataNodes();
List<DiscoveryNode> nodes = Stream.of(dataNodes.values().toArray(new DiscoveryNode[0]))
.collect(Collectors.toList());
if (nodes == null || nodes.isEmpty()) {
logger.debug("Found empty data nodes with asynchronous search enabled attribute [{}] for response clean up", dataNodes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.common.Nullable;
import org.opensearch.common.Strings;
import org.opensearch.core.common.Strings;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.unit.TimeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.node.NodeClient;
import org.opensearch.common.Strings;
import org.opensearch.core.common.Strings;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.RestRequest;
import org.opensearch.rest.action.RestActions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.apache.logging.log4j.Logger;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.search.SearchTask;
import org.opensearch.common.Strings;
import org.opensearch.core.common.Strings;
import org.opensearch.tasks.TaskId;

import java.util.Map;
Expand Down

0 comments on commit 14b4195

Please sign in to comment.