Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
170476f
RemoveUnusedPrivateMethods
Jul 16, 2025
daa1be5
spotless und gradle updateSHAs
Jul 16, 2025
fa768d8
spotless und gradle updateSHAs
Jul 16, 2025
3ee6f40
spotless und gradle updateSHAs
Jul 16, 2025
52967ab
spotless und gradle updateSHAs
Jul 16, 2025
7e41b90
spotless und gradle updateSHAs
Jul 16, 2025
b5008dc
spotless und gradle updateSHAs
Jul 16, 2025
467293d
spotless und gradle updateSHAs
Jul 16, 2025
1e28daa
RemoveUnusedImports
Jul 16, 2025
219d261
RemoveUnusedImports
Jul 16, 2025
d56715c
RemoveUnusedImports
Jul 16, 2025
1b39a3c
RemoveUnusedImports
Jul 16, 2025
567da6e
Merge branch 'fm' into CodeCleanup
Jul 16, 2025
085a752
RemoveUnusedImports
Jul 16, 2025
4f98d3a
RemoveUnusedImports
Jul 16, 2025
b5a7802
RemoveUnusedImports
Jul 16, 2025
65e0dd1
RemoveUnusedImports
Jul 16, 2025
910aeda
RemoveUnusedImports
Jul 16, 2025
a92a8dd
RemoveUnusedImports
Jul 16, 2025
f9320db
RemoveUnusedImports
Jul 16, 2025
ee2cf5a
RemoveUnusedImports
Jul 16, 2025
34ed4d9
RemoveUnusedImports
Jul 16, 2025
30bf570
RemoveUnusedPrivateMethods
Jul 16, 2025
8d38fbc
RemoveUnusedPrivateMethods
Jul 16, 2025
0537e54
RemoveUnusedPrivateMethods
Jul 16, 2025
27e634a
RemoveUnusedPrivateMethods
Jul 16, 2025
df5f191
RemoveUnusedPrivateMethods
Jul 16, 2025
cddaa81
RemoveUnusedPrivateMethods
Jul 16, 2025
86b932d
RemoveUnusedPrivateMethods
Jul 16, 2025
60c3bc0
RemoveUnusedPrivateMethods
Jul 16, 2025
eca4143
RemoveUnusedPrivateMethods
Jul 16, 2025
07133bf
RemoveUnusedPrivateMethods
Jul 16, 2025
a96d9c9
RemoveUnusedPrivateMethods
Jul 16, 2025
dddff86
RemoveUnusedPrivateMethods
Jul 16, 2025
0742f7a
RemoveUnusedPrivateMethods
Jul 16, 2025
9665c0d
RemoveUnusedPrivateMethods
Jul 16, 2025
2cf69e6
RemoveUnusedPrivateMethods
Jul 16, 2025
8a25a11
RemoveUnusedPrivateMethods
Jul 16, 2025
90fc19f
RemoveUnusedPrivateMethods
Jul 16, 2025
eb36d24
RemoveUnusedPrivateMethods
Jul 16, 2025
f422105
RemoveUnusedPrivateMethods
Jul 16, 2025
3e42046
RemoveUnusedPrivateMethods
Jul 16, 2025
eada184
RemoveUnusedPrivateMethods
Jul 16, 2025
659d712
RemoveUnusedPrivateMethods
Jul 16, 2025
008b69d
RemoveUnusedPrivateMethods
Jul 16, 2025
5d3a840
RemoveUnusedPrivateMethods
Jul 16, 2025
943439c
RemoveUnusedPrivateMethods
Jul 16, 2025
2dc7643
Merge branch 'fm' into RemoveUnusedPrivateMethods
Jul 16, 2025
c06f307
RemoveUnusedPrivateMethods
Jul 16, 2025
4b1266b
RemoveUnusedPrivateMethods
Jul 16, 2025
b7e6c42
RemoveUnusedPrivateMethods
Jul 16, 2025
b39547f
spot
Jul 16, 2025
aceec27
spot
Jul 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ import java.nio.charset.StandardCharsets
import static org.opensearch.gradle.util.GradleUtils.maybeConfigure

