Skip to content

Commit 6ca2834

Browse files
committed
Merge branch 'master' into compile-with-jdk-9
* master: Fix Gradle wrapper usage on Windows when building BWC (elastic#28146) [Docs] Fix some typos in comments (elastic#28098)
2 parents 8d33402 + 82da56c commit 6ca2834

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

core/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ private void executeSearch(SearchTask task, SearchTimeProvider timeProvider, Sea
313313

314314
// optimize search type for cases where there is only one shard group to search on
315315
if (shardIterators.size() == 1) {
316-
// if we only have one group, then we always want Q_A_F, no need for DFS, and no need to do THEN since we hit one shard
316+
// if we only have one group, then we always want Q_T_F, no need for DFS, and no need to do THEN since we hit one shard
317317
searchRequest.searchType(QUERY_THEN_FETCH);
318318
}
319319
if (searchRequest.isSuggestOnly()) {
@@ -338,8 +338,8 @@ private void executeSearch(SearchTask task, SearchTimeProvider timeProvider, Sea
338338
if (searchRequest.isMaxConcurrentShardRequestsSet() == false) {
339339
// we try to set a default of max concurrent shard requests based on
340340
// the node count but upper-bound it by 256 by default to keep it sane. A single
341-
// search request that fans out lots of shards should hit a cluster too hard while 256 is already a lot
342-
// we multiply is by the default number of shards such that a single request in a cluster of 1 would hit all shards of a
341+
// search request that fans out lots of shards should hit a cluster too hard while 256 is already a lot.
342+
// we multiply it by the default number of shards such that a single request in a cluster of 1 would hit all shards of a
343343
// default index.
344344
searchRequest.setMaxConcurrentShardRequests(Math.min(256, nodeCount
345345
* IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING.getDefault(Settings.EMPTY)));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ private void parseSource(DefaultSearchContext context, SearchSourceBuilder sourc
855855

856856
/**
857857
* Shortcut ids to load, we load only "from" and up to "size". The phase controller
858-
* handles this as well since the result is always size * shards for Q_A_F
858+
* handles this as well since the result is always size * shards for Q_T_F
859859
*/
860860
private void shortcutDocIdsToLoad(SearchContext context) {
861861
final int[] docIdsToLoad;

distribution/bwc/build.gradle

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
import org.apache.tools.ant.taskdefs.condition.Os
2021
import org.elasticsearch.gradle.LoggedExec
2122
import org.elasticsearch.gradle.Version
2223

@@ -118,31 +119,31 @@ if (project.hasProperty('bwcVersion')) {
118119
task buildBwcVersion(type: Exec) {
119120
dependsOn checkoutBwcBranch, writeBuildMetadata
120121
workingDir = checkoutDir
121-
executable = new File(checkoutDir, 'gradlew').toString()
122122
if (project.rootProject.ext.runtimeJavaVersion == JavaVersion.VERSION_1_8 && ["5.6", "6.1"].contains(bwcBranch)) {
123123
/*
124124
* If runtime Java home is set to JDK 8 and we are building branches that are officially built with JDK 8, push this to JAVA_HOME for
125125
* these builds.
126126
*/
127127
environment('JAVA_HOME', System.getenv('RUNTIME_JAVA_HOME'))
128128
}
129-
final ArrayList<String> commandLineArgs = [
130-
":distribution:deb:assemble",
131-
":distribution:rpm:assemble",
132-
":distribution:zip:assemble",
133-
"-Dbuild.snapshot=${System.getProperty('build.snapshot') ?: 'true'}"]
129+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
130+
executable 'cmd'
131+
args '/C', 'call', new File(checkoutDir, 'gradlew').toString()
132+
} else {
133+
executable new File(checkoutDir, 'gradlew').toString()
134+
}
135+
args ":distribution:deb:assemble", ":distribution:rpm:assemble", ":distribution:zip:assemble", "-Dbuild.snapshot=${System.getProperty('build.snapshot') ?: 'true'}"
134136
final LogLevel logLevel = gradle.startParameter.logLevel
135137
if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) {
136-
commandLineArgs << "--${logLevel.name().toLowerCase(Locale.ENGLISH)}"
138+
args "--${logLevel.name().toLowerCase(Locale.ENGLISH)}"
137139
}
138140
final String showStacktraceName = gradle.startParameter.showStacktrace.name()
139141
assert ["INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL"].contains(showStacktraceName)
140142
if (showStacktraceName.equals("ALWAYS")) {
141-
commandLineArgs << "--stacktrace"
143+
args "--stacktrace"
142144
} else if (showStacktraceName.equals("ALWAYS_FULL")) {
143-
commandLineArgs << "--full-stacktrace"
145+
args "--full-stacktrace"
144146
}
145-
args = commandLineArgs
146147
doLast {
147148
List missing = [bwcDeb, bwcRpm, bwcZip].grep { file ->
148149
false == file.exists()

0 commit comments

Comments
 (0)