Skip to content

Commit

Permalink
Resolve additional compile issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Agrawal <[email protected]>
  • Loading branch information
lezzago committed Aug 21, 2023
1 parent b97bc7d commit 87d738f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected PercolateQueryBuilderExt(String field, Supplier<BytesReference> docume
}
documents = in.readList(StreamInput::readBytesReference);
if (documents.isEmpty() == false) {
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_0_0)) {
documentXContentType = in.readMediaType();
} else {
documentXContentType = in.readEnum(XContentType.class);
Expand Down Expand Up @@ -308,7 +308,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
out.writeBytesReference(document);
}
if (documents.isEmpty() == false) {
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_0_0)) {
documentXContentType.writeTo(out);
} else {
out.writeEnum((XContentType) documentXContentType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ abstract class ODFERestTestCase : OpenSearchRestTestCase() {

val response = client().performRequest(Request("GET", "/_cat/indices?format=json&expand_wildcards=all"))

val xContentType = MediaType.fromMediaType(response.entity.contentType)
val xContentType = MediaType.fromMediaType(response.entity.contentType.value)
xContentType.xContent().createParser(
NamedXContentRegistry.EMPTY,
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.opensearch.cluster.ClusterStateListener
import org.opensearch.cluster.routing.IndexShardRoutingTable
import org.opensearch.cluster.routing.Murmur3HashFunction
import org.opensearch.cluster.service.ClusterService
import org.opensearch.common.Strings
import org.opensearch.common.lifecycle.LifecycleListener
import org.opensearch.common.logging.Loggers
import org.opensearch.common.lucene.uid.Versions
Expand All @@ -34,6 +33,7 @@ import org.opensearch.common.xcontent.LoggingDeprecationHandler
import org.opensearch.common.xcontent.XContentHelper
import org.opensearch.common.xcontent.XContentType
import org.opensearch.commons.alerting.model.ScheduledJob
import org.opensearch.core.common.Strings
import org.opensearch.core.common.bytes.BytesReference
import org.opensearch.core.index.shard.ShardId
import org.opensearch.core.rest.RestStatus
Expand Down

0 comments on commit 87d738f

Please sign in to comment.