Skip to content

Commit 4ac74d5

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 18391a3 commit 4ac74d5

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

server/src/main/java/org/elasticsearch/action/search/ClearScrollController.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ public static void closeContexts(
163163
ActionListener<Integer> listener
164164
) {
165165
DiscoveryNodes nodes = clusterService.state().nodes();
166-
final Set<String> clusters = shards.values().stream()
166+
final Set<String> clusters = shards.values()
167+
.stream()
167168
.map(SearchContextIdForNode::getClusterAlias)
168169
.filter(clusterAlias -> Strings.isEmpty(clusterAlias) == false)
169170
.collect(Collectors.toSet());
@@ -193,9 +194,11 @@ public static void closeContexts(
193194
IndexShardRoutingTable indexShardRoutingTable = clusterService.state()
194195
.routingTable(projectResolver.getProjectId())
195196
.shardRoutingTable(entry.getKey());
196-
targetNodes = indexShardRoutingTable.assignedUnpromotableShards().stream()
197-
.map(ShardRouting::currentNodeId).map(nodeId -> nodeLookup.apply(contextId.getClusterAlias(), nodeId)).collect(
198-
Collectors.toSet());
197+
targetNodes = indexShardRoutingTable.assignedUnpromotableShards()
198+
.stream()
199+
.map(ShardRouting::currentNodeId)
200+
.map(nodeId -> nodeLookup.apply(contextId.getClusterAlias(), nodeId))
201+
.collect(Collectors.toSet());
199202
staticLogger.info("---> trying alternative nodes to close context: " + targetNodes);
200203
}
201204
for (DiscoveryNode targetNode : targetNodes) {

server/src/main/java/org/elasticsearch/search/SearchService.java

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,9 +1245,9 @@ private ReaderContext findReaderContext(ShardSearchContextId id, TransportReques
12451245
if (id.getSessionId().isEmpty()) {
12461246
throw new IllegalArgumentException("Session id must be specified");
12471247
}
1248-
// if (sessionId.equals(id.getSessionId()) == false) {
1249-
// throw new SearchContextMissingException(id);
1250-
// }
1248+
// if (sessionId.equals(id.getSessionId()) == false) {
1249+
// throw new SearchContextMissingException(id);
1250+
// }
12511251
final ReaderContext reader = activeReaders.get(id.readerContextId());
12521252
if (reader == null) {
12531253
throw new SearchContextMissingException(id);
@@ -1848,10 +1848,10 @@ public long getDefaultKeepAliveInMillis() {
18481848

18491849
public List<ReaderContext> getActiveContexts(ShardId shardId) {
18501850
return this.activeReaders.values()
1851-
.stream()
1852-
.filter(c -> c.singleSession() == false)
1853-
.filter(c -> c.indexShard().shardId().equals(shardId))
1854-
.collect(Collectors.toList());
1851+
.stream()
1852+
.filter(c -> c.singleSession() == false)
1853+
.filter(c -> c.indexShard().shardId().equals(shardId))
1854+
.collect(Collectors.toList());
18551855
}
18561856

18571857
public void reopenPitContexts(ShardId shardId, String segmentsFileName, long keepAlive, String sessionId, long contextId) {
@@ -1860,17 +1860,16 @@ public void reopenPitContexts(ShardId shardId, String segmentsFileName, long kee
18601860
ReaderContext readerContext = null;
18611861
try {
18621862
Directory directory = shard.store().directory();
1863-
SegmentInfos segmentCommitInfos = SegmentInfos.readCommit(directory, segmentsFileName,
1864-
IndexVersions.MINIMUM_READONLY_COMPATIBLE.luceneVersion().major);
1863+
SegmentInfos segmentCommitInfos = SegmentInfos.readCommit(
1864+
directory,
1865+
segmentsFileName,
1866+
IndexVersions.MINIMUM_READONLY_COMPATIBLE.luceneVersion().major
1867+
);
18651868
IndexCommit indexCommit = Lucene.getIndexCommit(segmentCommitInfos, directory);
18661869
DirectoryReader open = StandardDirectoryReader.open(indexCommit);
18671870

18681871
String searcherId = ReadOnlyEngine.generateSearcherId(segmentCommitInfos);
1869-
final ShardSearchContextId shardSearchContextId = new ShardSearchContextId(
1870-
sessionId,
1871-
contextId,
1872-
searcherId
1873-
);
1872+
final ShardSearchContextId shardSearchContextId = new ShardSearchContextId(sessionId, contextId, searcherId);
18741873
SearcherSupplier searchSupplier = new Engine.SearcherSupplier(Function.identity()) {
18751874

18761875
@Override
@@ -1883,13 +1882,12 @@ protected Searcher acquireSearcherInternal(String source) {
18831882
EngineConfig engineConfig = shard.getEngineOrNull().getEngineConfig();
18841883

18851884
return new Searcher(
1886-
"source",
1887-
open,
1888-
engineConfig.getSimilarity(),
1889-
engineConfig.getQueryCache(),
1890-
engineConfig.getQueryCachingPolicy(),
1891-
() -> {
1892-
}
1885+
"source",
1886+
open,
1887+
engineConfig.getSimilarity(),
1888+
engineConfig.getQueryCache(),
1889+
engineConfig.getQueryCachingPolicy(),
1890+
() -> {}
18931891
);
18941892
}
18951893
};

server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.action.search;
1111

1212
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
13+
1314
import org.apache.lucene.search.TotalHits;
1415
import org.apache.lucene.util.SetOnce;
1516
import org.elasticsearch.TransportVersion;

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
2121
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
2222
import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter;
23+
2324
import org.apache.logging.log4j.Level;
2425
import org.apache.logging.log4j.LogManager;
2526
import org.apache.logging.log4j.Logger;

0 commit comments

Comments
 (0)