plugins {
id "test-report-aggregation"
id 'jacoco-report-aggregation'
id 'lifecycle-base'
id 'opensearch.docker-support'
id 'opensearch.global-build-info'
id "com.diffplug.spotless" version "6.25.0" apply false
id "org.openrewrite.rewrite" version "7.11.0" apply false
id "com.diffplug.spotless" version "7.1.0" apply false
id "org.gradle.test-retry" version "1.6.2" apply false
id "test-report-aggregation"
id 'jacoco-report-aggregation'
id "org.openrewrite.rewrite" version "7.11.0" apply false
}

apply from: 'gradle/build-complete.gradle'
apply from: 'gradle/runtime-jdk-provision.gradle'
apply from: 'gradle/ide.gradle'
apply from: 'gradle/code-convention.gradle'
apply from: 'gradle/code-coverage.gradle'
apply from: 'gradle/forbidden-dependencies.gradle'
apply from: 'gradle/formatting.gradle'
apply from: 'gradle/rewrite.gradle'
apply from: 'gradle/ide.gradle'
apply from: 'gradle/local-distribution.gradle'
apply from: 'gradle/run.gradle'
apply from: 'gradle/missing-javadoc.gradle'
apply from: 'gradle/code-coverage.gradle'
apply from: 'gradle/run.gradle'
apply from: 'gradle/runtime-jdk-provision.gradle'

