Add missed final keywords in BootstrapChecks
This commit is contained in:
parent
f2220c9786
commit
0c914b51c7
|
@ -69,7 +69,7 @@ final class BootstrapCheck {
|
||||||
* @param checks the checks to execute
|
* @param checks the checks to execute
|
||||||
*/
|
*/
|
||||||
// visible for testing
|
// visible for testing
|
||||||
static void check(boolean enforceLimits, List<Check> checks) {
|
static void check(final boolean enforceLimits, final List<Check> checks) {
|
||||||
final ESLogger logger = Loggers.getLogger(BootstrapCheck.class);
|
final ESLogger logger = Loggers.getLogger(BootstrapCheck.class);
|
||||||
|
|
||||||
for (Check check : checks) {
|
for (Check check : checks) {
|
||||||
|
@ -114,7 +114,7 @@ final class BootstrapCheck {
|
||||||
}
|
}
|
||||||
|
|
||||||
// the list of checks to execute
|
// the list of checks to execute
|
||||||
private static List<Check> checks(Settings settings) {
|
private static List<Check> checks(final Settings settings) {
|
||||||
List<Check> checks = new ArrayList<>();
|
List<Check> checks = new ArrayList<>();
|
||||||
FileDescriptorCheck fileDescriptorCheck
|
FileDescriptorCheck fileDescriptorCheck
|
||||||
= Constants.MAC_OS_X ? new OsXFileDescriptorCheck() : new FileDescriptorCheck();
|
= Constants.MAC_OS_X ? new OsXFileDescriptorCheck() : new FileDescriptorCheck();
|
||||||
|
@ -165,7 +165,7 @@ final class BootstrapCheck {
|
||||||
this(1 << 16);
|
this(1 << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FileDescriptorCheck(int limit) {
|
protected FileDescriptorCheck(final int limit) {
|
||||||
if (limit <= 0) {
|
if (limit <= 0) {
|
||||||
throw new IllegalArgumentException("limit must be positive but was [" + limit + "]");
|
throw new IllegalArgumentException("limit must be positive but was [" + limit + "]");
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ final class BootstrapCheck {
|
||||||
|
|
||||||
private final boolean mlockallSet;
|
private final boolean mlockallSet;
|
||||||
|
|
||||||
public MlockallCheck(boolean mlockAllSet) {
|
public MlockallCheck(final boolean mlockAllSet) {
|
||||||
this.mlockallSet = mlockAllSet;
|
this.mlockallSet = mlockAllSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class BootstrapCheckTests extends ESTestCase {
|
||||||
try {
|
try {
|
||||||
BootstrapCheck.check(true, Collections.singletonList(check));
|
BootstrapCheck.check(true, Collections.singletonList(check));
|
||||||
fail("should have failed due to max file descriptors too low");
|
fail("should have failed due to max file descriptors too low");
|
||||||
} catch (RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
assertThat(e.getMessage(), containsString("max file descriptors"));
|
assertThat(e.getMessage(), containsString("max file descriptors"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public class BootstrapCheckTests extends ESTestCase {
|
||||||
private final boolean isMemoryLocked;
|
private final boolean isMemoryLocked;
|
||||||
private final boolean shouldFail;
|
private final boolean shouldFail;
|
||||||
|
|
||||||
public MlockallCheckTestCase(boolean mlockallSet, boolean isMemoryLocked, boolean shouldFail) {
|
public MlockallCheckTestCase(final boolean mlockallSet, final boolean isMemoryLocked, final boolean shouldFail) {
|
||||||
this.mlockallSet = mlockallSet;
|
this.mlockallSet = mlockallSet;
|
||||||
this.isMemoryLocked = isMemoryLocked;
|
this.isMemoryLocked = isMemoryLocked;
|
||||||
this.shouldFail = shouldFail;
|
this.shouldFail = shouldFail;
|
||||||
|
@ -118,7 +118,7 @@ public class BootstrapCheckTests extends ESTestCase {
|
||||||
try {
|
try {
|
||||||
BootstrapCheck.check(true, Collections.singletonList(check));
|
BootstrapCheck.check(true, Collections.singletonList(check));
|
||||||
fail("should have failed due to memory not being locked");
|
fail("should have failed due to memory not being locked");
|
||||||
} catch (RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
assertThat(
|
assertThat(
|
||||||
e.getMessage(),
|
e.getMessage(),
|
||||||
containsString("Memory locking requested for elasticsearch process but memory is not locked"));
|
containsString("Memory locking requested for elasticsearch process but memory is not locked"));
|
||||||
|
|
Loading…
Reference in New Issue