diff options
author | Jason Tedor <jason@tedor.me> | 2017-06-26 21:43:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 21:43:20 -0400 |
commit | dfd241e0a66192ca4e7599ca49c26d2d165af7b8 (patch) | |
tree | 43e3c23c3e41b9e7b7aef7dc6145a8b67bd691c1 /core/src/test/java/org/elasticsearch/node | |
parent | cca18a2c356afbe1025d6ba680e126236158a938 (diff) |
Remove default path settings
This commit removes the default path settings for data and logs. With
this change, we now ship the packages with these settings set in the
elasticsearch.yml configuration file rather than going through the
default.path.data and default.path.logs dance that we went through in
the past.
Relates #25408
Diffstat (limited to 'core/src/test/java/org/elasticsearch/node')
-rw-r--r-- | core/src/test/java/org/elasticsearch/node/NodeTests.java | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/core/src/test/java/org/elasticsearch/node/NodeTests.java b/core/src/test/java/org/elasticsearch/node/NodeTests.java index 26835370c6..6590def3a7 100644 --- a/core/src/test/java/org/elasticsearch/node/NodeTests.java +++ b/core/src/test/java/org/elasticsearch/node/NodeTests.java @@ -163,72 +163,6 @@ public class NodeTests extends ESTestCase { } } - public void testDefaultPathDataSet() throws IOException { - final Path zero = createTempDir().toAbsolutePath(); - final Path one = createTempDir().toAbsolutePath(); - final Path defaultPathData = createTempDir().toAbsolutePath(); - final Settings settings = Settings.builder() - .put("path.home", "/home") - .put("path.data.0", zero) - .put("path.data.1", one) - .put("default.path.data", defaultPathData) - .build(); - try (NodeEnvironment nodeEnv = new NodeEnvironment(settings, new Environment(settings))) { - final Path defaultPathDataWithNodesAndId = defaultPathData.resolve("nodes/0"); - Files.createDirectories(defaultPathDataWithNodesAndId); - final NodeEnvironment.NodePath defaultNodePath = new NodeEnvironment.NodePath(defaultPathDataWithNodesAndId); - final boolean indexExists = randomBoolean(); - final List<String> indices; - if (indexExists) { - indices = IntStream.range(0, randomIntBetween(1, 3)).mapToObj(i -> UUIDs.randomBase64UUID()).collect(Collectors.toList()); - for (final String index : indices) { - Files.createDirectories(defaultNodePath.indicesPath.resolve(index)); - } - } else { - indices = Collections.emptyList(); - } - final Logger mock = mock(Logger.class); - if (indexExists) { - final IllegalStateException e = expectThrows( - IllegalStateException.class, - () -> Node.checkForIndexDataInDefaultPathData(settings, nodeEnv, mock)); - final String message = String.format( - Locale.ROOT, - "detected index data in default.path.data [%s] where there should not be any; check the logs for details", - defaultPathData); - assertThat(e, hasToString(containsString(message))); - verify(mock) - .error("detected index data in default.path.data [{}] where there should not be any", defaultNodePath.indicesPath); - for (final String index : indices) { - verify(mock).info( - "index folder [{}] in default.path.data [{}] must be moved to any of {}", - index, - defaultNodePath.indicesPath, - Arrays.stream(nodeEnv.nodePaths()).map(np -> np.indicesPath).collect(Collectors.toList())); - } - verifyNoMoreInteractions(mock); - } else { - Node.checkForIndexDataInDefaultPathData(settings, nodeEnv, mock); - verifyNoMoreInteractions(mock); - } - } - } - - public void testDefaultPathDataNotSet() throws IOException { - final Path zero = createTempDir().toAbsolutePath(); - final Path one = createTempDir().toAbsolutePath(); - final Settings settings = Settings.builder() - .put("path.home", "/home") - .put("path.data.0", zero) - .put("path.data.1", one) - .build(); - try (NodeEnvironment nodeEnv = new NodeEnvironment(settings, new Environment(settings))) { - final Logger mock = mock(Logger.class); - Node.checkForIndexDataInDefaultPathData(settings, nodeEnv, mock); - verifyNoMoreInteractions(mock); - } - } - private static Settings.Builder baseSettings() { final Path tempDir = createTempDir(); return Settings.builder() |