// common maven publishing configuration
allprojects {
Expand Down
1 change: 1 addition & 0 deletions client/sniffer/licenses/jackson-core-2.17.3.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1d6eb3e959c737692b720d3492b2f1f34c4c8579
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ org.gradle.caching=true
org.gradle.warning.mode=none
org.gradle.parallel=true
# https://github.com/openrewrite/rewrite-gradle-plugin/issues/212
#org.gradle.workers.max=3
org.gradle.workers.max=3
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
Expand Down
69 changes: 69 additions & 0 deletions gradle/code-convention.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import org.opensearch.gradle.BuildPlugin

import static java.lang.System.getenv

allprojects {
plugins.withType(BuildPlugin).whenPluginAdded {
project.apply plugin: "org.openrewrite.rewrite"
rewrite {
activeRecipe("org.opensearch.openrewrite.recipe.CodeCleanup")
configFile = file("$rootDir/gradle/code-convention.yml")
exclusions.add("**OpenSearchTestCaseTests.java")
exclusions.add("**/simple-bulk11.json")
exclusions.add("**/simple-msearch5.json")
exclusions.add("**AbstractBenchmark.java")
exclusions.add("**ScriptClassPathResolutionContext.java")
exclusions.add("**StarTreeMapper.java")
failOnDryRunResults = true
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-rewrite:0.9.0")
rewrite("org.openrewrite.recipe:rewrite-static-analysis:2.12.0")
}
tasks {
if (getenv("dogFoodDev")) {
assemble {
dependsOn(rewriteRun)
}
}
if (!getenv("skipDogFood")) {
check {
dependsOn(rewriteDryRun)
}
}
}
}
}
15 changes: 15 additions & 0 deletions gradle/code-convention.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: specs.openrewrite.org/v1beta/recipe
name: org.opensearch.openrewrite.recipe.CodeCleanup
displayName: CodeCleanup
description: Automatically cleanup code, e.g. remove unnecessary parentheses, simplify expressions.
recipeList:
- org.openrewrite.java.RemoveUnusedImports
- org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
# - org.openrewrite.text.EndOfLineAtEndOfFile
# - org.openrewrite.java.OrderImports
# - org.openrewrite.java.format.RemoveTrailingWhitespace
# - org.openrewrite.staticanalysis.EmptyBlock
# - org.openrewrite.staticanalysis.RemoveCallsToSystemGc
# - org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
# - org.openrewrite.staticanalysis.RemoveUnusedPrivateFields
# - org.openrewrite.staticanalysis.UnnecessaryThrows
115 changes: 45 additions & 70 deletions gradle/formatting.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,81 +30,56 @@

import org.opensearch.gradle.BuildPlugin

/*
* This script plugin configures formatting for Java source using Spotless
* for Gradle. Since the act of formatting existing source can interfere
* with developers' workflows, we don't automatically format all code
* (yet). Instead, we maintain a list of projects that are excluded from
* formatting, until we reach a point where we can comfortably format them
* in one go without too much disruption.
*
* Any new sub-projects must not be added to the exclusions list!
*
* To perform a reformat, run:
*
* ./gradlew spotlessApply
*
* To check the current format, run:
*
* ./gradlew spotlessJavaCheck
*
* This is also carried out by the `precommit` task.
*
* For more about Spotless, see:
*
* https://github.com/diffplug/spotless/tree/master/plugin-gradle
*/
import static java.lang.System.getenv

allprojects {
plugins.withType(BuildPlugin).whenPluginAdded {
project.apply plugin: "com.diffplug.spotless"

spotless {
java {
// Normally this isn't necessary, but we have Java sources in
// non-standard places
target '**/*.java'

importOrder(
'de.thetaphi',
'com.carrotsearch',
'com.fasterxml',
'com.avast',
'com.sun',
'com.maxmind|com.github|com.networknt|groovy|nebula',
'org.antlr',
'software.amazon',
'com.azure|com.microsoft|com.ibm|com.google|joptsimple|org.apache|org.bouncycastle|org.codehaus|org.opensearch|org.objectweb|org.joda|org.hamcrest|org.openjdk|org.gradle|org.junit',
'javax',
'java',
'',
'\\#java|\\#org.opensearch|\\#org.hamcrest|\\#'
)

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('buildSrc/formatterConfig.xml')
endWithNewline()

custom 'Refuse wildcard imports', {
// Wildcard imports can't be resolved; fail the build
if (it =~ /\s+import .*\*;/) {
throw new AssertionError("Do not use wildcard imports. 'spotlessApply' cannot resolve this issue.")
}
}

// See DEVELOPER_GUIDE.md for details of when to enable this.
if (System.getProperty('spotless.paddedcell') != null) {
paddedCell()
}
project.apply plugin: "com.diffplug.spotless"
spotless {
java {
// Normally this isn't necessary, but we have Java sources in
// non-standard places
target '**/*.java'
importOrder(
'de.thetaphi',
'com.carrotsearch',
'com.fasterxml',
'com.avast',
'com.sun',
'com.maxmind|com.github|com.networknt|groovy|nebula',
'org.antlr',
'software.amazon',
'com.azure|com.microsoft|com.ibm|com.google|joptsimple|org.apache|org.bouncycastle|org.codehaus|org.opensearch|org.objectweb|org.joda|org.hamcrest|org.openjdk|org.gradle|org.junit',
'javax',
'java',
'',
'\\#java|\\#org.opensearch|\\#org.hamcrest|\\#'
)
eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('buildSrc/formatterConfig.xml')
endWithNewline()
removeWildcardImports()
// See DEVELOPER_GUIDE.md for details of when to enable this.
if (System.getProperty('spotless.paddedcell') != null) {
paddedCell()
}
format 'misc', {
target '*.md', '*.gradle', '**/*.json', '**/*.yaml', '**/*.yml', '**/*.svg'

targetExclude '**/simple-bulk11.json', '**/simple-msearch5.json'

endWithNewline()
}
format 'misc', {
target '*.md', '*.gradle', '**/*.json', '**/*.yaml', '**/*.yml', '**/*.svg'
targetExclude '**/simple-bulk11.json', '**/simple-msearch5.json'
endWithNewline()
}
}
tasks {
if (getenv("dogFoodDev")) {
assemble {
dependsOn(spotlessJavaApply)
}
}

precommit.dependsOn 'spotlessJavaCheck'
if (!getenv("skipDogFood")) {
check {
dependsOn(spotlessJavaCheck)
}
}
}
}
}
1 change: 1 addition & 0 deletions libs/core/licenses/jackson-core-2.17.3.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1d6eb3e959c737692b720d3492b2f1f34c4c8579
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ public TaskListRequest taskType(TaskStatus... taskStatus) {
return this;
}

/**
* Update worker node to filter with in the request
* @param workerNode WorkerNode
* @return ListTaskRequest
*/
private TaskListRequest workerNode(WorkerNode workerNode) {
this.workerNodes = workerNode;
return this;
}

/**
* Update page number to start with when fetching the list of tasks
* @param startPageNumber startPageNumber
Expand Down
1 change: 1 addition & 0 deletions libs/x-content/licenses/jackson-core-2.17.3.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1d6eb3e959c737692b720d3492b2f1f34c4c8579
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5286b5df35824b8c2a8ceae9a54e99dca9220e15
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cd19020c7bace93ce269e85ac6fee782a6bf4e16
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
536e9d9ee966cf40a8b5d2f9ba505551364d0ad5
Original file line number Diff line number Diff line change
Expand Up @@ -2600,17 +2600,6 @@ private TieredSpilloverCache<String, String> getTieredSpilloverCache(
return builder.build();
}

private TieredSpilloverCache<String, String> initializeTieredSpilloverCache(
int keyValueSize,
int diskCacheSize,
RemovalListener<ICacheKey<String>, String> removalListener,
Settings settings,
long diskDeliberateDelay

) {
return initializeTieredSpilloverCache(keyValueSize, diskCacheSize, removalListener, settings, diskDeliberateDelay, null, 256);
}

private TieredSpilloverCache<String, String> initializeTieredSpilloverCache(
int keyValueSize,
int diskCacheSize,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4f30a05d2eee0ab700cdc27aa5967e934d3042b2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42c617beb411ee813bdc39a287424bfb19d99185
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a25fe2f5607fea9e00ed00cf81b7aa2eaacbbd6e
1 change: 1 addition & 0 deletions modules/lang-expression/licenses/asm-9.8.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dc19ecb3f7889b7860697215cae99c0f9b6f6b4b
1 change: 1 addition & 0 deletions modules/lang-painless/licenses/asm-9.8.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dc19ecb3f7889b7860697215cae99c0f9b6f6b4b
1 change: 1 addition & 0 deletions modules/lang-painless/licenses/asm-util-9.8.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
395f1c1f035258511f27bc9b2583d76e4b143f59
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
227d4d4957ccc3dc5761bd897e3a0ee587e750a7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4f30a05d2eee0ab700cdc27aa5967e934d3042b2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42c617beb411ee813bdc39a287424bfb19d99185
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -247,10 +246,6 @@ private static boolean isValidNode(DiscoveryNode node) {
return node != null && !node.getVersion().before(MIN_SUPPORTED_VERSION) && FeatureFlags.isEnabled(ARROW_STREAMS_SETTING);
}

private Set<String> getCurrentClusterNodes() {
return Objects.requireNonNull(clientConfig.clusterService).state().nodes().getNodes().keySet();
}

@VisibleForTesting
Map<String, ClientHolder> getFlightClients() {
return flightClients;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,9 @@ public void testGetFlightInfo_LocationNotFound() {
}

public void testGetFlightInfo_SchemaError() {
when(streamManager.getStreamProducer(any(FlightStreamTicket.class)))
.thenReturn(Optional.of(FlightStreamManager.StreamProducerHolder.create(streamProducer, allocator)));
when(streamManager.getStreamProducer(any(FlightStreamTicket.class))).thenReturn(
Optional.of(FlightStreamManager.StreamProducerHolder.create(streamProducer, allocator))
);
Location location = Location.forGrpcInsecure("localhost", 8815);
when(flightClientManager.getFlightClientLocation(LOCAL_NODE_ID)).thenReturn(Optional.of(location));
when(streamProducer.createRoot(allocator)).thenReturn(mock(VectorSchemaRoot.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void tearDown() throws Exception {
public void testNext_ReturnsTrue_WhenFlightStreamHasNext() throws Exception {
when(mockFlightStream.next()).thenReturn(true);
assertTrue(iterator.next());
assert(mockFlightStream).next();
assert (mockFlightStream).next();
}

public void testNext_ReturnsFalse_WhenFlightStreamHasNoNext() throws Exception {
Expand Down
Loading
Loading