Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 7849650

Browse files
authored
Revert "Merge from master to 1.10 (#189)" (#192)
This reverts commit 4e7e8b4.
1 parent 4bfcf55 commit 7849650

File tree

6 files changed

+33
-284
lines changed

6 files changed

+33
-284
lines changed

build.gradle

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ static def propEnabled(property) {
200200

201201
// The following Gradle tasks are used to create a PA/RCA enabled Elasticsearch cluster
202202
// Pass the -Dtests.enableIT property to Gradle to run ITs
203-
/**
204-
* cloneGitRepo clones the performance-analyzer-rca repo if the -Dtests.enableIT=true flag is passed
205-
* to the Gradle JVM
206-
*/
207203
task cloneGitRepo(type: GitClone) {
208204
rcaDir = Paths.get(getProject().getBuildDir().toString(), "performance-analyzer-rca").toString()
209205
def destination = file(rcaDir)
@@ -277,10 +273,6 @@ bundlePlugin {
277273
}
278274
}
279275

280-
/**
281-
* setupESCluster spins up a local 2 node ES cluster using the enableRca task in the performance-analyzer-rca
282-
* repo. The performance-analyzer-rca repo is cloned as part of the cloneGitRepo task.
283-
*/
284276
task setupEsCluster() {
285277
dependsOn(cloneGitRepo)
286278
onlyIf = {
@@ -295,30 +287,6 @@ task setupEsCluster() {
295287
}
296288
}
297289

298-
/**
299-
* integTestRunner is a task provided by the ES test framework, which allows us to spin up clients
300-
* and test API calls against a local or remote Elasticsearch cluster.
301-
*
302-
* The simplest way to run this task in a way that "just works" is to invoke
303-
* ./gradlew integTest -Dtests.enableIT=true -Dtests.useDockerCluster=true
304-
* which will spin up a local 2 node ES cluster on your machine, then execute the test suite against it
305-
*
306-
* A full list of options is provided below. Check our gradle.properties file for the defaults for
307-
* each of these properties.
308-
*
309-
* -Dtests.rest.cluster the Elasticsearch REST endpoint that test clients should hit
310-
* -Dtests.cluster the Elasticsearch <a href="https://discuss.elastic.co/t/transport-client-vs-rest-client/13936">transport</a>
311-
* endpoint that test clients should hit
312-
* -Dtests.enableIT a flag to enable integration testing, by default this is false
313-
* -Dtests.useDockerCluster if true, spin up a local 2 node cluster before executing tests
314-
* NOTE: if you specify this, don't specify -Dtests.rest.cluster or -Dtests.cluster
315-
* -Dtests.pa.port the port number of the PerformanceAnalyzer REST endpoint
316-
* -Dtests.https either true or false, if true, then instantiate REST and transport clients using
317-
* the https:// protocol and basic authentication via the -Dtests.user and -Dtests.password properties
318-
* -Dtests.user the username of the admin user, this is used in conjunction with -Dtests.https and
319-
* -Dtests.password to authenticate requests in the opendistro-security context
320-
* -Dtests.password the password of the admin user specified by -Dtests.user
321-
*/
322290
integTestRunner {
323291
onlyIf = {
324292
propEnabled("tests.enableIT")

gradle.properties

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,8 @@
77
systemProp.tests.rest.cluster=localhost:9200
88
# The Elasticsearch cluster node communication endpoint
99
systemProp.tests.cluster=localhost:9300
10-
1110
# The Elasticsearch cluster name for integ tests
1211
systemProp.tests.clustername=IntegTestCluster
13-
14-
# Set this to true if you want a cluster spun up for integration testing
15-
systemProp.tests.useDockerCluster=false
16-
17-
# Set this to true if you want to enable integration testing
18-
systemProp.tests.enableIT=false
19-
20-
# The port number for the PerformanceAnalyzer WebService
21-
systemProp.tests.pa.port=9600
22-
23-
# Whether or not to use https for REST and transport clients
24-
systemProp.tests.https=false
25-
26-
# The username of the admin user (or any user able to auth requests against opendistro-security)
27-
# NOTE: this only does something if tests.https is set to true
28-
systemProp.tests.user=admin
29-
# The password of the user specified above
30-
systemProp.tests.password=admin
12+
# Whether or not to spin up a new Elasticsearch cluster for integration testing
13+
# Comment this out if you don't want a cluster spun up
14+
systemProp.tests.useDockerCluster=
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
830001e9ac4b0622979a0b7143a98990832364a4
1+
9c4d17774058b44a6f2ee6b9752c4f4254414784

src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerClusterSettingHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ public class PerformanceAnalyzerClusterSettingHandler implements ClusterSettingL
1010
private static final int BIT_ONE = 1;
1111
private static final int CLUSTER_SETTING_DISABLED_VALUE = 0;
1212
private static final int ENABLED_VALUE = 1;
13-
private static final int MAX_ALLOWED_BIT_POS = Math.min(PerformanceAnalyzerFeatureBits.values().length, Integer.SIZE - 1);
1413
private static final int RCA_ENABLED_BIT_POS = PerformanceAnalyzerFeatureBits.RCA_BIT.ordinal();
1514
private static final int PA_ENABLED_BIT_POS = PerformanceAnalyzerFeatureBits.PA_BIT.ordinal();
1615
private static final int LOGGING_ENABLED_BIT_POS = PerformanceAnalyzerFeatureBits.LOGGING_BIT.ordinal();
16+
private static final int MAX_ALLOWED_BIT_POS = Math.min(PerformanceAnalyzerFeatureBits.values().length, Integer.SIZE - 1);
1717

1818
private final PerformanceAnalyzerController controller;
1919
private final ClusterSettingsManager clusterSettingsManager;
@@ -219,7 +219,7 @@ private int resetBit(int number, int bitPosition) {
219219
* @param bitPosition The position of the bit in the clusterSettingValue
220220
* @return true if the bit is set, false otherwise.
221221
*/
222-
public static boolean checkBit(int clusterSettingValue, int bitPosition) {
223-
return ((bitPosition < MAX_ALLOWED_BIT_POS) && (clusterSettingValue & (1 << bitPosition)) > 0);
222+
private boolean checkBit(int clusterSettingValue, int bitPosition) {
223+
return ((bitPosition < MAX_ALLOWED_BIT_POS) & (clusterSettingValue & (1 << bitPosition)) == ENABLED_VALUE);
224224
}
225225
}

src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/ITConfig.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)