Merge branch 'master' into pom_gen
This commit is contained in:
commit
3d1be071c9
|
@ -176,10 +176,8 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
|
|||
String body = matcher.group("body")
|
||||
String catchPart = last ? snippet.catchPart : null
|
||||
if (pathAndQuery.startsWith('/')) {
|
||||
// Why not do some light linting while we're here?
|
||||
throw new InvalidUserDataException(
|
||||
"Path shouldn't start with a '/': $snippet\n"
|
||||
+ snippet.contents)
|
||||
// Leading '/'s break the generated paths
|
||||
pathAndQuery = pathAndQuery.substring(1)
|
||||
}
|
||||
emitDo(method, pathAndQuery, body, catchPart)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ActionRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ReplicationResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]health[/\\]ClusterHealthRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]health[/\\]ClusterHealthResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]health[/\\]TransportClusterHealthAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]node[/\\]hotthreads[/\\]NodesHotThreadsRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]node[/\\]hotthreads[/\\]TransportNodesHotThreadsAction.java" checks="LineLength" />
|
||||
|
@ -61,7 +60,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]snapshots[/\\]status[/\\]TransportSnapshotsStatusAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]state[/\\]ClusterStateRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]state[/\\]TransportClusterStateAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]stats[/\\]ClusterStatsIndices.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]stats[/\\]ClusterStatsNodeResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]stats[/\\]ClusterStatsRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]stats[/\\]TransportClusterStatsAction.java" checks="LineLength" />
|
||||
|
@ -178,21 +176,17 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]IngestActionFilter.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]IngestProxyActionFilter.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]PutPipelineTransportAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulateExecutionService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulatePipelineRequest.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulatePipelineRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulatePipelineTransportAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]MultiPercolateRequest.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]MultiPercolateRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]PercolateRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]PercolateResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]PercolateShardResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]TransportMultiPercolateAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]TransportPercolateAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]percolate[/\\]TransportShardMultiPercolateAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]search[/\\]MultiSearchRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]search[/\\]SearchPhaseExecutionException.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]search[/\\]SearchRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]search[/\\]SearchResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]search[/\\]ShardSearchFailure.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]search[/\\]TransportClearScrollAction.java" checks="LineLength" />
|
||||
|
@ -201,10 +195,8 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]ActionFilter.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]AutoCreateIndex.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]DelegatingActionListener.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]DestructiveOperations.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]HandledTransportAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]IndicesOptions.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]ThreadedActionListener.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]ToXContentToBytes.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]broadcast[/\\]BroadcastOperationRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]broadcast[/\\]BroadcastRequest.java" checks="LineLength" />
|
||||
|
@ -216,13 +208,11 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]MasterNodeOperationRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]MasterNodeReadOperationRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]TransportMasterNodeAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]TransportMasterNodeReadAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]info[/\\]ClusterInfoRequest.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]info[/\\]ClusterInfoRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]master[/\\]info[/\\]TransportClusterInfoAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]nodes[/\\]NodesOperationRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]nodes[/\\]TransportNodesAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]replication[/\\]ReplicationRequest.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]replication[/\\]ReplicationRequestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]replication[/\\]TransportBroadcastReplicationAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]support[/\\]single[/\\]instance[/\\]InstanceShardOperationRequestBuilder.java" checks="LineLength" />
|
||||
|
@ -251,7 +241,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]bootstrap[/\\]JarHell.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]bootstrap[/\\]Seccomp.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]bootstrap[/\\]Security.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cache[/\\]recycler[/\\]PageCacheRecycler.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]client[/\\]ElasticsearchClient.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]client[/\\]FilterClient.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]client[/\\]node[/\\]NodeClient.java" checks="LineLength" />
|
||||
|
@ -267,7 +256,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]InternalClusterInfoService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]LocalNodeMasterListener.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]SnapshotsInProgress.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]action[/\\]index[/\\]MappingUpdatedAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]action[/\\]index[/\\]NodeIndexDeletedAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]action[/\\]index[/\\]NodeMappingRefreshAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]action[/\\]shard[/\\]ShardStateAction.java" checks="LineLength" />
|
||||
|
@ -375,8 +363,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]zen[/\\]publish[/\\]PendingClusterStatesQueue.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]zen[/\\]publish[/\\]PublishClusterStateAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]env[/\\]ESFileStore.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]env[/\\]Environment.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]env[/\\]NodeEnvironment.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gateway[/\\]AsyncShardFetch.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gateway[/\\]DanglingIndicesState.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gateway[/\\]GatewayAllocator.java" checks="LineLength" />
|
||||
|
@ -392,21 +378,16 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]IndexSettings.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]IndexingSlowLog.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]MergePolicyConfig.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]MergeSchedulerConfig.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]NodeServicesProvider.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]SearchSlowLog.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]AnalysisRegistry.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]AnalysisService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]CommonGramsTokenFilterFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]CustomAnalyzerProvider.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]EdgeNGramTokenizerFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]NumericDoubleAnalyzer.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]ShingleTokenFilterFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]StemmerOverrideTokenFilterFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]StopTokenFilterFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]compound[/\\]HyphenationCompoundWordTokenFilterFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]cache[/\\]bitset[/\\]BitsetFilterCache.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]cache[/\\]request[/\\]ShardRequestCache.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]codec[/\\]PerFieldMappingPostingFormatCodec.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]engine[/\\]ElasticsearchConcurrentMergeScheduler.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]engine[/\\]Engine.java" checks="LineLength" />
|
||||
|
@ -420,16 +401,13 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]fieldcomparator[/\\]FloatValuesComparatorSource.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]fieldcomparator[/\\]LongValuesComparatorSource.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ordinals[/\\]GlobalOrdinalsBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ordinals[/\\]GlobalOrdinalsIndexFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ordinals[/\\]InternalGlobalOrdinalsIndexFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ordinals[/\\]MultiOrdinals.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ordinals[/\\]OrdinalsBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ordinals[/\\]SinglePackedOrdinals.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]AbstractAtomicParentChildFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]AbstractIndexGeoPointFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]AbstractIndexOrdinalsFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]BinaryDVIndexFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]GeoPointArrayIndexFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]PagedBytesIndexFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]ParentChildIndexFieldData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]plain[/\\]SortedNumericDVIndexFieldData.java" checks="LineLength" />
|
||||
|
@ -481,9 +459,7 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]percolator[/\\]PercolatorQueriesRegistry.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]AbstractQueryBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]MatchQueryParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]MoreLikeThisQueryBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]QueryBuilders.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]QueryShardContext.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]QueryValidationException.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]support[/\\]InnerHitsQueryParserHelper.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]support[/\\]QueryParsers.java" checks="LineLength" />
|
||||
|
@ -500,7 +476,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]shard[/\\]ShardStateMetaData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]shard[/\\]StoreRecovery.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]shard[/\\]TranslogRecoveryPerformer.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]similarity[/\\]SimilarityService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]snapshots[/\\]blobstore[/\\]BlobStoreIndexShardRepository.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]snapshots[/\\]blobstore[/\\]BlobStoreIndexShardSnapshots.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]store[/\\]IndexStore.java" checks="LineLength" />
|
||||
|
@ -530,28 +505,21 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]recovery[/\\]RecoveryFailedException.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]recovery[/\\]RecoverySettings.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]recovery[/\\]RecoverySource.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]recovery[/\\]RecoverySourceHandler.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]recovery[/\\]RecoveryState.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]recovery[/\\]StartRecoveryRequest.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]store[/\\]IndicesStore.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]store[/\\]TransportNodesListShardStoreMetaData.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]ttl[/\\]IndicesTTLService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]IngestMetadata.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]PipelineExecutionService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]PipelineStore.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]CompoundProcessor.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]IngestDocument.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]Pipeline.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]processor[/\\]ConvertProcessor.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]fs[/\\]FsService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]DeadlockAnalyzer.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]GcNames.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]HotThreads.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmGcMonitorService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmStats.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]os[/\\]OsService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]process[/\\]ProcessService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]node[/\\]Node.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]node[/\\]internal[/\\]InternalSettingsPreparer.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]percolator[/\\]PercolatorQuery.java" checks="LineLength" />
|
||||
|
@ -569,13 +537,11 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]fs[/\\]FsRepository.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]uri[/\\]URLIndexShardRepository.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]uri[/\\]URLRepository.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]BaseRestHandler.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]BytesRestResponse.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]RestController.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]health[/\\]RestClusterHealthAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]node[/\\]info[/\\]RestNodesInfoAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]node[/\\]stats[/\\]RestNodesStatsAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]reroute[/\\]RestClusterRerouteAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]settings[/\\]RestClusterGetSettingsAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]settings[/\\]RestClusterUpdateSettingsAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]cluster[/\\]state[/\\]RestClusterStateAction.java" checks="LineLength" />
|
||||
|
@ -596,20 +562,16 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]bulk[/\\]RestBulkAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestCountAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestIndicesAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestNodeAttrsAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestNodesAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestPendingClusterTasksAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestShardsAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]cat[/\\]RestThreadPoolAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]get[/\\]RestMultiGetAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]index[/\\]RestIndexAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]main[/\\]RestMainAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]percolate[/\\]RestPercolateAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]script[/\\]RestDeleteIndexedScriptAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]script[/\\]RestPutIndexedScriptAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]search[/\\]RestClearScrollAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]search[/\\]RestMultiSearchAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]search[/\\]RestSearchAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]search[/\\]RestSearchScrollAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]suggest[/\\]RestSuggestAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]support[/\\]RestActions.java" checks="LineLength" />
|
||||
|
@ -626,7 +588,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]MultiValueMode.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]SearchService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]AggregatorFactories.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]AggregatorFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]InternalAggregation.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]InternalMultiBucketAggregation.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]ValuesSourceAggregationBuilder.java" checks="LineLength" />
|
||||
|
@ -639,10 +600,8 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]filters[/\\]FiltersParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]filters[/\\]InternalFilters.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]geogrid[/\\]GeoHashGridAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]geogrid[/\\]GeoHashGridParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]global[/\\]GlobalAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]global[/\\]InternalGlobal.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]histogram[/\\]DateHistogramParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]histogram[/\\]HistogramAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]missing[/\\]InternalMissing.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]missing[/\\]MissingAggregator.java" checks="LineLength" />
|
||||
|
@ -651,10 +610,7 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]nested[/\\]ReverseNestedAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]InternalRange.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]RangeAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]date[/\\]DateRangeParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]date[/\\]InternalDateRange.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]geodistance[/\\]GeoDistanceParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]geodistance[/\\]InternalGeoDistance.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]range[/\\]ipv4[/\\]InternalIPv4Range.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]sampler[/\\]DiversifiedBytesHashSamplerAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]sampler[/\\]DiversifiedMapSamplerAggregator.java" checks="LineLength" />
|
||||
|
@ -665,15 +621,11 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]GlobalOrdinalsSignificantTermsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]InternalSignificantTerms.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantLongTerms.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantLongTermsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantStringTerms.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantStringTermsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantTermsAggregatorFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantTermsParametersParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]SignificantTermsParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]UnmappedSignificantTerms.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]heuristics[/\\]GND.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]heuristics[/\\]JLHScore.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]heuristics[/\\]NXYSignificanceHeuristic.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]heuristics[/\\]PercentageScore.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]significant[/\\]heuristics[/\\]ScriptHeuristic.java" checks="LineLength" />
|
||||
|
@ -691,37 +643,23 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]TermsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]TermsAggregatorFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]TermsParametersParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]TermsParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]UnmappedTerms.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]terms[/\\]support[/\\]IncludeExclude.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]ValuesSourceMetricsAggregationBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]cardinality[/\\]CardinalityAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]cardinality[/\\]CardinalityAggregatorFactory.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]cardinality[/\\]HyperLogLogPlusPlus.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]geobounds[/\\]GeoBoundsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]geobounds[/\\]InternalGeoBounds.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]percentiles[/\\]AbstractPercentilesParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]percentiles[/\\]tdigest[/\\]AbstractTDigestPercentilesAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]percentiles[/\\]tdigest[/\\]TDigestPercentileRanksAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]percentiles[/\\]tdigest[/\\]TDigestPercentilesAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]scripted[/\\]InternalScriptedMetric.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]scripted[/\\]ScriptedMetricAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]stats[/\\]StatsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]stats[/\\]extended[/\\]ExtendedStatsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]stats[/\\]extended[/\\]ExtendedStatsParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]stats[/\\]extended[/\\]InternalExtendedStats.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]metrics[/\\]tophits[/\\]TopHitsAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]BucketHelpers.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]bucketmetrics[/\\]BucketMetricsParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]bucketmetrics[/\\]avg[/\\]AvgBucketPipelineAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]bucketscript[/\\]BucketScriptPipelineAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]cumulativesum[/\\]CumulativeSumPipelineAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]derivative[/\\]DerivativePipelineAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]derivative[/\\]InternalDerivative.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]pipeline[/\\]having[/\\]BucketSelectorPipelineAggregator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]AggregationContext.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]AggregationPath.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]GeoPointParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]ValuesSourceParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]format[/\\]ValueFormat.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]format[/\\]ValueParser.java" checks="LineLength" />
|
||||
|
@ -736,10 +674,7 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]FetchSubPhaseParseElement.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]explain[/\\]ExplainFetchSubPhase.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]fielddata[/\\]FieldDataFieldsParseElement.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]innerhits[/\\]InnerHitsContext.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]innerhits[/\\]InnerHitsFetchSubPhase.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]innerhits[/\\]InnerHitsParseElement.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]script[/\\]ScriptFieldsParseElement.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]fetch[/\\]source[/\\]FetchSourceContext.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]highlight[/\\]FastVectorHighlighter.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]highlight[/\\]HighlightPhase.java" checks="LineLength" />
|
||||
|
@ -764,7 +699,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]sort[/\\]GeoDistanceSortParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]sort[/\\]ScriptSortParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]sort[/\\]SortParseElement.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]suggest[/\\]SuggestBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]suggest[/\\]SuggestContextParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]suggest[/\\]SuggestUtils.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]suggest[/\\]completion[/\\]CompletionSuggestParser.java" checks="LineLength" />
|
||||
|
@ -778,7 +712,6 @@
|
|||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]suggest[/\\]phrase[/\\]WordScorer.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]suggest[/\\]term[/\\]TermSuggestParser.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]snapshots[/\\]RestoreService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]snapshots[/\\]SnapshotInfo.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]snapshots[/\\]SnapshotShardFailure.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]snapshots[/\\]SnapshotShardsService.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]snapshots[/\\]SnapshotsService.java" checks="LineLength" />
|
||||
|
@ -788,7 +721,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ESExceptionTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]NamingConventionTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]VersionTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ListenerActionIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]RejectionActionIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]HotThreadsIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]cluster[/\\]health[/\\]ClusterHealthResponsesTests.java" checks="LineLength" />
|
||||
|
@ -805,14 +737,12 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]indices[/\\]shards[/\\]IndicesShardStoreRequestIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]indices[/\\]shards[/\\]IndicesShardStoreResponseTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]indices[/\\]template[/\\]put[/\\]MetaDataIndexTemplateServiceTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]admin[/\\]indices[/\\]upgrade[/\\]UpgradeIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]bulk[/\\]BulkProcessorIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]bulk[/\\]BulkRequestTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]bulk[/\\]RetryTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]get[/\\]MultiGetShardRequestTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]BulkRequestModifierTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]IngestProxyActionFilterTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulateDocumentSimpleResultTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulateExecutionServiceTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulatePipelineRequestParsingTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]ingest[/\\]SimulatePipelineResponseTests.java" checks="LineLength" />
|
||||
|
@ -844,7 +774,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]ClusterHealthIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]ClusterInfoServiceIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]ClusterModuleTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]ClusterServiceIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]ClusterStateDiffIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]ClusterStateTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]DiskUsageTests.java" checks="LineLength" />
|
||||
|
@ -865,7 +794,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]allocation[/\\]SimpleAllocationIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]health[/\\]ClusterIndexHealthTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]health[/\\]ClusterStateHealthTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]health[/\\]RoutingTableGenerator.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]metadata[/\\]AutoExpandReplicasTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]metadata[/\\]DateMathExpressionResolverTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]metadata[/\\]HumanReadableIndexSettingsTests.java" checks="LineLength" />
|
||||
|
@ -932,7 +860,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]geo[/\\]ShapeBuilderTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]hash[/\\]MessageDigestsTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]inject[/\\]ModuleTestCase.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]io[/\\]stream[/\\]BytesStreamsTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]lucene[/\\]index[/\\]FreqTermsEnumTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]lucene[/\\]uid[/\\]VersionsTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]network[/\\]CidrsTests.java" checks="LineLength" />
|
||||
|
@ -948,14 +875,11 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]xcontent[/\\]builder[/\\]XContentBuilderTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]xcontent[/\\]cbor[/\\]JsonVsCborTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]xcontent[/\\]smile[/\\]JsonVsSmileTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]xcontent[/\\]support[/\\]filtering[/\\]AbstractFilteringJsonGeneratorTestCase.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]xcontent[/\\]support[/\\]filtering[/\\]FilterPathGeneratorFilteringTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]consistencylevel[/\\]WriteConsistencyLevelIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]deps[/\\]joda[/\\]SimpleJodaTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]deps[/\\]lucene[/\\]VectorHighlighterTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]BlockingClusterStatePublishResponseHandlerTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]DiscoveryWithServiceDisruptionsIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ZenFaultDetectionTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ZenUnicastDiscoveryIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]zen[/\\]NodeJoinControllerTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]zen[/\\]ZenDiscoveryUnitTests.java" checks="LineLength" />
|
||||
|
@ -1007,11 +931,8 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]BinaryDVFieldDataTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]DuelFieldDataTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]FieldDataCacheTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]FilterFieldDataTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]IndexFieldDataServiceTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]PagedBytesStringFieldDataTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]ParentChildFieldDataTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]fielddata[/\\]SortedSetDVStringFieldDataTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]mapper[/\\]DocumentFieldMapperTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]mapper[/\\]DynamicMappingTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]mapper[/\\]FieldTypeTestCase.java" checks="LineLength" />
|
||||
|
@ -1075,7 +996,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]MultiMatchQueryBuilderTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]RandomQueryBuilder.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]RangeQueryBuilderTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]ScoreModeTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]SpanMultiTermQueryBuilderTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]SpanNotQueryBuilderTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]query[/\\]plugin[/\\]CustomQueryParserIT.java" checks="LineLength" />
|
||||
|
@ -1106,7 +1026,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]IndicesLifecycleListenerIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]IndicesLifecycleListenerSingleNodeTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]IndicesOptionsIntegrationIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]analysis[/\\]PreBuiltAnalyzerIntegrationIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]analyze[/\\]AnalyzeActionIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]analyze[/\\]HunspellServiceIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indices[/\\]exists[/\\]indices[/\\]IndicesExistsIT.java" checks="LineLength" />
|
||||
|
@ -1139,7 +1058,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]PipelineExecutionServiceTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]PipelineStoreTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]CompoundProcessorTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]IngestDocumentTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]PipelineFactoryTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]core[/\\]ValueSourceTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]processor[/\\]AbstractStringProcessorTestCase.java" checks="LineLength" />
|
||||
|
@ -1168,7 +1086,6 @@
|
|||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]BytesRestResponseTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]CorsRegexDefaultIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]CorsRegexIT.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]NoOpClient.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]RestControllerTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]util[/\\]RestUtilsTests.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]routing[/\\]AliasResolveRoutingIT.java" checks="LineLength" />
|
||||
|
@ -1280,13 +1197,11 @@
|
|||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]BulkTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]DoubleTermsTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]EquivalenceTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]GeoDistanceTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]HDRPercentileRanksTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]HDRPercentilesTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]HistogramTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]IPv4RangeTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]IndexLookupTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]IndexedScriptTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]IndicesRequestTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]LongTermsTests.java" checks="LineLength" />
|
||||
<suppress files="modules[/\\]lang-groovy[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]messy[/\\]tests[/\\]MinDocCountTests.java" checks="LineLength" />
|
||||
|
@ -1326,15 +1241,12 @@
|
|||
<suppress files="plugins[/\\]delete-by-query[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]deletebyquery[/\\]IndexDeleteByQueryResponseTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]delete-by-query[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]action[/\\]deletebyquery[/\\]TransportDeleteByQueryActionTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]delete-by-query[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]plugin[/\\]deletebyquery[/\\]DeleteByQueryTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]management[/\\]AzureComputeService.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]AbstractAzureTestCase.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureMinimumMasterNodesTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureSimpleTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureTwoStartedNodesTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]aws[/\\]AwsEc2ServiceImpl.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]aws[/\\]AbstractAwsTestCase.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ec2[/\\]AmazonEC2Mock.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-gce[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]gce[/\\]GceUnicastHostsProvider.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]discovery-gce[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]gce[/\\]GceNetworkTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]ingest-geoip[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]geoip[/\\]GeoIpProcessor.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]ingest-geoip[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]geoip[/\\]GeoIpProcessorFactoryTests.java" checks="LineLength" />
|
||||
|
@ -1366,7 +1278,6 @@
|
|||
<suppress files="plugins[/\\]mapper-size[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]mapper[/\\]size[/\\]SizeMappingTests.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]blobstore[/\\]AzureBlobContainer.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]blobstore[/\\]AzureBlobStore.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]storage[/\\]AzureStorageService.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]storage[/\\]AzureStorageServiceImpl.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]storage[/\\]AzureStorageSettings.java" checks="LineLength" />
|
||||
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]azure[/\\]AzureRepository.java" checks="LineLength" />
|
||||
|
@ -1399,7 +1310,6 @@
|
|||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]TestShardRouting.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]cli[/\\]CliToolTestCase.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]util[/\\]MockBigArrays.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]MockSearchService.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]bucket[/\\]script[/\\]NativeSignificanceScoreScriptWithParams.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]BackgroundIndexer.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]CompositeTestCluster.java" checks="LineLength" />
|
||||
|
@ -1423,7 +1333,6 @@
|
|||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]disruption[/\\]SlowClusterStateProcessing.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]engine[/\\]AssertingSearcher.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]engine[/\\]MockEngineSupport.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]engine[/\\]MockInternalEngine.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]hamcrest[/\\]ElasticsearchAssertions.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]junit[/\\]listeners[/\\]LoggingListener.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]ESRestTestCase.java" checks="LineLength" />
|
||||
|
@ -1452,7 +1361,6 @@
|
|||
<suppress files="test[/\\]framework[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]test[/\\]JsonPathTests.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]test[/\\]RestTestParserTests.java" checks="LineLength" />
|
||||
<suppress files="test[/\\]framework[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]test[/\\]InternalTestClusterTests.java" checks="LineLength" />
|
||||
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]common[/\\]cli[/\\]CliTool.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]action[/\\]admin[/\\]indices[/\\]settings[/\\]RestGetSettingsAction.java" checks="LineLength" />
|
||||
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]tribe[/\\]TribeService.java" checks="LineLength" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
elasticsearch = 5.0.0-alpha2
|
||||
elasticsearch = 5.0.0
|
||||
lucene = 6.0.0
|
||||
|
||||
# optional dependencies
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.elasticsearch.cluster.action.shard.ShardStateAction;
|
|||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.logging.LoggerMessageFormat;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -47,7 +48,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetaData.INDEX_UUID_NA_VAL
|
|||
/**
|
||||
* A base class for all elasticsearch exceptions.
|
||||
*/
|
||||
public class ElasticsearchException extends RuntimeException implements ToXContent {
|
||||
public class ElasticsearchException extends RuntimeException implements ToXContent, Writeable {
|
||||
|
||||
public static final String REST_EXCEPTION_SKIP_CAUSE = "rest.exception.cause.skip";
|
||||
public static final String REST_EXCEPTION_SKIP_STACK_TRACE = "rest.exception.stacktrace.skip";
|
||||
|
@ -235,6 +236,7 @@ public class ElasticsearchException extends RuntimeException implements ToXConte
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeOptionalString(this.getMessage());
|
||||
out.writeThrowable(this.getCause());
|
||||
|
|
|
@ -73,7 +73,9 @@ public class Version {
|
|||
public static final Version V_5_0_0_alpha1 = new Version(V_5_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
|
||||
public static final int V_5_0_0_alpha2_ID = 5000002;
|
||||
public static final Version V_5_0_0_alpha2 = new Version(V_5_0_0_alpha2_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
|
||||
public static final Version CURRENT = V_5_0_0_alpha2;
|
||||
public static final int V_5_0_0_ID = 5000099;
|
||||
public static final Version V_5_0_0 = new Version(V_5_0_0_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
|
||||
public static final Version CURRENT = V_5_0_0;
|
||||
|
||||
static {
|
||||
assert CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) : "Version must be upgraded to ["
|
||||
|
@ -86,6 +88,8 @@ public class Version {
|
|||
|
||||
public static Version fromId(int id) {
|
||||
switch (id) {
|
||||
case V_5_0_0_ID:
|
||||
return V_5_0_0;
|
||||
case V_5_0_0_alpha2_ID:
|
||||
return V_5_0_0_alpha2;
|
||||
case V_5_0_0_alpha1_ID:
|
||||
|
|
|
@ -19,12 +19,14 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.node.hotthreads;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
@ -33,26 +35,18 @@ public class NodesHotThreadsResponse extends BaseNodesResponse<NodeHotThreads> {
|
|||
NodesHotThreadsResponse() {
|
||||
}
|
||||
|
||||
public NodesHotThreadsResponse(ClusterName clusterName, NodeHotThreads[] nodes) {
|
||||
super(clusterName, nodes);
|
||||
public NodesHotThreadsResponse(ClusterName clusterName, List<NodeHotThreads> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeHotThreads[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = NodeHotThreads.readNodeHotThreads(in);
|
||||
}
|
||||
protected List<NodeHotThreads> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readList(NodeHotThreads::readNodeHotThreads);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeHotThreads node : nodes) {
|
||||
node.writeTo(out);
|
||||
}
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeHotThreads> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.elasticsearch.action.admin.cluster.node.hotthreads;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
|
@ -35,33 +36,28 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TransportNodesHotThreadsAction extends TransportNodesAction<NodesHotThreadsRequest, NodesHotThreadsResponse, TransportNodesHotThreadsAction.NodeRequest, NodeHotThreads> {
|
||||
public class TransportNodesHotThreadsAction extends TransportNodesAction<NodesHotThreadsRequest,
|
||||
NodesHotThreadsResponse,
|
||||
TransportNodesHotThreadsAction.NodeRequest,
|
||||
NodeHotThreads> {
|
||||
|
||||
@Inject
|
||||
public TransportNodesHotThreadsAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NodesHotThreadsAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesHotThreadsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC);
|
||||
indexNameExpressionResolver, NodesHotThreadsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeHotThreads.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NodesHotThreadsResponse newResponse(NodesHotThreadsRequest request, AtomicReferenceArray responses) {
|
||||
final List<NodeHotThreads> nodes = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeHotThreads) {
|
||||
nodes.add((NodeHotThreads) resp);
|
||||
}
|
||||
}
|
||||
return new NodesHotThreadsResponse(clusterName, nodes.toArray(new NodeHotThreads[nodes.size()]));
|
||||
protected NodesHotThreadsResponse newResponse(NodesHotThreadsRequest request,
|
||||
List<NodeHotThreads> responses, List<FailedNodeException> failures) {
|
||||
return new NodesHotThreadsResponse(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.node.info;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
|
@ -30,6 +31,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -40,34 +42,24 @@ public class NodesInfoResponse extends BaseNodesResponse<NodeInfo> implements To
|
|||
public NodesInfoResponse() {
|
||||
}
|
||||
|
||||
public NodesInfoResponse(ClusterName clusterName, NodeInfo[] nodes) {
|
||||
super(clusterName, nodes);
|
||||
public NodesInfoResponse(ClusterName clusterName, List<NodeInfo> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeInfo[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = NodeInfo.readNodeInfo(in);
|
||||
}
|
||||
protected List<NodeInfo> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readList(NodeInfo::readNodeInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeInfo node : nodes) {
|
||||
node.writeTo(out);
|
||||
}
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeInfo> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field("cluster_name", getClusterName().value());
|
||||
|
||||
builder.startObject("nodes");
|
||||
for (NodeInfo nodeInfo : this) {
|
||||
for (NodeInfo nodeInfo : getNodes()) {
|
||||
builder.startObject(nodeInfo.getNode().getId());
|
||||
|
||||
builder.field("name", nodeInfo.getNode().getName());
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.node.info;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
|
@ -34,36 +35,32 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TransportNodesInfoAction extends TransportNodesAction<NodesInfoRequest, NodesInfoResponse, TransportNodesInfoAction.NodeInfoRequest, NodeInfo> {
|
||||
public class TransportNodesInfoAction extends TransportNodesAction<NodesInfoRequest,
|
||||
NodesInfoResponse,
|
||||
TransportNodesInfoAction.NodeInfoRequest,
|
||||
NodeInfo> {
|
||||
|
||||
private final NodeService nodeService;
|
||||
|
||||
@Inject
|
||||
public TransportNodesInfoAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
NodeService nodeService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
NodeService nodeService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NodesInfoAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesInfoRequest::new, NodeInfoRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
indexNameExpressionResolver, NodesInfoRequest::new, NodeInfoRequest::new, ThreadPool.Names.MANAGEMENT, NodeInfo.class);
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NodesInfoResponse newResponse(NodesInfoRequest nodesInfoRequest, AtomicReferenceArray responses) {
|
||||
final List<NodeInfo> nodesInfos = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeInfo) {
|
||||
nodesInfos.add((NodeInfo) resp);
|
||||
}
|
||||
}
|
||||
return new NodesInfoResponse(clusterName, nodesInfos.toArray(new NodeInfo[nodesInfos.size()]));
|
||||
protected NodesInfoResponse newResponse(NodesInfoRequest nodesInfoRequest,
|
||||
List<NodeInfo> responses, List<FailedNodeException> failures) {
|
||||
return new NodesInfoResponse(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.node.stats;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
|
@ -28,6 +29,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -37,34 +39,24 @@ public class NodesStatsResponse extends BaseNodesResponse<NodeStats> implements
|
|||
NodesStatsResponse() {
|
||||
}
|
||||
|
||||
public NodesStatsResponse(ClusterName clusterName, NodeStats[] nodes) {
|
||||
super(clusterName, nodes);
|
||||
public NodesStatsResponse(ClusterName clusterName, List<NodeStats> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeStats[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = NodeStats.readNodeStats(in);
|
||||
}
|
||||
protected List<NodeStats> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readList(NodeStats::readNodeStats);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeStats node : nodes) {
|
||||
node.writeTo(out);
|
||||
}
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeStats> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field("cluster_name", getClusterName().value());
|
||||
|
||||
builder.startObject("nodes");
|
||||
for (NodeStats nodeStats : this) {
|
||||
for (NodeStats nodeStats : getNodes()) {
|
||||
builder.startObject(nodeStats.getNode().getId());
|
||||
builder.field("timestamp", nodeStats.getTimestamp());
|
||||
nodeStats.toXContent(builder, params);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.node.stats;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
|
@ -34,36 +35,31 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TransportNodesStatsAction extends TransportNodesAction<NodesStatsRequest, NodesStatsResponse, TransportNodesStatsAction.NodeStatsRequest, NodeStats> {
|
||||
public class TransportNodesStatsAction extends TransportNodesAction<NodesStatsRequest,
|
||||
NodesStatsResponse,
|
||||
TransportNodesStatsAction.NodeStatsRequest,
|
||||
NodeStats> {
|
||||
|
||||
private final NodeService nodeService;
|
||||
|
||||
@Inject
|
||||
public TransportNodesStatsAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
NodeService nodeService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NodesStatsAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
NodesStatsRequest::new, NodeStatsRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
NodeService nodeService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NodesStatsAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesStatsRequest::new, NodeStatsRequest::new, ThreadPool.Names.MANAGEMENT, NodeStats.class);
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NodesStatsResponse newResponse(NodesStatsRequest nodesInfoRequest, AtomicReferenceArray responses) {
|
||||
final List<NodeStats> nodeStats = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeStats) {
|
||||
nodeStats.add((NodeStats) resp);
|
||||
}
|
||||
}
|
||||
return new NodesStatsResponse(clusterName, nodeStats.toArray(new NodeStats[nodeStats.size()]));
|
||||
protected NodesStatsResponse newResponse(NodesStatsRequest request, List<NodeStats> responses, List<FailedNodeException> failures) {
|
||||
return new NodesStatsResponse(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -57,13 +57,13 @@ public class CreateSnapshotResponse extends ActionResponse implements ToXContent
|
|||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
snapshotInfo = SnapshotInfo.readOptionalSnapshotInfo(in);
|
||||
snapshotInfo = in.readOptionalWriteable(SnapshotInfo::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeOptionalStreamable(snapshotInfo);
|
||||
out.writeOptionalWriteable(snapshotInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,7 +90,7 @@ public class CreateSnapshotResponse extends ActionResponse implements ToXContent
|
|||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
if (snapshotInfo != null) {
|
||||
builder.field(Fields.SNAPSHOT);
|
||||
snapshotInfo.toXContent(builder, params);
|
||||
snapshotInfo.toExternalXContent(builder, params);
|
||||
} else {
|
||||
builder.field(Fields.ACCEPTED, true);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class GetSnapshotsResponse extends ActionResponse implements ToXContent {
|
|||
int size = in.readVInt();
|
||||
List<SnapshotInfo> builder = new ArrayList<>();
|
||||
for (int i = 0; i < size; i++) {
|
||||
builder.add(SnapshotInfo.readSnapshotInfo(in));
|
||||
builder.add(new SnapshotInfo(in));
|
||||
}
|
||||
snapshots = Collections.unmodifiableList(builder);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public class GetSnapshotsResponse extends ActionResponse implements ToXContent {
|
|||
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
|
||||
builder.startArray(Fields.SNAPSHOTS);
|
||||
for (SnapshotInfo snapshotInfo : snapshots) {
|
||||
snapshotInfo.toXContent(builder, params);
|
||||
snapshotInfo.toExternalXContent(builder, params);
|
||||
}
|
||||
builder.endArray();
|
||||
return builder;
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.snapshots.SnapshotInfo;
|
||||
import org.elasticsearch.snapshots.SnapshotsService;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
|
@ -77,18 +76,12 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction<GetSn
|
|||
try {
|
||||
List<SnapshotInfo> snapshotInfoBuilder = new ArrayList<>();
|
||||
if (isAllSnapshots(request.snapshots())) {
|
||||
List<Snapshot> snapshots = snapshotsService.snapshots(request.repository(), request.ignoreUnavailable());
|
||||
for (Snapshot snapshot : snapshots) {
|
||||
snapshotInfoBuilder.add(new SnapshotInfo(snapshot));
|
||||
}
|
||||
snapshotInfoBuilder.addAll(snapshotsService.snapshots(request.repository(), request.ignoreUnavailable()));
|
||||
} else if (isCurrentSnapshots(request.snapshots())) {
|
||||
List<Snapshot> snapshots = snapshotsService.currentSnapshots(request.repository());
|
||||
for (Snapshot snapshot : snapshots) {
|
||||
snapshotInfoBuilder.add(new SnapshotInfo(snapshot));
|
||||
}
|
||||
snapshotInfoBuilder.addAll(snapshotsService.currentSnapshots(request.repository()));
|
||||
} else {
|
||||
Set<String> snapshotsToGet = new LinkedHashSet<>(); // to keep insertion order
|
||||
List<Snapshot> snapshots = null;
|
||||
List<SnapshotInfo> snapshots = null;
|
||||
for (String snapshotOrPattern : request.snapshots()) {
|
||||
if (Regex.isSimpleMatchPattern(snapshotOrPattern) == false) {
|
||||
snapshotsToGet.add(snapshotOrPattern);
|
||||
|
@ -96,7 +89,7 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction<GetSn
|
|||
if (snapshots == null) { // lazily load snapshots
|
||||
snapshots = snapshotsService.snapshots(request.repository(), request.ignoreUnavailable());
|
||||
}
|
||||
for (Snapshot snapshot : snapshots) {
|
||||
for (SnapshotInfo snapshot : snapshots) {
|
||||
if (Regex.simpleMatch(snapshotOrPattern, snapshot.name())) {
|
||||
snapshotsToGet.add(snapshot.name());
|
||||
}
|
||||
|
@ -105,7 +98,7 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction<GetSn
|
|||
}
|
||||
for (String snapshot : snapshotsToGet) {
|
||||
SnapshotId snapshotId = new SnapshotId(request.repository(), snapshot);
|
||||
snapshotInfoBuilder.add(new SnapshotInfo(snapshotsService.snapshot(snapshotId)));
|
||||
snapshotInfoBuilder.add(snapshotsService.snapshot(snapshotId));
|
||||
}
|
||||
}
|
||||
listener.onResponse(new GetSnapshotsResponse(Collections.unmodifiableList(snapshotInfoBuilder)));
|
||||
|
|
|
@ -43,18 +43,20 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
import static java.util.Collections.unmodifiableMap;
|
||||
|
||||
/**
|
||||
* Transport client that collects snapshot shard statuses from data nodes
|
||||
*/
|
||||
public class TransportNodesSnapshotsStatus extends TransportNodesAction<TransportNodesSnapshotsStatus.Request, TransportNodesSnapshotsStatus.NodesSnapshotStatus, TransportNodesSnapshotsStatus.NodeRequest, TransportNodesSnapshotsStatus.NodeSnapshotStatus> {
|
||||
public class TransportNodesSnapshotsStatus extends TransportNodesAction<TransportNodesSnapshotsStatus.Request,
|
||||
TransportNodesSnapshotsStatus.NodesSnapshotStatus,
|
||||
TransportNodesSnapshotsStatus.NodeRequest,
|
||||
TransportNodesSnapshotsStatus.NodeSnapshotStatus> {
|
||||
|
||||
public static final String ACTION_NAME = SnapshotsStatusAction.NAME + "[nodes]";
|
||||
|
||||
|
@ -66,7 +68,7 @@ public class TransportNodesSnapshotsStatus extends TransportNodesAction<Transpor
|
|||
SnapshotShardsService snapshotShardsService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ACTION_NAME, clusterName, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.GENERIC);
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeSnapshotStatus.class);
|
||||
this.snapshotShardsService = snapshotShardsService;
|
||||
}
|
||||
|
||||
|
@ -86,21 +88,8 @@ public class TransportNodesSnapshotsStatus extends TransportNodesAction<Transpor
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodesSnapshotStatus newResponse(Request request, AtomicReferenceArray responses) {
|
||||
final List<NodeSnapshotStatus> nodesList = new ArrayList<>();
|
||||
final List<FailedNodeException> failures = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeSnapshotStatus) { // will also filter out null response for unallocated ones
|
||||
nodesList.add((NodeSnapshotStatus) resp);
|
||||
} else if (resp instanceof FailedNodeException) {
|
||||
failures.add((FailedNodeException) resp);
|
||||
} else {
|
||||
logger.warn("unknown response type [{}], expected NodeSnapshotStatus or FailedNodeException", resp);
|
||||
}
|
||||
}
|
||||
return new NodesSnapshotStatus(clusterName, nodesList.toArray(new NodeSnapshotStatus[nodesList.size()]),
|
||||
failures.toArray(new FailedNodeException[failures.size()]));
|
||||
protected NodesSnapshotStatus newResponse(Request request, List<NodeSnapshotStatus> responses, List<FailedNodeException> failures) {
|
||||
return new NodesSnapshotStatus(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -169,75 +158,47 @@ public class TransportNodesSnapshotsStatus extends TransportNodesAction<Transpor
|
|||
|
||||
public static class NodesSnapshotStatus extends BaseNodesResponse<NodeSnapshotStatus> {
|
||||
|
||||
private FailedNodeException[] failures;
|
||||
|
||||
NodesSnapshotStatus() {
|
||||
}
|
||||
|
||||
public NodesSnapshotStatus(ClusterName clusterName, NodeSnapshotStatus[] nodes, FailedNodeException[] failures) {
|
||||
super(clusterName, nodes);
|
||||
this.failures = failures;
|
||||
public NodesSnapshotStatus(ClusterName clusterName, List<NodeSnapshotStatus> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FailedNodeException[] failures() {
|
||||
return failures;
|
||||
protected List<NodeSnapshotStatus> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readStreamableList(NodeSnapshotStatus::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeSnapshotStatus[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = new NodeSnapshotStatus();
|
||||
nodes[i].readFrom(in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeSnapshotStatus response : nodes) {
|
||||
response.writeTo(out);
|
||||
}
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeSnapshotStatus> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NodeRequest extends BaseNodeRequest {
|
||||
|
||||
private SnapshotId[] snapshotIds;
|
||||
private List<SnapshotId> snapshotIds;
|
||||
|
||||
public NodeRequest() {
|
||||
}
|
||||
|
||||
NodeRequest(String nodeId, TransportNodesSnapshotsStatus.Request request) {
|
||||
super(nodeId);
|
||||
snapshotIds = request.snapshotIds;
|
||||
snapshotIds = Arrays.asList(request.snapshotIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
int n = in.readVInt();
|
||||
snapshotIds = new SnapshotId[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
snapshotIds[i] = SnapshotId.readSnapshotId(in);
|
||||
}
|
||||
snapshotIds = in.readList(SnapshotId::readSnapshotId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
if (snapshotIds != null) {
|
||||
out.writeVInt(snapshotIds.length);
|
||||
for (int i = 0; i < snapshotIds.length; i++) {
|
||||
snapshotIds[i].writeTo(out);
|
||||
}
|
||||
} else {
|
||||
out.writeVInt(0);
|
||||
}
|
||||
out.writeStreamableList(snapshotIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.snapshots.SnapshotInfo;
|
||||
import org.elasticsearch.snapshots.SnapshotsService;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
@ -202,7 +202,7 @@ public class TransportSnapshotsStatusAction extends TransportMasterNodeAction<Sn
|
|||
// This is a snapshot the is currently running - skipping
|
||||
continue;
|
||||
}
|
||||
Snapshot snapshot = snapshotsService.snapshot(snapshotId);
|
||||
SnapshotInfo snapshot = snapshotsService.snapshot(snapshotId);
|
||||
List<SnapshotIndexShardStatus> shardStatusBuilder = new ArrayList<>();
|
||||
if (snapshot.state().completed()) {
|
||||
Map<ShardId, IndexShardSnapshotStatus> shardStatues = snapshotsService.snapshotShards(snapshotId);
|
||||
|
|
|
@ -22,9 +22,6 @@ package org.elasticsearch.action.admin.cluster.stats;
|
|||
import com.carrotsearch.hppc.ObjectObjectHashMap;
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import org.elasticsearch.action.admin.indices.stats.CommonStats;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.cache.query.QueryCacheStats;
|
||||
|
@ -36,8 +33,9 @@ import org.elasticsearch.index.store.StoreStats;
|
|||
import org.elasticsearch.search.suggest.completion.CompletionStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class ClusterStatsIndices implements ToXContent, Streamable {
|
||||
public class ClusterStatsIndices implements ToXContent {
|
||||
|
||||
private int indexCount;
|
||||
private ShardStats shards;
|
||||
|
@ -49,10 +47,7 @@ public class ClusterStatsIndices implements ToXContent, Streamable {
|
|||
private SegmentsStats segments;
|
||||
private PercolatorQueryCacheStats percolatorCache;
|
||||
|
||||
private ClusterStatsIndices() {
|
||||
}
|
||||
|
||||
public ClusterStatsIndices(ClusterStatsNodeResponse[] nodeResponses) {
|
||||
public ClusterStatsIndices(List<ClusterStatsNodeResponse> nodeResponses) {
|
||||
ObjectObjectHashMap<String, ShardStats> countsPerIndex = new ObjectObjectHashMap<>();
|
||||
|
||||
this.docs = new DocsStats();
|
||||
|
@ -131,38 +126,6 @@ public class ClusterStatsIndices implements ToXContent, Streamable {
|
|||
return percolatorCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
indexCount = in.readVInt();
|
||||
shards = ShardStats.readShardStats(in);
|
||||
docs = DocsStats.readDocStats(in);
|
||||
store = StoreStats.readStoreStats(in);
|
||||
fieldData = FieldDataStats.readFieldDataStats(in);
|
||||
queryCache = QueryCacheStats.readQueryCacheStats(in);
|
||||
completion = CompletionStats.readCompletionStats(in);
|
||||
segments = SegmentsStats.readSegmentsStats(in);
|
||||
percolatorCache = PercolatorQueryCacheStats.readPercolateStats(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(indexCount);
|
||||
shards.writeTo(out);
|
||||
docs.writeTo(out);
|
||||
store.writeTo(out);
|
||||
fieldData.writeTo(out);
|
||||
queryCache.writeTo(out);
|
||||
completion.writeTo(out);
|
||||
segments.writeTo(out);
|
||||
percolatorCache.writeTo(out);
|
||||
}
|
||||
|
||||
public static ClusterStatsIndices readIndicesStats(StreamInput in) throws IOException {
|
||||
ClusterStatsIndices indicesStats = new ClusterStatsIndices();
|
||||
indicesStats.readFrom(in);
|
||||
return indicesStats;
|
||||
}
|
||||
|
||||
static final class Fields {
|
||||
static final String COUNT = "count";
|
||||
}
|
||||
|
@ -181,7 +144,7 @@ public class ClusterStatsIndices implements ToXContent, Streamable {
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static class ShardStats implements ToXContent, Streamable {
|
||||
public static class ShardStats implements ToXContent {
|
||||
|
||||
int indices;
|
||||
int total;
|
||||
|
@ -326,40 +289,6 @@ public class ClusterStatsIndices implements ToXContent, Streamable {
|
|||
}
|
||||
}
|
||||
|
||||
public static ShardStats readShardStats(StreamInput in) throws IOException {
|
||||
ShardStats c = new ShardStats();
|
||||
c.readFrom(in);
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
indices = in.readVInt();
|
||||
total = in.readVInt();
|
||||
primaries = in.readVInt();
|
||||
minIndexShards = in.readVInt();
|
||||
maxIndexShards = in.readVInt();
|
||||
minIndexPrimaryShards = in.readVInt();
|
||||
maxIndexPrimaryShards = in.readVInt();
|
||||
minIndexReplication = in.readDouble();
|
||||
totalIndexReplication = in.readDouble();
|
||||
maxIndexReplication = in.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(indices);
|
||||
out.writeVInt(total);
|
||||
out.writeVInt(primaries);
|
||||
out.writeVInt(minIndexShards);
|
||||
out.writeVInt(maxIndexShards);
|
||||
out.writeVInt(minIndexPrimaryShards);
|
||||
out.writeVInt(maxIndexPrimaryShards);
|
||||
out.writeDouble(minIndexReplication);
|
||||
out.writeDouble(totalIndexReplication);
|
||||
out.writeDouble(maxIndexReplication);
|
||||
}
|
||||
|
||||
static final class Fields {
|
||||
static final String SHARDS = "shards";
|
||||
static final String TOTAL = "total";
|
||||
|
|
|
@ -26,9 +26,6 @@ import org.elasticsearch.Version;
|
|||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
|
@ -48,7 +45,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ClusterStatsNodes implements ToXContent, Writeable {
|
||||
public class ClusterStatsNodes implements ToXContent {
|
||||
|
||||
private final Counts counts;
|
||||
private final Set<Version> versions;
|
||||
|
@ -58,33 +55,12 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
private final FsInfo.Path fs;
|
||||
private final Set<PluginInfo> plugins;
|
||||
|
||||
ClusterStatsNodes(StreamInput in) throws IOException {
|
||||
this.counts = new Counts(in);
|
||||
|
||||
int size = in.readVInt();
|
||||
this.versions = new HashSet<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.versions.add(Version.readVersion(in));
|
||||
}
|
||||
|
||||
this.os = new OsStats(in);
|
||||
this.process = new ProcessStats(in);
|
||||
this.jvm = new JvmStats(in);
|
||||
this.fs = new FsInfo.Path(in);
|
||||
|
||||
size = in.readVInt();
|
||||
this.plugins = new HashSet<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.plugins.add(PluginInfo.readFromStream(in));
|
||||
}
|
||||
}
|
||||
|
||||
ClusterStatsNodes(ClusterStatsNodeResponse[] nodeResponses) {
|
||||
ClusterStatsNodes(List<ClusterStatsNodeResponse> nodeResponses) {
|
||||
this.versions = new HashSet<>();
|
||||
this.fs = new FsInfo.Path();
|
||||
this.plugins = new HashSet<>();
|
||||
|
||||
Set<InetAddress> seenAddresses = new HashSet<>(nodeResponses.length);
|
||||
Set<InetAddress> seenAddresses = new HashSet<>(nodeResponses.size());
|
||||
List<NodeInfo> nodeInfos = new ArrayList<>();
|
||||
List<NodeStats> nodeStats = new ArrayList<>();
|
||||
for (ClusterStatsNodeResponse nodeResponse : nodeResponses) {
|
||||
|
@ -140,21 +116,6 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
return plugins;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
counts.writeTo(out);
|
||||
out.writeVInt(versions.size());
|
||||
for (Version v : versions) Version.writeVersion(v, out);
|
||||
os.writeTo(out);
|
||||
process.writeTo(out);
|
||||
jvm.writeTo(out);
|
||||
fs.writeTo(out);
|
||||
out.writeVInt(plugins.size());
|
||||
for (PluginInfo p : plugins) {
|
||||
p.writeTo(out);
|
||||
}
|
||||
}
|
||||
|
||||
static final class Fields {
|
||||
static final String COUNT = "count";
|
||||
static final String VERSIONS = "versions";
|
||||
|
@ -200,18 +161,12 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static class Counts implements Writeable, ToXContent {
|
||||
public static class Counts implements ToXContent {
|
||||
static final String COORDINATING_ONLY = "coordinating_only";
|
||||
|
||||
private final int total;
|
||||
private final Map<String, Integer> roles;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Counts(StreamInput in) throws IOException {
|
||||
this.total = in.readVInt();
|
||||
this.roles = (Map<String, Integer>)in.readGenericValue();
|
||||
}
|
||||
|
||||
private Counts(List<NodeInfo> nodeInfos) {
|
||||
this.roles = new HashMap<>();
|
||||
for (DiscoveryNode.Role role : DiscoveryNode.Role.values()) {
|
||||
|
@ -243,12 +198,6 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
return roles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(total);
|
||||
out.writeGenericValue(roles);
|
||||
}
|
||||
|
||||
static final class Fields {
|
||||
static final String TOTAL = "total";
|
||||
}
|
||||
|
@ -263,7 +212,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
}
|
||||
}
|
||||
|
||||
public static class OsStats implements ToXContent, Writeable {
|
||||
public static class OsStats implements ToXContent {
|
||||
final int availableProcessors;
|
||||
final int allocatedProcessors;
|
||||
final ObjectIntHashMap<String> names;
|
||||
|
@ -287,30 +236,6 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
this.allocatedProcessors = allocatedProcessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
private OsStats(StreamInput in) throws IOException {
|
||||
this.availableProcessors = in.readVInt();
|
||||
this.allocatedProcessors = in.readVInt();
|
||||
int size = in.readVInt();
|
||||
this.names = new ObjectIntHashMap<>();
|
||||
for (int i = 0; i < size; i++) {
|
||||
names.addTo(in.readString(), in.readVInt());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(availableProcessors);
|
||||
out.writeVInt(allocatedProcessors);
|
||||
out.writeVInt(names.size());
|
||||
for (ObjectIntCursor<String> name : names) {
|
||||
out.writeString(name.key);
|
||||
out.writeVInt(name.value);
|
||||
}
|
||||
}
|
||||
|
||||
public int getAvailableProcessors() {
|
||||
return availableProcessors;
|
||||
}
|
||||
|
@ -343,7 +268,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
}
|
||||
}
|
||||
|
||||
public static class ProcessStats implements ToXContent, Writeable {
|
||||
public static class ProcessStats implements ToXContent {
|
||||
|
||||
final int count;
|
||||
final int cpuPercent;
|
||||
|
@ -384,27 +309,6 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
this.maxOpenFileDescriptors = maxOpenFileDescriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
private ProcessStats(StreamInput in) throws IOException {
|
||||
this.count = in.readVInt();
|
||||
this.cpuPercent = in.readVInt();
|
||||
this.totalOpenFileDescriptors = in.readVLong();
|
||||
this.minOpenFileDescriptors = in.readLong();
|
||||
this.maxOpenFileDescriptors = in.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(count);
|
||||
out.writeVInt(cpuPercent);
|
||||
out.writeVLong(totalOpenFileDescriptors);
|
||||
out.writeLong(minOpenFileDescriptors);
|
||||
out.writeLong(maxOpenFileDescriptors);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cpu usage in percentages - 100 is 1 core.
|
||||
*/
|
||||
|
@ -456,7 +360,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
}
|
||||
}
|
||||
|
||||
public static class JvmStats implements Writeable, ToXContent {
|
||||
public static class JvmStats implements ToXContent {
|
||||
|
||||
private final ObjectIntHashMap<JvmVersion> versions;
|
||||
private final long threads;
|
||||
|
@ -497,34 +401,6 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
this.heapMax = heapMax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
private JvmStats(StreamInput in) throws IOException {
|
||||
int size = in.readVInt();
|
||||
this.versions = new ObjectIntHashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.versions.addTo(new JvmVersion(in), in.readVInt());
|
||||
}
|
||||
this.threads = in.readVLong();
|
||||
this.maxUptime = in.readVLong();
|
||||
this.heapUsed = in.readVLong();
|
||||
this.heapMax = in.readVLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(versions.size());
|
||||
for (ObjectIntCursor<JvmVersion> v : versions) {
|
||||
v.key.writeTo(out);
|
||||
out.writeVInt(v.value);
|
||||
}
|
||||
out.writeVLong(threads);
|
||||
out.writeVLong(maxUptime);
|
||||
out.writeVLong(heapUsed);
|
||||
out.writeVLong(heapMax);
|
||||
}
|
||||
|
||||
public ObjectIntHashMap<JvmVersion> getVersions() {
|
||||
return versions;
|
||||
}
|
||||
|
@ -598,7 +474,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
}
|
||||
}
|
||||
|
||||
public static class JvmVersion implements Writeable {
|
||||
public static class JvmVersion {
|
||||
String version;
|
||||
String vmName;
|
||||
String vmVersion;
|
||||
|
@ -611,27 +487,6 @@ public class ClusterStatsNodes implements ToXContent, Writeable {
|
|||
vmVendor = jvmInfo.getVmVendor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
JvmVersion(StreamInput in) throws IOException {
|
||||
version = in.readString();
|
||||
vmName = in.readString();
|
||||
vmVersion = in.readString();
|
||||
vmVendor = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeString(version);
|
||||
out.writeString(vmName);
|
||||
out.writeString(vmVersion);
|
||||
out.writeString(vmVendor);
|
||||
}
|
||||
|
||||
JvmVersion() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.stats;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||
|
@ -29,9 +30,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -48,8 +48,9 @@ public class ClusterStatsResponse extends BaseNodesResponse<ClusterStatsNodeResp
|
|||
ClusterStatsResponse() {
|
||||
}
|
||||
|
||||
public ClusterStatsResponse(long timestamp, ClusterName clusterName, String clusterUUID, ClusterStatsNodeResponse[] nodes) {
|
||||
super(clusterName, null);
|
||||
public ClusterStatsResponse(long timestamp, ClusterName clusterName, String clusterUUID,
|
||||
List<ClusterStatsNodeResponse> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
this.timestamp = timestamp;
|
||||
this.clusterUUID = clusterUUID;
|
||||
nodesStats = new ClusterStatsNodes(nodes);
|
||||
|
@ -79,77 +80,53 @@ public class ClusterStatsResponse extends BaseNodesResponse<ClusterStatsNodeResp
|
|||
return indicesStats;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClusterStatsNodeResponse[] getNodes() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ClusterStatsNodeResponse> getNodesMap() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClusterStatsNodeResponse getAt(int position) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ClusterStatsNodeResponse> iterator() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
timestamp = in.readVLong();
|
||||
status = null;
|
||||
if (in.readBoolean()) {
|
||||
// it may be that the master switched on us while doing the operation. In this case the status may be null.
|
||||
status = ClusterHealthStatus.fromValue(in.readByte());
|
||||
}
|
||||
clusterUUID = in.readString();
|
||||
nodesStats = new ClusterStatsNodes(in);
|
||||
indicesStats = ClusterStatsIndices.readIndicesStats(in);
|
||||
// it may be that the master switched on us while doing the operation. In this case the status may be null.
|
||||
status = in.readOptionalWriteable(ClusterHealthStatus::readFrom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVLong(timestamp);
|
||||
if (status == null) {
|
||||
out.writeBoolean(false);
|
||||
} else {
|
||||
out.writeBoolean(true);
|
||||
out.writeByte(status.value());
|
||||
}
|
||||
out.writeString(clusterUUID);
|
||||
nodesStats.writeTo(out);
|
||||
indicesStats.writeTo(out);
|
||||
out.writeOptionalWriteable(status);
|
||||
}
|
||||
|
||||
static final class Fields {
|
||||
static final String NODES = "nodes";
|
||||
static final String INDICES = "indices";
|
||||
static final String UUID = "uuid";
|
||||
static final String CLUSTER_NAME = "cluster_name";
|
||||
static final String STATUS = "status";
|
||||
@Override
|
||||
protected List<ClusterStatsNodeResponse> readNodesFrom(StreamInput in) throws IOException {
|
||||
List<ClusterStatsNodeResponse> nodes = in.readList(ClusterStatsNodeResponse::readNodeResponse);
|
||||
|
||||
// built from nodes rather than from the stream directly
|
||||
nodesStats = new ClusterStatsNodes(nodes);
|
||||
indicesStats = new ClusterStatsIndices(nodes);
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeNodesTo(StreamOutput out, List<ClusterStatsNodeResponse> nodes) throws IOException {
|
||||
// nodeStats and indicesStats are rebuilt from nodes
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field("timestamp", getTimestamp());
|
||||
builder.field(Fields.CLUSTER_NAME, getClusterName().value());
|
||||
if (params.paramAsBoolean("output_uuid", false)) {
|
||||
builder.field(Fields.UUID, clusterUUID);
|
||||
builder.field("uuid", clusterUUID);
|
||||
}
|
||||
if (status != null) {
|
||||
builder.field(Fields.STATUS, status.name().toLowerCase(Locale.ROOT));
|
||||
builder.field("status", status.name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
builder.startObject(Fields.INDICES);
|
||||
builder.startObject("indices");
|
||||
indicesStats.toXContent(builder, params);
|
||||
builder.endObject();
|
||||
builder.startObject(Fields.NODES);
|
||||
builder.startObject("nodes");
|
||||
nodesStats.toXContent(builder, params);
|
||||
builder.endObject();
|
||||
return builder;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action.admin.cluster.stats;
|
||||
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
||||
import org.elasticsearch.action.admin.indices.stats.CommonStats;
|
||||
|
@ -46,7 +47,6 @@ import org.elasticsearch.transport.TransportService;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -68,22 +68,17 @@ public class TransportClusterStatsAction extends TransportNodesAction<ClusterSta
|
|||
NodeService nodeService, IndicesService indicesService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ClusterStatsAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, ClusterStatsRequest::new, ClusterStatsNodeRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
indexNameExpressionResolver, ClusterStatsRequest::new, ClusterStatsNodeRequest::new, ThreadPool.Names.MANAGEMENT,
|
||||
ClusterStatsNodeResponse.class);
|
||||
this.nodeService = nodeService;
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClusterStatsResponse newResponse(ClusterStatsRequest clusterStatsRequest, AtomicReferenceArray responses) {
|
||||
final List<ClusterStatsNodeResponse> nodeStats = new ArrayList<>(responses.length());
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof ClusterStatsNodeResponse) {
|
||||
nodeStats.add((ClusterStatsNodeResponse) resp);
|
||||
}
|
||||
}
|
||||
return new ClusterStatsResponse(System.currentTimeMillis(), clusterName,
|
||||
clusterService.state().metaData().clusterUUID(), nodeStats.toArray(new ClusterStatsNodeResponse[nodeStats.size()]));
|
||||
protected ClusterStatsResponse newResponse(ClusterStatsRequest request,
|
||||
List<ClusterStatsNodeResponse> responses, List<FailedNodeException> failures) {
|
||||
return new ClusterStatsResponse(System.currentTimeMillis(), clusterName, clusterService.state().metaData().clusterUUID(),
|
||||
responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,6 +53,7 @@ import org.elasticsearch.transport.TransportService;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
@ -152,7 +153,7 @@ public class TransportIndicesShardStoresAction extends TransportMasterNodeReadAc
|
|||
}
|
||||
|
||||
@Override
|
||||
protected synchronized void processAsyncFetch(ShardId shardId, NodeGatewayStartedShards[] responses, FailedNodeException[] failures) {
|
||||
protected synchronized void processAsyncFetch(ShardId shardId, List<NodeGatewayStartedShards> responses, List<FailedNodeException> failures) {
|
||||
fetchResponses.add(new Response(shardId, responses, failures));
|
||||
if (expectedOps.countDown()) {
|
||||
finish();
|
||||
|
@ -220,10 +221,10 @@ public class TransportIndicesShardStoresAction extends TransportMasterNodeReadAc
|
|||
|
||||
public class Response {
|
||||
private final ShardId shardId;
|
||||
private final NodeGatewayStartedShards[] responses;
|
||||
private final FailedNodeException[] failures;
|
||||
private final List<NodeGatewayStartedShards> responses;
|
||||
private final List<FailedNodeException> failures;
|
||||
|
||||
public Response(ShardId shardId, NodeGatewayStartedShards[] responses, FailedNodeException[] failures) {
|
||||
public Response(ShardId shardId, List<NodeGatewayStartedShards> responses, List<FailedNodeException> failures) {
|
||||
this.shardId = shardId;
|
||||
this.responses = responses;
|
||||
this.failures = failures;
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.io.IOException;
|
|||
*/
|
||||
public class ShardValidateQueryRequest extends BroadcastShardRequest {
|
||||
|
||||
private QueryBuilder<?> query;
|
||||
private QueryBuilder query;
|
||||
private String[] types = Strings.EMPTY_ARRAY;
|
||||
private boolean explain;
|
||||
private boolean rewrite;
|
||||
|
@ -57,7 +57,7 @@ public class ShardValidateQueryRequest extends BroadcastShardRequest {
|
|||
this.nowInMillis = request.nowInMillis;
|
||||
}
|
||||
|
||||
public QueryBuilder<?> query() {
|
||||
public QueryBuilder query() {
|
||||
return query;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
public class ValidateQueryRequest extends BroadcastRequest<ValidateQueryRequest> {
|
||||
|
||||
private QueryBuilder<?> query = new MatchAllQueryBuilder();
|
||||
private QueryBuilder query = new MatchAllQueryBuilder();
|
||||
|
||||
private boolean explain;
|
||||
private boolean rewrite;
|
||||
|
@ -73,11 +73,11 @@ public class ValidateQueryRequest extends BroadcastRequest<ValidateQueryRequest>
|
|||
/**
|
||||
* The query to validate.
|
||||
*/
|
||||
public QueryBuilder<?> query() {
|
||||
public QueryBuilder query() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public ValidateQueryRequest query(QueryBuilder<?> query) {
|
||||
public ValidateQueryRequest query(QueryBuilder query) {
|
||||
this.query = query;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ExplainRequest extends SingleShardRequest<ExplainRequest> {
|
|||
private String id;
|
||||
private String routing;
|
||||
private String preference;
|
||||
private QueryBuilder<?> query;
|
||||
private QueryBuilder query;
|
||||
private String[] fields;
|
||||
private FetchSourceContext fetchSourceContext;
|
||||
|
||||
|
@ -100,11 +100,11 @@ public class ExplainRequest extends SingleShardRequest<ExplainRequest> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public QueryBuilder<?> query() {
|
||||
public QueryBuilder query() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public ExplainRequest query(QueryBuilder<?> query) {
|
||||
public ExplainRequest query(QueryBuilder query) {
|
||||
this.query = query;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class PutPipelineTransportAction extends TransportMasterNodeAction<PutPip
|
|||
public void onResponse(NodesInfoResponse nodeInfos) {
|
||||
try {
|
||||
Map<DiscoveryNode, IngestInfo> ingestInfos = new HashMap<>();
|
||||
for (NodeInfo nodeInfo : nodeInfos) {
|
||||
for (NodeInfo nodeInfo : nodeInfos.getNodes()) {
|
||||
ingestInfos.put(nodeInfo.getNode(), nodeInfo.getIngest());
|
||||
}
|
||||
pipelineStore.put(clusterService, ingestInfos, request, listener);
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.util.Map;
|
|||
public class PercolateSourceBuilder extends ToXContentToBytes {
|
||||
|
||||
private DocBuilder docBuilder;
|
||||
private QueryBuilder<?> queryBuilder;
|
||||
private QueryBuilder queryBuilder;
|
||||
private Integer size;
|
||||
private List<SortBuilder<?>> sorts;
|
||||
private Boolean trackScores;
|
||||
|
@ -68,7 +68,7 @@ public class PercolateSourceBuilder extends ToXContentToBytes {
|
|||
* Sets a query to reduce the number of percolate queries to be evaluated and score the queries that match based
|
||||
* on this query.
|
||||
*/
|
||||
public PercolateSourceBuilder setQueryBuilder(QueryBuilder<?> queryBuilder) {
|
||||
public PercolateSourceBuilder setQueryBuilder(QueryBuilder queryBuilder) {
|
||||
this.queryBuilder = queryBuilder;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ public class TransportPercolateAction extends HandledTransportAction<PercolateRe
|
|||
if (querySource != null) {
|
||||
try (XContentParser parser = XContentHelper.createParser(querySource)) {
|
||||
QueryParseContext queryParseContext = new QueryParseContext(queryRegistry, parser, parseFieldMatcher);
|
||||
QueryBuilder<?> queryBuilder = queryParseContext.parseInnerQueryBuilder();
|
||||
QueryBuilder queryBuilder = queryParseContext.parseInnerQueryBuilder();
|
||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
||||
boolQueryBuilder.must(queryBuilder);
|
||||
boolQueryBuilder.filter(percolateQueryBuilder);
|
||||
|
|
|
@ -166,7 +166,7 @@ public class SearchRequestBuilder extends ActionRequestBuilder<SearchRequest, Se
|
|||
*
|
||||
* @see org.elasticsearch.index.query.QueryBuilders
|
||||
*/
|
||||
public SearchRequestBuilder setQuery(QueryBuilder<?> queryBuilder) {
|
||||
public SearchRequestBuilder setQuery(QueryBuilder queryBuilder) {
|
||||
sourceBuilder().query(queryBuilder);
|
||||
return this;
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ public class SearchRequestBuilder extends ActionRequestBuilder<SearchRequest, Se
|
|||
* Sets a filter that will be executed after the query has been executed and only has affect on the search hits
|
||||
* (not aggregations). This filter is always executed as last filtering mechanism.
|
||||
*/
|
||||
public SearchRequestBuilder setPostFilter(QueryBuilder<?> postFilter) {
|
||||
public SearchRequestBuilder setPostFilter(QueryBuilder postFilter) {
|
||||
sourceBuilder().postFilter(postFilter);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -22,61 +22,77 @@ package org.elasticsearch.action.support.nodes;
|
|||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public abstract class BaseNodesResponse<TNodeResponse extends BaseNodeResponse> extends ActionResponse implements Iterable<TNodeResponse> {
|
||||
public abstract class BaseNodesResponse<TNodeResponse extends BaseNodeResponse> extends ActionResponse {
|
||||
|
||||
private ClusterName clusterName;
|
||||
protected TNodeResponse[] nodes;
|
||||
private List<FailedNodeException> failures;
|
||||
private List<TNodeResponse> nodes;
|
||||
private Map<String, TNodeResponse> nodesMap;
|
||||
|
||||
protected BaseNodesResponse() {
|
||||
}
|
||||
|
||||
protected BaseNodesResponse(ClusterName clusterName, TNodeResponse[] nodes) {
|
||||
this.clusterName = clusterName;
|
||||
this.nodes = nodes;
|
||||
protected BaseNodesResponse(ClusterName clusterName, List<TNodeResponse> nodes, List<FailedNodeException> failures) {
|
||||
this.clusterName = Objects.requireNonNull(clusterName);
|
||||
this.failures = Objects.requireNonNull(failures);
|
||||
this.nodes = Objects.requireNonNull(nodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* The failed nodes, if set to be captured.
|
||||
* Get the {@link ClusterName} associated with all of the nodes.
|
||||
*
|
||||
* @return Never {@code null}.
|
||||
*/
|
||||
@Nullable
|
||||
public FailedNodeException[] failures() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ClusterName getClusterName() {
|
||||
return this.clusterName;
|
||||
return clusterName;
|
||||
}
|
||||
|
||||
public String getClusterNameAsString() {
|
||||
return this.clusterName.value();
|
||||
/**
|
||||
* Get the failed node exceptions.
|
||||
*
|
||||
* @return Never {@code null}. Can be empty.
|
||||
*/
|
||||
public List<FailedNodeException> failures() {
|
||||
return failures;
|
||||
}
|
||||
|
||||
public TNodeResponse[] getNodes() {
|
||||
/**
|
||||
* Determine if there are any node failures in {@link #failures}.
|
||||
*
|
||||
* @return {@code true} if {@link #failures} contains at least 1 {@link FailedNodeException}.
|
||||
*/
|
||||
public boolean hasFailures() {
|
||||
return failures.isEmpty() == false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <em>successful</em> node responses.
|
||||
*
|
||||
* @return Never {@code null}. Can be empty.
|
||||
* @see #hasFailures()
|
||||
*/
|
||||
public List<TNodeResponse> getNodes() {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
public TNodeResponse getAt(int position) {
|
||||
return nodes[position];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<TNodeResponse> iterator() {
|
||||
return getNodesMap().values().iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lazily build and get a map of Node ID to node response.
|
||||
*
|
||||
* @return Never {@code null}. Can be empty.
|
||||
* @see #getNodes()
|
||||
*/
|
||||
public Map<String, TNodeResponse> getNodesMap() {
|
||||
if (nodesMap == null) {
|
||||
nodesMap = new HashMap<>();
|
||||
|
@ -91,11 +107,28 @@ public abstract class BaseNodesResponse<TNodeResponse extends BaseNodeResponse>
|
|||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
clusterName = ClusterName.readClusterName(in);
|
||||
nodes = readNodesFrom(in);
|
||||
failures = in.readList(FailedNodeException::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
clusterName.writeTo(out);
|
||||
writeNodesTo(out, nodes);
|
||||
out.writeList(failures);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the {@link #nodes} from the stream.
|
||||
*
|
||||
* @return Never {@code null}.
|
||||
*/
|
||||
protected abstract List<TNodeResponse> readNodesFrom(StreamInput in) throws IOException;
|
||||
|
||||
/**
|
||||
* Write the {@link #nodes} to the stream.
|
||||
*/
|
||||
protected abstract void writeNodesTo(StreamOutput out, List<TNodeResponse> nodes) throws IOException;
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,9 @@ import org.elasticsearch.transport.TransportRequestHandler;
|
|||
import org.elasticsearch.transport.TransportRequestOptions;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
import java.util.function.Supplier;
|
||||
|
@ -50,22 +53,30 @@ import java.util.function.Supplier;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest<NodesRequest>, NodesResponse extends BaseNodesResponse, NodeRequest extends BaseNodeRequest, NodeResponse extends BaseNodeResponse> extends HandledTransportAction<NodesRequest, NodesResponse> {
|
||||
public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest<NodesRequest>,
|
||||
NodesResponse extends BaseNodesResponse,
|
||||
NodeRequest extends BaseNodeRequest,
|
||||
NodeResponse extends BaseNodeResponse>
|
||||
extends HandledTransportAction<NodesRequest, NodesResponse> {
|
||||
|
||||
protected final ClusterName clusterName;
|
||||
protected final ClusterService clusterService;
|
||||
protected final TransportService transportService;
|
||||
protected final Class<NodeResponse> nodeResponseClass;
|
||||
|
||||
final String transportNodeAction;
|
||||
|
||||
protected TransportNodesAction(Settings settings, String actionName, ClusterName clusterName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<NodesRequest> request, Supplier<NodeRequest> nodeRequest,
|
||||
String nodeExecutor) {
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<NodesRequest> request, Supplier<NodeRequest> nodeRequest,
|
||||
String nodeExecutor,
|
||||
Class<NodeResponse> nodeResponseClass) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
|
||||
this.clusterName = clusterName;
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.clusterName = Objects.requireNonNull(clusterName);
|
||||
this.clusterService = Objects.requireNonNull(clusterService);
|
||||
this.transportService = Objects.requireNonNull(transportService);
|
||||
this.nodeResponseClass = Objects.requireNonNull(nodeResponseClass);
|
||||
|
||||
this.transportNodeAction = actionName + "[n]";
|
||||
|
||||
|
@ -87,7 +98,46 @@ public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest
|
|||
return false;
|
||||
}
|
||||
|
||||
protected abstract NodesResponse newResponse(NodesRequest request, AtomicReferenceArray nodesResponses);
|
||||
/**
|
||||
* Map the responses into {@code nodeResponseClass} responses and {@link FailedNodeException}s.
|
||||
*
|
||||
* @param request The associated request.
|
||||
* @param nodesResponses All node-level responses
|
||||
* @return Never {@code null}.
|
||||
* @throws NullPointerException if {@code nodesResponses} is {@code null}
|
||||
* @see #newResponse(BaseNodesRequest, List, List)
|
||||
*/
|
||||
protected NodesResponse newResponse(NodesRequest request, AtomicReferenceArray nodesResponses) {
|
||||
final List<NodeResponse> responses = new ArrayList<>();
|
||||
final List<FailedNodeException> failures = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < nodesResponses.length(); ++i) {
|
||||
Object response = nodesResponses.get(i);
|
||||
|
||||
if (nodeResponseClass.isInstance(response)) {
|
||||
responses.add(nodeResponseClass.cast(response));
|
||||
} else if (response instanceof FailedNodeException) {
|
||||
failures.add((FailedNodeException)response);
|
||||
} else {
|
||||
logger.warn("ignoring unexpected response [{}] of type [{}], expected [{}] or [{}]",
|
||||
response, response != null ? response.getClass().getName() : null,
|
||||
nodeResponseClass.getSimpleName(), FailedNodeException.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
return newResponse(request, responses, failures);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link NodesResponse} (multi-node response).
|
||||
*
|
||||
* @param request The associated request.
|
||||
* @param responses All successful node-level responses.
|
||||
* @param failures All node-level failures.
|
||||
* @return Never {@code null}.
|
||||
* @throws NullPointerException if any parameter is {@code null}.
|
||||
*/
|
||||
protected abstract NodesResponse newResponse(NodesRequest request, List<NodeResponse> responses, List<FailedNodeException> failures);
|
||||
|
||||
protected abstract NodeRequest newNodeRequest(String nodeId, NodesRequest request);
|
||||
|
||||
|
@ -165,7 +215,8 @@ public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest
|
|||
taskManager.registerChildTask(task, node.getId());
|
||||
}
|
||||
|
||||
transportService.sendRequest(node, transportNodeAction, nodeRequest, builder.build(), new BaseTransportResponseHandler<NodeResponse>() {
|
||||
transportService.sendRequest(node, transportNodeAction, nodeRequest, builder.build(),
|
||||
new BaseTransportResponseHandler<NodeResponse>() {
|
||||
@Override
|
||||
public NodeResponse newInstance() {
|
||||
return newNodeResponse();
|
||||
|
@ -238,4 +289,5 @@ public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ public class TransportClientNodesService extends AbstractComponent {
|
|||
try {
|
||||
// its a listed node, light connect to it...
|
||||
logger.trace("connecting to listed node (light) [{}]", listedNode);
|
||||
transportService.connectToNodeLight(listedNode, pingTimeout, !ignoreClusterName);
|
||||
transportService.connectToNodeLight(listedNode);
|
||||
} catch (Throwable e) {
|
||||
logger.debug("failed to connect to node [{}], removed from nodes list", e, listedNode);
|
||||
newFilteredNodes.add(listedNode);
|
||||
|
@ -435,7 +435,7 @@ public class TransportClientNodesService extends AbstractComponent {
|
|||
} else {
|
||||
// its a listed node, light connect to it...
|
||||
logger.trace("connecting to listed node (light) [{}]", listedNode);
|
||||
transportService.connectToNodeLight(listedNode, pingTimeout, !ignoreClusterName);
|
||||
transportService.connectToNodeLight(listedNode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.debug("failed to connect to node [{}], ignoring...", e, listedNode);
|
||||
|
|
|
@ -404,7 +404,7 @@ public class InternalClusterInfoService extends AbstractComponent implements Clu
|
|||
}
|
||||
}
|
||||
|
||||
static void fillDiskUsagePerNode(ESLogger logger, NodeStats[] nodeStatsArray,
|
||||
static void fillDiskUsagePerNode(ESLogger logger, List<NodeStats> nodeStatsArray,
|
||||
ImmutableOpenMap.Builder<String, DiskUsage> newLeastAvaiableUsages,
|
||||
ImmutableOpenMap.Builder<String, DiskUsage> newMostAvaiableUsages) {
|
||||
for (NodeStats nodeStats : nodeStatsArray) {
|
||||
|
|
|
@ -20,10 +20,16 @@
|
|||
package org.elasticsearch.cluster.health;
|
||||
|
||||
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public enum ClusterHealthStatus {
|
||||
public enum ClusterHealthStatus implements Writeable {
|
||||
GREEN((byte) 0),
|
||||
YELLOW((byte) 1),
|
||||
RED((byte) 2);
|
||||
|
@ -38,7 +44,21 @@ public enum ClusterHealthStatus {
|
|||
return value;
|
||||
}
|
||||
|
||||
public static ClusterHealthStatus fromValue(byte value) {
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeByte(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*
|
||||
* @throws IllegalArgumentException if the value is unrecognized
|
||||
*/
|
||||
public static ClusterHealthStatus readFrom(StreamInput in) throws IOException {
|
||||
return fromValue(in.readByte());
|
||||
}
|
||||
|
||||
public static ClusterHealthStatus fromValue(byte value) throws IOException {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return GREEN;
|
||||
|
|
|
@ -141,7 +141,7 @@ public class AliasValidator extends AbstractComponent {
|
|||
|
||||
private static void validateAliasFilter(XContentParser parser, QueryShardContext queryShardContext) throws IOException {
|
||||
QueryParseContext queryParseContext = queryShardContext.newParseContext(parser);
|
||||
QueryBuilder<?> queryBuilder = QueryBuilder.rewriteQuery(queryParseContext.parseInnerQueryBuilder(), queryShardContext);
|
||||
QueryBuilder queryBuilder = QueryBuilder.rewriteQuery(queryParseContext.parseInnerQueryBuilder(), queryShardContext);
|
||||
queryBuilder.toFilter(queryShardContext);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public final class GeoPoint {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a new Geopointform a string. This String must either be a geohash
|
||||
* Create a new Geopoint from a string. This String must either be a geohash
|
||||
* or a lat-lon tuple.
|
||||
*
|
||||
* @param value String to create the point from
|
||||
|
|
|
@ -736,6 +736,29 @@ public abstract class StreamInput extends InputStream {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a {@link List} of {@link Streamable} objects, using the {@code constructor} to instantiate each instance.
|
||||
* <p>
|
||||
* This is expected to take the form:
|
||||
* <code>
|
||||
* List<MyStreamableClass> list = in.readStreamList(MyStreamableClass::new);
|
||||
* </code>
|
||||
*
|
||||
* @param constructor Streamable instance creator
|
||||
* @return Never {@code null}.
|
||||
* @throws IOException if any step fails
|
||||
*/
|
||||
public <T extends Streamable> List<T> readStreamableList(Supplier<T> constructor) throws IOException {
|
||||
int count = readVInt();
|
||||
List<T> builder = new ArrayList<>(count);
|
||||
for (int i=0; i<count; i++) {
|
||||
T instance = constructor.get();
|
||||
instance.readFrom(this);
|
||||
builder.add(instance);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a list of objects
|
||||
*/
|
||||
|
@ -762,4 +785,5 @@ public abstract class StreamInput extends InputStream {
|
|||
public static StreamInput wrap(byte[] bytes, int offset, int length) {
|
||||
return new InputStreamStreamInput(new ByteArrayInputStream(bytes, offset, length));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -727,12 +727,22 @@ public abstract class StreamOutput extends OutputStream {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a list of {@link Streamable} objects
|
||||
*/
|
||||
public void writeStreamableList(List<? extends Streamable> list) throws IOException {
|
||||
writeVInt(list.size());
|
||||
for (Streamable obj: list) {
|
||||
obj.writeTo(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a list of {@link Writeable} objects
|
||||
*/
|
||||
public <T extends Writeable> void writeList(List<T> list) throws IOException {
|
||||
public void writeList(List<? extends Writeable> list) throws IOException {
|
||||
writeVInt(list.size());
|
||||
for (T obj: list) {
|
||||
for (Writeable obj: list) {
|
||||
obj.writeTo(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,10 @@ public final class XContentBuilder implements BytesStream, Releasable {
|
|||
return this;
|
||||
}
|
||||
|
||||
public boolean isPrettyPrint() {
|
||||
return generator.isPrettyPrint();
|
||||
}
|
||||
|
||||
public XContentBuilder lfAtEnd() {
|
||||
generator.usePrintLineFeedAtEnd();
|
||||
return this;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.common.xcontent;
|
||||
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -34,6 +33,8 @@ public interface XContentGenerator extends Closeable {
|
|||
|
||||
void usePrettyPrint();
|
||||
|
||||
boolean isPrettyPrint();
|
||||
|
||||
void usePrintLineFeedAtEnd();
|
||||
|
||||
void writeStartArray() throws IOException;
|
||||
|
|
|
@ -104,6 +104,11 @@ public class JsonXContentGenerator implements XContentGenerator {
|
|||
prettyPrint = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrettyPrint() {
|
||||
return this.prettyPrint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void usePrintLineFeedAtEnd() {
|
||||
writeLineFeedAtEnd = true;
|
||||
|
|
|
@ -402,7 +402,7 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
|
|||
// connect to the node, see if we manage to do it, if not, bail
|
||||
if (!nodeFoundByAddress) {
|
||||
logger.trace("[{}] connecting (light) to {}", sendPingsHandler.id(), finalNodeToSend);
|
||||
transportService.connectToNodeLight(finalNodeToSend, timeout.getMillis());
|
||||
transportService.connectToNodeLightAndHandshake(finalNodeToSend, timeout.getMillis());
|
||||
} else {
|
||||
logger.trace("[{}] connecting to {}", sendPingsHandler.id(), finalNodeToSend);
|
||||
transportService.connectToNode(finalNodeToSend);
|
||||
|
|
|
@ -35,9 +35,11 @@ import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
|
|||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.transport.ReceiveTimeoutTransportException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -57,24 +59,24 @@ public abstract class AsyncShardFetch<T extends BaseNodeResponse> implements Rel
|
|||
/**
|
||||
* An action that lists the relevant shard data that needs to be fetched.
|
||||
*/
|
||||
public interface List<NodesResponse extends BaseNodesResponse<NodeResponse>, NodeResponse extends BaseNodeResponse> {
|
||||
public interface Lister<NodesResponse extends BaseNodesResponse<NodeResponse>, NodeResponse extends BaseNodeResponse> {
|
||||
void list(ShardId shardId, String[] nodesIds, ActionListener<NodesResponse> listener);
|
||||
}
|
||||
|
||||
protected final ESLogger logger;
|
||||
protected final String type;
|
||||
private final ShardId shardId;
|
||||
private final List<BaseNodesResponse<T>, T> action;
|
||||
private final Lister<BaseNodesResponse<T>, T> action;
|
||||
private final Map<String, NodeEntry<T>> cache = new HashMap<>();
|
||||
private final Set<String> nodesToIgnore = new HashSet<>();
|
||||
private boolean closed;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected AsyncShardFetch(ESLogger logger, String type, ShardId shardId, List<? extends BaseNodesResponse<T>, T> action) {
|
||||
protected AsyncShardFetch(ESLogger logger, String type, ShardId shardId, Lister<? extends BaseNodesResponse<T>, T> action) {
|
||||
this.logger = logger;
|
||||
this.type = type;
|
||||
this.shardId = shardId;
|
||||
this.action = (List<BaseNodesResponse<T>, T>) action;
|
||||
this.action = (Lister<BaseNodesResponse<T>, T>) action;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -167,7 +169,7 @@ public abstract class AsyncShardFetch<T extends BaseNodeResponse> implements Rel
|
|||
* the shard (response + failures), issuing a reroute at the end of it to make sure there will be another round
|
||||
* of allocations taking this new data into account.
|
||||
*/
|
||||
protected synchronized void processAsyncFetch(ShardId shardId, T[] responses, FailedNodeException[] failures) {
|
||||
protected synchronized void processAsyncFetch(ShardId shardId, List<T> responses, List<FailedNodeException> failures) {
|
||||
if (closed) {
|
||||
// we are closed, no need to process this async fetch at all
|
||||
logger.trace("{} ignoring fetched [{}] results, already closed", shardId, type);
|
||||
|
@ -276,9 +278,9 @@ public abstract class AsyncShardFetch<T extends BaseNodeResponse> implements Rel
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable e) {
|
||||
FailedNodeException[] failures = new FailedNodeException[nodesIds.length];
|
||||
for (int i = 0; i < failures.length; i++) {
|
||||
failures[i] = new FailedNodeException(nodesIds[i], "total failure in fetching", e);
|
||||
List<FailedNodeException> failures = new ArrayList<>(nodesIds.length);
|
||||
for (String nodeId : nodesIds) {
|
||||
failures.add(new FailedNodeException(nodeId, "total failure in fetching", e));
|
||||
}
|
||||
processAsyncFetch(shardId, null, failures);
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class Gateway extends AbstractComponent implements ClusterStateListener {
|
|||
int requiredAllocation = Math.max(1, minimumMasterNodesProvider.get());
|
||||
|
||||
|
||||
if (nodesState.failures().length > 0) {
|
||||
if (nodesState.hasFailures()) {
|
||||
for (FailedNodeException failedNodeException : nodesState.failures()) {
|
||||
logger.warn("failed to fetch state from node", failedNodeException);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class Gateway extends AbstractComponent implements ClusterStateListener {
|
|||
ObjectFloatHashMap<Index> indices = new ObjectFloatHashMap<>();
|
||||
MetaData electedGlobalState = null;
|
||||
int found = 0;
|
||||
for (TransportNodesListGatewayMetaState.NodeGatewayMetaState nodeState : nodesState) {
|
||||
for (TransportNodesListGatewayMetaState.NodeGatewayMetaState nodeState : nodesState.getNodes()) {
|
||||
if (nodeState.metaData() == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class Gateway extends AbstractComponent implements ClusterStateListener {
|
|||
Index index = (Index) keys[i];
|
||||
IndexMetaData electedIndexMetaData = null;
|
||||
int indexMetaDataCount = 0;
|
||||
for (TransportNodesListGatewayMetaState.NodeGatewayMetaState nodeState : nodesState) {
|
||||
for (TransportNodesListGatewayMetaState.NodeGatewayMetaState nodeState : nodesState.getNodes()) {
|
||||
if (nodeState.metaData() == null) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ public class GatewayAllocator extends AbstractComponent {
|
|||
|
||||
class InternalAsyncFetch<T extends BaseNodeResponse> extends AsyncShardFetch<T> {
|
||||
|
||||
public InternalAsyncFetch(ESLogger logger, String type, ShardId shardId, List<? extends BaseNodesResponse<T>, T> action) {
|
||||
public InternalAsyncFetch(ESLogger logger, String type, ShardId shardId, Lister<? extends BaseNodesResponse<T>, T> action) {
|
||||
super(logger, type, shardId, action);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,14 +43,15 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TransportNodesListGatewayMetaState extends TransportNodesAction<TransportNodesListGatewayMetaState.Request, TransportNodesListGatewayMetaState.NodesGatewayMetaState, TransportNodesListGatewayMetaState.NodeRequest, TransportNodesListGatewayMetaState.NodeGatewayMetaState> {
|
||||
public class TransportNodesListGatewayMetaState extends TransportNodesAction<TransportNodesListGatewayMetaState.Request,
|
||||
TransportNodesListGatewayMetaState.NodesGatewayMetaState,
|
||||
TransportNodesListGatewayMetaState.NodeRequest,
|
||||
TransportNodesListGatewayMetaState.NodeGatewayMetaState> {
|
||||
|
||||
public static final String ACTION_NAME = "internal:gateway/local/meta_state";
|
||||
|
||||
|
@ -61,7 +62,7 @@ public class TransportNodesListGatewayMetaState extends TransportNodesAction<Tra
|
|||
ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ACTION_NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, Request::new, NodeRequest::new, ThreadPool.Names.GENERIC);
|
||||
indexNameExpressionResolver, Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeGatewayMetaState.class);
|
||||
}
|
||||
|
||||
TransportNodesListGatewayMetaState init(GatewayMetaState metaState) {
|
||||
|
@ -80,7 +81,7 @@ public class TransportNodesListGatewayMetaState extends TransportNodesAction<Tra
|
|||
|
||||
@Override
|
||||
protected NodeRequest newNodeRequest(String nodeId, Request request) {
|
||||
return new NodeRequest(nodeId, request);
|
||||
return new NodeRequest(nodeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,21 +90,8 @@ public class TransportNodesListGatewayMetaState extends TransportNodesAction<Tra
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodesGatewayMetaState newResponse(Request request, AtomicReferenceArray responses) {
|
||||
final List<NodeGatewayMetaState> nodesList = new ArrayList<>();
|
||||
final List<FailedNodeException> failures = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeGatewayMetaState) { // will also filter out null response for unallocated ones
|
||||
nodesList.add((NodeGatewayMetaState) resp);
|
||||
} else if (resp instanceof FailedNodeException) {
|
||||
failures.add((FailedNodeException) resp);
|
||||
} else {
|
||||
logger.warn("unknown response type [{}], expected NodeLocalGatewayMetaState or FailedNodeException", resp);
|
||||
}
|
||||
}
|
||||
return new NodesGatewayMetaState(clusterName, nodesList.toArray(new NodeGatewayMetaState[nodesList.size()]),
|
||||
failures.toArray(new FailedNodeException[failures.size()]));
|
||||
protected NodesGatewayMetaState newResponse(Request request, List<NodeGatewayMetaState> responses, List<FailedNodeException> failures) {
|
||||
return new NodesGatewayMetaState(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -142,47 +130,30 @@ public class TransportNodesListGatewayMetaState extends TransportNodesAction<Tra
|
|||
|
||||
public static class NodesGatewayMetaState extends BaseNodesResponse<NodeGatewayMetaState> {
|
||||
|
||||
private FailedNodeException[] failures;
|
||||
|
||||
NodesGatewayMetaState() {
|
||||
}
|
||||
|
||||
public NodesGatewayMetaState(ClusterName clusterName, NodeGatewayMetaState[] nodes, FailedNodeException[] failures) {
|
||||
super(clusterName, nodes);
|
||||
this.failures = failures;
|
||||
}
|
||||
|
||||
public FailedNodeException[] failures() {
|
||||
return failures;
|
||||
public NodesGatewayMetaState(ClusterName clusterName, List<NodeGatewayMetaState> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeGatewayMetaState[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = new NodeGatewayMetaState();
|
||||
nodes[i].readFrom(in);
|
||||
}
|
||||
protected List<NodeGatewayMetaState> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readStreamableList(NodeGatewayMetaState::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeGatewayMetaState response : nodes) {
|
||||
response.writeTo(out);
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeGatewayMetaState> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NodeRequest extends BaseNodeRequest {
|
||||
|
||||
public NodeRequest() {
|
||||
}
|
||||
|
||||
NodeRequest(String nodeId, TransportNodesListGatewayMetaState.Request request) {
|
||||
NodeRequest(String nodeId) {
|
||||
super(nodeId);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,7 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
* This transport action is used to fetch the shard version from each node during primary allocation in {@link GatewayAllocator}.
|
||||
|
@ -63,7 +61,7 @@ public class TransportNodesListGatewayStartedShards extends
|
|||
TransportNodesListGatewayStartedShards.NodeRequest,
|
||||
TransportNodesListGatewayStartedShards.NodeGatewayStartedShards>
|
||||
implements
|
||||
AsyncShardFetch.List<TransportNodesListGatewayStartedShards.NodesGatewayStartedShards,
|
||||
AsyncShardFetch.Lister<TransportNodesListGatewayStartedShards.NodesGatewayStartedShards,
|
||||
TransportNodesListGatewayStartedShards.NodeGatewayStartedShards> {
|
||||
|
||||
public static final String ACTION_NAME = "internal:gateway/local/started_shards";
|
||||
|
@ -77,7 +75,8 @@ public class TransportNodesListGatewayStartedShards extends
|
|||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
NodeEnvironment env) {
|
||||
super(settings, ACTION_NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STARTED);
|
||||
indexNameExpressionResolver, Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STARTED,
|
||||
NodeGatewayStartedShards.class);
|
||||
this.nodeEnv = env;
|
||||
}
|
||||
|
||||
|
@ -110,23 +109,9 @@ public class TransportNodesListGatewayStartedShards extends
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodesGatewayStartedShards newResponse(Request request, AtomicReferenceArray responses) {
|
||||
final List<NodeGatewayStartedShards> nodesList = new ArrayList<>();
|
||||
final List<FailedNodeException> failures = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeGatewayStartedShards) { // will also filter out null response for unallocated ones
|
||||
nodesList.add((NodeGatewayStartedShards) resp);
|
||||
} else if (resp instanceof FailedNodeException) {
|
||||
failures.add((FailedNodeException) resp);
|
||||
} else {
|
||||
logger.warn("unknown response type [{}], expected NodeLocalGatewayStartedShards or FailedNodeException",
|
||||
resp);
|
||||
}
|
||||
}
|
||||
return new NodesGatewayStartedShards(clusterName,
|
||||
nodesList.toArray(new NodeGatewayStartedShards[nodesList.size()]),
|
||||
failures.toArray(new FailedNodeException[failures.size()]));
|
||||
protected NodesGatewayStartedShards newResponse(Request request,
|
||||
List<NodeGatewayStartedShards> responses, List<FailedNodeException> failures) {
|
||||
return new NodesGatewayStartedShards(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -217,36 +202,19 @@ public class TransportNodesListGatewayStartedShards extends
|
|||
|
||||
public static class NodesGatewayStartedShards extends BaseNodesResponse<NodeGatewayStartedShards> {
|
||||
|
||||
private FailedNodeException[] failures;
|
||||
|
||||
public NodesGatewayStartedShards(ClusterName clusterName, NodeGatewayStartedShards[] nodes,
|
||||
FailedNodeException[] failures) {
|
||||
super(clusterName, nodes);
|
||||
this.failures = failures;
|
||||
public NodesGatewayStartedShards(ClusterName clusterName, List<NodeGatewayStartedShards> nodes,
|
||||
List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FailedNodeException[] failures() {
|
||||
return failures;
|
||||
protected List<NodeGatewayStartedShards> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readStreamableList(NodeGatewayStartedShards::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeGatewayStartedShards[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = new NodeGatewayStartedShards();
|
||||
nodes[i].readFrom(in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeGatewayStartedShards response : nodes) {
|
||||
response.writeTo(out);
|
||||
}
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeGatewayStartedShards> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,7 +226,7 @@ public class TransportNodesListGatewayStartedShards extends
|
|||
public NodeRequest() {
|
||||
}
|
||||
|
||||
NodeRequest(String nodeId, Request request) {
|
||||
public NodeRequest(String nodeId, Request request) {
|
||||
super(nodeId);
|
||||
this.shardId = request.shardId();
|
||||
}
|
||||
|
|
|
@ -326,11 +326,6 @@ public abstract class ParseContext {
|
|||
return in.externalValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder stringBuilder() {
|
||||
return in.stringBuilder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDynamicMapper(Mapper update) {
|
||||
in.addDynamicMapper(update);
|
||||
|
@ -366,8 +361,6 @@ public abstract class ParseContext {
|
|||
|
||||
private Field uid, version;
|
||||
|
||||
private StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
private AllEntries allEntries = new AllEntries();
|
||||
|
||||
private List<Mapper> dynamicMappers = new ArrayList<>();
|
||||
|
@ -526,16 +519,6 @@ public abstract class ParseContext {
|
|||
return this.allEntries;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string builder that can be used to construct complex names for example.
|
||||
* Its better to reuse the.
|
||||
*/
|
||||
@Override
|
||||
public StringBuilder stringBuilder() {
|
||||
stringBuilder.setLength(0);
|
||||
return this.stringBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDynamicMapper(Mapper mapper) {
|
||||
dynamicMappers.add(mapper);
|
||||
|
@ -736,12 +719,6 @@ public abstract class ParseContext {
|
|||
return clazz.cast(externalValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* A string builder that can be used to construct complex names for example.
|
||||
* Its better to reuse the.
|
||||
*/
|
||||
public abstract StringBuilder stringBuilder();
|
||||
|
||||
/**
|
||||
* Add a new mapper dynamically created while parsing.
|
||||
*/
|
||||
|
|
|
@ -123,13 +123,6 @@ public final class Uid {
|
|||
return ref;
|
||||
}
|
||||
|
||||
public static BytesRef createUidAsBytes(BytesRef type, BytesRef id, BytesRefBuilder spare) {
|
||||
spare.copyBytes(type);
|
||||
spare.append(DELIMITER_BYTES);
|
||||
spare.append(id);
|
||||
return spare.get();
|
||||
}
|
||||
|
||||
public static BytesRef[] createUidsForTypesAndId(Collection<String> types, Object id) {
|
||||
return createUidsForTypesAndIds(types, Collections.singletonList(id));
|
||||
}
|
||||
|
@ -149,11 +142,7 @@ public final class Uid {
|
|||
}
|
||||
|
||||
public static String createUid(String type, String id) {
|
||||
return createUid(new StringBuilder(), type, id);
|
||||
}
|
||||
|
||||
public static String createUid(StringBuilder sb, String type, String id) {
|
||||
return sb.append(type).append(DELIMITER).append(id).toString();
|
||||
return type + DELIMITER + id;
|
||||
}
|
||||
|
||||
public static boolean hasDelimiter(BytesRef uid) {
|
||||
|
|
|
@ -36,7 +36,6 @@ import org.elasticsearch.common.Nullable;
|
|||
import org.elasticsearch.common.joda.DateMathParser;
|
||||
import org.elasticsearch.common.joda.FormatDateTimeFormatter;
|
||||
import org.elasticsearch.common.joda.Joda;
|
||||
import org.elasticsearch.common.network.InetAddresses;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.Fuzziness;
|
||||
import org.elasticsearch.common.util.LocaleUtils;
|
||||
|
@ -152,7 +151,7 @@ public class DateFieldMapper extends FieldMapper implements AllFieldMapper.Inclu
|
|||
if (propNode == null) {
|
||||
throw new MapperParsingException("Property [null_value] cannot be null.");
|
||||
}
|
||||
builder.nullValue(InetAddresses.forString(propNode.toString()));
|
||||
builder.nullValue(propNode.toString());
|
||||
iterator.remove();
|
||||
} else if (propName.equals("ignore_malformed")) {
|
||||
builder.ignoreMalformed(TypeParsers.nodeBooleanValue("ignore_malformed", propNode, parserContext));
|
||||
|
@ -561,7 +560,7 @@ public class DateFieldMapper extends FieldMapper implements AllFieldMapper.Inclu
|
|||
dateAsString = dateAsObject.toString();
|
||||
}
|
||||
} else {
|
||||
dateAsString = context.parser().text();
|
||||
dateAsString = context.parser().textOrNull();
|
||||
}
|
||||
|
||||
if (dateAsString == null) {
|
||||
|
@ -615,6 +614,11 @@ public class DateFieldMapper extends FieldMapper implements AllFieldMapper.Inclu
|
|||
if (includeDefaults || ignoreMalformed.explicit()) {
|
||||
builder.field("ignore_malformed", ignoreMalformed.value());
|
||||
}
|
||||
|
||||
if (includeDefaults || fieldType().nullValue() != null) {
|
||||
builder.field("null_value", fieldType().nullValueAsString());
|
||||
}
|
||||
|
||||
if (includeInAll != null) {
|
||||
builder.field("include_in_all", includeInAll);
|
||||
} else if (includeDefaults) {
|
||||
|
|
|
@ -366,8 +366,15 @@ public class NumberFieldMapper extends FieldMapper implements AllFieldMapper.Inc
|
|||
BYTE("byte", NumericType.BYTE) {
|
||||
@Override
|
||||
Byte parse(Object value) {
|
||||
if (value instanceof Byte) {
|
||||
return (Byte) value;
|
||||
if (value instanceof Number) {
|
||||
double doubleValue = ((Number) value).doubleValue();
|
||||
if (doubleValue < Byte.MIN_VALUE || doubleValue > Byte.MAX_VALUE) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] is out of range for a byte");
|
||||
}
|
||||
if (doubleValue % 1 != 0) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] has a decimal part");
|
||||
}
|
||||
return ((Number) value).byteValue();
|
||||
}
|
||||
if (value instanceof BytesRef) {
|
||||
value = ((BytesRef) value).utf8ToString();
|
||||
|
@ -426,6 +433,13 @@ public class NumberFieldMapper extends FieldMapper implements AllFieldMapper.Inc
|
|||
@Override
|
||||
Short parse(Object value) {
|
||||
if (value instanceof Number) {
|
||||
double doubleValue = ((Number) value).doubleValue();
|
||||
if (doubleValue < Short.MIN_VALUE || doubleValue > Short.MAX_VALUE) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] is out of range for a short");
|
||||
}
|
||||
if (doubleValue % 1 != 0) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] has a decimal part");
|
||||
}
|
||||
return ((Number) value).shortValue();
|
||||
}
|
||||
if (value instanceof BytesRef) {
|
||||
|
@ -485,6 +499,13 @@ public class NumberFieldMapper extends FieldMapper implements AllFieldMapper.Inc
|
|||
@Override
|
||||
Integer parse(Object value) {
|
||||
if (value instanceof Number) {
|
||||
double doubleValue = ((Number) value).doubleValue();
|
||||
if (doubleValue < Integer.MIN_VALUE || doubleValue > Integer.MAX_VALUE) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] is out of range for an integer");
|
||||
}
|
||||
if (doubleValue % 1 != 0) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] has a decimal part");
|
||||
}
|
||||
return ((Number) value).intValue();
|
||||
}
|
||||
if (value instanceof BytesRef) {
|
||||
|
@ -581,6 +602,13 @@ public class NumberFieldMapper extends FieldMapper implements AllFieldMapper.Inc
|
|||
@Override
|
||||
Long parse(Object value) {
|
||||
if (value instanceof Number) {
|
||||
double doubleValue = ((Number) value).doubleValue();
|
||||
if (doubleValue < Long.MIN_VALUE || doubleValue > Long.MAX_VALUE) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] is out of range for a long");
|
||||
}
|
||||
if (doubleValue % 1 != 0) {
|
||||
throw new IllegalArgumentException("Value [" + value + "] has a decimal part");
|
||||
}
|
||||
return ((Number) value).longValue();
|
||||
}
|
||||
if (value instanceof BytesRef) {
|
||||
|
@ -944,6 +972,11 @@ public class NumberFieldMapper extends FieldMapper implements AllFieldMapper.Inc
|
|||
if (includeDefaults || coerce.explicit()) {
|
||||
builder.field("coerce", coerce.value());
|
||||
}
|
||||
|
||||
if (includeDefaults || fieldType().nullValue() != null) {
|
||||
builder.field("null_value", fieldType().nullValue());
|
||||
}
|
||||
|
||||
if (includeInAll != null) {
|
||||
builder.field("include_in_all", includeInAll);
|
||||
} else if (includeDefaults) {
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.apache.lucene.search.TermQuery;
|
|||
import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.loader.SettingsLoader;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -264,7 +263,7 @@ public class ParentFieldMapper extends MetadataFieldMapper {
|
|||
}
|
||||
// we did not add it in the parsing phase, add it now
|
||||
fields.add(new SortedDocValuesField(fieldType.name(), new BytesRef(parentId)));
|
||||
} else if (parentId != null && !parsedParentId.equals(Uid.createUid(context.stringBuilder(), parentType, parentId))) {
|
||||
} else if (parentId != null && !parsedParentId.equals(Uid.createUid(parentType, parentId))) {
|
||||
throw new MapperParsingException("Parent id mismatch, document value is [" + Uid.createUid(parsedParentId).id() + "], while external value is [" + parentId + "]");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.lucene.document.BinaryDocValuesField;
|
|||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.index.IndexOptions;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.common.lucene.Lucene;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
@ -177,7 +176,7 @@ public class UidFieldMapper extends MetadataFieldMapper {
|
|||
|
||||
@Override
|
||||
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException {
|
||||
Field uid = new Field(NAME, Uid.createUid(context.stringBuilder(), context.type(), context.id()), Defaults.FIELD_TYPE);
|
||||
Field uid = new Field(NAME, Uid.createUid(context.type(), context.id()), Defaults.FIELD_TYPE);
|
||||
context.uid(uid);
|
||||
fields.add(uid);
|
||||
if (fieldType().hasDocValues()) {
|
||||
|
|
|
@ -339,7 +339,7 @@ public class IpFieldMapper extends FieldMapper implements AllFieldMapper.Include
|
|||
if (context.externalValueSet()) {
|
||||
addressAsObject = context.externalValue();
|
||||
} else {
|
||||
addressAsObject = context.parser().text();
|
||||
addressAsObject = context.parser().textOrNull();
|
||||
}
|
||||
|
||||
if (addressAsObject == null) {
|
||||
|
@ -395,6 +395,10 @@ public class IpFieldMapper extends FieldMapper implements AllFieldMapper.Include
|
|||
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
|
||||
super.doXContentBody(builder, includeDefaults, params);
|
||||
|
||||
if (includeDefaults || fieldType().nullValue() != null) {
|
||||
builder.field("null_value", InetAddresses.toAddrString((InetAddress) fieldType().nullValue()));
|
||||
}
|
||||
|
||||
if (includeDefaults || ignoreMalformed.explicit()) {
|
||||
builder.field("ignore_malformed", ignoreMalformed.value());
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ public class PercolatorFieldMapper extends FieldMapper {
|
|||
}
|
||||
|
||||
XContentParser parser = context.parser();
|
||||
QueryBuilder<?> queryBuilder = parseQueryBuilder(queryShardContext.newParseContext(parser), parser.getTokenLocation());
|
||||
QueryBuilder queryBuilder = parseQueryBuilder(queryShardContext.newParseContext(parser), parser.getTokenLocation());
|
||||
// Fetching of terms, shapes and indexed scripts happen during this rewrite:
|
||||
queryBuilder = queryBuilder.rewrite(queryShardContext);
|
||||
|
||||
|
@ -206,7 +206,7 @@ public class PercolatorFieldMapper extends FieldMapper {
|
|||
return toQuery(context, mapUnmappedFieldsAsString, parseQueryBuilder(context.newParseContext(parser), parser.getTokenLocation()));
|
||||
}
|
||||
|
||||
static Query toQuery(QueryShardContext context, boolean mapUnmappedFieldsAsString, QueryBuilder<?> queryBuilder) throws IOException {
|
||||
static Query toQuery(QueryShardContext context, boolean mapUnmappedFieldsAsString, QueryBuilder queryBuilder) throws IOException {
|
||||
// This means that fields in the query need to exist in the mapping prior to registering this query
|
||||
// The reason that this is required, is that if a field doesn't exist then the query assumes defaults, which may be undesired.
|
||||
//
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.util.Objects;
|
|||
* Base class for all classes producing lucene queries.
|
||||
* Supports conversion to BytesReference and creation of lucene Query objects.
|
||||
*/
|
||||
public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>> extends ToXContentToBytes implements QueryBuilder<QB> {
|
||||
public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>> extends ToXContentToBytes implements QueryBuilder {
|
||||
|
||||
/** Default for boost to apply to resulting Lucene query. Defaults to 1.0*/
|
||||
public static final float DEFAULT_BOOST = 1.0f;
|
||||
|
@ -221,10 +221,10 @@ public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>>
|
|||
* their {@link QueryBuilder#toQuery(QueryShardContext)} method are not added to the
|
||||
* resulting collection.
|
||||
*/
|
||||
protected static Collection<Query> toQueries(Collection<QueryBuilder<?>> queryBuilders, QueryShardContext context) throws QueryShardException,
|
||||
protected static Collection<Query> toQueries(Collection<QueryBuilder> queryBuilders, QueryShardContext context) throws QueryShardException,
|
||||
IOException {
|
||||
List<Query> queries = new ArrayList<>(queryBuilders.size());
|
||||
for (QueryBuilder<?> queryBuilder : queryBuilders) {
|
||||
for (QueryBuilder queryBuilder : queryBuilders) {
|
||||
Query query = queryBuilder.toQuery(context);
|
||||
if (query != null) {
|
||||
queries.add(query);
|
||||
|
@ -241,13 +241,13 @@ public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>>
|
|||
|
||||
protected final static void writeQueries(StreamOutput out, List<? extends QueryBuilder> queries) throws IOException {
|
||||
out.writeVInt(queries.size());
|
||||
for (QueryBuilder<?> query : queries) {
|
||||
for (QueryBuilder query : queries) {
|
||||
out.writeNamedWriteable(query);
|
||||
}
|
||||
}
|
||||
|
||||
protected final static List<QueryBuilder<?>> readQueries(StreamInput in) throws IOException {
|
||||
List<QueryBuilder<?>> queries = new ArrayList<>();
|
||||
protected final static List<QueryBuilder> readQueries(StreamInput in) throws IOException {
|
||||
List<QueryBuilder> queries = new ArrayList<>();
|
||||
int size = in.readVInt();
|
||||
for (int i = 0; i < size; i++) {
|
||||
queries.add(in.readNamedWriteable(QueryBuilder.class));
|
||||
|
@ -256,8 +256,8 @@ public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>>
|
|||
}
|
||||
|
||||
@Override
|
||||
public final QueryBuilder<?> rewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
QueryBuilder<?> rewritten = doRewrite(queryShardContext);
|
||||
public final QueryBuilder rewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
QueryBuilder rewritten = doRewrite(queryShardContext);
|
||||
if (rewritten == this) {
|
||||
return rewritten;
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>>
|
|||
return rewritten;
|
||||
}
|
||||
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,13 +62,13 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
private static final ParseField MINIMUM_NUMBER_SHOULD_MATCH = new ParseField("minimum_number_should_match");
|
||||
private static final ParseField ADJUST_PURE_NEGATIVE = new ParseField("adjust_pure_negative");
|
||||
|
||||
private final List<QueryBuilder<?>> mustClauses = new ArrayList<>();
|
||||
private final List<QueryBuilder> mustClauses = new ArrayList<>();
|
||||
|
||||
private final List<QueryBuilder<?>> mustNotClauses = new ArrayList<>();
|
||||
private final List<QueryBuilder> mustNotClauses = new ArrayList<>();
|
||||
|
||||
private final List<QueryBuilder<?>> filterClauses = new ArrayList<>();
|
||||
private final List<QueryBuilder> filterClauses = new ArrayList<>();
|
||||
|
||||
private final List<QueryBuilder<?>> shouldClauses = new ArrayList<>();
|
||||
private final List<QueryBuilder> shouldClauses = new ArrayList<>();
|
||||
|
||||
private boolean disableCoord = DISABLE_COORD_DEFAULT;
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
* Adds a query that <b>must</b> appear in the matching documents and will
|
||||
* contribute to scoring. No <tt>null</tt> value allowed.
|
||||
*/
|
||||
public BoolQueryBuilder must(QueryBuilder<?> queryBuilder) {
|
||||
public BoolQueryBuilder must(QueryBuilder queryBuilder) {
|
||||
if (queryBuilder == null) {
|
||||
throw new IllegalArgumentException("inner bool query clause cannot be null");
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
/**
|
||||
* Gets the queries that <b>must</b> appear in the matching documents.
|
||||
*/
|
||||
public List<QueryBuilder<?>> must() {
|
||||
public List<QueryBuilder> must() {
|
||||
return this.mustClauses;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
* Adds a query that <b>must</b> appear in the matching documents but will
|
||||
* not contribute to scoring. No <tt>null</tt> value allowed.
|
||||
*/
|
||||
public BoolQueryBuilder filter(QueryBuilder<?> queryBuilder) {
|
||||
public BoolQueryBuilder filter(QueryBuilder queryBuilder) {
|
||||
if (queryBuilder == null) {
|
||||
throw new IllegalArgumentException("inner bool query clause cannot be null");
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
/**
|
||||
* Gets the queries that <b>must</b> appear in the matching documents but don't contribute to scoring
|
||||
*/
|
||||
public List<QueryBuilder<?>> filter() {
|
||||
public List<QueryBuilder> filter() {
|
||||
return this.filterClauses;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
* Adds a query that <b>must not</b> appear in the matching documents.
|
||||
* No <tt>null</tt> value allowed.
|
||||
*/
|
||||
public BoolQueryBuilder mustNot(QueryBuilder<?> queryBuilder) {
|
||||
public BoolQueryBuilder mustNot(QueryBuilder queryBuilder) {
|
||||
if (queryBuilder == null) {
|
||||
throw new IllegalArgumentException("inner bool query clause cannot be null");
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
/**
|
||||
* Gets the queries that <b>must not</b> appear in the matching documents.
|
||||
*/
|
||||
public List<QueryBuilder<?>> mustNot() {
|
||||
public List<QueryBuilder> mustNot() {
|
||||
return this.mustNotClauses;
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
*
|
||||
* @see #minimumNumberShouldMatch(int)
|
||||
*/
|
||||
public BoolQueryBuilder should(QueryBuilder<?> queryBuilder) {
|
||||
public BoolQueryBuilder should(QueryBuilder queryBuilder) {
|
||||
if (queryBuilder == null) {
|
||||
throw new IllegalArgumentException("inner bool query clause cannot be null");
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
* @see #should(QueryBuilder)
|
||||
* @see #minimumNumberShouldMatch(int)
|
||||
*/
|
||||
public List<QueryBuilder<?>> should() {
|
||||
public List<QueryBuilder> should() {
|
||||
return this.shouldClauses;
|
||||
}
|
||||
|
||||
|
@ -288,13 +288,13 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
builder.endObject();
|
||||
}
|
||||
|
||||
private static void doXArrayContent(String field, List<QueryBuilder<?>> clauses, XContentBuilder builder, Params params)
|
||||
private static void doXArrayContent(String field, List<QueryBuilder> clauses, XContentBuilder builder, Params params)
|
||||
throws IOException {
|
||||
if (clauses.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
builder.startArray(field);
|
||||
for (QueryBuilder<?> clause : clauses) {
|
||||
for (QueryBuilder clause : clauses) {
|
||||
clause.toXContent(builder, params);
|
||||
}
|
||||
builder.endArray();
|
||||
|
@ -308,15 +308,15 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
String minimumShouldMatch = null;
|
||||
|
||||
final List<QueryBuilder<?>> mustClauses = new ArrayList<>();
|
||||
final List<QueryBuilder<?>> mustNotClauses = new ArrayList<>();
|
||||
final List<QueryBuilder<?>> shouldClauses = new ArrayList<>();
|
||||
final List<QueryBuilder<?>> filterClauses = new ArrayList<>();
|
||||
final List<QueryBuilder> mustClauses = new ArrayList<>();
|
||||
final List<QueryBuilder> mustNotClauses = new ArrayList<>();
|
||||
final List<QueryBuilder> shouldClauses = new ArrayList<>();
|
||||
final List<QueryBuilder> filterClauses = new ArrayList<>();
|
||||
String queryName = null;
|
||||
|
||||
String currentFieldName = null;
|
||||
XContentParser.Token token;
|
||||
QueryBuilder<?> query;
|
||||
QueryBuilder query;
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
currentFieldName = parser.currentName();
|
||||
|
@ -387,16 +387,16 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
}
|
||||
}
|
||||
BoolQueryBuilder boolQuery = new BoolQueryBuilder();
|
||||
for (QueryBuilder<?> queryBuilder : mustClauses) {
|
||||
for (QueryBuilder queryBuilder : mustClauses) {
|
||||
boolQuery.must(queryBuilder);
|
||||
}
|
||||
for (QueryBuilder<?> queryBuilder : mustNotClauses) {
|
||||
for (QueryBuilder queryBuilder : mustNotClauses) {
|
||||
boolQuery.mustNot(queryBuilder);
|
||||
}
|
||||
for (QueryBuilder<?> queryBuilder : shouldClauses) {
|
||||
for (QueryBuilder queryBuilder : shouldClauses) {
|
||||
boolQuery.should(queryBuilder);
|
||||
}
|
||||
for (QueryBuilder<?> queryBuilder : filterClauses) {
|
||||
for (QueryBuilder queryBuilder : filterClauses) {
|
||||
boolQuery.filter(queryBuilder);
|
||||
}
|
||||
boolQuery.boost(boost);
|
||||
|
@ -436,8 +436,8 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
}
|
||||
|
||||
private static void addBooleanClauses(QueryShardContext context, BooleanQuery.Builder booleanQueryBuilder,
|
||||
List<QueryBuilder<?>> clauses, Occur occurs) throws IOException {
|
||||
for (QueryBuilder<?> query : clauses) {
|
||||
List<QueryBuilder> clauses, Occur occurs) throws IOException {
|
||||
for (QueryBuilder query : clauses) {
|
||||
Query luceneQuery = null;
|
||||
switch (occurs) {
|
||||
case MUST:
|
||||
|
@ -473,7 +473,7 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
BoolQueryBuilder newBuilder = new BoolQueryBuilder();
|
||||
boolean changed = false;
|
||||
final int clauses = mustClauses.size() + mustNotClauses.size() + filterClauses.size() + shouldClauses.size();
|
||||
|
@ -498,20 +498,20 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> {
|
|||
|
||||
@Override
|
||||
protected void extractInnerHitBuilders(Map<String, InnerHitBuilder> innerHits) {
|
||||
List<QueryBuilder<?>> clauses = new ArrayList<>(filter());
|
||||
List<QueryBuilder> clauses = new ArrayList<>(filter());
|
||||
clauses.addAll(must());
|
||||
clauses.addAll(should());
|
||||
// no need to include must_not (since there will be no hits for it)
|
||||
for (QueryBuilder<?> clause : clauses) {
|
||||
for (QueryBuilder clause : clauses) {
|
||||
InnerHitBuilder.extractInnerHits(clause, innerHits);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean rewriteClauses(QueryRewriteContext queryRewriteContext, List<QueryBuilder<?>> builders,
|
||||
Consumer<QueryBuilder<?>> consumer) throws IOException {
|
||||
private static boolean rewriteClauses(QueryRewriteContext queryRewriteContext, List<QueryBuilder> builders,
|
||||
Consumer<QueryBuilder> consumer) throws IOException {
|
||||
boolean changed = false;
|
||||
for (QueryBuilder<?> builder : builders) {
|
||||
QueryBuilder<?> result = builder.rewrite(queryRewriteContext);
|
||||
for (QueryBuilder builder : builders) {
|
||||
QueryBuilder result = builder.rewrite(queryRewriteContext);
|
||||
if (result != builder) {
|
||||
changed = true;
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ public class BoostingQueryBuilder extends AbstractQueryBuilder<BoostingQueryBuil
|
|||
private static final ParseField NEGATIVE_FIELD = new ParseField("negative");
|
||||
private static final ParseField NEGATIVE_BOOST_FIELD = new ParseField("negative_boost");
|
||||
|
||||
private final QueryBuilder<?> positiveQuery;
|
||||
private final QueryBuilder positiveQuery;
|
||||
|
||||
private final QueryBuilder<?> negativeQuery;
|
||||
private final QueryBuilder negativeQuery;
|
||||
|
||||
private float negativeBoost = -1;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class BoostingQueryBuilder extends AbstractQueryBuilder<BoostingQueryBuil
|
|||
* @param positiveQuery the positive query for this boosting query.
|
||||
* @param negativeQuery the negative query for this boosting query.
|
||||
*/
|
||||
public BoostingQueryBuilder(QueryBuilder<?> positiveQuery, QueryBuilder<?> negativeQuery) {
|
||||
public BoostingQueryBuilder(QueryBuilder positiveQuery, QueryBuilder negativeQuery) {
|
||||
if (positiveQuery == null) {
|
||||
throw new IllegalArgumentException("inner clause [positive] cannot be null.");
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ public class BoostingQueryBuilder extends AbstractQueryBuilder<BoostingQueryBuil
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder positiveQuery = this.positiveQuery.rewrite(queryRewriteContext);
|
||||
QueryBuilder negativeQuery = this.negativeQuery.rewrite(queryRewriteContext);
|
||||
if (positiveQuery != this.positiveQuery || negativeQuery != this.negativeQuery) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class ConstantScoreQueryBuilder extends AbstractQueryBuilder<ConstantScor
|
|||
|
||||
private static final ParseField INNER_QUERY_FIELD = new ParseField("filter", "query");
|
||||
|
||||
private final QueryBuilder<?> filterBuilder;
|
||||
private final QueryBuilder filterBuilder;
|
||||
|
||||
/**
|
||||
* A query that wraps another query and simply returns a constant score equal to the
|
||||
|
@ -51,7 +51,7 @@ public class ConstantScoreQueryBuilder extends AbstractQueryBuilder<ConstantScor
|
|||
*
|
||||
* @param filterBuilder The query to wrap in a constant score query
|
||||
*/
|
||||
public ConstantScoreQueryBuilder(QueryBuilder<?> filterBuilder) {
|
||||
public ConstantScoreQueryBuilder(QueryBuilder filterBuilder) {
|
||||
if (filterBuilder == null) {
|
||||
throw new IllegalArgumentException("inner clause [filter] cannot be null.");
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class ConstantScoreQueryBuilder extends AbstractQueryBuilder<ConstantScor
|
|||
/**
|
||||
* @return the query that was wrapped in this constant score query
|
||||
*/
|
||||
public QueryBuilder<?> innerQuery() {
|
||||
public QueryBuilder innerQuery() {
|
||||
return this.filterBuilder;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ public class ConstantScoreQueryBuilder extends AbstractQueryBuilder<ConstantScor
|
|||
public static ConstantScoreQueryBuilder fromXContent(QueryParseContext parseContext) throws IOException {
|
||||
XContentParser parser = parseContext.parser();
|
||||
|
||||
QueryBuilder<?> query = null;
|
||||
QueryBuilder query = null;
|
||||
boolean queryFound = false;
|
||||
String queryName = null;
|
||||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
|
@ -163,8 +163,8 @@ public class ConstantScoreQueryBuilder extends AbstractQueryBuilder<ConstantScor
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder<?> rewrite = filterBuilder.rewrite(queryRewriteContext);
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder rewrite = filterBuilder.rewrite(queryRewriteContext);
|
||||
if (rewrite != filterBuilder) {
|
||||
return new ConstantScoreQueryBuilder(rewrite);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
private static final ParseField TIE_BREAKER_FIELD = new ParseField("tie_breaker");
|
||||
private static final ParseField QUERIES_FIELD = new ParseField("queries");
|
||||
|
||||
private final List<QueryBuilder<?>> queries = new ArrayList<>();
|
||||
private final List<QueryBuilder> queries = new ArrayList<>();
|
||||
|
||||
private float tieBreaker = DEFAULT_TIE_BREAKER;
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
/**
|
||||
* Add a sub-query to this disjunction.
|
||||
*/
|
||||
public DisMaxQueryBuilder add(QueryBuilder<?> queryBuilder) {
|
||||
public DisMaxQueryBuilder add(QueryBuilder queryBuilder) {
|
||||
if (queryBuilder == null) {
|
||||
throw new IllegalArgumentException("inner dismax query clause cannot be null");
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
/**
|
||||
* @return an immutable list copy of the current sub-queries of this disjunction
|
||||
*/
|
||||
public List<QueryBuilder<?>> innerQueries() {
|
||||
public List<QueryBuilder> innerQueries() {
|
||||
return this.queries;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
builder.startObject(NAME);
|
||||
builder.field(TIE_BREAKER_FIELD.getPreferredName(), tieBreaker);
|
||||
builder.startArray(QUERIES_FIELD.getPreferredName());
|
||||
for (QueryBuilder<?> queryBuilder : queries) {
|
||||
for (QueryBuilder queryBuilder : queries) {
|
||||
queryBuilder.toXContent(builder, params);
|
||||
}
|
||||
builder.endArray();
|
||||
|
@ -128,7 +128,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
float tieBreaker = DisMaxQueryBuilder.DEFAULT_TIE_BREAKER;
|
||||
|
||||
final List<QueryBuilder<?>> queries = new ArrayList<>();
|
||||
final List<QueryBuilder> queries = new ArrayList<>();
|
||||
boolean queriesFound = false;
|
||||
String queryName = null;
|
||||
|
||||
|
@ -140,7 +140,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||
if (parseContext.getParseFieldMatcher().match(currentFieldName, QUERIES_FIELD)) {
|
||||
queriesFound = true;
|
||||
QueryBuilder<?> query = parseContext.parseInnerQueryBuilder();
|
||||
QueryBuilder query = parseContext.parseInnerQueryBuilder();
|
||||
queries.add(query);
|
||||
} else {
|
||||
throw new ParsingException(parser.getTokenLocation(), "[dis_max] query does not support [" + currentFieldName + "]");
|
||||
|
@ -149,7 +149,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
if (parseContext.getParseFieldMatcher().match(currentFieldName, QUERIES_FIELD)) {
|
||||
queriesFound = true;
|
||||
while (token != XContentParser.Token.END_ARRAY) {
|
||||
QueryBuilder<?> query = parseContext.parseInnerQueryBuilder();
|
||||
QueryBuilder query = parseContext.parseInnerQueryBuilder();
|
||||
queries.add(query);
|
||||
token = parser.nextToken();
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
|||
disMaxQuery.tieBreaker(tieBreaker);
|
||||
disMaxQuery.queryName(queryName);
|
||||
disMaxQuery.boost(boost);
|
||||
for (QueryBuilder<?> query : queries) {
|
||||
for (QueryBuilder query : queries) {
|
||||
disMaxQuery.add(query);
|
||||
}
|
||||
return disMaxQuery;
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.io.IOException;
|
|||
import java.util.Objects;
|
||||
|
||||
public class FieldMaskingSpanQueryBuilder extends AbstractQueryBuilder<FieldMaskingSpanQueryBuilder>
|
||||
implements SpanQueryBuilder<FieldMaskingSpanQueryBuilder>{
|
||||
implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "field_masking_span";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
@ -43,7 +43,7 @@ public class FieldMaskingSpanQueryBuilder extends AbstractQueryBuilder<FieldMask
|
|||
private static final ParseField FIELD_FIELD = new ParseField("field");
|
||||
private static final ParseField QUERY_FIELD = new ParseField("query");
|
||||
|
||||
private final SpanQueryBuilder<?> queryBuilder;
|
||||
private final SpanQueryBuilder queryBuilder;
|
||||
|
||||
private final String fieldName;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class FieldMaskingSpanQueryBuilder extends AbstractQueryBuilder<FieldMask
|
|||
* @param queryBuilder inner {@link SpanQueryBuilder}
|
||||
* @param fieldName the field name
|
||||
*/
|
||||
public FieldMaskingSpanQueryBuilder(SpanQueryBuilder<?> queryBuilder, String fieldName) {
|
||||
public FieldMaskingSpanQueryBuilder(SpanQueryBuilder queryBuilder, String fieldName) {
|
||||
if (Strings.isEmpty(fieldName)) {
|
||||
throw new IllegalArgumentException("field name is null or empty");
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class FieldMaskingSpanQueryBuilder extends AbstractQueryBuilder<FieldMask
|
|||
*/
|
||||
public FieldMaskingSpanQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
queryBuilder = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
queryBuilder = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
fieldName = in.readString();
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import java.util.Objects;
|
|||
* a match query with the fuzziness parameter for strings or range queries for numeric and date fields.
|
||||
*/
|
||||
@Deprecated
|
||||
public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> implements MultiTermQueryBuilder<FuzzyQueryBuilder> {
|
||||
public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> implements MultiTermQueryBuilder {
|
||||
|
||||
public static final String NAME = "fuzzy";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
|
|
@ -587,7 +587,7 @@ public class GeoShapeQueryBuilder extends AbstractQueryBuilder<GeoShapeQueryBuil
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<GeoShapeQueryBuilder> doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
if (this.shape == null) {
|
||||
GetRequest getRequest = new GetRequest(indexedShapeIndex, indexedShapeType, indexedShapeId);
|
||||
ShapeBuilder shape = fetch(queryShardContext.getClient(), getRequest, indexedShapePath);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuil
|
|||
private static final ParseField INNER_HITS_FIELD = new ParseField("inner_hits");
|
||||
private static final ParseField IGNORE_UNMAPPED_FIELD = new ParseField("ignore_unmapped");
|
||||
|
||||
private final QueryBuilder<?> query;
|
||||
private final QueryBuilder query;
|
||||
private final String type;
|
||||
private final ScoreMode scoreMode;
|
||||
private InnerHitBuilder innerHitBuilder;
|
||||
|
@ -85,11 +85,11 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuil
|
|||
private int maxChildren = DEFAULT_MAX_CHILDREN;
|
||||
private boolean ignoreUnmapped = false;
|
||||
|
||||
public HasChildQueryBuilder(String type, QueryBuilder<?> query, ScoreMode scoreMode) {
|
||||
public HasChildQueryBuilder(String type, QueryBuilder query, ScoreMode scoreMode) {
|
||||
this(type, query, DEFAULT_MIN_CHILDREN, DEFAULT_MAX_CHILDREN, scoreMode, null);
|
||||
}
|
||||
|
||||
private HasChildQueryBuilder(String type, QueryBuilder<?> query, int minChildren, int maxChildren, ScoreMode scoreMode,
|
||||
private HasChildQueryBuilder(String type, QueryBuilder query, int minChildren, int maxChildren, ScoreMode scoreMode,
|
||||
InnerHitBuilder innerHitBuilder) {
|
||||
this.type = requireValue(type, "[" + NAME + "] requires 'type' field");
|
||||
this.query = requireValue(query, "[" + NAME + "] requires 'query' field");
|
||||
|
@ -158,7 +158,7 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuil
|
|||
/**
|
||||
* Returns the children query to execute.
|
||||
*/
|
||||
public QueryBuilder<?> query() {
|
||||
public QueryBuilder query() {
|
||||
return query;
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuil
|
|||
InnerHitBuilder innerHitBuilder = null;
|
||||
String currentFieldName = null;
|
||||
XContentParser.Token token;
|
||||
QueryBuilder<?> iqb = null;
|
||||
QueryBuilder iqb = null;
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
currentFieldName = parser.currentName();
|
||||
|
@ -467,8 +467,8 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuil
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder<?> rewrite = query.rewrite(queryRewriteContext);
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder rewrite = query.rewrite(queryRewriteContext);
|
||||
if (rewrite != query) {
|
||||
return new HasChildQueryBuilder(type, rewrite, minChildren, minChildren, scoreMode, innerHitBuilder);
|
||||
}
|
||||
|
|
|
@ -60,17 +60,17 @@ public class HasParentQueryBuilder extends AbstractQueryBuilder<HasParentQueryBu
|
|||
private static final ParseField INNER_HITS_FIELD = new ParseField("inner_hits");
|
||||
private static final ParseField IGNORE_UNMAPPED_FIELD = new ParseField("ignore_unmapped");
|
||||
|
||||
private final QueryBuilder<?> query;
|
||||
private final QueryBuilder query;
|
||||
private final String type;
|
||||
private final boolean score;
|
||||
private InnerHitBuilder innerHit;
|
||||
private boolean ignoreUnmapped = false;
|
||||
|
||||
public HasParentQueryBuilder(String type, QueryBuilder<?> query, boolean score) {
|
||||
public HasParentQueryBuilder(String type, QueryBuilder query, boolean score) {
|
||||
this(type, query, score, null);
|
||||
}
|
||||
|
||||
private HasParentQueryBuilder(String type, QueryBuilder<?> query, boolean score, InnerHitBuilder innerHit) {
|
||||
private HasParentQueryBuilder(String type, QueryBuilder query, boolean score, InnerHitBuilder innerHit) {
|
||||
this.type = requireValue(type, "[" + NAME + "] requires 'type' field");
|
||||
this.query = requireValue(query, "[" + NAME + "] requires 'query' field");
|
||||
this.score = score;
|
||||
|
@ -101,7 +101,7 @@ public class HasParentQueryBuilder extends AbstractQueryBuilder<HasParentQueryBu
|
|||
/**
|
||||
* Returns the query to execute.
|
||||
*/
|
||||
public QueryBuilder<?> query() {
|
||||
public QueryBuilder query() {
|
||||
return query;
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class HasParentQueryBuilder extends AbstractQueryBuilder<HasParentQueryBu
|
|||
|
||||
String currentFieldName = null;
|
||||
XContentParser.Token token;
|
||||
QueryBuilder<?> iqb = null;
|
||||
QueryBuilder iqb = null;
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
currentFieldName = parser.currentName();
|
||||
|
@ -306,8 +306,8 @@ public class HasParentQueryBuilder extends AbstractQueryBuilder<HasParentQueryBu
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
QueryBuilder<?> rewrite = query.rewrite(queryShardContext);
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
QueryBuilder rewrite = query.rewrite(queryShardContext);
|
||||
if (rewrite != query) {
|
||||
return new HasParentQueryBuilder(type, rewrite, score, innerHit);
|
||||
}
|
||||
|
|
|
@ -55,17 +55,17 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(IndicesQueryBuilder.class));
|
||||
|
||||
private final QueryBuilder<?> innerQuery;
|
||||
private final QueryBuilder innerQuery;
|
||||
|
||||
private final String[] indices;
|
||||
|
||||
private QueryBuilder<?> noMatchQuery = defaultNoMatchQuery();
|
||||
private QueryBuilder noMatchQuery = defaultNoMatchQuery();
|
||||
|
||||
/**
|
||||
* @deprecated instead search on the `_index` field
|
||||
*/
|
||||
@Deprecated
|
||||
public IndicesQueryBuilder(QueryBuilder<?> innerQuery, String... indices) {
|
||||
public IndicesQueryBuilder(QueryBuilder innerQuery, String... indices) {
|
||||
DEPRECATION_LOGGER.deprecated("{} query is deprecated. Instead search on the '_index' field", NAME);
|
||||
if (innerQuery == null) {
|
||||
throw new IllegalArgumentException("inner query cannot be null");
|
||||
|
@ -94,7 +94,7 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
out.writeNamedWriteable(noMatchQuery);
|
||||
}
|
||||
|
||||
public QueryBuilder<?> innerQuery() {
|
||||
public QueryBuilder innerQuery() {
|
||||
return this.innerQuery;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
/**
|
||||
* Sets the query to use when it executes on an index that does not match the indices provided.
|
||||
*/
|
||||
public IndicesQueryBuilder noMatchQuery(QueryBuilder<?> noMatchQuery) {
|
||||
public IndicesQueryBuilder noMatchQuery(QueryBuilder noMatchQuery) {
|
||||
if (noMatchQuery == null) {
|
||||
throw new IllegalArgumentException("noMatch query cannot be null");
|
||||
}
|
||||
|
@ -121,11 +121,11 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
return this;
|
||||
}
|
||||
|
||||
public QueryBuilder<?> noMatchQuery() {
|
||||
public QueryBuilder noMatchQuery() {
|
||||
return this.noMatchQuery;
|
||||
}
|
||||
|
||||
private static QueryBuilder<?> defaultNoMatchQuery() {
|
||||
private static QueryBuilder defaultNoMatchQuery() {
|
||||
return QueryBuilders.matchAllQuery();
|
||||
}
|
||||
|
||||
|
@ -144,9 +144,9 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
public static IndicesQueryBuilder fromXContent(QueryParseContext parseContext) throws IOException, ParsingException {
|
||||
XContentParser parser = parseContext.parser();
|
||||
|
||||
QueryBuilder<?> innerQuery = null;
|
||||
QueryBuilder innerQuery = null;
|
||||
Collection<String> indices = new ArrayList<>();
|
||||
QueryBuilder<?> noMatchQuery = defaultNoMatchQuery();
|
||||
QueryBuilder noMatchQuery = defaultNoMatchQuery();
|
||||
|
||||
String queryName = null;
|
||||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
|
@ -209,7 +209,7 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
.queryName(queryName);
|
||||
}
|
||||
|
||||
static QueryBuilder<?> parseNoMatchQuery(String type) {
|
||||
static QueryBuilder parseNoMatchQuery(String type) {
|
||||
if ("all".equals(type)) {
|
||||
return QueryBuilders.matchAllQuery();
|
||||
} else if ("none".equals(type)) {
|
||||
|
@ -244,9 +244,9 @@ public class IndicesQueryBuilder extends AbstractQueryBuilder<IndicesQueryBuilde
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
QueryBuilder<?> newInnnerQuery = innerQuery.rewrite(queryShardContext);
|
||||
QueryBuilder<?> newNoMatchQuery = noMatchQuery.rewrite(queryShardContext);
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
QueryBuilder newInnnerQuery = innerQuery.rewrite(queryShardContext);
|
||||
QueryBuilder newNoMatchQuery = noMatchQuery.rewrite(queryShardContext);
|
||||
if (newInnnerQuery != innerQuery || newNoMatchQuery != noMatchQuery) {
|
||||
return new IndicesQueryBuilder(innerQuery, indices).noMatchQuery(noMatchQuery);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package org.elasticsearch.index.query;
|
||||
|
||||
import org.apache.lucene.search.Sort;
|
||||
import org.elasticsearch.action.support.ToXContentToBytes;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.ParsingException;
|
||||
|
@ -41,6 +40,7 @@ import org.elasticsearch.search.fetch.innerhits.InnerHitsContext;
|
|||
import org.elasticsearch.search.fetch.source.FetchSourceContext;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.internal.SearchContext;
|
||||
import org.elasticsearch.search.sort.SortAndFormats;
|
||||
import org.elasticsearch.search.sort.SortBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -131,7 +131,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||
private boolean trackScores;
|
||||
|
||||
private List<String> fieldNames;
|
||||
private QueryBuilder<?> query = new MatchAllQueryBuilder();
|
||||
private QueryBuilder query = new MatchAllQueryBuilder();
|
||||
private List<SortBuilder<?>> sorts;
|
||||
private List<String> fieldDataFields;
|
||||
private Set<ScriptField> scriptFields;
|
||||
|
@ -411,7 +411,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||
return this;
|
||||
}
|
||||
|
||||
QueryBuilder<?> getQuery() {
|
||||
QueryBuilder getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||
innerHitsContext.fetchSourceContext(fetchSourceContext);
|
||||
}
|
||||
if (sorts != null) {
|
||||
Optional<Sort> optionalSort = SortBuilder.buildSort(sorts, context);
|
||||
Optional<SortAndFormats> optionalSort = SortBuilder.buildSort(sorts, context);
|
||||
if (optionalSort.isPresent()) {
|
||||
innerHitsContext.sort(optionalSort.get());
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||
return PARSER.parse(context.parser(), new InnerHitBuilder(), context);
|
||||
}
|
||||
|
||||
public static void extractInnerHits(QueryBuilder<?> query, Map<String, InnerHitBuilder> innerHitBuilders) {
|
||||
public static void extractInnerHits(QueryBuilder query, Map<String, InnerHitBuilder> innerHitBuilders) {
|
||||
if (query instanceof AbstractQueryBuilder) {
|
||||
((AbstractQueryBuilder) query).extractInnerHitBuilders(innerHitBuilders);
|
||||
} else {
|
||||
|
|
|
@ -57,7 +57,6 @@ import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType;
|
|||
import org.elasticsearch.index.mapper.core.StringFieldMapper.StringFieldType;
|
||||
import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType;
|
||||
import org.elasticsearch.index.mapper.internal.UidFieldMapper;
|
||||
import org.elasticsearch.search.internal.SearchContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -1197,7 +1196,7 @@ public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder<MoreLikeThisQ
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
// TODO this needs heavy cleanups before we can rewrite it
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,6 @@
|
|||
*/
|
||||
package org.elasticsearch.index.query;
|
||||
|
||||
public interface MultiTermQueryBuilder<QB extends MultiTermQueryBuilder<QB>> extends QueryBuilder<QB> {
|
||||
public interface MultiTermQueryBuilder extends QueryBuilder {
|
||||
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class NestedQueryBuilder extends AbstractQueryBuilder<NestedQueryBuilder>
|
|||
|
||||
private final String path;
|
||||
private final ScoreMode scoreMode;
|
||||
private final QueryBuilder<?> query;
|
||||
private final QueryBuilder query;
|
||||
private InnerHitBuilder innerHitBuilder;
|
||||
private boolean ignoreUnmapped = DEFAULT_IGNORE_UNMAPPED;
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class NestedQueryBuilder extends AbstractQueryBuilder<NestedQueryBuilder>
|
|||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
ScoreMode scoreMode = ScoreMode.Avg;
|
||||
String queryName = null;
|
||||
QueryBuilder<?> query = null;
|
||||
QueryBuilder query = null;
|
||||
String path = null;
|
||||
String currentFieldName = null;
|
||||
InnerHitBuilder innerHitBuilder = null;
|
||||
|
@ -259,7 +259,7 @@ public class NestedQueryBuilder extends AbstractQueryBuilder<NestedQueryBuilder>
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder rewrite = query.rewrite(queryRewriteContext);
|
||||
if (rewrite != query) {
|
||||
return new NestedQueryBuilder(path, rewrite, scoreMode, innerHitBuilder);
|
||||
|
|
|
@ -327,7 +327,7 @@ public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBu
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
if (document != null) {
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ import java.util.Objects;
|
|||
/**
|
||||
* A Query that matches documents containing terms with a specified prefix.
|
||||
*/
|
||||
public class PrefixQueryBuilder extends AbstractQueryBuilder<PrefixQueryBuilder> implements MultiTermQueryBuilder<PrefixQueryBuilder> {
|
||||
public class PrefixQueryBuilder extends AbstractQueryBuilder<PrefixQueryBuilder> implements MultiTermQueryBuilder {
|
||||
|
||||
public static final String NAME = "prefix";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteable, ToXContent {
|
||||
public interface QueryBuilder extends NamedWriteable, ToXContent {
|
||||
|
||||
/**
|
||||
* Converts this QueryBuilder to a lucene {@link Query}.
|
||||
|
@ -49,8 +49,11 @@ public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteabl
|
|||
|
||||
/**
|
||||
* Sets the arbitrary name to be assigned to the query (see named queries).
|
||||
* Implementers should return the concrete type of the
|
||||
* {@link QueryBuilder} so that calls can be chained. This is done
|
||||
* automatically when extending {@link AbstractQueryBuilder}.
|
||||
*/
|
||||
QB queryName(String queryName);
|
||||
QueryBuilder queryName(String queryName);
|
||||
|
||||
/**
|
||||
* Returns the arbitrary name assigned to the query (see named queries).
|
||||
|
@ -65,8 +68,11 @@ public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteabl
|
|||
/**
|
||||
* Sets the boost for this query. Documents matching this query will (in addition to the normal
|
||||
* weightings) have their score multiplied by the boost provided.
|
||||
* Implementers should return the concrete type of the
|
||||
* {@link QueryBuilder} so that calls can be chained. This is done
|
||||
* automatically when extending {@link AbstractQueryBuilder}.
|
||||
*/
|
||||
QB boost(float boost);
|
||||
QueryBuilder boost(float boost);
|
||||
|
||||
/**
|
||||
* Returns the name that identifies uniquely the query
|
||||
|
@ -77,7 +83,7 @@ public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteabl
|
|||
* Rewrites this query builder into its primitive form. By default this method return the builder itself. If the builder
|
||||
* did not change the identity reference must be returned otherwise the builder will be rewritten infinitely.
|
||||
*/
|
||||
default QueryBuilder<?> rewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
default QueryBuilder rewrite(QueryRewriteContext queryShardContext) throws IOException {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -87,7 +93,7 @@ public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteabl
|
|||
* rewrites the query until it doesn't change anymore.
|
||||
* @throws IOException if an {@link IOException} occurs
|
||||
*/
|
||||
static QueryBuilder<?> rewriteQuery(QueryBuilder<?> original, QueryRewriteContext context) throws IOException {
|
||||
static QueryBuilder rewriteQuery(QueryBuilder original, QueryRewriteContext context) throws IOException {
|
||||
QueryBuilder builder = original;
|
||||
for (QueryBuilder rewrittenBuilder = builder.rewrite(context); rewrittenBuilder != builder;
|
||||
rewrittenBuilder = builder.rewrite(context)) {
|
||||
|
|
|
@ -55,9 +55,9 @@ public class QueryParseContext implements ParseFieldMatcherSupplier {
|
|||
/**
|
||||
* Parses a top level query including the query element that wraps it
|
||||
*/
|
||||
public QueryBuilder<?> parseTopLevelQueryBuilder() {
|
||||
public QueryBuilder parseTopLevelQueryBuilder() {
|
||||
try {
|
||||
QueryBuilder<?> queryBuilder = null;
|
||||
QueryBuilder queryBuilder = null;
|
||||
for (XContentParser.Token token = parser.nextToken(); token != XContentParser.Token.END_OBJECT; token = parser.nextToken()) {
|
||||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
String fieldName = parser.currentName();
|
||||
|
@ -82,7 +82,7 @@ public class QueryParseContext implements ParseFieldMatcherSupplier {
|
|||
/**
|
||||
* Parses a query excluding the query element that wraps it
|
||||
*/
|
||||
public QueryBuilder<?> parseInnerQueryBuilder() throws IOException {
|
||||
public QueryBuilder parseInnerQueryBuilder() throws IOException {
|
||||
// move to START object
|
||||
XContentParser.Token token;
|
||||
if (parser.currentToken() != XContentParser.Token.START_OBJECT) {
|
||||
|
@ -105,7 +105,7 @@ public class QueryParseContext implements ParseFieldMatcherSupplier {
|
|||
if (token != XContentParser.Token.START_OBJECT && token != XContentParser.Token.START_ARRAY) {
|
||||
throw new ParsingException(parser.getTokenLocation(), "[_na] query malformed, no field after start_object");
|
||||
}
|
||||
QueryBuilder<?> result = indicesQueriesRegistry.lookup(queryName, parseFieldMatcher, parser.getTokenLocation()).fromXContent(this);
|
||||
QueryBuilder result = indicesQueriesRegistry.lookup(queryName, parseFieldMatcher, parser.getTokenLocation()).fromXContent(this);
|
||||
if (parser.currentToken() == XContentParser.Token.END_OBJECT || parser.currentToken() == XContentParser.Token.END_ARRAY) {
|
||||
// if we are at END_OBJECT, move to the next one...
|
||||
parser.nextToken();
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.io.IOException;
|
|||
* Defines a query parser that is able to parse {@link QueryBuilder}s from {@link org.elasticsearch.common.xcontent.XContent}.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface QueryParser<QB extends QueryBuilder<QB>> {
|
||||
public interface QueryParser<QB extends QueryBuilder> {
|
||||
/**
|
||||
* Creates a new {@link QueryBuilder} from the query held by the {@link QueryParseContext}
|
||||
* in {@link org.elasticsearch.common.xcontent.XContent} format
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.util.Objects;
|
|||
/**
|
||||
* A Query that matches documents within an range of terms.
|
||||
*/
|
||||
public class RangeQueryBuilder extends AbstractQueryBuilder<RangeQueryBuilder> implements MultiTermQueryBuilder<RangeQueryBuilder> {
|
||||
public class RangeQueryBuilder extends AbstractQueryBuilder<RangeQueryBuilder> implements MultiTermQueryBuilder {
|
||||
public static final String NAME = "range";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
|
@ -410,7 +410,7 @@ public class RangeQueryBuilder extends AbstractQueryBuilder<RangeQueryBuilder> i
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
final MappedFieldType.Relation relation = getRelation(queryRewriteContext);
|
||||
switch (relation) {
|
||||
case DISJOINT:
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.Objects;
|
|||
/**
|
||||
* A Query that does fuzzy matching for a specific value.
|
||||
*/
|
||||
public class RegexpQueryBuilder extends AbstractQueryBuilder<RegexpQueryBuilder> implements MultiTermQueryBuilder<RegexpQueryBuilder> {
|
||||
public class RegexpQueryBuilder extends AbstractQueryBuilder<RegexpQueryBuilder> implements MultiTermQueryBuilder {
|
||||
|
||||
public static final String NAME = "regexp";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Objects;
|
|||
* Builder for {@link org.apache.lucene.search.spans.SpanContainingQuery}.
|
||||
*/
|
||||
public class SpanContainingQueryBuilder extends AbstractQueryBuilder<SpanContainingQueryBuilder>
|
||||
implements SpanQueryBuilder<SpanContainingQueryBuilder> {
|
||||
implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_containing";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
@ -44,14 +44,14 @@ public class SpanContainingQueryBuilder extends AbstractQueryBuilder<SpanContain
|
|||
private static final ParseField BIG_FIELD = new ParseField("big");
|
||||
private static final ParseField LITTLE_FIELD = new ParseField("little");
|
||||
|
||||
private final SpanQueryBuilder<?> big;
|
||||
private final SpanQueryBuilder<?> little;
|
||||
private final SpanQueryBuilder big;
|
||||
private final SpanQueryBuilder little;
|
||||
|
||||
/**
|
||||
* @param big the big clause, it must enclose {@code little} for a match.
|
||||
* @param little the little clause, it must be contained within {@code big} for a match.
|
||||
*/
|
||||
public SpanContainingQueryBuilder(SpanQueryBuilder<?> big, SpanQueryBuilder<?> little) {
|
||||
public SpanContainingQueryBuilder(SpanQueryBuilder big, SpanQueryBuilder little) {
|
||||
if (big == null) {
|
||||
throw new IllegalArgumentException("inner clause [big] cannot be null.");
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ public class SpanContainingQueryBuilder extends AbstractQueryBuilder<SpanContain
|
|||
*/
|
||||
public SpanContainingQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
big = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
little = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
big = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
little = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,8 +106,8 @@ public class SpanContainingQueryBuilder extends AbstractQueryBuilder<SpanContain
|
|||
XContentParser parser = parseContext.parser();
|
||||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
String queryName = null;
|
||||
SpanQueryBuilder<?> big = null;
|
||||
SpanQueryBuilder<?> little = null;
|
||||
SpanQueryBuilder big = null;
|
||||
SpanQueryBuilder little = null;
|
||||
|
||||
String currentFieldName = null;
|
||||
XContentParser.Token token;
|
||||
|
@ -117,16 +117,16 @@ public class SpanContainingQueryBuilder extends AbstractQueryBuilder<SpanContain
|
|||
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||
if (parseContext.getParseFieldMatcher().match(currentFieldName, BIG_FIELD)) {
|
||||
QueryBuilder query = parseContext.parseInnerQueryBuilder();
|
||||
if (!(query instanceof SpanQueryBuilder<?>)) {
|
||||
if (!(query instanceof SpanQueryBuilder)) {
|
||||
throw new ParsingException(parser.getTokenLocation(), "span_containing [big] must be of type span query");
|
||||
}
|
||||
big = (SpanQueryBuilder<?>) query;
|
||||
big = (SpanQueryBuilder) query;
|
||||
} else if (parseContext.getParseFieldMatcher().match(currentFieldName, LITTLE_FIELD)) {
|
||||
QueryBuilder query = parseContext.parseInnerQueryBuilder();
|
||||
if (!(query instanceof SpanQueryBuilder<?>)) {
|
||||
if (!(query instanceof SpanQueryBuilder)) {
|
||||
throw new ParsingException(parser.getTokenLocation(), "span_containing [little] must be of type span query");
|
||||
}
|
||||
little = (SpanQueryBuilder<?>) query;
|
||||
little = (SpanQueryBuilder) query;
|
||||
} else {
|
||||
throw new ParsingException(parser.getTokenLocation(),
|
||||
"[span_containing] query does not support [" + currentFieldName + "]");
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SpanFirstQueryBuilder extends AbstractQueryBuilder<SpanFirstQueryBuilder> implements SpanQueryBuilder<SpanFirstQueryBuilder>{
|
||||
public class SpanFirstQueryBuilder extends AbstractQueryBuilder<SpanFirstQueryBuilder> implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_first";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
@ -40,7 +40,7 @@ public class SpanFirstQueryBuilder extends AbstractQueryBuilder<SpanFirstQueryBu
|
|||
private static final ParseField MATCH_FIELD = new ParseField("match");
|
||||
private static final ParseField END_FIELD = new ParseField("end");
|
||||
|
||||
private final SpanQueryBuilder<?> matchBuilder;
|
||||
private final SpanQueryBuilder matchBuilder;
|
||||
|
||||
private final int end;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class SpanFirstQueryBuilder extends AbstractQueryBuilder<SpanFirstQueryBu
|
|||
* @param end maximum end position of the match, needs to be positive
|
||||
* @throws IllegalArgumentException for negative <code>end</code> positions
|
||||
*/
|
||||
public SpanFirstQueryBuilder(SpanQueryBuilder<?> matchBuilder, int end) {
|
||||
public SpanFirstQueryBuilder(SpanQueryBuilder matchBuilder, int end) {
|
||||
if (matchBuilder == null) {
|
||||
throw new IllegalArgumentException("inner span query cannot be null");
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class SpanFirstQueryBuilder extends AbstractQueryBuilder<SpanFirstQueryBu
|
|||
*/
|
||||
public SpanFirstQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
matchBuilder = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
matchBuilder = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
end = in.readInt();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class SpanFirstQueryBuilder extends AbstractQueryBuilder<SpanFirstQueryBu
|
|||
/**
|
||||
* @return the inner {@link SpanQueryBuilder} defined in this query
|
||||
*/
|
||||
public SpanQueryBuilder<?> innerQuery() {
|
||||
public SpanQueryBuilder innerQuery() {
|
||||
return this.matchBuilder;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,16 +39,16 @@ import java.util.Objects;
|
|||
* as a {@link SpanQueryBuilder} so it can be nested.
|
||||
*/
|
||||
public class SpanMultiTermQueryBuilder extends AbstractQueryBuilder<SpanMultiTermQueryBuilder>
|
||||
implements SpanQueryBuilder<SpanMultiTermQueryBuilder> {
|
||||
implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_multi";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
private static final ParseField MATCH_FIELD = new ParseField("match");
|
||||
|
||||
private final MultiTermQueryBuilder<?> multiTermQueryBuilder;
|
||||
private final MultiTermQueryBuilder multiTermQueryBuilder;
|
||||
|
||||
public SpanMultiTermQueryBuilder(MultiTermQueryBuilder<?> multiTermQueryBuilder) {
|
||||
public SpanMultiTermQueryBuilder(MultiTermQueryBuilder multiTermQueryBuilder) {
|
||||
if (multiTermQueryBuilder == null) {
|
||||
throw new IllegalArgumentException("inner multi term query cannot be null");
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class SpanMultiTermQueryBuilder extends AbstractQueryBuilder<SpanMultiTer
|
|||
*/
|
||||
public SpanMultiTermQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
multiTermQueryBuilder = (MultiTermQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
multiTermQueryBuilder = (MultiTermQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,7 +68,7 @@ public class SpanMultiTermQueryBuilder extends AbstractQueryBuilder<SpanMultiTer
|
|||
out.writeNamedWriteable(multiTermQueryBuilder);
|
||||
}
|
||||
|
||||
public MultiTermQueryBuilder<?> innerQuery() {
|
||||
public MultiTermQueryBuilder innerQuery() {
|
||||
return this.multiTermQueryBuilder;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.Objects;
|
|||
* of intervening unmatched positions, as well as whether matches are required to be in-order.
|
||||
* The span near query maps to Lucene {@link SpanNearQuery}.
|
||||
*/
|
||||
public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuilder> implements SpanQueryBuilder<SpanNearQueryBuilder> {
|
||||
public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuilder> implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_near";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
@ -52,7 +52,7 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuil
|
|||
private static final ParseField CLAUSES_FIELD = new ParseField("clauses");
|
||||
private static final ParseField IN_ORDER_FIELD = new ParseField("in_order");
|
||||
|
||||
private final List<SpanQueryBuilder<?>> clauses = new ArrayList<>();
|
||||
private final List<SpanQueryBuilder> clauses = new ArrayList<>();
|
||||
|
||||
private final int slop;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuil
|
|||
* @param initialClause an initial span query clause
|
||||
* @param slop controls the maximum number of intervening unmatched positions permitted
|
||||
*/
|
||||
public SpanNearQueryBuilder(SpanQueryBuilder<?> initialClause, int slop) {
|
||||
public SpanNearQueryBuilder(SpanQueryBuilder initialClause, int slop) {
|
||||
if (initialClause == null) {
|
||||
throw new IllegalArgumentException("query must include at least one clause");
|
||||
}
|
||||
|
@ -75,8 +75,8 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuil
|
|||
*/
|
||||
public SpanNearQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
for (QueryBuilder<?> clause : readQueries(in)) {
|
||||
this.clauses.add((SpanQueryBuilder<?>) clause);
|
||||
for (QueryBuilder clause : readQueries(in)) {
|
||||
this.clauses.add((SpanQueryBuilder) clause);
|
||||
}
|
||||
slop = in.readVInt();
|
||||
inOrder = in.readBoolean();
|
||||
|
@ -96,7 +96,7 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuil
|
|||
return this.slop;
|
||||
}
|
||||
|
||||
public SpanNearQueryBuilder clause(SpanQueryBuilder<?> clause) {
|
||||
public SpanNearQueryBuilder clause(SpanQueryBuilder clause) {
|
||||
if (clause == null) {
|
||||
throw new IllegalArgumentException("query clauses cannot be null");
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuil
|
|||
/**
|
||||
* @return the {@link SpanQueryBuilder} clauses that were set for this query
|
||||
*/
|
||||
public List<SpanQueryBuilder<?>> clauses() {
|
||||
public List<SpanQueryBuilder> clauses() {
|
||||
return this.clauses;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuil
|
|||
protected void doXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.startObject(NAME);
|
||||
builder.startArray(CLAUSES_FIELD.getPreferredName());
|
||||
for (SpanQueryBuilder<?> clause : clauses) {
|
||||
for (SpanQueryBuilder clause : clauses) {
|
||||
clause.toXContent(builder, params);
|
||||
}
|
||||
builder.endArray();
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SpanNotQueryBuilder extends AbstractQueryBuilder<SpanNotQueryBuilder> implements SpanQueryBuilder<SpanNotQueryBuilder> {
|
||||
public class SpanNotQueryBuilder extends AbstractQueryBuilder<SpanNotQueryBuilder> implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_not";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
@ -48,9 +48,9 @@ public class SpanNotQueryBuilder extends AbstractQueryBuilder<SpanNotQueryBuilde
|
|||
private static final ParseField EXCLUDE_FIELD = new ParseField("exclude");
|
||||
private static final ParseField INCLUDE_FIELD = new ParseField("include");
|
||||
|
||||
private final SpanQueryBuilder<?> include;
|
||||
private final SpanQueryBuilder include;
|
||||
|
||||
private final SpanQueryBuilder<?> exclude;
|
||||
private final SpanQueryBuilder exclude;
|
||||
|
||||
private int pre = DEFAULT_PRE;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class SpanNotQueryBuilder extends AbstractQueryBuilder<SpanNotQueryBuilde
|
|||
* @param include the span query whose matches are filtered
|
||||
* @param exclude the span query whose matches must not overlap
|
||||
*/
|
||||
public SpanNotQueryBuilder(SpanQueryBuilder<?> include, SpanQueryBuilder<?> exclude) {
|
||||
public SpanNotQueryBuilder(SpanQueryBuilder include, SpanQueryBuilder exclude) {
|
||||
if (include == null) {
|
||||
throw new IllegalArgumentException("inner clause [include] cannot be null.");
|
||||
}
|
||||
|
@ -78,8 +78,8 @@ public class SpanNotQueryBuilder extends AbstractQueryBuilder<SpanNotQueryBuilde
|
|||
*/
|
||||
public SpanNotQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
include = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
exclude = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
include = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
exclude = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
pre = in.readVInt();
|
||||
post = in.readVInt();
|
||||
}
|
||||
|
|
|
@ -37,16 +37,16 @@ import java.util.Objects;
|
|||
/**
|
||||
* Span query that matches the union of its clauses. Maps to {@link SpanOrQuery}.
|
||||
*/
|
||||
public class SpanOrQueryBuilder extends AbstractQueryBuilder<SpanOrQueryBuilder> implements SpanQueryBuilder<SpanOrQueryBuilder> {
|
||||
public class SpanOrQueryBuilder extends AbstractQueryBuilder<SpanOrQueryBuilder> implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_or";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
private static final ParseField CLAUSES_FIELD = new ParseField("clauses");
|
||||
|
||||
private final List<SpanQueryBuilder<?>> clauses = new ArrayList<>();
|
||||
private final List<SpanQueryBuilder> clauses = new ArrayList<>();
|
||||
|
||||
public SpanOrQueryBuilder(SpanQueryBuilder<?> initialClause) {
|
||||
public SpanOrQueryBuilder(SpanQueryBuilder initialClause) {
|
||||
if (initialClause == null) {
|
||||
throw new IllegalArgumentException("query must include at least one clause");
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ public class SpanOrQueryBuilder extends AbstractQueryBuilder<SpanOrQueryBuilder>
|
|||
*/
|
||||
public SpanOrQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
for (QueryBuilder<?> clause: readQueries(in)) {
|
||||
clauses.add((SpanQueryBuilder<?>) clause);
|
||||
for (QueryBuilder clause: readQueries(in)) {
|
||||
clauses.add((SpanQueryBuilder) clause);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class SpanOrQueryBuilder extends AbstractQueryBuilder<SpanOrQueryBuilder>
|
|||
writeQueries(out, clauses);
|
||||
}
|
||||
|
||||
public SpanOrQueryBuilder clause(SpanQueryBuilder<?> clause) {
|
||||
public SpanOrQueryBuilder clause(SpanQueryBuilder clause) {
|
||||
if (clause == null) {
|
||||
throw new IllegalArgumentException("inner bool query clause cannot be null");
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class SpanOrQueryBuilder extends AbstractQueryBuilder<SpanOrQueryBuilder>
|
|||
/**
|
||||
* @return the {@link SpanQueryBuilder} clauses that were set for this query
|
||||
*/
|
||||
public List<SpanQueryBuilder<?>> clauses() {
|
||||
public List<SpanQueryBuilder> clauses() {
|
||||
return this.clauses;
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class SpanOrQueryBuilder extends AbstractQueryBuilder<SpanOrQueryBuilder>
|
|||
protected void doXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.startObject(NAME);
|
||||
builder.startArray(CLAUSES_FIELD.getPreferredName());
|
||||
for (SpanQueryBuilder<?> clause : clauses) {
|
||||
for (SpanQueryBuilder clause : clauses) {
|
||||
clause.toXContent(builder, params);
|
||||
}
|
||||
builder.endArray();
|
||||
|
|
|
@ -22,6 +22,6 @@ package org.elasticsearch.index.query;
|
|||
/**
|
||||
* Marker interface for a specific type of {@link QueryBuilder} that allows to build span queries
|
||||
*/
|
||||
public interface SpanQueryBuilder<QB extends SpanQueryBuilder<QB>> extends QueryBuilder<QB> {
|
||||
public interface SpanQueryBuilder extends QueryBuilder {
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.io.IOException;
|
|||
* A Span Query that matches documents containing a term.
|
||||
* @see SpanTermQuery
|
||||
*/
|
||||
public class SpanTermQueryBuilder extends BaseTermQueryBuilder<SpanTermQueryBuilder> implements SpanQueryBuilder<SpanTermQueryBuilder> {
|
||||
public class SpanTermQueryBuilder extends BaseTermQueryBuilder<SpanTermQueryBuilder> implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_term";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Objects;
|
|||
* Builder for {@link org.apache.lucene.search.spans.SpanWithinQuery}.
|
||||
*/
|
||||
public class SpanWithinQueryBuilder extends AbstractQueryBuilder<SpanWithinQueryBuilder>
|
||||
implements SpanQueryBuilder<SpanWithinQueryBuilder> {
|
||||
implements SpanQueryBuilder {
|
||||
|
||||
public static final String NAME = "span_within";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
@ -44,15 +44,15 @@ public class SpanWithinQueryBuilder extends AbstractQueryBuilder<SpanWithinQuery
|
|||
private static final ParseField BIG_FIELD = new ParseField("big");
|
||||
private static final ParseField LITTLE_FIELD = new ParseField("little");
|
||||
|
||||
private final SpanQueryBuilder<?> big;
|
||||
private final SpanQueryBuilder<?> little;
|
||||
private final SpanQueryBuilder big;
|
||||
private final SpanQueryBuilder little;
|
||||
|
||||
/**
|
||||
* Query that returns spans from <code>little</code> that are contained in a spans from <code>big</code>.
|
||||
* @param big clause that must enclose {@code little} for a match.
|
||||
* @param little the little clause, it must be contained within {@code big} for a match.
|
||||
*/
|
||||
public SpanWithinQueryBuilder(SpanQueryBuilder<?> big, SpanQueryBuilder<?> little) {
|
||||
public SpanWithinQueryBuilder(SpanQueryBuilder big, SpanQueryBuilder little) {
|
||||
if (big == null) {
|
||||
throw new IllegalArgumentException("inner clause [big] cannot be null.");
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ public class SpanWithinQueryBuilder extends AbstractQueryBuilder<SpanWithinQuery
|
|||
*/
|
||||
public SpanWithinQueryBuilder(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
big = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
little = (SpanQueryBuilder<?>) in.readNamedWriteable(QueryBuilder.class);
|
||||
big = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
little = (SpanQueryBuilder) in.readNamedWriteable(QueryBuilder.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -173,13 +173,13 @@ public class TemplateQueryBuilder extends AbstractQueryBuilder<TemplateQueryBuil
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
ExecutableScript executable = queryRewriteContext.getScriptService().executable(template,
|
||||
ScriptContext.Standard.SEARCH, Collections.emptyMap(), queryRewriteContext.getClusterState());
|
||||
BytesReference querySource = (BytesReference) executable.run();
|
||||
try (XContentParser qSourceParser = XContentFactory.xContent(querySource).createParser(querySource)) {
|
||||
final QueryParseContext queryParseContext = queryRewriteContext.newParseContext(qSourceParser);
|
||||
final QueryBuilder<?> queryBuilder = queryParseContext.parseInnerQueryBuilder();
|
||||
final QueryBuilder queryBuilder = queryParseContext.parseInnerQueryBuilder();
|
||||
if (boost() != DEFAULT_BOOST || queryName() != null) {
|
||||
final BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
|
||||
boolQueryBuilder.must(queryBuilder);
|
||||
|
|
|
@ -381,7 +381,7 @@ public class TermsQueryBuilder extends AbstractQueryBuilder<TermsQueryBuilder> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
if (this.termsLookup != null) {
|
||||
TermsLookup termsLookup = new TermsLookup(this.termsLookup);
|
||||
if (termsLookup.index() == null) { // TODO this should go away?
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.util.Objects;
|
|||
* <tt>?</tt>.
|
||||
*/
|
||||
public class WildcardQueryBuilder extends AbstractQueryBuilder<WildcardQueryBuilder>
|
||||
implements MultiTermQueryBuilder<WildcardQueryBuilder> {
|
||||
implements MultiTermQueryBuilder {
|
||||
|
||||
public static final String NAME = "wildcard";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
|
|
@ -160,11 +160,11 @@ public class WrapperQueryBuilder extends AbstractQueryBuilder<WrapperQueryBuilde
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext context) throws IOException {
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext context) throws IOException {
|
||||
try (XContentParser qSourceParser = XContentFactory.xContent(source).createParser(source)) {
|
||||
QueryParseContext parseContext = context.newParseContext(qSourceParser);
|
||||
|
||||
final QueryBuilder<?> queryBuilder = parseContext.parseInnerQueryBuilder();
|
||||
final QueryBuilder queryBuilder = parseContext.parseInnerQueryBuilder();
|
||||
if (boost() != DEFAULT_BOOST || queryName() != null) {
|
||||
final BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
|
||||
boolQueryBuilder.must(queryBuilder);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
public static final CombineFunction DEFAULT_BOOST_MODE = CombineFunction.MULTIPLY;
|
||||
public static final FiltersFunctionScoreQuery.ScoreMode DEFAULT_SCORE_MODE = FiltersFunctionScoreQuery.ScoreMode.MULTIPLY;
|
||||
|
||||
private final QueryBuilder<?> query;
|
||||
private final QueryBuilder query;
|
||||
|
||||
private float maxBoost = FunctionScoreQuery.DEFAULT_MAX_BOOST;
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
*
|
||||
* @param query the query that needs to be custom scored
|
||||
*/
|
||||
public FunctionScoreQueryBuilder(QueryBuilder<?> query) {
|
||||
public FunctionScoreQueryBuilder(QueryBuilder query) {
|
||||
this(query, new FilterFunctionBuilder[0]);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
* @param query the query to custom score
|
||||
* @param scoreFunctionBuilder score function that is executed
|
||||
*/
|
||||
public FunctionScoreQueryBuilder(QueryBuilder<?> query, ScoreFunctionBuilder<?> scoreFunctionBuilder) {
|
||||
public FunctionScoreQueryBuilder(QueryBuilder query, ScoreFunctionBuilder<?> scoreFunctionBuilder) {
|
||||
this(query, new FilterFunctionBuilder[]{new FilterFunctionBuilder(scoreFunctionBuilder)});
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
* @param query the query that defines which documents the function_score query will be executed on.
|
||||
* @param filterFunctionBuilders the filters and functions
|
||||
*/
|
||||
public FunctionScoreQueryBuilder(QueryBuilder<?> query, FilterFunctionBuilder[] filterFunctionBuilders) {
|
||||
public FunctionScoreQueryBuilder(QueryBuilder query, FilterFunctionBuilder[] filterFunctionBuilders) {
|
||||
if (query == null) {
|
||||
throw new IllegalArgumentException("function_score: query must not be null");
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
/**
|
||||
* Returns the query that defines which documents the function_score query will be executed on.
|
||||
*/
|
||||
public QueryBuilder<?> query() {
|
||||
public QueryBuilder query() {
|
||||
return this.query;
|
||||
}
|
||||
|
||||
|
@ -334,14 +334,14 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
* that match the given filter.
|
||||
*/
|
||||
public static class FilterFunctionBuilder implements ToXContent, Writeable {
|
||||
private final QueryBuilder<?> filter;
|
||||
private final QueryBuilder filter;
|
||||
private final ScoreFunctionBuilder<?> scoreFunction;
|
||||
|
||||
public FilterFunctionBuilder(ScoreFunctionBuilder<?> scoreFunctionBuilder) {
|
||||
this(new MatchAllQueryBuilder(), scoreFunctionBuilder);
|
||||
}
|
||||
|
||||
public FilterFunctionBuilder(QueryBuilder<?> filter, ScoreFunctionBuilder<?> scoreFunction) {
|
||||
public FilterFunctionBuilder(QueryBuilder filter, ScoreFunctionBuilder<?> scoreFunction) {
|
||||
if (filter == null) {
|
||||
throw new IllegalArgumentException("function_score: filter must not be null");
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
out.writeNamedWriteable(scoreFunction);
|
||||
}
|
||||
|
||||
public QueryBuilder<?> getFilter() {
|
||||
public QueryBuilder getFilter() {
|
||||
return filter;
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
}
|
||||
|
||||
public FilterFunctionBuilder rewrite(QueryRewriteContext context) throws IOException {
|
||||
QueryBuilder<?> rewrite = filter.rewrite(context);
|
||||
QueryBuilder rewrite = filter.rewrite(context);
|
||||
if (rewrite != filter) {
|
||||
return new FilterFunctionBuilder(rewrite, scoreFunction);
|
||||
}
|
||||
|
@ -412,8 +412,8 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
}
|
||||
|
||||
@Override
|
||||
protected QueryBuilder<?> doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder<?> queryBuilder = this.query.rewrite(queryRewriteContext);
|
||||
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
|
||||
QueryBuilder queryBuilder = this.query.rewrite(queryRewriteContext);
|
||||
FilterFunctionBuilder[] rewrittenBuilders = new FilterFunctionBuilder[this.filterFunctionBuilders.length];
|
||||
boolean rewritten = false;
|
||||
for (int i = 0; i < rewrittenBuilders.length; i++) {
|
||||
|
@ -442,7 +442,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
QueryParseContext parseContext) throws IOException {
|
||||
XContentParser parser = parseContext.parser();
|
||||
|
||||
QueryBuilder<?> query = null;
|
||||
QueryBuilder query = null;
|
||||
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
|
||||
String queryName = null;
|
||||
|
||||
|
@ -571,7 +571,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
|
|||
XContentParser.Token token;
|
||||
XContentParser parser = parseContext.parser();
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
|
||||
QueryBuilder<?> filter = null;
|
||||
QueryBuilder filter = null;
|
||||
ScoreFunctionBuilder<?> scoreFunction = null;
|
||||
Float functionWeight = null;
|
||||
if (token != XContentParser.Token.START_OBJECT) {
|
||||
|
|
|
@ -54,18 +54,20 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class TransportNodesListShardStoreMetaData extends TransportNodesAction<TransportNodesListShardStoreMetaData.Request, TransportNodesListShardStoreMetaData.NodesStoreFilesMetaData, TransportNodesListShardStoreMetaData.NodeRequest, TransportNodesListShardStoreMetaData.NodeStoreFilesMetaData>
|
||||
implements AsyncShardFetch.List<TransportNodesListShardStoreMetaData.NodesStoreFilesMetaData, TransportNodesListShardStoreMetaData.NodeStoreFilesMetaData> {
|
||||
public class TransportNodesListShardStoreMetaData extends TransportNodesAction<TransportNodesListShardStoreMetaData.Request,
|
||||
TransportNodesListShardStoreMetaData.NodesStoreFilesMetaData,
|
||||
TransportNodesListShardStoreMetaData.NodeRequest,
|
||||
TransportNodesListShardStoreMetaData.NodeStoreFilesMetaData>
|
||||
implements AsyncShardFetch.Lister<TransportNodesListShardStoreMetaData.NodesStoreFilesMetaData,
|
||||
TransportNodesListShardStoreMetaData.NodeStoreFilesMetaData> {
|
||||
|
||||
public static final String ACTION_NAME = "internal:cluster/nodes/indices/shard/store";
|
||||
|
||||
|
@ -74,11 +76,12 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
|||
private final NodeEnvironment nodeEnv;
|
||||
|
||||
@Inject
|
||||
public TransportNodesListShardStoreMetaData(Settings settings, ClusterName clusterName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
|
||||
public TransportNodesListShardStoreMetaData(Settings settings, ClusterName clusterName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
IndicesService indicesService, NodeEnvironment nodeEnv, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ACTION_NAME, clusterName, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STORE);
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STORE, NodeStoreFilesMetaData.class);
|
||||
this.indicesService = indicesService;
|
||||
this.nodeEnv = nodeEnv;
|
||||
}
|
||||
|
@ -106,21 +109,9 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
|||
}
|
||||
|
||||
@Override
|
||||
protected NodesStoreFilesMetaData newResponse(Request request, AtomicReferenceArray responses) {
|
||||
final List<NodeStoreFilesMetaData> nodeStoreFilesMetaDatas = new ArrayList<>();
|
||||
final List<FailedNodeException> failures = new ArrayList<>();
|
||||
for (int i = 0; i < responses.length(); i++) {
|
||||
Object resp = responses.get(i);
|
||||
if (resp instanceof NodeStoreFilesMetaData) { // will also filter out null response for unallocated ones
|
||||
nodeStoreFilesMetaDatas.add((NodeStoreFilesMetaData) resp);
|
||||
} else if (resp instanceof FailedNodeException) {
|
||||
failures.add((FailedNodeException) resp);
|
||||
} else {
|
||||
logger.warn("unknown response type [{}], expected NodeStoreFilesMetaData or FailedNodeException", resp);
|
||||
}
|
||||
}
|
||||
return new NodesStoreFilesMetaData(clusterName, nodeStoreFilesMetaDatas.toArray(new NodeStoreFilesMetaData[nodeStoreFilesMetaDatas.size()]),
|
||||
failures.toArray(new FailedNodeException[failures.size()]));
|
||||
protected NodesStoreFilesMetaData newResponse(Request request,
|
||||
List<NodeStoreFilesMetaData> responses, List<FailedNodeException> failures) {
|
||||
return new NodesStoreFilesMetaData(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -293,37 +284,21 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
|||
|
||||
public static class NodesStoreFilesMetaData extends BaseNodesResponse<NodeStoreFilesMetaData> {
|
||||
|
||||
private FailedNodeException[] failures;
|
||||
|
||||
NodesStoreFilesMetaData() {
|
||||
}
|
||||
|
||||
public NodesStoreFilesMetaData(ClusterName clusterName, NodeStoreFilesMetaData[] nodes, FailedNodeException[] failures) {
|
||||
super(clusterName, nodes);
|
||||
this.failures = failures;
|
||||
public NodesStoreFilesMetaData(ClusterName clusterName, List<NodeStoreFilesMetaData> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FailedNodeException[] failures() {
|
||||
return failures;
|
||||
protected List<NodeStoreFilesMetaData> readNodesFrom(StreamInput in) throws IOException {
|
||||
return in.readList(NodeStoreFilesMetaData::readListShardStoreNodeOperationResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = new NodeStoreFilesMetaData[in.readVInt()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
nodes[i] = NodeStoreFilesMetaData.readListShardStoreNodeOperationResponse(in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeVInt(nodes.length);
|
||||
for (NodeStoreFilesMetaData response : nodes) {
|
||||
response.writeTo(out);
|
||||
}
|
||||
protected void writeNodesTo(StreamOutput out, List<NodeStoreFilesMetaData> nodes) throws IOException {
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -124,9 +125,11 @@ public class PipelineExecutionService implements ClusterStateListener {
|
|||
void updatePipelineStats(IngestMetadata ingestMetadata) {
|
||||
boolean changed = false;
|
||||
Map<String, StatsHolder> newStatsPerPipeline = new HashMap<>(statsHolderPerPipeline);
|
||||
for (String pipeline : newStatsPerPipeline.keySet()) {
|
||||
Iterator<String> iterator = newStatsPerPipeline.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String pipeline = iterator.next();
|
||||
if (ingestMetadata.getPipelines().containsKey(pipeline) == false) {
|
||||
newStatsPerPipeline.remove(pipeline);
|
||||
iterator.remove();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.elasticsearch.cluster.metadata.SnapshotId;
|
|||
import org.elasticsearch.common.component.LifecycleComponent;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.snapshots.SnapshotInfo;
|
||||
import org.elasticsearch.snapshots.SnapshotShardFailure;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -54,7 +54,7 @@ public interface Repository extends LifecycleComponent<Repository> {
|
|||
* @param snapshotId snapshot ID
|
||||
* @return information about snapshot
|
||||
*/
|
||||
Snapshot readSnapshot(SnapshotId snapshotId);
|
||||
SnapshotInfo readSnapshot(SnapshotId snapshotId);
|
||||
|
||||
/**
|
||||
* Returns global metadata associate with the snapshot.
|
||||
|
@ -65,7 +65,7 @@ public interface Repository extends LifecycleComponent<Repository> {
|
|||
* @param indices list of indices
|
||||
* @return information about snapshot
|
||||
*/
|
||||
MetaData readSnapshotMetaData(SnapshotId snapshotId, Snapshot snapshot, List<String> indices) throws IOException;
|
||||
MetaData readSnapshotMetaData(SnapshotId snapshotId, SnapshotInfo snapshot, List<String> indices) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the list of snapshots currently stored in the repository
|
||||
|
@ -94,7 +94,7 @@ public interface Repository extends LifecycleComponent<Repository> {
|
|||
* @param shardFailures list of shard failures
|
||||
* @return snapshot description
|
||||
*/
|
||||
Snapshot finalizeSnapshot(SnapshotId snapshotId, List<String> indices, long startTime, String failure, int totalShards, List<SnapshotShardFailure> shardFailures);
|
||||
SnapshotInfo finalizeSnapshot(SnapshotId snapshotId, List<String> indices, long startTime, String failure, int totalShards, List<SnapshotShardFailure> shardFailures);
|
||||
|
||||
/**
|
||||
* Deletes snapshot
|
||||
|
|
|
@ -57,9 +57,9 @@ import org.elasticsearch.repositories.RepositoryException;
|
|||
import org.elasticsearch.repositories.RepositorySettings;
|
||||
import org.elasticsearch.repositories.RepositoryVerificationException;
|
||||
import org.elasticsearch.snapshots.InvalidSnapshotNameException;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.snapshots.SnapshotCreationException;
|
||||
import org.elasticsearch.snapshots.SnapshotException;
|
||||
import org.elasticsearch.snapshots.SnapshotInfo;
|
||||
import org.elasticsearch.snapshots.SnapshotMissingException;
|
||||
import org.elasticsearch.snapshots.SnapshotShardFailure;
|
||||
|
||||
|
@ -165,9 +165,9 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
|
||||
private LegacyBlobStoreFormat<IndexMetaData> indexMetaDataLegacyFormat;
|
||||
|
||||
private ChecksumBlobStoreFormat<Snapshot> snapshotFormat;
|
||||
private ChecksumBlobStoreFormat<SnapshotInfo> snapshotFormat;
|
||||
|
||||
private LegacyBlobStoreFormat<Snapshot> snapshotLegacyFormat;
|
||||
private LegacyBlobStoreFormat<SnapshotInfo> snapshotLegacyFormat;
|
||||
|
||||
private final boolean readOnly;
|
||||
|
||||
|
@ -202,8 +202,8 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
indexMetaDataFormat = new ChecksumBlobStoreFormat<>(INDEX_METADATA_CODEC, METADATA_NAME_FORMAT, IndexMetaData.PROTO, parseFieldMatcher, isCompress());
|
||||
indexMetaDataLegacyFormat = new LegacyBlobStoreFormat<>(LEGACY_SNAPSHOT_NAME_FORMAT, IndexMetaData.PROTO, parseFieldMatcher);
|
||||
|
||||
snapshotFormat = new ChecksumBlobStoreFormat<>(SNAPSHOT_CODEC, SNAPSHOT_NAME_FORMAT, Snapshot.PROTO, parseFieldMatcher, isCompress());
|
||||
snapshotLegacyFormat = new LegacyBlobStoreFormat<>(LEGACY_SNAPSHOT_NAME_FORMAT, Snapshot.PROTO, parseFieldMatcher);
|
||||
snapshotFormat = new ChecksumBlobStoreFormat<>(SNAPSHOT_CODEC, SNAPSHOT_NAME_FORMAT, SnapshotInfo.PROTO, parseFieldMatcher, isCompress());
|
||||
snapshotLegacyFormat = new LegacyBlobStoreFormat<>(LEGACY_SNAPSHOT_NAME_FORMAT, SnapshotInfo.PROTO, parseFieldMatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -294,7 +294,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
throw new RepositoryException(this.repositoryName, "cannot delete snapshot from a readonly repository");
|
||||
}
|
||||
List<String> indices = Collections.emptyList();
|
||||
Snapshot snapshot = null;
|
||||
SnapshotInfo snapshot = null;
|
||||
try {
|
||||
snapshot = readSnapshot(snapshotId);
|
||||
indices = snapshot.indices();
|
||||
|
@ -368,9 +368,9 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Snapshot finalizeSnapshot(SnapshotId snapshotId, List<String> indices, long startTime, String failure, int totalShards, List<SnapshotShardFailure> shardFailures) {
|
||||
public SnapshotInfo finalizeSnapshot(SnapshotId snapshotId, List<String> indices, long startTime, String failure, int totalShards, List<SnapshotShardFailure> shardFailures) {
|
||||
try {
|
||||
Snapshot blobStoreSnapshot = new Snapshot(snapshotId.getSnapshot(), indices, startTime, failure, System.currentTimeMillis(), totalShards, shardFailures);
|
||||
SnapshotInfo blobStoreSnapshot = new SnapshotInfo(snapshotId.getSnapshot(), indices, startTime, failure, System.currentTimeMillis(), totalShards, shardFailures);
|
||||
snapshotFormat.write(blobStoreSnapshot, snapshotsBlobContainer, snapshotId.getSnapshot());
|
||||
List<SnapshotId> snapshotIds = snapshots();
|
||||
if (!snapshotIds.contains(snapshotId)) {
|
||||
|
@ -425,7 +425,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MetaData readSnapshotMetaData(SnapshotId snapshotId, Snapshot snapshot, List<String> indices) throws IOException {
|
||||
public MetaData readSnapshotMetaData(SnapshotId snapshotId, SnapshotInfo snapshot, List<String> indices) throws IOException {
|
||||
return readSnapshotMetaData(snapshotId, snapshot.version(), indices, false);
|
||||
}
|
||||
|
||||
|
@ -433,7 +433,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Snapshot readSnapshot(SnapshotId snapshotId) {
|
||||
public SnapshotInfo readSnapshot(SnapshotId snapshotId) {
|
||||
try {
|
||||
return snapshotFormat.read(snapshotsBlobContainer, snapshotId.getSnapshot());
|
||||
} catch (FileNotFoundException | NoSuchFileException ex) {
|
||||
|
@ -520,7 +520,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
|
|||
/**
|
||||
* Returns appropriate snapshot format based on the provided version of the snapshot
|
||||
*/
|
||||
private BlobStoreFormat<Snapshot> snapshotFormat(Version version) {
|
||||
private BlobStoreFormat<SnapshotInfo> snapshotFormat(Version version) {
|
||||
if(legacyMetaData(version)) {
|
||||
return snapshotLegacyFormat;
|
||||
} else {
|
||||
|
|
|
@ -69,7 +69,7 @@ public class RestNodesHotThreadsAction extends BaseRestHandler {
|
|||
@Override
|
||||
public RestResponse buildResponse(NodesHotThreadsResponse response) throws Exception {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (NodeHotThreads node : response) {
|
||||
for (NodeHotThreads node : response.getNodes()) {
|
||||
sb.append("::: ").append(node.getNode().toString()).append("\n");
|
||||
Strings.spaceify(3, node.getHotThreads(), sb);
|
||||
sb.append('\n');
|
||||
|
|
|
@ -20,22 +20,17 @@
|
|||
package org.elasticsearch.rest.action.admin.cluster.node.info;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestChannel;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.RestResponse;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.rest.action.support.RestBuilderListener;
|
||||
import org.elasticsearch.rest.action.support.RestActions.NodesResponseRestListener;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -106,15 +101,6 @@ public class RestNodesInfoAction extends BaseRestHandler {
|
|||
|
||||
settingsFilter.addFilterSettingParams(request);
|
||||
|
||||
client.admin().cluster().nodesInfo(nodesInfoRequest, new RestBuilderListener<NodesInfoResponse>(channel) {
|
||||
|
||||
@Override
|
||||
public RestResponse buildResponse(NodesInfoResponse response, XContentBuilder builder) throws Exception {
|
||||
builder.startObject();
|
||||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
return new BytesRestResponse(RestStatus.OK, builder);
|
||||
}
|
||||
});
|
||||
client.admin().cluster().nodesInfo(nodesInfoRequest, new NodesResponseRestListener<>(channel));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.rest.action.admin.cluster.node.stats;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest;
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
|
||||
import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
|
||||
import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags.Flag;
|
||||
import org.elasticsearch.client.Client;
|
||||
|
@ -31,7 +30,7 @@ import org.elasticsearch.rest.BaseRestHandler;
|
|||
import org.elasticsearch.rest.RestChannel;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.support.RestToXContentListener;
|
||||
import org.elasticsearch.rest.action.support.RestActions.NodesResponseRestListener;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -114,6 +113,6 @@ public class RestNodesStatsAction extends BaseRestHandler {
|
|||
nodesStatsRequest.indices().includeSegmentFileSizes(true);
|
||||
}
|
||||
|
||||
client.admin().cluster().nodesStats(nodesStatsRequest, new RestToXContentListener<>(channel));
|
||||
client.admin().cluster().nodesStats(nodesStatsRequest, new NodesResponseRestListener<>(channel));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@ import org.elasticsearch.rest.BaseRestHandler;
|
|||
import org.elasticsearch.rest.RestChannel;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.support.RestToXContentListener;
|
||||
|
||||
import org.elasticsearch.rest.action.support.RestActions.NodesResponseRestListener;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -46,6 +45,6 @@ public class RestClusterStatsAction extends BaseRestHandler {
|
|||
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
|
||||
ClusterStatsRequest clusterStatsRequest = new ClusterStatsRequest().nodesIds(request.paramAsStringArray("nodeId", null));
|
||||
clusterStatsRequest.timeout(request.param("timeout"));
|
||||
client.admin().cluster().clusterStats(clusterStatsRequest, new RestToXContentListener<>(channel));
|
||||
client.admin().cluster().clusterStats(clusterStatsRequest, new NodesResponseRestListener<>(channel));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RestValidateQueryAction extends BaseRestHandler {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
QueryBuilder queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
validateQueryRequest.query(queryBuilder);
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RestCountAction extends AbstractCatAction {
|
|||
if (source != null) {
|
||||
searchSourceBuilder.query(RestActions.getQueryContent(new BytesArray(source), indicesQueriesRegistry, parseFieldMatcher));
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
QueryBuilder queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
searchSourceBuilder.query(queryBuilder);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue