Remove unnecessary warning supressions (#32250)
This commit is contained in:
parent
4b3284f7cb
commit
ff87b7aba4
|
@ -21,6 +21,7 @@ package org.elasticsearch.transport.client;
|
||||||
|
|
||||||
import io.netty.util.ThreadDeathWatcher;
|
import io.netty.util.ThreadDeathWatcher;
|
||||||
import io.netty.util.concurrent.GlobalEventExecutor;
|
import io.netty.util.concurrent.GlobalEventExecutor;
|
||||||
|
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
|
|
|
@ -137,7 +137,6 @@ public class ChannelFactoryTests extends ESTestCase {
|
||||||
super(rawChannelFactory);
|
super(rawChannelFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public NioSocketChannel createChannel(NioSelector selector, SocketChannel channel) throws IOException {
|
public NioSocketChannel createChannel(NioSelector selector, SocketChannel channel) throws IOException {
|
||||||
NioSocketChannel nioSocketChannel = new NioSocketChannel(channel);
|
NioSocketChannel nioSocketChannel = new NioSocketChannel(channel);
|
||||||
|
|
|
@ -120,7 +120,6 @@ public class EventHandlerTests extends ESTestCase {
|
||||||
verify(channelFactory, times(2)).acceptNioChannel(same(serverContext), same(selectorSupplier));
|
verify(channelFactory, times(2)).acceptNioChannel(same(serverContext), same(selectorSupplier));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testHandleAcceptCallsServerAcceptCallback() throws IOException {
|
public void testHandleAcceptCallsServerAcceptCallback() throws IOException {
|
||||||
NioSocketChannel childChannel = new NioSocketChannel(mock(SocketChannel.class));
|
NioSocketChannel childChannel = new NioSocketChannel(mock(SocketChannel.class));
|
||||||
SocketChannelContext childContext = mock(SocketChannelContext.class);
|
SocketChannelContext childContext = mock(SocketChannelContext.class);
|
||||||
|
|
|
@ -275,7 +275,6 @@ public class SocketChannelContextTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testCloseClosesChannelBuffer() throws IOException {
|
public void testCloseClosesChannelBuffer() throws IOException {
|
||||||
try (SocketChannel realChannel = SocketChannel.open()) {
|
try (SocketChannel realChannel = SocketChannel.open()) {
|
||||||
when(channel.getRawChannel()).thenReturn(realChannel);
|
when(channel.getRawChannel()).thenReturn(realChannel);
|
||||||
|
|
|
@ -43,7 +43,6 @@ class MultiPassStats {
|
||||||
this.fieldBKey = fieldBName;
|
this.fieldBKey = fieldBName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
void computeStats(final List<Double> fieldA, final List<Double> fieldB) {
|
void computeStats(final List<Double> fieldA, final List<Double> fieldB) {
|
||||||
// set count
|
// set count
|
||||||
count = fieldA.size();
|
count = fieldA.size();
|
||||||
|
|
|
@ -146,7 +146,6 @@ public class JsonProcessorTests extends ESTestCase {
|
||||||
assertThat(exception.getMessage(), equalTo("field [field] not present as part of path [field]"));
|
assertThat(exception.getMessage(), equalTo("field [field] not present as part of path [field]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testAddToRoot() throws Exception {
|
public void testAddToRoot() throws Exception {
|
||||||
String processorTag = randomAlphaOfLength(3);
|
String processorTag = randomAlphaOfLength(3);
|
||||||
String randomTargetField = randomAlphaOfLength(2);
|
String randomTargetField = randomAlphaOfLength(2);
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Map;
|
||||||
|
|
||||||
public class InitializerTests extends ScriptTestCase {
|
public class InitializerTests extends ScriptTestCase {
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"rawtypes"})
|
||||||
public void testArrayInitializers() {
|
public void testArrayInitializers() {
|
||||||
int[] ints = (int[])exec("new int[] {}");
|
int[] ints = (int[])exec("new int[] {}");
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class InitializerTests extends ScriptTestCase {
|
||||||
assertEquals("aaaaaa", objects[3]);
|
assertEquals("aaaaaa", objects[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"rawtypes"})
|
||||||
public void testListInitializers() {
|
public void testListInitializers() {
|
||||||
List list = (List)exec("[]");
|
List list = (List)exec("[]");
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class InitializerTests extends ScriptTestCase {
|
||||||
assertEquals("aaaaaa", list.get(3));
|
assertEquals("aaaaaa", list.get(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"rawtypes"})
|
||||||
public void testMapInitializers() {
|
public void testMapInitializers() {
|
||||||
Map map = (Map)exec("[:]");
|
Map map = (Map)exec("[:]");
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ public class RestUpdateByQueryAction extends AbstractBulkByQueryRestHandler<Upda
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected UpdateByQueryRequest buildRequest(RestRequest request) throws IOException {
|
protected UpdateByQueryRequest buildRequest(RestRequest request) throws IOException {
|
||||||
/*
|
/*
|
||||||
* Passing the search request through UpdateByQueryRequest first allows
|
* Passing the search request through UpdateByQueryRequest first allows
|
||||||
|
|
|
@ -90,7 +90,6 @@ public class SimpleNetty4TransportTests extends AbstractSimpleTransportTestCase
|
||||||
@Override
|
@Override
|
||||||
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
||||||
final Netty4Transport t = (Netty4Transport) transport;
|
final Netty4Transport t = (Netty4Transport) transport;
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
final TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
||||||
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ import io.netty.handler.codec.http.HttpResponseDecoder;
|
||||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||||
import io.netty.handler.codec.http.HttpUtil;
|
import io.netty.handler.codec.http.HttpUtil;
|
||||||
import io.netty.handler.codec.http.HttpVersion;
|
import io.netty.handler.codec.http.HttpVersion;
|
||||||
|
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||||
|
@ -89,7 +90,6 @@ public class HttpReadWriteHandlerTests extends ESTestCase {
|
||||||
private final ResponseDecoder responseDecoder = new ResponseDecoder();
|
private final ResponseDecoder responseDecoder = new ResponseDecoder();
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void setMocks() {
|
public void setMocks() {
|
||||||
transport = mock(NioHttpServerTransport.class);
|
transport = mock(NioHttpServerTransport.class);
|
||||||
Settings settings = Settings.EMPTY;
|
Settings settings = Settings.EMPTY;
|
||||||
|
|
|
@ -95,7 +95,6 @@ public class SimpleNioTransportTests extends AbstractSimpleTransportTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
||||||
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ public class ClusterGetSettingsResponse extends ActionResponse implements ToXCon
|
||||||
static final String TRANSIENT_FIELD = "transient";
|
static final String TRANSIENT_FIELD = "transient";
|
||||||
static final String DEFAULTS_FIELD = "defaults";
|
static final String DEFAULTS_FIELD = "defaults";
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private static final ConstructingObjectParser<ClusterGetSettingsResponse, Void> PARSER =
|
private static final ConstructingObjectParser<ClusterGetSettingsResponse, Void> PARSER =
|
||||||
new ConstructingObjectParser<>(
|
new ConstructingObjectParser<>(
|
||||||
"cluster_get_settings_response",
|
"cluster_get_settings_response",
|
||||||
|
|
|
@ -45,7 +45,6 @@ public class QueryExplanation implements Streamable, ToXContentFragment {
|
||||||
|
|
||||||
public static final int RANDOM_SHARD = -1;
|
public static final int RANDOM_SHARD = -1;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static ConstructingObjectParser<QueryExplanation, Void> PARSER = new ConstructingObjectParser<>(
|
static ConstructingObjectParser<QueryExplanation, Void> PARSER = new ConstructingObjectParser<>(
|
||||||
"query_explanation",
|
"query_explanation",
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -129,7 +129,6 @@ public class GetResponse extends ActionResponse implements Iterable<DocumentFiel
|
||||||
/**
|
/**
|
||||||
* The source of the document (As a map).
|
* The source of the document (As a map).
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked"})
|
|
||||||
public Map<String, Object> getSourceAsMap() throws ElasticsearchParseException {
|
public Map<String, Object> getSourceAsMap() throws ElasticsearchParseException {
|
||||||
return getResult.sourceAsMap();
|
return getResult.sourceAsMap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg;
|
|
||||||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg;
|
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg;
|
||||||
|
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg;
|
||||||
|
|
||||||
public class SimulateProcessorResult implements Writeable, ToXContentObject {
|
public class SimulateProcessorResult implements Writeable, ToXContentObject {
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ public class SimulateProcessorResult implements Writeable, ToXContentObject {
|
||||||
private final WriteableIngestDocument ingestDocument;
|
private final WriteableIngestDocument ingestDocument;
|
||||||
private final Exception failure;
|
private final Exception failure;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private static final ConstructingObjectParser<ElasticsearchException, Void> IGNORED_ERROR_PARSER =
|
private static final ConstructingObjectParser<ElasticsearchException, Void> IGNORED_ERROR_PARSER =
|
||||||
new ConstructingObjectParser<>(
|
new ConstructingObjectParser<>(
|
||||||
"ignored_error_parser",
|
"ignored_error_parser",
|
||||||
|
@ -57,7 +56,6 @@ public class SimulateProcessorResult implements Writeable, ToXContentObject {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static final ConstructingObjectParser<SimulateProcessorResult, Void> PARSER =
|
public static final ConstructingObjectParser<SimulateProcessorResult, Void> PARSER =
|
||||||
new ConstructingObjectParser<>(
|
new ConstructingObjectParser<>(
|
||||||
"simulate_processor_result",
|
"simulate_processor_result",
|
||||||
|
|
|
@ -94,7 +94,6 @@ final class WriteableIngestDocument implements Writeable, ToXContentFragment {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static final ConstructingObjectParser<WriteableIngestDocument, Void> PARSER =
|
public static final ConstructingObjectParser<WriteableIngestDocument, Void> PARSER =
|
||||||
new ConstructingObjectParser<>(
|
new ConstructingObjectParser<>(
|
||||||
"writeable_ingest_document",
|
"writeable_ingest_document",
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.action.support;
|
package org.elasticsearch.action.support;
|
||||||
|
|
||||||
import com.carrotsearch.hppc.cursors.IntObjectCursor;
|
import com.carrotsearch.hppc.cursors.IntObjectCursor;
|
||||||
|
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.cluster.routing.IndexRoutingTable;
|
import org.elasticsearch.cluster.routing.IndexRoutingTable;
|
||||||
|
@ -205,7 +206,7 @@ public final class ActiveShardCount implements Writeable {
|
||||||
if (o == null || getClass() != o.getClass()) {
|
if (o == null || getClass() != o.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") ActiveShardCount that = (ActiveShardCount) o;
|
ActiveShardCount that = (ActiveShardCount) o;
|
||||||
return value == that.value;
|
return value == that.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,6 @@ public abstract class ReplicationRequestBuilder<Request extends ReplicationReque
|
||||||
* shard count is passed in, instead of having to first call {@link ActiveShardCount#from(int)}
|
* shard count is passed in, instead of having to first call {@link ActiveShardCount#from(int)}
|
||||||
* to get the ActiveShardCount.
|
* to get the ActiveShardCount.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public RequestBuilder setWaitForActiveShards(final int waitForActiveShards) {
|
public RequestBuilder setWaitForActiveShards(final int waitForActiveShards) {
|
||||||
return setWaitForActiveShards(ActiveShardCount.from(waitForActiveShards));
|
return setWaitForActiveShards(ActiveShardCount.from(waitForActiveShards));
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.cluster;
|
package org.elasticsearch.cluster;
|
||||||
|
|
||||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.cluster.ClusterState.Custom;
|
import org.elasticsearch.cluster.ClusterState.Custom;
|
||||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||||
|
@ -165,7 +166,7 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
||||||
if (o == null || getClass() != o.getClass()) {
|
if (o == null || getClass() != o.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") Entry entry = (Entry) o;
|
Entry entry = (Entry) o;
|
||||||
return snapshot.equals(entry.snapshot) &&
|
return snapshot.equals(entry.snapshot) &&
|
||||||
state == entry.state &&
|
state == entry.state &&
|
||||||
indices.equals(entry.indices) &&
|
indices.equals(entry.indices) &&
|
||||||
|
@ -291,7 +292,7 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked") ShardRestoreStatus status = (ShardRestoreStatus) o;
|
ShardRestoreStatus status = (ShardRestoreStatus) o;
|
||||||
return state == status.state &&
|
return state == status.state &&
|
||||||
Objects.equals(nodeId, status.nodeId) &&
|
Objects.equals(nodeId, status.nodeId) &&
|
||||||
Objects.equals(reason, status.reason);
|
Objects.equals(reason, status.reason);
|
||||||
|
|
|
@ -161,7 +161,6 @@ public final class IndexGraveyard implements MetaData.Custom {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Diff<MetaData.Custom> diff(final MetaData.Custom previous) {
|
public Diff<MetaData.Custom> diff(final MetaData.Custom previous) {
|
||||||
return new IndexGraveyardDiff((IndexGraveyard) previous, this);
|
return new IndexGraveyardDiff((IndexGraveyard) previous, this);
|
||||||
}
|
}
|
||||||
|
@ -321,7 +320,7 @@ public final class IndexGraveyard implements MetaData.Custom {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IndexGraveyard apply(final MetaData.Custom previous) {
|
public IndexGraveyard apply(final MetaData.Custom previous) {
|
||||||
@SuppressWarnings("unchecked") final IndexGraveyard old = (IndexGraveyard) previous;
|
final IndexGraveyard old = (IndexGraveyard) previous;
|
||||||
if (removedCount > old.tombstones.size()) {
|
if (removedCount > old.tombstones.size()) {
|
||||||
throw new IllegalStateException("IndexGraveyardDiff cannot remove [" + removedCount + "] entries from [" +
|
throw new IllegalStateException("IndexGraveyardDiff cannot remove [" + removedCount + "] entries from [" +
|
||||||
old.tombstones.size() + "] tombstones.");
|
old.tombstones.size() + "] tombstones.");
|
||||||
|
@ -416,7 +415,7 @@ public final class IndexGraveyard implements MetaData.Custom {
|
||||||
if (other == null || getClass() != other.getClass()) {
|
if (other == null || getClass() != other.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") Tombstone that = (Tombstone) other;
|
Tombstone that = (Tombstone) other;
|
||||||
return index.equals(that.index) && deleteDateInMillis == that.deleteDateInMillis;
|
return index.equals(that.index) && deleteDateInMillis == that.deleteDateInMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import com.carrotsearch.hppc.LongArrayList;
|
||||||
import com.carrotsearch.hppc.cursors.IntObjectCursor;
|
import com.carrotsearch.hppc.cursors.IntObjectCursor;
|
||||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.admin.indices.rollover.RolloverInfo;
|
import org.elasticsearch.action.admin.indices.rollover.RolloverInfo;
|
||||||
import org.elasticsearch.action.support.ActiveShardCount;
|
import org.elasticsearch.action.support.ActiveShardCount;
|
||||||
|
@ -685,7 +686,6 @@ public class IndexMetaData implements Diffable<IndexMetaData>, ToXContentFragmen
|
||||||
return lookupPrototypeSafe(key).readFrom(in);
|
return lookupPrototypeSafe(key).readFrom(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public Diff<Custom> readDiff(StreamInput in, String key) throws IOException {
|
public Diff<Custom> readDiff(StreamInput in, String key) throws IOException {
|
||||||
return lookupPrototypeSafe(key).readDiffFrom(in);
|
return lookupPrototypeSafe(key).readDiffFrom(in);
|
||||||
|
|
|
@ -381,7 +381,6 @@ public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaDat
|
||||||
aliases.build(), customs.build());
|
aliases.build(), customs.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static void toXContent(IndexTemplateMetaData indexTemplateMetaData, XContentBuilder builder, ToXContent.Params params)
|
public static void toXContent(IndexTemplateMetaData indexTemplateMetaData, XContentBuilder builder, ToXContent.Params params)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
builder.startObject(indexTemplateMetaData.name());
|
builder.startObject(indexTemplateMetaData.name());
|
||||||
|
|
|
@ -22,6 +22,7 @@ package org.elasticsearch.cluster.metadata;
|
||||||
import com.carrotsearch.hppc.ObjectHashSet;
|
import com.carrotsearch.hppc.ObjectHashSet;
|
||||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.lucene.util.CollectionUtil;
|
import org.apache.lucene.util.CollectionUtil;
|
||||||
import org.elasticsearch.action.AliasesRequest;
|
import org.elasticsearch.action.AliasesRequest;
|
||||||
|
@ -169,7 +170,6 @@ public class MetaData implements Iterable<IndexMetaData>, Diffable<MetaData>, To
|
||||||
|
|
||||||
private final SortedMap<String, AliasOrIndex> aliasAndIndexLookup;
|
private final SortedMap<String, AliasOrIndex> aliasAndIndexLookup;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
MetaData(String clusterUUID, long version, Settings transientSettings, Settings persistentSettings,
|
MetaData(String clusterUUID, long version, Settings transientSettings, Settings persistentSettings,
|
||||||
ImmutableOpenMap<String, IndexMetaData> indices, ImmutableOpenMap<String, IndexTemplateMetaData> templates,
|
ImmutableOpenMap<String, IndexMetaData> indices, ImmutableOpenMap<String, IndexTemplateMetaData> templates,
|
||||||
ImmutableOpenMap<String, Custom> customs, String[] allIndices, String[] allOpenIndices, String[] allClosedIndices,
|
ImmutableOpenMap<String, Custom> customs, String[] allIndices, String[] allOpenIndices, String[] allClosedIndices,
|
||||||
|
@ -1000,7 +1000,7 @@ public class MetaData implements Iterable<IndexMetaData>, Diffable<MetaData>, To
|
||||||
}
|
}
|
||||||
|
|
||||||
public IndexGraveyard indexGraveyard() {
|
public IndexGraveyard indexGraveyard() {
|
||||||
@SuppressWarnings("unchecked") IndexGraveyard graveyard = (IndexGraveyard) getCustom(IndexGraveyard.TYPE);
|
IndexGraveyard graveyard = (IndexGraveyard) getCustom(IndexGraveyard.TYPE);
|
||||||
return graveyard;
|
return graveyard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked") SnapshotRecoverySource that = (SnapshotRecoverySource) o;
|
SnapshotRecoverySource that = (SnapshotRecoverySource) o;
|
||||||
return snapshot.equals(that.snapshot) && index.equals(that.index) && version.equals(that.version);
|
return snapshot.equals(that.snapshot) && index.equals(that.index) && version.equals(that.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ public abstract class AbstractAllocationDecision implements ToXContentFragment,
|
||||||
if (other == null || other instanceof AbstractAllocationDecision == false) {
|
if (other == null || other instanceof AbstractAllocationDecision == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") AbstractAllocationDecision that = (AbstractAllocationDecision) other;
|
AbstractAllocationDecision that = (AbstractAllocationDecision) other;
|
||||||
return Objects.equals(targetNode, that.targetNode) && Objects.equals(nodeDecisions, that.nodeDecisions);
|
return Objects.equals(targetNode, that.targetNode) && Objects.equals(nodeDecisions, that.nodeDecisions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ public class AllocateUnassignedDecision extends AbstractAllocationDecision {
|
||||||
if (other instanceof AllocateUnassignedDecision == false) {
|
if (other instanceof AllocateUnassignedDecision == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") AllocateUnassignedDecision that = (AllocateUnassignedDecision) other;
|
AllocateUnassignedDecision that = (AllocateUnassignedDecision) other;
|
||||||
return Objects.equals(allocationStatus, that.allocationStatus)
|
return Objects.equals(allocationStatus, that.allocationStatus)
|
||||||
&& Objects.equals(allocationId, that.allocationId)
|
&& Objects.equals(allocationId, that.allocationId)
|
||||||
&& reuseStore == that.reuseStore
|
&& reuseStore == that.reuseStore
|
||||||
|
|
|
@ -300,7 +300,7 @@ public final class MoveDecision extends AbstractAllocationDecision {
|
||||||
if (other instanceof MoveDecision == false) {
|
if (other instanceof MoveDecision == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") MoveDecision that = (MoveDecision) other;
|
MoveDecision that = (MoveDecision) other;
|
||||||
return Objects.equals(allocationDecision, that.allocationDecision)
|
return Objects.equals(allocationDecision, that.allocationDecision)
|
||||||
&& Objects.equals(canRemainDecision, that.canRemainDecision)
|
&& Objects.equals(canRemainDecision, that.canRemainDecision)
|
||||||
&& Objects.equals(clusterRebalanceDecision, that.clusterRebalanceDecision)
|
&& Objects.equals(clusterRebalanceDecision, that.clusterRebalanceDecision)
|
||||||
|
|
|
@ -54,7 +54,6 @@ public abstract class AbstractLifecycleComponent extends AbstractComponent imple
|
||||||
listeners.remove(listener);
|
listeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked"})
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
if (!lifecycle.canMoveToStarted()) {
|
if (!lifecycle.canMoveToStarted()) {
|
||||||
|
@ -72,7 +71,6 @@ public abstract class AbstractLifecycleComponent extends AbstractComponent imple
|
||||||
|
|
||||||
protected abstract void doStart();
|
protected abstract void doStart();
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked"})
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if (!lifecycle.canMoveToStopped()) {
|
if (!lifecycle.canMoveToStopped()) {
|
||||||
|
|
|
@ -32,7 +32,6 @@ class ConstructorInjectorStore {
|
||||||
private final FailableCache<TypeLiteral<?>, ConstructorInjector<?>> cache
|
private final FailableCache<TypeLiteral<?>, ConstructorInjector<?>> cache
|
||||||
= new FailableCache<TypeLiteral<?>, ConstructorInjector<?>>() {
|
= new FailableCache<TypeLiteral<?>, ConstructorInjector<?>>() {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected ConstructorInjector<?> create(TypeLiteral<?> type, Errors errors)
|
protected ConstructorInjector<?> create(TypeLiteral<?> type, Errors errors)
|
||||||
throws ErrorsException {
|
throws ErrorsException {
|
||||||
return createConstructor(type, errors);
|
return createConstructor(type, errors);
|
||||||
|
|
|
@ -101,7 +101,6 @@ class TypeConverterBindingProcessor extends AbstractProcessor {
|
||||||
},
|
},
|
||||||
new TypeConverter() {
|
new TypeConverter() {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Object convert(String value, TypeLiteral<?> toType) {
|
public Object convert(String value, TypeLiteral<?> toType) {
|
||||||
try {
|
try {
|
||||||
return Class.forName(value);
|
return Class.forName(value);
|
||||||
|
@ -128,7 +127,6 @@ class TypeConverterBindingProcessor extends AbstractProcessor {
|
||||||
|
|
||||||
TypeConverter typeConverter = new TypeConverter() {
|
TypeConverter typeConverter = new TypeConverter() {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Object convert(String value, TypeLiteral<?> toType) {
|
public Object convert(String value, TypeLiteral<?> toType) {
|
||||||
try {
|
try {
|
||||||
return parser.invoke(null, value);
|
return parser.invoke(null, value);
|
||||||
|
|
|
@ -42,7 +42,6 @@ class AssistedConstructor<T> {
|
||||||
private final ParameterListKey assistedParameters;
|
private final ParameterListKey assistedParameters;
|
||||||
private final List<Parameter> allParameters;
|
private final List<Parameter> allParameters;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
AssistedConstructor(Constructor<T> constructor, List<TypeLiteral<?>> parameterTypes) {
|
AssistedConstructor(Constructor<T> constructor, List<TypeLiteral<?>> parameterTypes) {
|
||||||
this.constructor = constructor;
|
this.constructor = constructor;
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class ProviderMethod<T> implements ProviderWithDependencies<T> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// We know this cast is safe because T is the method's return type.
|
// We know this cast is safe because T is the method's return type.
|
||||||
@SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"})
|
@SuppressWarnings({"unchecked"})
|
||||||
T result = (T) method.invoke(instance, parameters);
|
T result = (T) method.invoke(instance, parameters);
|
||||||
return result;
|
return result;
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
|
|
|
@ -220,7 +220,6 @@ public abstract class Multibinder<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void configure(Binder binder) {
|
public void configure(Binder binder) {
|
||||||
checkConfiguration(!isInitialized(), "Multibinder was already initialized");
|
checkConfiguration(!isInitialized(), "Multibinder was already initialized");
|
||||||
|
|
||||||
|
|
|
@ -78,8 +78,7 @@ public abstract class DefaultBindingTargetVisitor<T, V> implements BindingTarget
|
||||||
|
|
||||||
// javac says it's an error to cast ProviderBinding<? extends T> to Binding<? extends T>
|
// javac says it's an error to cast ProviderBinding<? extends T> to Binding<? extends T>
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public V visit(ProviderBinding<? extends T> providerBinding) {
|
public V visit(ProviderBinding<? extends T> providerBinding) {
|
||||||
return visitOther((Binding<? extends T>) providerBinding);
|
return visitOther(providerBinding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -518,7 +518,6 @@ public abstract class StreamInput extends InputStream {
|
||||||
return (Map<String, Object>) readGenericValue();
|
return (Map<String, Object>) readGenericValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked"})
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Object readGenericValue() throws IOException {
|
public Object readGenericValue() throws IOException {
|
||||||
byte type = readByte();
|
byte type = readByte();
|
||||||
|
|
|
@ -178,7 +178,6 @@ public class GetResult implements Streamable, Iterable<DocumentField>, ToXConten
|
||||||
/**
|
/**
|
||||||
* The source of the document (As a map).
|
* The source of the document (As a map).
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked"})
|
|
||||||
public Map<String, Object> sourceAsMap() throws ElasticsearchParseException {
|
public Map<String, Object> sourceAsMap() throws ElasticsearchParseException {
|
||||||
if (source == null) {
|
if (source == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -197,7 +197,6 @@ public class DocumentMapper implements ToXContentFragment {
|
||||||
return mapping.root;
|
return mapping.root;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked"})
|
|
||||||
public <T extends MetadataFieldMapper> T metadataMapper(Class<T> type) {
|
public <T extends MetadataFieldMapper> T metadataMapper(Class<T> type) {
|
||||||
return mapping.metadataMapper(type);
|
return mapping.metadataMapper(type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,6 @@ public class NodePersistentTasksExecutor {
|
||||||
task.markAsFailed(e);
|
task.markAsFailed(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
protected void doRun() throws Exception {
|
protected void doRun() throws Exception {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -85,7 +85,6 @@ public class PersistentTasksClusterService extends AbstractComponent implements
|
||||||
listener.onFailure(e);
|
listener.onFailure(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
|
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
|
||||||
PersistentTasksCustomMetaData tasks = newState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
|
PersistentTasksCustomMetaData tasks = newState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
|
||||||
|
|
|
@ -33,7 +33,6 @@ public class PersistentTasksExecutorRegistry extends AbstractComponent {
|
||||||
|
|
||||||
private final Map<String, PersistentTasksExecutor<?>> taskExecutors;
|
private final Map<String, PersistentTasksExecutor<?>> taskExecutors;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public PersistentTasksExecutorRegistry(Settings settings, Collection<PersistentTasksExecutor<?>> taskExecutors) {
|
public PersistentTasksExecutorRegistry(Settings settings, Collection<PersistentTasksExecutor<?>> taskExecutors) {
|
||||||
super(settings);
|
super(settings);
|
||||||
Map<String, PersistentTasksExecutor<?>> map = new HashMap<>();
|
Map<String, PersistentTasksExecutor<?>> map = new HashMap<>();
|
||||||
|
|
|
@ -89,7 +89,7 @@ public final class IndexId implements Writeable, ToXContentObject {
|
||||||
if (o == null || getClass() != o.getClass()) {
|
if (o == null || getClass() != o.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") IndexId that = (IndexId) o;
|
IndexId that = (IndexId) o;
|
||||||
return Objects.equals(name, that.name) && Objects.equals(id, that.id);
|
return Objects.equals(name, that.name) && Objects.equals(id, that.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ public final class RepositoryData {
|
||||||
if (obj == null || getClass() != obj.getClass()) {
|
if (obj == null || getClass() != obj.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") RepositoryData that = (RepositoryData) obj;
|
RepositoryData that = (RepositoryData) obj;
|
||||||
return snapshotIds.equals(that.snapshotIds)
|
return snapshotIds.equals(that.snapshotIds)
|
||||||
&& snapshotStates.equals(that.snapshotStates)
|
&& snapshotStates.equals(that.snapshotStates)
|
||||||
&& indices.equals(that.indices)
|
&& indices.equals(that.indices)
|
||||||
|
|
|
@ -247,7 +247,6 @@ public class InternalComposite
|
||||||
this.formats = formats;
|
this.formats = formats;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
InternalBucket(StreamInput in, List<String> sourceNames, List<DocValueFormat> formats, int[] reverseMuls) throws IOException {
|
InternalBucket(StreamInput in, List<String> sourceNames, List<DocValueFormat> formats, int[] reverseMuls) throws IOException {
|
||||||
this.key = new CompositeKey(in);
|
this.key = new CompositeKey(in);
|
||||||
this.docCount = in.readVLong();
|
this.docCount = in.readVLong();
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
|
||||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -358,7 +357,6 @@ public class RangeAggregator extends BucketsAggregator {
|
||||||
private final InternalRange.Factory factory;
|
private final InternalRange.Factory factory;
|
||||||
private final DocValueFormat format;
|
private final DocValueFormat format;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Unmapped(String name, R[] ranges, boolean keyed, DocValueFormat format,
|
public Unmapped(String name, R[] ranges, boolean keyed, DocValueFormat format,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
Aggregator parent, InternalRange.Factory factory, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
|
Aggregator parent, InternalRange.Factory factory, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData)
|
||||||
|
|
|
@ -62,7 +62,6 @@ public class MovFnPipelineAggregationBuilder extends AbstractPipelineAggregation
|
||||||
private static final Function<String, ConstructingObjectParser<MovFnPipelineAggregationBuilder, Void>> PARSER
|
private static final Function<String, ConstructingObjectParser<MovFnPipelineAggregationBuilder, Void>> PARSER
|
||||||
= name -> {
|
= name -> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
ConstructingObjectParser<MovFnPipelineAggregationBuilder, Void> parser = new ConstructingObjectParser<>(
|
ConstructingObjectParser<MovFnPipelineAggregationBuilder, Void> parser = new ConstructingObjectParser<>(
|
||||||
MovFnPipelineAggregationBuilder.NAME,
|
MovFnPipelineAggregationBuilder.NAME,
|
||||||
false,
|
false,
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class ValuesSourceConfig<VS extends ValuesSource> {
|
||||||
|
|
||||||
if (field == null) {
|
if (field == null) {
|
||||||
if (script == null) {
|
if (script == null) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
ValuesSourceConfig<VS> config = new ValuesSourceConfig<>(ValuesSourceType.ANY);
|
ValuesSourceConfig<VS> config = new ValuesSourceConfig<>(ValuesSourceType.ANY);
|
||||||
config.format(resolveFormat(null, valueType));
|
config.format(resolveFormat(null, valueType));
|
||||||
return config;
|
return config;
|
||||||
|
|
|
@ -90,7 +90,6 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
||||||
private DistanceUnit unit = DistanceUnit.DEFAULT;
|
private DistanceUnit unit = DistanceUnit.DEFAULT;
|
||||||
|
|
||||||
private SortMode sortMode = null;
|
private SortMode sortMode = null;
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
private QueryBuilder nestedFilter;
|
private QueryBuilder nestedFilter;
|
||||||
private String nestedPath;
|
private String nestedPath;
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public final class Snapshot implements Writeable {
|
||||||
if (o == null || getClass() != o.getClass()) {
|
if (o == null || getClass() != o.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") Snapshot that = (Snapshot) o;
|
Snapshot that = (Snapshot) o;
|
||||||
return repository.equals(that.repository) && snapshotId.equals(that.snapshotId);
|
return repository.equals(that.repository) && snapshotId.equals(that.snapshotId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.snapshots;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
|
||||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -98,7 +97,7 @@ public final class SnapshotId implements Comparable<SnapshotId>, Writeable, ToXC
|
||||||
if (o == null || getClass() != o.getClass()) {
|
if (o == null || getClass() != o.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unchecked") final SnapshotId that = (SnapshotId) o;
|
final SnapshotId that = (SnapshotId) o;
|
||||||
return name.equals(that.name) && uuid.equals(that.uuid);
|
return name.equals(that.name) && uuid.equals(that.uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.threadpool;
|
||||||
|
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.lucene.util.Counter;
|
import org.apache.lucene.util.Counter;
|
||||||
import org.elasticsearch.core.internal.io.IOUtils;
|
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.component.AbstractComponent;
|
import org.elasticsearch.common.component.AbstractComponent;
|
||||||
|
@ -38,6 +37,7 @@ import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
import org.elasticsearch.common.util.concurrent.XRejectedExecutionHandler;
|
import org.elasticsearch.common.util.concurrent.XRejectedExecutionHandler;
|
||||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
import org.elasticsearch.core.internal.io.IOUtils;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
|
@ -197,7 +197,7 @@ public class ThreadPool extends AbstractComponent implements Scheduler, Closeabl
|
||||||
threadContext = new ThreadContext(settings);
|
threadContext = new ThreadContext(settings);
|
||||||
|
|
||||||
final Map<String, ExecutorHolder> executors = new HashMap<>();
|
final Map<String, ExecutorHolder> executors = new HashMap<>();
|
||||||
for (@SuppressWarnings("unchecked") final Map.Entry<String, ExecutorBuilder> entry : builders.entrySet()) {
|
for (final Map.Entry<String, ExecutorBuilder> entry : builders.entrySet()) {
|
||||||
final ExecutorBuilder.ExecutorSettings executorSettings = entry.getValue().getSettings(settings);
|
final ExecutorBuilder.ExecutorSettings executorSettings = entry.getValue().getSettings(settings);
|
||||||
final ExecutorHolder executorHolder = entry.getValue().build(executorSettings, threadContext);
|
final ExecutorHolder executorHolder = entry.getValue().build(executorSettings, threadContext);
|
||||||
if (executors.containsKey(executorHolder.info.getName())) {
|
if (executors.containsKey(executorHolder.info.getName())) {
|
||||||
|
@ -338,6 +338,7 @@ public class ThreadPool extends AbstractComponent implements Scheduler, Closeabl
|
||||||
* the ScheduledFuture will cannot interact with it.
|
* the ScheduledFuture will cannot interact with it.
|
||||||
* @throws org.elasticsearch.common.util.concurrent.EsRejectedExecutionException if the task cannot be scheduled for execution
|
* @throws org.elasticsearch.common.util.concurrent.EsRejectedExecutionException if the task cannot be scheduled for execution
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ScheduledFuture<?> schedule(TimeValue delay, String executor, Runnable command) {
|
public ScheduledFuture<?> schedule(TimeValue delay, String executor, Runnable command) {
|
||||||
if (!Names.SAME.equals(executor)) {
|
if (!Names.SAME.equals(executor)) {
|
||||||
command = new ThreadedRunnable(command, executor(executor));
|
command = new ThreadedRunnable(command, executor(executor));
|
||||||
|
@ -358,6 +359,7 @@ public class ThreadPool extends AbstractComponent implements Scheduler, Closeabl
|
||||||
command, executor), e));
|
command, executor), e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Runnable preserveContext(Runnable command) {
|
public Runnable preserveContext(Runnable command) {
|
||||||
return getThreadContext().preserveContext(command);
|
return getThreadContext().preserveContext(command);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ public interface TransportResponseHandler<T extends TransportResponse> extends W
|
||||||
*
|
*
|
||||||
* @return the deserialized response.
|
* @return the deserialized response.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Override
|
@Override
|
||||||
default T read(StreamInput in) throws IOException {
|
default T read(StreamInput in) throws IOException {
|
||||||
T instance = newInstance();
|
T instance = newInstance();
|
||||||
|
|
|
@ -153,7 +153,6 @@ public class IndicesStatsTests extends ESSingleNodeTestCase {
|
||||||
assertEquals(0, common.refresh.getListeners());
|
assertEquals(0, common.refresh.getListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testUuidOnRootStatsIndices() {
|
public void testUuidOnRootStatsIndices() {
|
||||||
String uuid = createIndex("test").indexUUID();
|
String uuid = createIndex("test").indexUUID();
|
||||||
IndicesStatsResponse rsp = client().admin().indices().prepareStats().get();
|
IndicesStatsResponse rsp = client().admin().indices().prepareStats().get();
|
||||||
|
|
|
@ -672,7 +672,6 @@ public class MetaDataTests extends ESTestCase {
|
||||||
public static void assertLeafs(Map<String, Object> properties, String... fields) {
|
public static void assertLeafs(Map<String, Object> properties, String... fields) {
|
||||||
for (String field : fields) {
|
for (String field : fields) {
|
||||||
assertTrue(properties.containsKey(field));
|
assertTrue(properties.containsKey(field));
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<String, Object> fieldProp = (Map<String, Object>)properties.get(field);
|
Map<String, Object> fieldProp = (Map<String, Object>)properties.get(field);
|
||||||
assertNotNull(fieldProp);
|
assertNotNull(fieldProp);
|
||||||
assertFalse(fieldProp.containsKey("properties"));
|
assertFalse(fieldProp.containsKey("properties"));
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class BlobStoreRepositoryTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
logger.info("--> make sure the node's repository can resolve the snapshots");
|
logger.info("--> make sure the node's repository can resolve the snapshots");
|
||||||
final RepositoriesService repositoriesService = getInstanceFromNode(RepositoriesService.class);
|
final RepositoriesService repositoriesService = getInstanceFromNode(RepositoriesService.class);
|
||||||
@SuppressWarnings("unchecked") final BlobStoreRepository repository =
|
final BlobStoreRepository repository =
|
||||||
(BlobStoreRepository) repositoriesService.repository(repositoryName);
|
(BlobStoreRepository) repositoriesService.repository(repositoryName);
|
||||||
final List<SnapshotId> originalSnapshots = Arrays.asList(snapshotId1, snapshotId2);
|
final List<SnapshotId> originalSnapshots = Arrays.asList(snapshotId1, snapshotId2);
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ public class BlobStoreRepositoryTests extends ESSingleNodeTestCase {
|
||||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||||
|
|
||||||
final RepositoriesService repositoriesService = getInstanceFromNode(RepositoriesService.class);
|
final RepositoriesService repositoriesService = getInstanceFromNode(RepositoriesService.class);
|
||||||
@SuppressWarnings("unchecked") final BlobStoreRepository repository =
|
final BlobStoreRepository repository =
|
||||||
(BlobStoreRepository) repositoriesService.repository(repositoryName);
|
(BlobStoreRepository) repositoriesService.repository(repositoryName);
|
||||||
assertThat("getBlobContainer has to be lazy initialized", repository.getBlobContainer(), nullValue());
|
assertThat("getBlobContainer has to be lazy initialized", repository.getBlobContainer(), nullValue());
|
||||||
return repository;
|
return repository;
|
||||||
|
|
|
@ -32,9 +32,9 @@ import org.elasticsearch.search.aggregations.AggregationTestScriptsPlugin;
|
||||||
import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode;
|
import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode;
|
||||||
import org.elasticsearch.search.aggregations.BucketOrder;
|
import org.elasticsearch.search.aggregations.BucketOrder;
|
||||||
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
|
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
|
||||||
|
import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude;
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket;
|
import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket;
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude;
|
|
||||||
import org.elasticsearch.search.aggregations.metrics.avg.Avg;
|
import org.elasticsearch.search.aggregations.metrics.avg.Avg;
|
||||||
import org.elasticsearch.search.aggregations.metrics.max.Max;
|
import org.elasticsearch.search.aggregations.metrics.max.Max;
|
||||||
import org.elasticsearch.search.aggregations.metrics.stats.Stats;
|
import org.elasticsearch.search.aggregations.metrics.stats.Stats;
|
||||||
|
@ -84,7 +84,6 @@ public class DoubleTermsIT extends AbstractTermsTestCase {
|
||||||
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ public class LongTermsIT extends AbstractTermsTestCase {
|
||||||
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ package org.elasticsearch.search.aggregations.bucket;
|
||||||
import com.carrotsearch.hppc.LongHashSet;
|
import com.carrotsearch.hppc.LongHashSet;
|
||||||
import com.carrotsearch.hppc.LongSet;
|
import com.carrotsearch.hppc.LongSet;
|
||||||
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
||||||
|
|
||||||
import org.elasticsearch.action.index.IndexRequestBuilder;
|
import org.elasticsearch.action.index.IndexRequestBuilder;
|
||||||
import org.elasticsearch.action.search.SearchRequest;
|
import org.elasticsearch.action.search.SearchRequest;
|
||||||
import org.elasticsearch.action.search.SearchResponse;
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
|
@ -77,7 +78,6 @@ public class MinDocCountIT extends AbstractTermsTestCase {
|
||||||
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@ public class RangeIT extends ESIntegTestCase {
|
||||||
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
||||||
|
|
||||||
|
|
|
@ -1746,7 +1746,6 @@ public class CompositeAggregatorTests extends AggregatorTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private static Map<String, Object> createAfterKey(Object... fields) {
|
private static Map<String, Object> createAfterKey(Object... fields) {
|
||||||
assert fields.length % 2 == 0;
|
assert fields.length % 2 == 0;
|
||||||
final Map<String, Object> map = new HashMap<>();
|
final Map<String, Object> map = new HashMap<>();
|
||||||
|
|
|
@ -36,9 +36,6 @@ import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode;
|
||||||
import org.elasticsearch.search.aggregations.BucketOrder;
|
import org.elasticsearch.search.aggregations.BucketOrder;
|
||||||
import org.elasticsearch.search.aggregations.bucket.AbstractTermsTestCase;
|
import org.elasticsearch.search.aggregations.bucket.AbstractTermsTestCase;
|
||||||
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
|
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude;
|
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregatorFactory;
|
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket;
|
import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket;
|
||||||
import org.elasticsearch.search.aggregations.metrics.avg.Avg;
|
import org.elasticsearch.search.aggregations.metrics.avg.Avg;
|
||||||
import org.elasticsearch.search.aggregations.metrics.stats.Stats;
|
import org.elasticsearch.search.aggregations.metrics.stats.Stats;
|
||||||
|
@ -103,7 +100,6 @@ public class StringTermsIT extends AbstractTermsTestCase {
|
||||||
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
public static class CustomScriptPlugin extends AggregationTestScriptsPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
Map<String, Function<Map<String, Object>, Object>> scripts = super.pluginScripts();
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,6 @@ public class CumulativeSumAggregatorTests extends AggregatorTestCase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void executeTestCase(Query query, AggregationBuilder aggBuilder, Consumer<InternalAggregation> verify) throws IOException {
|
private void executeTestCase(Query query, AggregationBuilder aggBuilder, Consumer<InternalAggregation> verify) throws IOException {
|
||||||
executeTestCase(query, aggBuilder, verify, indexWriter -> {
|
executeTestCase(query, aggBuilder, verify, indexWriter -> {
|
||||||
Document document = new Document();
|
Document document = new Document();
|
||||||
|
@ -282,7 +281,6 @@ public class CumulativeSumAggregatorTests extends AggregatorTestCase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void executeTestCase(Query query, AggregationBuilder aggBuilder, Consumer<InternalAggregation> verify,
|
private void executeTestCase(Query query, AggregationBuilder aggBuilder, Consumer<InternalAggregation> verify,
|
||||||
CheckedConsumer<RandomIndexWriter, IOException> setup) throws IOException {
|
CheckedConsumer<RandomIndexWriter, IOException> setup) throws IOException {
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,6 @@ public class MovFnUnitTests extends AggregatorTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void executeTestCase(Query query,
|
private void executeTestCase(Query query,
|
||||||
DateHistogramAggregationBuilder aggBuilder,
|
DateHistogramAggregationBuilder aggBuilder,
|
||||||
Consumer<Histogram> verify,
|
Consumer<Histogram> verify,
|
||||||
|
|
|
@ -96,7 +96,6 @@ public class SearchFieldsIT extends ESIntegTestCase {
|
||||||
public static class CustomScriptPlugin extends MockScriptPlugin {
|
public static class CustomScriptPlugin extends MockScriptPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
||||||
|
|
||||||
|
@ -143,7 +142,6 @@ public class SearchFieldsIT extends ESIntegTestCase {
|
||||||
return scripts;
|
return scripts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static Object fieldsScript(Map<String, Object> vars, String fieldName) {
|
static Object fieldsScript(Map<String, Object> vars, String fieldName) {
|
||||||
Map<?, ?> fields = (Map) vars.get("_fields");
|
Map<?, ?> fields = (Map) vars.get("_fields");
|
||||||
FieldLookup fieldLookup = (FieldLookup) fields.get(fieldName);
|
FieldLookup fieldLookup = (FieldLookup) fields.get(fieldName);
|
||||||
|
@ -156,7 +154,6 @@ public class SearchFieldsIT extends ESIntegTestCase {
|
||||||
return XContentMapValues.extractValue(path, source);
|
return XContentMapValues.extractValue(path, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static Object docScript(Map<String, Object> vars, String fieldName) {
|
static Object docScript(Map<String, Object> vars, String fieldName) {
|
||||||
Map<?, ?> doc = (Map) vars.get("doc");
|
Map<?, ?> doc = (Map) vars.get("doc");
|
||||||
ScriptDocValues<?> values = (ScriptDocValues<?>) doc.get(fieldName);
|
ScriptDocValues<?> values = (ScriptDocValues<?>) doc.get(fieldName);
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.script.MockScriptPlugin;
|
import org.elasticsearch.script.MockScriptPlugin;
|
||||||
import org.elasticsearch.script.ScoreAccessor;
|
import org.elasticsearch.script.ScoreAccessor;
|
||||||
import org.elasticsearch.script.Script;
|
import org.elasticsearch.script.Script;
|
||||||
|
import org.elasticsearch.script.ScriptType;
|
||||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
|
||||||
|
@ -48,8 +49,6 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
||||||
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction;
|
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction;
|
||||||
|
|
||||||
import org.elasticsearch.script.ScriptType;
|
|
||||||
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
|
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
|
||||||
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
|
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
|
@ -70,7 +69,6 @@ public class FunctionScoreIT extends ESIntegTestCase {
|
||||||
public static class CustomScriptPlugin extends MockScriptPlugin {
|
public static class CustomScriptPlugin extends MockScriptPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
||||||
scripts.put("1", vars -> 1.0d);
|
scripts.put("1", vars -> 1.0d);
|
||||||
|
|
|
@ -67,7 +67,6 @@ public class RandomScoreFunctionIT extends ESIntegTestCase {
|
||||||
public static class CustomScriptPlugin extends MockScriptPlugin {
|
public static class CustomScriptPlugin extends MockScriptPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
||||||
|
|
||||||
|
@ -84,7 +83,6 @@ public class RandomScoreFunctionIT extends ESIntegTestCase {
|
||||||
return scripts;
|
return scripts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static Double scoringScript(Map<String, Object> vars, Function<ScoreAccessor, Number> scoring) {
|
static Double scoringScript(Map<String, Object> vars, Function<ScoreAccessor, Number> scoring) {
|
||||||
Map<?, ?> doc = (Map) vars.get("doc");
|
Map<?, ?> doc = (Map) vars.get("doc");
|
||||||
Double index = ((Number) ((ScriptDocValues<?>) doc.get("index")).getValues().get(0)).doubleValue();
|
Double index = ((Number) ((ScriptDocValues<?>) doc.get("index")).getValues().get(0)).doubleValue();
|
||||||
|
|
|
@ -86,7 +86,6 @@ import static org.hamcrest.Matchers.nullValue;
|
||||||
public class FieldSortIT extends ESIntegTestCase {
|
public class FieldSortIT extends ESIntegTestCase {
|
||||||
public static class CustomScriptPlugin extends MockScriptPlugin {
|
public static class CustomScriptPlugin extends MockScriptPlugin {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||||
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
Map<String, Function<Map<String, Object>, Object>> scripts = new HashMap<>();
|
||||||
scripts.put("doc['number'].value", vars -> sortDoubleScript(vars));
|
scripts.put("doc['number'].value", vars -> sortDoubleScript(vars));
|
||||||
|
@ -94,14 +93,12 @@ public class FieldSortIT extends ESIntegTestCase {
|
||||||
return scripts;
|
return scripts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static Double sortDoubleScript(Map<String, Object> vars) {
|
static Double sortDoubleScript(Map<String, Object> vars) {
|
||||||
Map<?, ?> doc = (Map) vars.get("doc");
|
Map<?, ?> doc = (Map) vars.get("doc");
|
||||||
Double index = ((Number) ((ScriptDocValues<?>) doc.get("number")).getValues().get(0)).doubleValue();
|
Double index = ((Number) ((ScriptDocValues<?>) doc.get("number")).getValues().get(0)).doubleValue();
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static String sortStringScript(Map<String, Object> vars) {
|
static String sortStringScript(Map<String, Object> vars) {
|
||||||
Map<?, ?> doc = (Map) vars.get("doc");
|
Map<?, ?> doc = (Map) vars.get("doc");
|
||||||
String value = ((String) ((ScriptDocValues<?>) doc.get("keyword")).getValues().get(0));
|
String value = ((String) ((ScriptDocValues<?>) doc.get("keyword")).getValues().get(0));
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.elasticsearch.index.fielddata.ScriptDocValues;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.script.MockScriptPlugin;
|
import org.elasticsearch.script.MockScriptPlugin;
|
||||||
import org.elasticsearch.script.Script;
|
import org.elasticsearch.script.Script;
|
||||||
|
import org.elasticsearch.script.ScriptType;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.search.sort.ScriptSortBuilder.ScriptSortType;
|
import org.elasticsearch.search.sort.ScriptSortBuilder.ScriptSortType;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
@ -50,8 +51,6 @@ import java.util.function.Function;
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
||||||
|
|
||||||
import org.elasticsearch.script.ScriptType;
|
|
||||||
import static org.elasticsearch.search.sort.SortBuilders.scriptSort;
|
import static org.elasticsearch.search.sort.SortBuilders.scriptSort;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
|
@ -104,7 +103,6 @@ public class SimpleSortIT extends ESIntegTestCase {
|
||||||
/**
|
/**
|
||||||
* Return the minimal value from a set of values.
|
* Return the minimal value from a set of values.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
static <T extends Comparable<T>> T getMinValueScript(Map<String, Object> vars, T initialValue, String fieldName,
|
static <T extends Comparable<T>> T getMinValueScript(Map<String, Object> vars, T initialValue, String fieldName,
|
||||||
Function<Object, T> converter) {
|
Function<Object, T> converter) {
|
||||||
T retval = initialValue;
|
T retval = initialValue;
|
||||||
|
|
|
@ -248,7 +248,7 @@ public abstract class ESBlobStoreRepositoryIntegTestCase extends ESIntegTestCase
|
||||||
logger.info("--> verify index folder deleted from blob container");
|
logger.info("--> verify index folder deleted from blob container");
|
||||||
RepositoriesService repositoriesSvc = internalCluster().getInstance(RepositoriesService.class, internalCluster().getMasterName());
|
RepositoriesService repositoriesSvc = internalCluster().getInstance(RepositoriesService.class, internalCluster().getMasterName());
|
||||||
ThreadPool threadPool = internalCluster().getInstance(ThreadPool.class, internalCluster().getMasterName());
|
ThreadPool threadPool = internalCluster().getInstance(ThreadPool.class, internalCluster().getMasterName());
|
||||||
@SuppressWarnings("unchecked") BlobStoreRepository repository = (BlobStoreRepository) repositoriesSvc.repository(repoName);
|
BlobStoreRepository repository = (BlobStoreRepository) repositoriesSvc.repository(repoName);
|
||||||
|
|
||||||
final SetOnce<BlobContainer> indicesBlobContainer = new SetOnce<>();
|
final SetOnce<BlobContainer> indicesBlobContainer = new SetOnce<>();
|
||||||
final SetOnce<RepositoryData> repositoryData = new SetOnce<>();
|
final SetOnce<RepositoryData> repositoryData = new SetOnce<>();
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
|
||||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||||
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
||||||
import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter;
|
import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
@ -1070,7 +1071,6 @@ public abstract class ESTestCase extends LuceneTestCase {
|
||||||
List<Object> targetList = new ArrayList<>();
|
List<Object> targetList = new ArrayList<>();
|
||||||
for(Object value : list) {
|
for(Object value : list) {
|
||||||
if (value instanceof Map) {
|
if (value instanceof Map) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
LinkedHashMap<String, Object> valueMap = (LinkedHashMap<String, Object>) value;
|
LinkedHashMap<String, Object> valueMap = (LinkedHashMap<String, Object>) value;
|
||||||
targetList.add(shuffleMap(valueMap, exceptFields));
|
targetList.add(shuffleMap(valueMap, exceptFields));
|
||||||
} else if(value instanceof List) {
|
} else if(value instanceof List) {
|
||||||
|
@ -1090,7 +1090,6 @@ public abstract class ESTestCase extends LuceneTestCase {
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
Object value = map.get(key);
|
Object value = map.get(key);
|
||||||
if (value instanceof Map && exceptFields.contains(key) == false) {
|
if (value instanceof Map && exceptFields.contains(key) == false) {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
LinkedHashMap<String, Object> valueMap = (LinkedHashMap<String, Object>) value;
|
LinkedHashMap<String, Object> valueMap = (LinkedHashMap<String, Object>) value;
|
||||||
targetMap.put(key, shuffleMap(valueMap, exceptFields));
|
targetMap.put(key, shuffleMap(valueMap, exceptFields));
|
||||||
} else if(value instanceof List && exceptFields.contains(key) == false) {
|
} else if(value instanceof List && exceptFields.contains(key) == false) {
|
||||||
|
|
|
@ -49,6 +49,8 @@ import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.xcontent.DeprecationHandler;
|
import org.elasticsearch.common.xcontent.DeprecationHandler;
|
||||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||||
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.common.xcontent.XContentType;
|
import org.elasticsearch.common.xcontent.XContentType;
|
||||||
import org.elasticsearch.rest.RestStatus;
|
import org.elasticsearch.rest.RestStatus;
|
||||||
|
@ -685,7 +687,6 @@ public class ElasticsearchAssertions {
|
||||||
/**
|
/**
|
||||||
* Compares two lists recursively, but using arrays comparisons for byte[] through Arrays.equals(byte[], byte[])
|
* Compares two lists recursively, but using arrays comparisons for byte[] through Arrays.equals(byte[], byte[])
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private static void assertListEquals(List<Object> expected, List<Object> actual) {
|
private static void assertListEquals(List<Object> expected, List<Object> actual) {
|
||||||
assertEquals(expected.size(), actual.size());
|
assertEquals(expected.size(), actual.size());
|
||||||
Iterator<Object> actualIterator = actual.iterator();
|
Iterator<Object> actualIterator = actual.iterator();
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class GreaterThanAssertion extends Assertion {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected void doAssert(Object actualValue, Object expectedValue) {
|
protected void doAssert(Object actualValue, Object expectedValue) {
|
||||||
logger.trace("assert that [{}] is greater than [{}] (field: [{}])", actualValue, expectedValue, getField());
|
logger.trace("assert that [{}] is greater than [{}] (field: [{}])", actualValue, expectedValue, getField());
|
||||||
assertThat("value of [" + getField() + "] is not comparable (got [" + safeClass(actualValue) + "])",
|
assertThat("value of [" + getField() + "] is not comparable (got [" + safeClass(actualValue) + "])",
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class MockTcpTransportTests extends AbstractSimpleTransportTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
||||||
final MockTcpTransport t = (MockTcpTransport) transport;
|
final MockTcpTransport t = (MockTcpTransport) transport;
|
||||||
@SuppressWarnings("unchecked") final TcpTransport.NodeChannels channels =
|
final TcpTransport.NodeChannels channels =
|
||||||
(TcpTransport.NodeChannels) connection;
|
(TcpTransport.NodeChannels) connection;
|
||||||
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,6 @@ public class SimpleMockNioTransportTests extends AbstractSimpleTransportTestCase
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
||||||
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,6 @@ public class SecurityClient {
|
||||||
* Clears the realm caches. It's possible to clear all user entries from all realms in the cluster or alternatively
|
* Clears the realm caches. It's possible to clear all user entries from all realms in the cluster or alternatively
|
||||||
* select the realms (by their unique names) and/or users (by their usernames) that should be evicted.
|
* select the realms (by their unique names) and/or users (by their usernames) that should be evicted.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public ClearRealmCacheRequestBuilder prepareClearRealmCache() {
|
public ClearRealmCacheRequestBuilder prepareClearRealmCache() {
|
||||||
return new ClearRealmCacheRequestBuilder(client);
|
return new ClearRealmCacheRequestBuilder(client);
|
||||||
}
|
}
|
||||||
|
@ -109,7 +108,6 @@ public class SecurityClient {
|
||||||
* Clears the realm caches. It's possible to clear all user entries from all realms in the cluster or alternatively
|
* Clears the realm caches. It's possible to clear all user entries from all realms in the cluster or alternatively
|
||||||
* select the realms (by their unique names) and/or users (by their usernames) that should be evicted.
|
* select the realms (by their unique names) and/or users (by their usernames) that should be evicted.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void clearRealmCache(ClearRealmCacheRequest request, ActionListener<ClearRealmCacheResponse> listener) {
|
public void clearRealmCache(ClearRealmCacheRequest request, ActionListener<ClearRealmCacheResponse> listener) {
|
||||||
client.execute(ClearRealmCacheAction.INSTANCE, request, listener);
|
client.execute(ClearRealmCacheAction.INSTANCE, request, listener);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +116,6 @@ public class SecurityClient {
|
||||||
* Clears the realm caches. It's possible to clear all user entries from all realms in the cluster or alternatively
|
* Clears the realm caches. It's possible to clear all user entries from all realms in the cluster or alternatively
|
||||||
* select the realms (by their unique names) and/or users (by their usernames) that should be evicted.
|
* select the realms (by their unique names) and/or users (by their usernames) that should be evicted.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public ActionFuture<ClearRealmCacheResponse> clearRealmCache(ClearRealmCacheRequest request) {
|
public ActionFuture<ClearRealmCacheResponse> clearRealmCache(ClearRealmCacheRequest request) {
|
||||||
return client.execute(ClearRealmCacheAction.INSTANCE, request);
|
return client.execute(ClearRealmCacheAction.INSTANCE, request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,6 @@ public class IndexUpgradeAction extends Action<BulkByScrollResponse> {
|
||||||
/**
|
/**
|
||||||
* Sets the index.
|
* Sets the index.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public final Request index(String index) {
|
public final Request index(String index) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -37,7 +37,6 @@ public class MlRestTestStateCleaner {
|
||||||
final Request datafeedsRequest = new Request("GET", "/_xpack/ml/datafeeds");
|
final Request datafeedsRequest = new Request("GET", "/_xpack/ml/datafeeds");
|
||||||
datafeedsRequest.addParameter("filter_path", "datafeeds");
|
datafeedsRequest.addParameter("filter_path", "datafeeds");
|
||||||
final Response datafeedsResponse = adminClient.performRequest(datafeedsRequest);
|
final Response datafeedsResponse = adminClient.performRequest(datafeedsRequest);
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final List<Map<String, Object>> datafeeds =
|
final List<Map<String, Object>> datafeeds =
|
||||||
(List<Map<String, Object>>) XContentMapValues.extractValue("datafeeds", ESRestTestCase.entityAsMap(datafeedsResponse));
|
(List<Map<String, Object>>) XContentMapValues.extractValue("datafeeds", ESRestTestCase.entityAsMap(datafeedsResponse));
|
||||||
if (datafeeds == null) {
|
if (datafeeds == null) {
|
||||||
|
|
|
@ -147,7 +147,6 @@ public class AnomalyRecordTests extends AbstractSerializingTestCase<AnomalyRecor
|
||||||
assertEquals(Arrays.asList("yes", "no"), serialisedSpoilerFieldValues);
|
assertEquals(Arrays.asList("yes", "no"), serialisedSpoilerFieldValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testToXContentDoesNotIncludesReservedWordInputFields() throws IOException {
|
public void testToXContentDoesNotIncludesReservedWordInputFields() throws IOException {
|
||||||
AnomalyRecord record = createTestInstance();
|
AnomalyRecord record = createTestInstance();
|
||||||
record.setByFieldName(AnomalyRecord.BUCKET_SPAN.getPreferredName());
|
record.setByFieldName(AnomalyRecord.BUCKET_SPAN.getPreferredName());
|
||||||
|
@ -157,7 +156,7 @@ public class AnomalyRecordTests extends AbstractSerializingTestCase<AnomalyRecor
|
||||||
XContentParser parser = createParser(XContentType.JSON.xContent(), bytes);
|
XContentParser parser = createParser(XContentType.JSON.xContent(), bytes);
|
||||||
Object value = parser.map().get(AnomalyRecord.BUCKET_SPAN.getPreferredName());
|
Object value = parser.map().get(AnomalyRecord.BUCKET_SPAN.getPreferredName());
|
||||||
assertNotEquals("bar", value);
|
assertNotEquals("bar", value);
|
||||||
assertEquals((Long)record.getBucketSpan(), (Long)value);
|
assertEquals(record.getBucketSpan(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testId() {
|
public void testId() {
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class RollupRestTestStateCleaner {
|
||||||
private static void deleteAllJobs(RestClient adminClient) throws Exception {
|
private static void deleteAllJobs(RestClient adminClient) throws Exception {
|
||||||
Response response = adminClient.performRequest("GET", "/_xpack/rollup/job/_all");
|
Response response = adminClient.performRequest("GET", "/_xpack/rollup/job/_all");
|
||||||
Map<String, Object> jobs = ESRestTestCase.entityAsMap(response);
|
Map<String, Object> jobs = ESRestTestCase.entityAsMap(response);
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Map<String, Object>> jobConfigs =
|
List<Map<String, Object>> jobConfigs =
|
||||||
(List<Map<String, Object>>) XContentMapValues.extractValue("jobs", jobs);
|
(List<Map<String, Object>>) XContentMapValues.extractValue("jobs", jobs);
|
||||||
|
|
||||||
|
|
|
@ -43,13 +43,13 @@ import org.elasticsearch.xpack.core.ml.action.util.QueryPage;
|
||||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||||
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex;
|
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex;
|
||||||
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
|
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
|
||||||
import org.elasticsearch.xpack.ml.job.persistence.InfluencersQueryBuilder.InfluencersQuery;
|
|
||||||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot;
|
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot;
|
||||||
import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord;
|
import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord;
|
||||||
import org.elasticsearch.xpack.core.ml.job.results.Bucket;
|
import org.elasticsearch.xpack.core.ml.job.results.Bucket;
|
||||||
import org.elasticsearch.xpack.core.ml.job.results.CategoryDefinition;
|
import org.elasticsearch.xpack.core.ml.job.results.CategoryDefinition;
|
||||||
import org.elasticsearch.xpack.core.ml.job.results.Influencer;
|
import org.elasticsearch.xpack.core.ml.job.results.Influencer;
|
||||||
import org.elasticsearch.xpack.core.ml.job.results.Result;
|
import org.elasticsearch.xpack.core.ml.job.results.Result;
|
||||||
|
import org.elasticsearch.xpack.ml.job.persistence.InfluencersQueryBuilder.InfluencersQuery;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -252,7 +252,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
|
|
||||||
BucketsQueryBuilder bq = new BucketsQueryBuilder().from(from).size(size).anomalyScoreThreshold(1.0);
|
BucketsQueryBuilder bq = new BucketsQueryBuilder().from(from).size(size).anomalyScoreThreshold(1.0);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<Bucket>[] holder = new QueryPage[1];
|
QueryPage<Bucket>[] holder = new QueryPage[1];
|
||||||
provider.buckets(jobId, bq, r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
provider.buckets(jobId, bq, r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
||||||
QueryPage<Bucket> buckets = holder[0];
|
QueryPage<Bucket> buckets = holder[0];
|
||||||
|
@ -286,7 +286,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
BucketsQueryBuilder bq = new BucketsQueryBuilder().from(from).size(size).anomalyScoreThreshold(5.1)
|
BucketsQueryBuilder bq = new BucketsQueryBuilder().from(from).size(size).anomalyScoreThreshold(5.1)
|
||||||
.includeInterim(true);
|
.includeInterim(true);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<Bucket>[] holder = new QueryPage[1];
|
QueryPage<Bucket>[] holder = new QueryPage[1];
|
||||||
provider.buckets(jobId, bq, r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
provider.buckets(jobId, bq, r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
||||||
QueryPage<Bucket> buckets = holder[0];
|
QueryPage<Bucket> buckets = holder[0];
|
||||||
|
@ -322,7 +322,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
bq.anomalyScoreThreshold(5.1);
|
bq.anomalyScoreThreshold(5.1);
|
||||||
bq.includeInterim(true);
|
bq.includeInterim(true);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<Bucket>[] holder = new QueryPage[1];
|
QueryPage<Bucket>[] holder = new QueryPage[1];
|
||||||
provider.buckets(jobId, bq, r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
provider.buckets(jobId, bq, r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
||||||
QueryPage<Bucket> buckets = holder[0];
|
QueryPage<Bucket> buckets = holder[0];
|
||||||
|
@ -368,7 +368,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
BucketsQueryBuilder bq = new BucketsQueryBuilder();
|
BucketsQueryBuilder bq = new BucketsQueryBuilder();
|
||||||
bq.timestamp(Long.toString(now.getTime()));
|
bq.timestamp(Long.toString(now.getTime()));
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<Bucket>[] bucketHolder = new QueryPage[1];
|
QueryPage<Bucket>[] bucketHolder = new QueryPage[1];
|
||||||
provider.buckets(jobId, bq, q -> bucketHolder[0] = q, e -> {}, client);
|
provider.buckets(jobId, bq, q -> bucketHolder[0] = q, e -> {}, client);
|
||||||
assertThat(bucketHolder[0].count(), equalTo(1L));
|
assertThat(bucketHolder[0].count(), equalTo(1L));
|
||||||
|
@ -409,7 +409,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
.epochEnd(String.valueOf(now.getTime())).includeInterim(true).sortField(sortfield)
|
.epochEnd(String.valueOf(now.getTime())).includeInterim(true).sortField(sortfield)
|
||||||
.recordScore(2.2);
|
.recordScore(2.2);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<AnomalyRecord>[] holder = new QueryPage[1];
|
QueryPage<AnomalyRecord>[] holder = new QueryPage[1];
|
||||||
provider.records(jobId, rqb, page -> holder[0] = page, RuntimeException::new, client);
|
provider.records(jobId, rqb, page -> holder[0] = page, RuntimeException::new, client);
|
||||||
QueryPage<AnomalyRecord> recordPage = holder[0];
|
QueryPage<AnomalyRecord> recordPage = holder[0];
|
||||||
|
@ -462,7 +462,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
rqb.sortField(sortfield);
|
rqb.sortField(sortfield);
|
||||||
rqb.recordScore(2.2);
|
rqb.recordScore(2.2);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<AnomalyRecord>[] holder = new QueryPage[1];
|
QueryPage<AnomalyRecord>[] holder = new QueryPage[1];
|
||||||
provider.records(jobId, rqb, page -> holder[0] = page, RuntimeException::new, client);
|
provider.records(jobId, rqb, page -> holder[0] = page, RuntimeException::new, client);
|
||||||
QueryPage<AnomalyRecord> recordPage = holder[0];
|
QueryPage<AnomalyRecord> recordPage = holder[0];
|
||||||
|
@ -507,7 +507,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
Client client = getMockedClient(qb -> {}, response);
|
Client client = getMockedClient(qb -> {}, response);
|
||||||
JobProvider provider = createProvider(client);
|
JobProvider provider = createProvider(client);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<AnomalyRecord>[] holder = new QueryPage[1];
|
QueryPage<AnomalyRecord>[] holder = new QueryPage[1];
|
||||||
provider.bucketRecords(jobId, bucket, from, size, true, sortfield, true, page -> holder[0] = page, RuntimeException::new,
|
provider.bucketRecords(jobId, bucket, from, size, true, sortfield, true, page -> holder[0] = page, RuntimeException::new,
|
||||||
client);
|
client);
|
||||||
|
@ -568,7 +568,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
Client client = getMockedClient(q -> {}, response);
|
Client client = getMockedClient(q -> {}, response);
|
||||||
|
|
||||||
JobProvider provider = createProvider(client);
|
JobProvider provider = createProvider(client);
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<CategoryDefinition>[] holder = new QueryPage[1];
|
QueryPage<CategoryDefinition>[] holder = new QueryPage[1];
|
||||||
provider.categoryDefinitions(jobId, null, false, from, size, r -> holder[0] = r,
|
provider.categoryDefinitions(jobId, null, false, from, size, r -> holder[0] = r,
|
||||||
e -> {throw new RuntimeException(e);}, client);
|
e -> {throw new RuntimeException(e);}, client);
|
||||||
|
@ -590,7 +590,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
SearchResponse response = createSearchResponse(Collections.singletonList(source));
|
SearchResponse response = createSearchResponse(Collections.singletonList(source));
|
||||||
Client client = getMockedClient(q -> {}, response);
|
Client client = getMockedClient(q -> {}, response);
|
||||||
JobProvider provider = createProvider(client);
|
JobProvider provider = createProvider(client);
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<CategoryDefinition>[] holder = new QueryPage[1];
|
QueryPage<CategoryDefinition>[] holder = new QueryPage[1];
|
||||||
provider.categoryDefinitions(jobId, categoryId, false, null, null,
|
provider.categoryDefinitions(jobId, categoryId, false, null, null,
|
||||||
r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
r -> holder[0] = r, e -> {throw new RuntimeException(e);}, client);
|
||||||
|
@ -632,7 +632,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
Client client = getMockedClient(q -> qbHolder[0] = q, response);
|
Client client = getMockedClient(q -> qbHolder[0] = q, response);
|
||||||
JobProvider provider = createProvider(client);
|
JobProvider provider = createProvider(client);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<Influencer>[] holder = new QueryPage[1];
|
QueryPage<Influencer>[] holder = new QueryPage[1];
|
||||||
InfluencersQuery query = new InfluencersQueryBuilder().from(from).size(size).includeInterim(false).build();
|
InfluencersQuery query = new InfluencersQueryBuilder().from(from).size(size).includeInterim(false).build();
|
||||||
provider.influencers(jobId, query, page -> holder[0] = page, RuntimeException::new, client);
|
provider.influencers(jobId, query, page -> holder[0] = page, RuntimeException::new, client);
|
||||||
|
@ -692,7 +692,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
Client client = getMockedClient(q -> qbHolder[0] = q, response);
|
Client client = getMockedClient(q -> qbHolder[0] = q, response);
|
||||||
JobProvider provider = createProvider(client);
|
JobProvider provider = createProvider(client);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<Influencer>[] holder = new QueryPage[1];
|
QueryPage<Influencer>[] holder = new QueryPage[1];
|
||||||
InfluencersQuery query = new InfluencersQueryBuilder().from(from).size(size).start("0").end("0").sortField("sort")
|
InfluencersQuery query = new InfluencersQueryBuilder().from(from).size(size).start("0").end("0").sortField("sort")
|
||||||
.sortDescending(true).influencerScoreThreshold(0.0).includeInterim(true).build();
|
.sortDescending(true).influencerScoreThreshold(0.0).includeInterim(true).build();
|
||||||
|
@ -747,7 +747,7 @@ public class JobProviderTests extends ESTestCase {
|
||||||
Client client = getMockedClient(qb -> {}, response);
|
Client client = getMockedClient(qb -> {}, response);
|
||||||
JobProvider provider = createProvider(client);
|
JobProvider provider = createProvider(client);
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
QueryPage<ModelSnapshot>[] holder = new QueryPage[1];
|
QueryPage<ModelSnapshot>[] holder = new QueryPage[1];
|
||||||
provider.modelSnapshots(jobId, from, size, r -> holder[0] = r, RuntimeException::new);
|
provider.modelSnapshots(jobId, from, size, r -> holder[0] = r, RuntimeException::new);
|
||||||
QueryPage<ModelSnapshot> page = holder[0];
|
QueryPage<ModelSnapshot> page = holder[0];
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class JobResultsPersisterTests extends ESTestCase {
|
||||||
verifyNoMoreInteractions(client);
|
verifyNoMoreInteractions(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked"})
|
||||||
private Client mockClient(ArgumentCaptor<BulkRequest> captor) {
|
private Client mockClient(ArgumentCaptor<BulkRequest> captor) {
|
||||||
Client client = mock(Client.class);
|
Client client = mock(Client.class);
|
||||||
ThreadPool threadPool = mock(ThreadPool.class);
|
ThreadPool threadPool = mock(ThreadPool.class);
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class ScoresUpdaterTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void setUpMocks() throws IOException {
|
public void setUpMocks() throws IOException {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ import org.elasticsearch.threadpool.ThreadPoolStats;
|
||||||
import org.elasticsearch.xpack.core.XPackSettings;
|
import org.elasticsearch.xpack.core.XPackSettings;
|
||||||
import org.elasticsearch.xpack.core.action.XPackUsageRequestBuilder;
|
import org.elasticsearch.xpack.core.action.XPackUsageRequestBuilder;
|
||||||
import org.elasticsearch.xpack.core.action.XPackUsageResponse;
|
import org.elasticsearch.xpack.core.action.XPackUsageResponse;
|
||||||
|
import org.elasticsearch.xpack.core.monitoring.MonitoredSystem;
|
||||||
|
import org.elasticsearch.xpack.core.monitoring.MonitoringFeatureSetUsage;
|
||||||
import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkRequestBuilder;
|
import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkRequestBuilder;
|
||||||
import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkResponse;
|
import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkResponse;
|
||||||
import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils;
|
import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils;
|
||||||
import org.elasticsearch.xpack.core.monitoring.MonitoredSystem;
|
|
||||||
import org.elasticsearch.xpack.core.monitoring.MonitoringFeatureSetUsage;
|
|
||||||
import org.elasticsearch.xpack.monitoring.LocalStateMonitoring;
|
import org.elasticsearch.xpack.monitoring.LocalStateMonitoring;
|
||||||
import org.elasticsearch.xpack.monitoring.MonitoringService;
|
import org.elasticsearch.xpack.monitoring.MonitoringService;
|
||||||
import org.elasticsearch.xpack.monitoring.collector.cluster.ClusterStatsMonitoringDoc;
|
import org.elasticsearch.xpack.monitoring.collector.cluster.ClusterStatsMonitoringDoc;
|
||||||
|
@ -112,7 +112,6 @@ public class MonitoringIT extends ESSingleNodeTestCase {
|
||||||
* This test uses the Monitoring Bulk API to index document as an external application like Kibana would do. It
|
* This test uses the Monitoring Bulk API to index document as an external application like Kibana would do. It
|
||||||
* then ensure that the documents were correctly indexed and have the expected information.
|
* then ensure that the documents were correctly indexed and have the expected information.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testMonitoringBulk() throws Exception {
|
public void testMonitoringBulk() throws Exception {
|
||||||
whenExportersAreReady(() -> {
|
whenExportersAreReady(() -> {
|
||||||
final MonitoredSystem system = randomSystem();
|
final MonitoredSystem system = randomSystem();
|
||||||
|
@ -188,7 +187,6 @@ public class MonitoringIT extends ESSingleNodeTestCase {
|
||||||
* have been indexed with the expected information.
|
* have been indexed with the expected information.
|
||||||
*/
|
*/
|
||||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29880")
|
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29880")
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void testMonitoringService() throws Exception {
|
public void testMonitoringService() throws Exception {
|
||||||
final boolean createAPMIndex = randomBoolean();
|
final boolean createAPMIndex = randomBoolean();
|
||||||
final String indexName = createAPMIndex ? "apm-2017.11.06" : "books";
|
final String indexName = createAPMIndex ? "apm-2017.11.06" : "books";
|
||||||
|
@ -284,7 +282,6 @@ public class MonitoringIT extends ESSingleNodeTestCase {
|
||||||
* Asserts that the source_node information (provided as a Map) of a monitoring document correspond to
|
* Asserts that the source_node information (provided as a Map) of a monitoring document correspond to
|
||||||
* the current local node information
|
* the current local node information
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void assertMonitoringDocSourceNode(final Map<String, Object> sourceNode) {
|
private void assertMonitoringDocSourceNode(final Map<String, Object> sourceNode) {
|
||||||
assertEquals(6, sourceNode.size());
|
assertEquals(6, sourceNode.size());
|
||||||
|
|
||||||
|
@ -541,7 +538,6 @@ public class MonitoringIT extends ESSingleNodeTestCase {
|
||||||
/**
|
/**
|
||||||
* Disable the monitoring service and the Local exporter.
|
* Disable the monitoring service and the Local exporter.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void disableMonitoring() throws Exception {
|
public void disableMonitoring() throws Exception {
|
||||||
final Settings settings = Settings.builder()
|
final Settings settings = Settings.builder()
|
||||||
.putNull("xpack.monitoring.collection.enabled")
|
.putNull("xpack.monitoring.collection.enabled")
|
||||||
|
|
|
@ -541,7 +541,6 @@ public class AuthenticationService extends AbstractComponent {
|
||||||
|
|
||||||
private final RestRequest request;
|
private final RestRequest request;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
AuditableRestRequest(AuditTrail auditTrail, AuthenticationFailureHandler failureHandler, ThreadContext threadContext,
|
AuditableRestRequest(AuditTrail auditTrail, AuthenticationFailureHandler failureHandler, ThreadContext threadContext,
|
||||||
RestRequest request) {
|
RestRequest request) {
|
||||||
super(auditTrail, failureHandler, threadContext);
|
super(auditTrail, failureHandler, threadContext);
|
||||||
|
|
|
@ -58,7 +58,6 @@ public class RestAuthenticateActionTests extends SecurityIntegTestCase {
|
||||||
assertThat(response.getStatusLine().getStatusCode(), is(200));
|
assertThat(response.getStatusLine().getStatusCode(), is(200));
|
||||||
ObjectPath objectPath = ObjectPath.createFromResponse(response);
|
ObjectPath objectPath = ObjectPath.createFromResponse(response);
|
||||||
assertThat(objectPath.evaluate("username").toString(), equalTo(SecuritySettingsSource.TEST_USER_NAME));
|
assertThat(objectPath.evaluate("username").toString(), equalTo(SecuritySettingsSource.TEST_USER_NAME));
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<String> roles = objectPath.evaluate("roles");
|
List<String> roles = objectPath.evaluate("roles");
|
||||||
assertThat(roles.size(), is(1));
|
assertThat(roles.size(), is(1));
|
||||||
assertThat(roles, contains(SecuritySettingsSource.TEST_ROLE));
|
assertThat(roles, contains(SecuritySettingsSource.TEST_ROLE));
|
||||||
|
|
|
@ -35,9 +35,6 @@ import org.elasticsearch.xpack.core.common.socket.SocketAccess;
|
||||||
import org.elasticsearch.xpack.core.ssl.SSLConfiguration;
|
import org.elasticsearch.xpack.core.ssl.SSLConfiguration;
|
||||||
import org.elasticsearch.xpack.core.ssl.SSLService;
|
import org.elasticsearch.xpack.core.ssl.SSLService;
|
||||||
|
|
||||||
import javax.net.SocketFactory;
|
|
||||||
import javax.net.ssl.HandshakeCompletedListener;
|
|
||||||
import javax.net.ssl.SSLSocket;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
|
@ -47,6 +44,10 @@ import java.util.Collections;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
import javax.net.SocketFactory;
|
||||||
|
import javax.net.ssl.HandshakeCompletedListener;
|
||||||
|
import javax.net.ssl.SSLSocket;
|
||||||
|
|
||||||
import static java.util.Collections.emptyMap;
|
import static java.util.Collections.emptyMap;
|
||||||
import static java.util.Collections.emptySet;
|
import static java.util.Collections.emptySet;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
|
@ -119,7 +120,6 @@ public class SimpleSecurityNioTransportTests extends AbstractSimpleTransportTest
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
|
||||||
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
package org.elasticsearch.xpack.test.rest;
|
package org.elasticsearch.xpack.test.rest;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||||
|
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.client.Response;
|
import org.elasticsearch.client.Response;
|
||||||
|
@ -219,7 +220,6 @@ public class XPackRestIT extends ESClientYamlSuiteTestCase {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final Map<String, Object> node = (Map<String, Object>) nodes.values().iterator().next();
|
final Map<String, Object> node = (Map<String, Object>) nodes.values().iterator().next();
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final Number activeWrites = (Number) extractValue("thread_pool.write.active", node);
|
final Number activeWrites = (Number) extractValue("thread_pool.write.active", node);
|
||||||
return activeWrites != null && activeWrites.longValue() == 0L;
|
return activeWrites != null && activeWrites.longValue() == 0L;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ package org.elasticsearch.xpack.security.authc.ldap;
|
||||||
|
|
||||||
import com.unboundid.ldap.sdk.LDAPException;
|
import com.unboundid.ldap.sdk.LDAPException;
|
||||||
import com.unboundid.ldap.sdk.ResultCode;
|
import com.unboundid.ldap.sdk.ResultCode;
|
||||||
|
|
||||||
import org.elasticsearch.action.support.PlainActionFuture;
|
import org.elasticsearch.action.support.PlainActionFuture;
|
||||||
import org.elasticsearch.common.settings.SecureString;
|
import org.elasticsearch.common.settings.SecureString;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -302,7 +303,6 @@ public class ActiveDirectorySessionFactoryTests extends AbstractActiveDirectoryT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29840")
|
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/29840")
|
||||||
public void testHandlingLdapReferralErrors() throws Exception {
|
public void testHandlingLdapReferralErrors() throws Exception {
|
||||||
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
|
|
Loading…
Reference in New Issue