nuke duplicate methods
This commit is contained in:
parent
61b60da7d2
commit
a312098785
|
@ -112,7 +112,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
void setupCluster() throws Exception {
|
void setupCluster() throws Exception {
|
||||||
ListenableFuture<List<String>> replicas = internalCluster().startNodesAsync(1); // for replicas
|
ListenableFuture<List<String>> replicas = internalCluster().startNodesAsync(1); // for replicas
|
||||||
|
|
||||||
Path baseTempDir = newTempDirPath();
|
Path baseTempDir = createTempDir();
|
||||||
// start single data path node
|
// start single data path node
|
||||||
ImmutableSettings.Builder nodeSettings = ImmutableSettings.builder()
|
ImmutableSettings.Builder nodeSettings = ImmutableSettings.builder()
|
||||||
.put("path.data", baseTempDir.resolve("single-path").toAbsolutePath())
|
.put("path.data", baseTempDir.resolve("single-path").toAbsolutePath())
|
||||||
|
@ -148,7 +148,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
|
||||||
}
|
}
|
||||||
|
|
||||||
String loadIndex(String indexFile) throws Exception {
|
String loadIndex(String indexFile) throws Exception {
|
||||||
Path unzipDir = newTempDirPath();
|
Path unzipDir = createTempDir();
|
||||||
Path unzipDataDir = unzipDir.resolve("data");
|
Path unzipDataDir = unzipDir.resolve("data");
|
||||||
String indexName = indexFile.replace(".zip", "").toLowerCase(Locale.ROOT);
|
String indexName = indexFile.replace(".zip", "").toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class TransportClientTests extends ElasticsearchIntegrationTest {
|
||||||
TransportClientNodesService nodeService = client.nodeService();
|
TransportClientNodesService nodeService = client.nodeService();
|
||||||
Node node = nodeBuilder().data(false).settings(ImmutableSettings.builder()
|
Node node = nodeBuilder().data(false).settings(ImmutableSettings.builder()
|
||||||
.put(internalCluster().getDefaultSettings())
|
.put(internalCluster().getDefaultSettings())
|
||||||
.put("path.home", newTempDirPath())
|
.put("path.home", createTempDir())
|
||||||
.put("node.name", "testNodeVersionIsUpdated")
|
.put("node.name", "testNodeVersionIsUpdated")
|
||||||
.put("http.enabled", false)
|
.put("http.enabled", false)
|
||||||
.put("index.store.type", "ram")
|
.put("index.store.type", "ram")
|
||||||
|
|
|
@ -38,7 +38,7 @@ import java.util.Arrays;
|
||||||
public class RoutingBackwardCompatibilityTests extends ElasticsearchTestCase {
|
public class RoutingBackwardCompatibilityTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
public void testBackwardCompatibility() throws Exception {
|
public void testBackwardCompatibility() throws Exception {
|
||||||
Path baseDir = newTempDirPath();
|
Path baseDir = createTempDir();
|
||||||
Node node = new Node(ImmutableSettings.builder().put("path.home", baseDir.toString()).build(), false);
|
Node node = new Node(ImmutableSettings.builder().put("path.home", baseDir.toString()).build(), false);
|
||||||
try {
|
try {
|
||||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(RoutingBackwardCompatibilityTests.class.getResourceAsStream("/org/elasticsearch/cluster/routing/shard_routes.txt"), "UTF-8"))) {
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(RoutingBackwardCompatibilityTests.class.getResourceAsStream("/org/elasticsearch/cluster/routing/shard_routes.txt"), "UTF-8"))) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class BalanceUnbalancedClusterTest extends CatAllocationTestBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Path getCatPath() throws IOException {
|
protected Path getCatPath() throws IOException {
|
||||||
Path tmp = newTempDirPath();
|
Path tmp = createTempDir();
|
||||||
try (InputStream stream = Files.newInputStream(getDataPath("/org/elasticsearch/cluster/routing/issue_9023.zip"))) {
|
try (InputStream stream = Files.newInputStream(getDataPath("/org/elasticsearch/cluster/routing/issue_9023.zip"))) {
|
||||||
TestUtil.unzip(stream, tmp);
|
TestUtil.unzip(stream, tmp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ChannelsTests extends ElasticsearchTestCase {
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
Path tmpFile = newTempFilePath();
|
Path tmpFile = createTempFile();
|
||||||
FileChannel randomAccessFile = FileChannel.open(tmpFile, StandardOpenOption.READ, StandardOpenOption.WRITE);
|
FileChannel randomAccessFile = FileChannel.open(tmpFile, StandardOpenOption.READ, StandardOpenOption.WRITE);
|
||||||
fileChannel = new MockFileChannel(randomAccessFile);
|
fileChannel = new MockFileChannel(randomAccessFile);
|
||||||
randomBytes = randomUnicodeOfLength(scaledRandomIntBetween(10, 100000)).getBytes("UTF-8");
|
randomBytes = randomUnicodeOfLength(scaledRandomIntBetween(10, 100000)).getBytes("UTF-8");
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class PidFileTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test(expected = ElasticsearchIllegalArgumentException.class)
|
@Test(expected = ElasticsearchIllegalArgumentException.class)
|
||||||
public void testParentIsFile() throws IOException {
|
public void testParentIsFile() throws IOException {
|
||||||
Path dir = newTempDirPath();
|
Path dir = createTempDir();
|
||||||
Path parent = dir.resolve("foo");
|
Path parent = dir.resolve("foo");
|
||||||
try(BufferedWriter stream = Files.newBufferedWriter(parent, Charsets.UTF_8, StandardOpenOption.CREATE_NEW)) {
|
try(BufferedWriter stream = Files.newBufferedWriter(parent, Charsets.UTF_8, StandardOpenOption.CREATE_NEW)) {
|
||||||
stream.write("foo");
|
stream.write("foo");
|
||||||
|
@ -48,7 +48,7 @@ public class PidFileTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPidFile() throws IOException {
|
public void testPidFile() throws IOException {
|
||||||
Path dir = newTempDirPath();
|
Path dir = createTempDir();
|
||||||
Path parent = dir.resolve("foo");
|
Path parent = dir.resolve("foo");
|
||||||
if (randomBoolean()) {
|
if (randomBoolean()) {
|
||||||
Files.createDirectories(parent);
|
Files.createDirectories(parent);
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class BlobStoreTest extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BlobStore newBlobStore() throws IOException {
|
protected BlobStore newBlobStore() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
Settings settings = randomBoolean() ? ImmutableSettings.EMPTY : ImmutableSettings.builder().put("buffer_size", new ByteSizeValue(randomIntBetween(1, 100), ByteSizeUnit.KB)).build();
|
Settings settings = randomBoolean() ? ImmutableSettings.EMPTY : ImmutableSettings.builder().put("buffer_size", new ByteSizeValue(randomIntBetween(1, 100), ByteSizeUnit.KB)).build();
|
||||||
FsBlobStore store = new FsBlobStore(settings, tempDir);
|
FsBlobStore store = new FsBlobStore(settings, tempDir);
|
||||||
return store;
|
return store;
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class PagedBytesReferenceTest extends ElasticsearchTestCase {
|
||||||
public void testWriteToChannel() throws IOException {
|
public void testWriteToChannel() throws IOException {
|
||||||
int length = randomIntBetween(10, PAGE_SIZE * 4);
|
int length = randomIntBetween(10, PAGE_SIZE * 4);
|
||||||
BytesReference pbr = getRandomizedPagedBytesReference(length);
|
BytesReference pbr = getRandomizedPagedBytesReference(length);
|
||||||
Path tFile = newTempFilePath();
|
Path tFile = createTempFile();
|
||||||
try (FileChannel channel = FileChannel.open(tFile, StandardOpenOption.WRITE)) {
|
try (FileChannel channel = FileChannel.open(tFile, StandardOpenOption.WRITE)) {
|
||||||
pbr.writeTo(channel);
|
pbr.writeTo(channel);
|
||||||
assertEquals(pbr.length(), channel.position());
|
assertEquals(pbr.length(), channel.position());
|
||||||
|
@ -290,7 +290,7 @@ public class PagedBytesReferenceTest extends ElasticsearchTestCase {
|
||||||
int sliceOffset = randomIntBetween(1, length / 2);
|
int sliceOffset = randomIntBetween(1, length / 2);
|
||||||
int sliceLength = length - sliceOffset;
|
int sliceLength = length - sliceOffset;
|
||||||
BytesReference slice = pbr.slice(sliceOffset, sliceLength);
|
BytesReference slice = pbr.slice(sliceOffset, sliceLength);
|
||||||
Path tFile = newTempFilePath();
|
Path tFile = createTempFile();
|
||||||
try (FileChannel channel = FileChannel.open(tFile, StandardOpenOption.WRITE)) {
|
try (FileChannel channel = FileChannel.open(tFile, StandardOpenOption.WRITE)) {
|
||||||
slice.writeTo(channel);
|
slice.writeTo(channel);
|
||||||
assertEquals(slice.length(), channel.position());
|
assertEquals(slice.length(), channel.position());
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class FileSystemUtilsTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void copySourceFilesToTarget() throws IOException, URISyntaxException {
|
public void copySourceFilesToTarget() throws IOException, URISyntaxException {
|
||||||
src = newTempDirPath();
|
src = createTempDir();
|
||||||
dst = newTempDirPath();
|
dst = createTempDir();
|
||||||
Files.createDirectories(src);
|
Files.createDirectories(src);
|
||||||
Files.createDirectories(dst);
|
Files.createDirectories(dst);
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class FileSystemUtilsTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMoveOverExistingFileAndIgnore() throws IOException {
|
public void testMoveOverExistingFileAndIgnore() throws IOException {
|
||||||
Path dest = newTempDirPath();
|
Path dest = createTempDir();
|
||||||
|
|
||||||
FileSystemUtils.moveFilesWithoutOverwriting(src.resolve("v1"), dest, null);
|
FileSystemUtils.moveFilesWithoutOverwriting(src.resolve("v1"), dest, null);
|
||||||
assertFileContent(dest, "file1.txt", "version1");
|
assertFileContent(dest, "file1.txt", "version1");
|
||||||
|
@ -117,7 +117,7 @@ public class FileSystemUtilsTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMoveFilesDoesNotCreateSameFileWithSuffix() throws Exception {
|
public void testMoveFilesDoesNotCreateSameFileWithSuffix() throws Exception {
|
||||||
Path[] dirs = new Path[] { newTempDirPath(), newTempDirPath(), newTempDirPath()};
|
Path[] dirs = new Path[] { createTempDir(), createTempDir(), createTempDir()};
|
||||||
for (Path dir : dirs) {
|
for (Path dir : dirs) {
|
||||||
Files.write(dir.resolve("file1.txt"), "file1".getBytes(Charsets.UTF_8));
|
Files.write(dir.resolve("file1.txt"), "file1".getBytes(Charsets.UTF_8));
|
||||||
Files.createDirectory(dir.resolve("dir"));
|
Files.createDirectory(dir.resolve("dir"));
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveJsonLoggingConfig() throws Exception {
|
public void testResolveJsonLoggingConfig() throws Exception {
|
||||||
Path tmpDir = newTempDirPath();
|
Path tmpDir = createTempDir();
|
||||||
Path loggingConf = tmpDir.resolve(loggingConfiguration("json"));
|
Path loggingConf = tmpDir.resolve(loggingConfiguration("json"));
|
||||||
Files.write(loggingConf, "{\"json\": \"foo\"}".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf, "{\"json\": \"foo\"}".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
|
@ -98,7 +98,7 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolvePropertiesLoggingConfig() throws Exception {
|
public void testResolvePropertiesLoggingConfig() throws Exception {
|
||||||
Path tmpDir = newTempDirPath();
|
Path tmpDir = createTempDir();
|
||||||
Path loggingConf = tmpDir.resolve(loggingConfiguration("properties"));
|
Path loggingConf = tmpDir.resolve(loggingConfiguration("properties"));
|
||||||
Files.write(loggingConf, "key: value".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf, "key: value".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
|
@ -113,7 +113,7 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveYamlLoggingConfig() throws Exception {
|
public void testResolveYamlLoggingConfig() throws Exception {
|
||||||
Path tmpDir = newTempDirPath();
|
Path tmpDir = createTempDir();
|
||||||
Path loggingConf1 = tmpDir.resolve(loggingConfiguration("yml"));
|
Path loggingConf1 = tmpDir.resolve(loggingConfiguration("yml"));
|
||||||
Path loggingConf2 = tmpDir.resolve(loggingConfiguration("yaml"));
|
Path loggingConf2 = tmpDir.resolve(loggingConfiguration("yaml"));
|
||||||
Files.write(loggingConf1, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
Files.write(loggingConf1, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
||||||
|
@ -131,7 +131,7 @@ public class LoggingConfigurationTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveConfigInvalidFilename() throws Exception {
|
public void testResolveConfigInvalidFilename() throws Exception {
|
||||||
Path tmpDir = newTempDirPath();
|
Path tmpDir = createTempDir();
|
||||||
Path invalidSuffix = tmpDir.resolve(loggingConfiguration(randomFrom(LogConfigurator.ALLOWED_SUFFIXES)) + randomInvalidSuffix());
|
Path invalidSuffix = tmpDir.resolve(loggingConfiguration(randomFrom(LogConfigurator.ALLOWED_SUFFIXES)) + randomInvalidSuffix());
|
||||||
Files.write(invalidSuffix, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
Files.write(invalidSuffix, "yml: bar".getBytes(StandardCharsets.UTF_8));
|
||||||
Environment environment = new Environment(
|
Environment environment = new Environment(
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class EnvironmentTests extends ElasticsearchTestCase {
|
||||||
public Environment newEnvironment(Settings settings) throws IOException {
|
public Environment newEnvironment(Settings settings) throws IOException {
|
||||||
Settings build = ImmutableSettings.builder()
|
Settings build = ImmutableSettings.builder()
|
||||||
.put(settings)
|
.put(settings)
|
||||||
.put("path.home", newTempDirPath().toAbsolutePath())
|
.put("path.home", createTempDir().toAbsolutePath())
|
||||||
.putArray("path.data", tmpPaths()).build();
|
.putArray("path.data", tmpPaths()).build();
|
||||||
return new Environment(build);
|
return new Environment(build);
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,7 +355,7 @@ public class NodeEnvironmentTests extends ElasticsearchTestCase {
|
||||||
final int numPaths = randomIntBetween(1, 3);
|
final int numPaths = randomIntBetween(1, 3);
|
||||||
final String[] absPaths = new String[numPaths];
|
final String[] absPaths = new String[numPaths];
|
||||||
for (int i = 0; i < numPaths; i++) {
|
for (int i = 0; i < numPaths; i++) {
|
||||||
absPaths[i] = newTempDirPath().toAbsolutePath().toString();
|
absPaths[i] = createTempDir().toAbsolutePath().toString();
|
||||||
}
|
}
|
||||||
return absPaths;
|
return absPaths;
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ public class NodeEnvironmentTests extends ElasticsearchTestCase {
|
||||||
public NodeEnvironment newNodeEnvironment(Settings settings) throws IOException {
|
public NodeEnvironment newNodeEnvironment(Settings settings) throws IOException {
|
||||||
Settings build = ImmutableSettings.builder()
|
Settings build = ImmutableSettings.builder()
|
||||||
.put(settings)
|
.put(settings)
|
||||||
.put("path.home", newTempDirPath().toAbsolutePath().toString())
|
.put("path.home", createTempDir().toAbsolutePath().toString())
|
||||||
.put(NodeEnvironment.SETTING_CUSTOM_DATA_PATH_ENABLED, true)
|
.put(NodeEnvironment.SETTING_CUSTOM_DATA_PATH_ENABLED, true)
|
||||||
.putArray("path.data", tmpPaths()).build();
|
.putArray("path.data", tmpPaths()).build();
|
||||||
return new NodeEnvironment(build, new Environment(build));
|
return new NodeEnvironment(build, new Environment(build));
|
||||||
|
@ -378,7 +378,7 @@ public class NodeEnvironmentTests extends ElasticsearchTestCase {
|
||||||
public NodeEnvironment newNodeEnvironment(String[] dataPaths, Settings settings) throws IOException {
|
public NodeEnvironment newNodeEnvironment(String[] dataPaths, Settings settings) throws IOException {
|
||||||
Settings build = ImmutableSettings.builder()
|
Settings build = ImmutableSettings.builder()
|
||||||
.put(settings)
|
.put(settings)
|
||||||
.put("path.home", newTempDirPath().toAbsolutePath().toString())
|
.put("path.home", createTempDir().toAbsolutePath().toString())
|
||||||
.put(NodeEnvironment.SETTING_CUSTOM_DATA_PATH_ENABLED, true)
|
.put(NodeEnvironment.SETTING_CUSTOM_DATA_PATH_ENABLED, true)
|
||||||
.putArray("path.data", dataPaths).build();
|
.putArray("path.data", dataPaths).build();
|
||||||
return new NodeEnvironment(build, new Environment(build));
|
return new NodeEnvironment(build, new Environment(build));
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
return MetaData.Builder.fromXContent(parser);
|
return MetaData.Builder.fromXContent(parser);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Path tmp = newTempDirPath();
|
Path tmp = createTempDir();
|
||||||
final InputStream resource = this.getClass().getResourceAsStream("global-3.st");
|
final InputStream resource = this.getClass().getResourceAsStream("global-3.st");
|
||||||
assertThat(resource, notNullValue());
|
assertThat(resource, notNullValue());
|
||||||
Path dst = tmp.resolve("global-3.st");
|
Path dst = tmp.resolve("global-3.st");
|
||||||
|
@ -106,7 +106,7 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
public void testReadWriteState() throws IOException {
|
public void testReadWriteState() throws IOException {
|
||||||
Path[] dirs = new Path[randomIntBetween(1, 5)];
|
Path[] dirs = new Path[randomIntBetween(1, 5)];
|
||||||
for (int i = 0; i < dirs.length; i++) {
|
for (int i = 0; i < dirs.length; i++) {
|
||||||
dirs[i] = newTempDirPath();
|
dirs[i] = createTempDir();
|
||||||
}
|
}
|
||||||
final long id = addDummyFiles("foo-", dirs);
|
final long id = addDummyFiles("foo-", dirs);
|
||||||
Format format = new Format(randomFrom(XContentType.values()), "foo-");
|
Format format = new Format(randomFrom(XContentType.values()), "foo-");
|
||||||
|
@ -148,7 +148,7 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
public void testVersionMismatch() throws IOException {
|
public void testVersionMismatch() throws IOException {
|
||||||
Path[] dirs = new Path[randomIntBetween(1, 5)];
|
Path[] dirs = new Path[randomIntBetween(1, 5)];
|
||||||
for (int i = 0; i < dirs.length; i++) {
|
for (int i = 0; i < dirs.length; i++) {
|
||||||
dirs[i] = newTempDirPath();
|
dirs[i] = createTempDir();
|
||||||
}
|
}
|
||||||
final long id = addDummyFiles("foo-", dirs);
|
final long id = addDummyFiles("foo-", dirs);
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
public void testCorruption() throws IOException {
|
public void testCorruption() throws IOException {
|
||||||
Path[] dirs = new Path[randomIntBetween(1, 5)];
|
Path[] dirs = new Path[randomIntBetween(1, 5)];
|
||||||
for (int i = 0; i < dirs.length; i++) {
|
for (int i = 0; i < dirs.length; i++) {
|
||||||
dirs[i] = newTempDirPath();
|
dirs[i] = createTempDir();
|
||||||
}
|
}
|
||||||
final long id = addDummyFiles("foo-", dirs);
|
final long id = addDummyFiles("foo-", dirs);
|
||||||
Format format = new Format(randomFrom(XContentType.values()), "foo-");
|
Format format = new Format(randomFrom(XContentType.values()), "foo-");
|
||||||
|
@ -247,8 +247,8 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
final ToXContent.Params params = ToXContent.EMPTY_PARAMS;
|
final ToXContent.Params params = ToXContent.EMPTY_PARAMS;
|
||||||
MetaDataStateFormat<MetaData> format = MetaStateService.globalStateFormat(randomFrom(XContentType.values()), params);
|
MetaDataStateFormat<MetaData> format = MetaStateService.globalStateFormat(randomFrom(XContentType.values()), params);
|
||||||
final Path[] dirs = new Path[2];
|
final Path[] dirs = new Path[2];
|
||||||
dirs[0] = newTempDirPath();
|
dirs[0] = createTempDir();
|
||||||
dirs[1] = newTempDirPath();
|
dirs[1] = createTempDir();
|
||||||
for (Path dir : dirs) {
|
for (Path dir : dirs) {
|
||||||
Files.createDirectories(dir.resolve(MetaDataStateFormat.STATE_DIR_NAME));
|
Files.createDirectories(dir.resolve(MetaDataStateFormat.STATE_DIR_NAME));
|
||||||
}
|
}
|
||||||
|
@ -292,8 +292,8 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
final ToXContent.Params params = ToXContent.EMPTY_PARAMS;
|
final ToXContent.Params params = ToXContent.EMPTY_PARAMS;
|
||||||
MetaDataStateFormat<MetaData> format = MetaStateService.globalStateFormat(randomFrom(XContentType.values()), params);
|
MetaDataStateFormat<MetaData> format = MetaStateService.globalStateFormat(randomFrom(XContentType.values()), params);
|
||||||
final Path[] dirs = new Path[2];
|
final Path[] dirs = new Path[2];
|
||||||
dirs[0] = newTempDirPath();
|
dirs[0] = createTempDir();
|
||||||
dirs[1] = newTempDirPath();
|
dirs[1] = createTempDir();
|
||||||
for (Path dir : dirs) {
|
for (Path dir : dirs) {
|
||||||
Files.createDirectories(dir.resolve(MetaDataStateFormat.STATE_DIR_NAME));
|
Files.createDirectories(dir.resolve(MetaDataStateFormat.STATE_DIR_NAME));
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ public class MetaDataStateFormatTest extends ElasticsearchTestCase {
|
||||||
Set<Path> corruptedFiles = new HashSet<>();
|
Set<Path> corruptedFiles = new HashSet<>();
|
||||||
MetaDataStateFormat<MetaData> format = MetaStateService.globalStateFormat(randomFrom(XContentType.values()), params);
|
MetaDataStateFormat<MetaData> format = MetaStateService.globalStateFormat(randomFrom(XContentType.values()), params);
|
||||||
for (int i = 0; i < dirs.length; i++) {
|
for (int i = 0; i < dirs.length; i++) {
|
||||||
dirs[i] = newTempDirPath();
|
dirs[i] = createTempDir();
|
||||||
Files.createDirectories(dirs[i].resolve(MetaDataStateFormat.STATE_DIR_NAME));
|
Files.createDirectories(dirs[i].resolve(MetaDataStateFormat.STATE_DIR_NAME));
|
||||||
for (int j = 0; j < numLegacy; j++) {
|
for (int j = 0; j < numLegacy; j++) {
|
||||||
XContentType type = format.format();
|
XContentType type = format.format();
|
||||||
|
|
|
@ -438,11 +438,11 @@ public class RecoveryFromGatewayTests extends ElasticsearchIntegrationTest {
|
||||||
public void testRecoveryDifferentNodeOrderStartup() throws Exception {
|
public void testRecoveryDifferentNodeOrderStartup() throws Exception {
|
||||||
// we need different data paths so we make sure we start the second node fresh
|
// we need different data paths so we make sure we start the second node fresh
|
||||||
|
|
||||||
final String node_1 = internalCluster().startNode(settingsBuilder().put("path.data", newTempDirPath()).build());
|
final String node_1 = internalCluster().startNode(settingsBuilder().put("path.data", createTempDir()).build());
|
||||||
|
|
||||||
client().prepareIndex("test", "type1", "1").setSource("field", "value").execute().actionGet();
|
client().prepareIndex("test", "type1", "1").setSource("field", "value").execute().actionGet();
|
||||||
|
|
||||||
internalCluster().startNode(settingsBuilder().put("path.data", newTempDirPath()).build());
|
internalCluster().startNode(settingsBuilder().put("path.data", createTempDir()).build());
|
||||||
|
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
internalCluster().startNodesAsync(3, nodeSettings).get();
|
internalCluster().startNodesAsync(3, nodeSettings).get();
|
||||||
final Path dataPath = newTempDirPath();
|
final Path dataPath = createTempDir();
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0).build();
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0).build();
|
||||||
|
@ -82,7 +82,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())));
|
.put("location", createTempDir())));
|
||||||
CreateSnapshotResponse createSnapshotResponse = client().admin().cluster().prepareCreateSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("foo").get();
|
CreateSnapshotResponse createSnapshotResponse = client().admin().cluster().prepareCreateSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("foo").get();
|
||||||
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), greaterThan(0));
|
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), greaterThan(0));
|
||||||
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()));
|
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()));
|
||||||
|
@ -128,7 +128,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
internalCluster().startNodesAsync(3, nodeSettings).get();
|
internalCluster().startNodesAsync(3, nodeSettings).get();
|
||||||
final String IDX = "test";
|
final String IDX = "test";
|
||||||
final Path dataPath = newTempDirPath();
|
final Path dataPath = createTempDir();
|
||||||
|
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
|
||||||
|
@ -193,7 +193,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
String node1 = internalCluster().startNode(nodeSettings);
|
String node1 = internalCluster().startNode(nodeSettings);
|
||||||
Path dataPath = newTempDirPath();
|
Path dataPath = createTempDir();
|
||||||
String IDX = "test";
|
String IDX = "test";
|
||||||
|
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
|
@ -255,7 +255,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
String node1 = internalCluster().startNode(nodeSettings);
|
String node1 = internalCluster().startNode(nodeSettings);
|
||||||
Path dataPath = newTempDirPath();
|
Path dataPath = createTempDir();
|
||||||
String IDX = "test";
|
String IDX = "test";
|
||||||
|
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
|
@ -320,7 +320,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
int nodeCount = randomIntBetween(2, 5);
|
int nodeCount = randomIntBetween(2, 5);
|
||||||
internalCluster().startNodesAsync(nodeCount, nodeSettings).get();
|
internalCluster().startNodesAsync(nodeCount, nodeSettings).get();
|
||||||
Path dataPath = newTempDirPath();
|
Path dataPath = createTempDir();
|
||||||
String IDX = "test";
|
String IDX = "test";
|
||||||
|
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
|
@ -364,7 +364,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
internalCluster().startNodesAsync(2, nodeSettings).get();
|
internalCluster().startNodesAsync(2, nodeSettings).get();
|
||||||
Path dataPath = newTempDirPath();
|
Path dataPath = createTempDir();
|
||||||
String IDX = "test";
|
String IDX = "test";
|
||||||
|
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
|
@ -421,7 +421,7 @@ public class IndexWithShadowReplicasTests extends ElasticsearchIntegrationTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
internalCluster().startNodesAsync(3, nodeSettings).get();
|
internalCluster().startNodesAsync(3, nodeSettings).get();
|
||||||
Path dataPath = newTempDirPath();
|
Path dataPath = createTempDir();
|
||||||
String IDX = "test";
|
String IDX = "test";
|
||||||
|
|
||||||
Settings idxSettings = ImmutableSettings.builder()
|
Settings idxSettings = ImmutableSettings.builder()
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class AnalysisModuleTests extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Path generateWordList(String[] words) throws Exception {
|
private Path generateWordList(String[] words) throws Exception {
|
||||||
Path wordListFile = newTempDirPath().resolve("wordlist.txt");
|
Path wordListFile = createTempDir().resolve("wordlist.txt");
|
||||||
try (BufferedWriter writer = Files.newBufferedWriter(wordListFile, StandardCharsets.UTF_8)) {
|
try (BufferedWriter writer = Files.newBufferedWriter(wordListFile, StandardCharsets.UTF_8)) {
|
||||||
for (String word : words) {
|
for (String word : words) {
|
||||||
writer.write(word);
|
writer.write(word);
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class FileBasedMappingsTests extends ElasticsearchTestCase {
|
||||||
private static final String NAME = FileBasedMappingsTests.class.getSimpleName();
|
private static final String NAME = FileBasedMappingsTests.class.getSimpleName();
|
||||||
|
|
||||||
public void testFileBasedMappings() throws Exception {
|
public void testFileBasedMappings() throws Exception {
|
||||||
Path configDir = newTempDirPath();
|
Path configDir = createTempDir();
|
||||||
Path mappingsDir = configDir.resolve("mappings");
|
Path mappingsDir = configDir.resolve("mappings");
|
||||||
Path indexMappings = mappingsDir.resolve("index").resolve("type.json");
|
Path indexMappings = mappingsDir.resolve("index").resolve("type.json");
|
||||||
Path defaultMappings = mappingsDir.resolve("_default").resolve("type.json");
|
Path defaultMappings = mappingsDir.resolve("_default").resolve("type.json");
|
||||||
|
@ -82,7 +82,7 @@ public class FileBasedMappingsTests extends ElasticsearchTestCase {
|
||||||
Settings settings = ImmutableSettings.builder()
|
Settings settings = ImmutableSettings.builder()
|
||||||
.put(ClusterName.SETTING, NAME)
|
.put(ClusterName.SETTING, NAME)
|
||||||
.put("node.name", NAME)
|
.put("node.name", NAME)
|
||||||
.put("path.home", newTempDirPath())
|
.put("path.home", createTempDir())
|
||||||
.put("path.conf", configDir.toAbsolutePath())
|
.put("path.conf", configDir.toAbsolutePath())
|
||||||
.put("http.enabled", false)
|
.put("http.enabled", false)
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -486,7 +486,7 @@ public class CorruptedFileTest extends ElasticsearchIntegrationTest {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(settingsBuilder()
|
.setType("fs").setSettings(settingsBuilder()
|
||||||
.put("location", newTempDirPath().toAbsolutePath())
|
.put("location", createTempDir().toAbsolutePath())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
logger.info("--> snapshot");
|
logger.info("--> snapshot");
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class DistributorTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
|
|
||||||
public FakeFsDirectory(String path, long usableSpace) throws IOException {
|
public FakeFsDirectory(String path, long usableSpace) throws IOException {
|
||||||
super(newTempDirPath().resolve(path), NoLockFactory.INSTANCE);
|
super(createTempDir().resolve(path), NoLockFactory.INSTANCE);
|
||||||
allocationCount = 0;
|
allocationCount = 0;
|
||||||
this.useableSpace = usableSpace;
|
this.useableSpace = usableSpace;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ public abstract class AbstractSimpleTranslogTests extends ElasticsearchTestCase
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
translogDir = newTempDirPath();
|
translogDir = createTempDir();
|
||||||
translog = create(translogDir);
|
translog = create(translogDir);
|
||||||
translog.newTranslog(1);
|
translog.newTranslog(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class IndicesCustomDataPathTests extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
path = newTempDirPath().toAbsolutePath().toString();
|
path = createTempDir().toAbsolutePath().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
@ -63,7 +63,7 @@ public class IndicesCustomDataPathTests extends ElasticsearchIntegrationTest {
|
||||||
@TestLogging("_root:DEBUG,index:TRACE")
|
@TestLogging("_root:DEBUG,index:TRACE")
|
||||||
public void testDataPathCanBeChanged() throws Exception {
|
public void testDataPathCanBeChanged() throws Exception {
|
||||||
final String INDEX = "idx";
|
final String INDEX = "idx";
|
||||||
Path root = newTempDirPath();
|
Path root = createTempDir();
|
||||||
Path startDir = root.resolve("start");
|
Path startDir = root.resolve("start");
|
||||||
Path endDir = root.resolve("end");
|
Path endDir = root.resolve("end");
|
||||||
logger.info("--> start dir: [{}]", startDir.toAbsolutePath().toString());
|
logger.info("--> start dir: [{}]", startDir.toAbsolutePath().toString());
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class IndexTemplateFileLoadingTests extends ElasticsearchIntegrationTest
|
||||||
settingsBuilder.put(super.nodeSettings(nodeOrdinal));
|
settingsBuilder.put(super.nodeSettings(nodeOrdinal));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Path directory = newTempDirPath();
|
Path directory = createTempDir();
|
||||||
settingsBuilder.put("path.conf", directory.toAbsolutePath());
|
settingsBuilder.put("path.conf", directory.toAbsolutePath());
|
||||||
|
|
||||||
Path templatesDir = directory.resolve("templates");
|
Path templatesDir = directory.resolve("templates");
|
||||||
|
|
|
@ -287,7 +287,7 @@ public class PluginManagerTests extends ElasticsearchIntegrationTest {
|
||||||
Settings settings = ImmutableSettings.settingsBuilder()
|
Settings settings = ImmutableSettings.settingsBuilder()
|
||||||
.put("discovery.zen.ping.multicast.enabled", false)
|
.put("discovery.zen.ping.multicast.enabled", false)
|
||||||
.put("http.enabled", true)
|
.put("http.enabled", true)
|
||||||
.put("path.home", newTempDirPath()).build();
|
.put("path.home", createTempDir()).build();
|
||||||
return InternalSettingsPreparer.prepareSettings(settings, false);
|
return InternalSettingsPreparer.prepareSettings(settings, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ public class PluginManagerUnitTests extends ElasticsearchTestCase {
|
||||||
@Test
|
@Test
|
||||||
public void testThatConfigDirectoryCanBeOutsideOfElasticsearchHomeDirectory() throws IOException {
|
public void testThatConfigDirectoryCanBeOutsideOfElasticsearchHomeDirectory() throws IOException {
|
||||||
String pluginName = randomAsciiOfLength(10);
|
String pluginName = randomAsciiOfLength(10);
|
||||||
Path homeFolder = newTempDirPath();
|
Path homeFolder = createTempDir();
|
||||||
Path genericConfigFolder = newTempDirPath();
|
Path genericConfigFolder = createTempDir();
|
||||||
|
|
||||||
Settings settings = settingsBuilder()
|
Settings settings = settingsBuilder()
|
||||||
.put("path.conf", genericConfigFolder)
|
.put("path.conf", genericConfigFolder)
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class ScriptServiceTests extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws IOException {
|
public void setup() throws IOException {
|
||||||
Path genericConfigFolder = newTempDirPath();
|
Path genericConfigFolder = createTempDir();
|
||||||
baseSettings = settingsBuilder()
|
baseSettings = settingsBuilder()
|
||||||
.put("path.conf", genericConfigFolder)
|
.put("path.conf", genericConfigFolder)
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
|
|
||||||
logger.info("--> create repository");
|
logger.info("--> create repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDirPath())).execute().actionGet();
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())).execute().actionGet();
|
||||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||||
|
|
||||||
logger.info("--> start snapshot");
|
logger.info("--> start snapshot");
|
||||||
|
@ -146,7 +146,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void restoreCustomMetadata() throws Exception {
|
public void restoreCustomMetadata() throws Exception {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
|
|
||||||
logger.info("--> start node");
|
logger.info("--> start node");
|
||||||
internalCluster().startNode();
|
internalCluster().startNode();
|
||||||
|
@ -293,7 +293,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
ImmutableSettings.settingsBuilder()
|
ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("random", randomAsciiOfLength(10))
|
.put("random", randomAsciiOfLength(10))
|
||||||
.put("wait_after_unblock", 200)
|
.put("wait_after_unblock", 200)
|
||||||
).get();
|
).get();
|
||||||
|
@ -338,7 +338,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
assertThat(client.prepareCount("test-idx").get().getCount(), equalTo(100L));
|
assertThat(client.prepareCount("test-idx").get().getCount(), equalTo(100L));
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
Path repo = newTempDirPath();
|
Path repo = createTempDir();
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
ImmutableSettings.settingsBuilder()
|
ImmutableSettings.settingsBuilder()
|
||||||
|
@ -427,7 +427,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
logger.info("--> create repository");
|
logger.info("--> create repository");
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDirPath())).execute().actionGet();
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())).execute().actionGet();
|
||||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||||
|
|
||||||
logger.info("--> start snapshot with default settings - should fail");
|
logger.info("--> start snapshot with default settings - should fail");
|
||||||
|
@ -530,7 +530,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
|
|
||||||
logger.info("--> create repository");
|
logger.info("--> create repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDirPath())).execute().actionGet();
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())).execute().actionGet();
|
||||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||||
int numberOfShards = 6;
|
int numberOfShards = 6;
|
||||||
logger.info("--> create an index that will have some unallocated shards");
|
logger.info("--> create an index that will have some unallocated shards");
|
||||||
|
@ -589,12 +589,12 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
client().admin().cluster().preparePutRepository("test-repo" + i)
|
client().admin().cluster().preparePutRepository("test-repo" + i)
|
||||||
.setType("mock").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("mock").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())).setVerify(false).get();
|
.put("location", createTempDir())).setVerify(false).get();
|
||||||
}
|
}
|
||||||
logger.info("--> make sure that properly setup repository can be registered on all nodes");
|
logger.info("--> make sure that properly setup repository can be registered on all nodes");
|
||||||
client().admin().cluster().preparePutRepository("test-repo-0")
|
client().admin().cluster().preparePutRepository("test-repo-0")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())).get();
|
.put("location", createTempDir())).get();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,7 +612,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
public void testRepositoryCreation() throws Exception {
|
public void testRepositoryCreation() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Path location = newTempDirPath();
|
Path location = createTempDir();
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo-1")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo-1")
|
||||||
|
@ -82,7 +82,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating another repository");
|
logger.info("--> creating another repository");
|
||||||
putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo-2")
|
putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo-2")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
).get();
|
).get();
|
||||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository test-repo-1 with 0s timeout - shouldn't ack");
|
logger.info("--> creating repository test-repo-1 with 0s timeout - shouldn't ack");
|
||||||
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo-1")
|
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo-1")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(5, 100))
|
.put("chunk_size", randomIntBetween(5, 100))
|
||||||
)
|
)
|
||||||
|
@ -152,7 +152,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository test-repo-2 with standard timeout - should ack");
|
logger.info("--> creating repository test-repo-2 with standard timeout - should ack");
|
||||||
putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo-2")
|
putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo-2")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(5, 100))
|
.put("chunk_size", randomIntBetween(5, 100))
|
||||||
).get();
|
).get();
|
||||||
|
@ -173,7 +173,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Settings settings = ImmutableSettings.settingsBuilder()
|
Settings settings = ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("random_control_io_exception_rate", 1.0).build();
|
.put("random_control_io_exception_rate", 1.0).build();
|
||||||
logger.info("--> creating repository that cannot write any files - should fail");
|
logger.info("--> creating repository that cannot write any files - should fail");
|
||||||
assertThrows(client.admin().cluster().preparePutRepository("test-repo-1")
|
assertThrows(client.admin().cluster().preparePutRepository("test-repo-1")
|
||||||
|
@ -187,7 +187,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> verifying repository");
|
logger.info("--> verifying repository");
|
||||||
assertThrows(client.admin().cluster().prepareVerifyRepository("test-repo-1"), RepositoryVerificationException.class);
|
assertThrows(client.admin().cluster().prepareVerifyRepository("test-repo-1"), RepositoryVerificationException.class);
|
||||||
|
|
||||||
Path location = newTempDirPath();
|
Path location = createTempDir();
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
try {
|
try {
|
||||||
|
@ -208,7 +208,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Settings settings = ImmutableSettings.settingsBuilder()
|
Settings settings = ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("random_control_io_exception_rate", 1.0).build();
|
.put("random_control_io_exception_rate", 1.0).build();
|
||||||
logger.info("--> creating repository that cannot write any files - should fail");
|
logger.info("--> creating repository that cannot write any files - should fail");
|
||||||
assertThrows(client.admin().cluster().preparePutRepository("test-repo-1")
|
assertThrows(client.admin().cluster().preparePutRepository("test-repo-1")
|
||||||
|
@ -222,7 +222,7 @@ public class RepositoriesTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> verifying repository");
|
logger.info("--> verifying repository");
|
||||||
assertThrows(client.admin().cluster().prepareVerifyRepository("test-repo-1"), RepositoryVerificationException.class);
|
assertThrows(client.admin().cluster().prepareVerifyRepository("test-repo-1"), RepositoryVerificationException.class);
|
||||||
|
|
||||||
Path location = newTempDirPath();
|
Path location = createTempDir();
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
String indexName = "testindex";
|
String indexName = "testindex";
|
||||||
String repoName = "test-restore-snapshot-repo";
|
String repoName = "test-restore-snapshot-repo";
|
||||||
String snapshotName = "test-restore-snapshot";
|
String snapshotName = "test-restore-snapshot";
|
||||||
String absolutePath = newTempDirPath().toAbsolutePath().toString();
|
String absolutePath = createTempDir().toAbsolutePath().toString();
|
||||||
logger.info("Path [{}]", absolutePath);
|
logger.info("Path [{}]", absolutePath);
|
||||||
String restoredIndexName = indexName + "-restored";
|
String restoredIndexName = indexName + "-restored";
|
||||||
String typeName = "actions";
|
String typeName = "actions";
|
||||||
|
@ -228,7 +228,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDirPath())).get();
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())).get();
|
||||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||||
|
|
||||||
logger.info("--> snapshot");
|
logger.info("--> snapshot");
|
||||||
|
@ -342,7 +342,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDirPath())));
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())));
|
||||||
|
|
||||||
logger.info("--> create test indices");
|
logger.info("--> create test indices");
|
||||||
createIndex("test-idx-1", "test-idx-2", "test-idx-3");
|
createIndex("test-idx-1", "test-idx-2", "test-idx-3");
|
||||||
|
@ -398,7 +398,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDirPath())));
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", createTempDir())));
|
||||||
|
|
||||||
logger.info("--> creating test template");
|
logger.info("--> creating test template");
|
||||||
assertThat(client.admin().indices().preparePutTemplate("test-template").setTemplate("te*").addMapping("test-mapping", "{}").get().isAcknowledged(), equalTo(true));
|
assertThat(client.admin().indices().preparePutTemplate("test-template").setTemplate("te*").addMapping("test-mapping", "{}").get().isAcknowledged(), equalTo(true));
|
||||||
|
@ -430,7 +430,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
Path location = newTempDirPath();
|
Path location = createTempDir();
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", location)));
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", location)));
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
ImmutableSettings.settingsBuilder()
|
ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("random", randomAsciiOfLength(10))
|
.put("random", randomAsciiOfLength(10))
|
||||||
.put("random_control_io_exception_rate", 0.2))
|
.put("random_control_io_exception_rate", 0.2))
|
||||||
.setVerify(false));
|
.setVerify(false));
|
||||||
|
@ -562,7 +562,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
ImmutableSettings.settingsBuilder()
|
ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("random", randomAsciiOfLength(10))
|
.put("random", randomAsciiOfLength(10))
|
||||||
.put("random_data_file_io_exception_rate", 0.3)));
|
.put("random_data_file_io_exception_rate", 0.3)));
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataFileFailureDuringRestoreTest() throws Exception {
|
public void dataFileFailureDuringRestoreTest() throws Exception {
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
Client client = client();
|
Client client = client();
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
|
@ -666,7 +666,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void deletionOfFailingToRecoverIndexShouldStopRestore() throws Exception {
|
public void deletionOfFailingToRecoverIndexShouldStopRestore() throws Exception {
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
Client client = client();
|
Client client = client();
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
|
@ -735,7 +735,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())));
|
.put("location", createTempDir())));
|
||||||
|
|
||||||
logger.info("--> creating index that cannot be allocated");
|
logger.info("--> creating index that cannot be allocated");
|
||||||
prepareCreate("test-idx", 2, ImmutableSettings.builder().put(FilterAllocationDecider.INDEX_ROUTING_INCLUDE_GROUP + ".tag", "nowhere").put("index.number_of_shards", 3)).get();
|
prepareCreate("test-idx", 2, ImmutableSettings.builder().put(FilterAllocationDecider.INDEX_ROUTING_INCLUDE_GROUP + ".tag", "nowhere").put("index.number_of_shards", 3)).get();
|
||||||
|
@ -753,7 +753,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
final int numberOfSnapshots = between(5, 15);
|
final int numberOfSnapshots = between(5, 15);
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Path repo = newTempDirPath();
|
Path repo = createTempDir();
|
||||||
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
|
@ -810,7 +810,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
public void deleteSnapshotWithMissingIndexAndShardMetadataTest() throws Exception {
|
public void deleteSnapshotWithMissingIndexAndShardMetadataTest() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Path repo = newTempDirPath();
|
Path repo = createTempDir();
|
||||||
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
|
@ -849,7 +849,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
public void deleteSnapshotWithMissingMetadataTest() throws Exception {
|
public void deleteSnapshotWithMissingMetadataTest() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Path repo = newTempDirPath();
|
Path repo = createTempDir();
|
||||||
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
|
@ -884,7 +884,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
public void deleteSnapshotWithCorruptedSnapshotFileTest() throws Exception {
|
public void deleteSnapshotWithCorruptedSnapshotFileTest() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
Path repo = newTempDirPath();
|
Path repo = createTempDir();
|
||||||
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
logger.info("--> creating repository at " + repo.toAbsolutePath());
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
|
@ -929,7 +929,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())));
|
.put("location", createTempDir())));
|
||||||
|
|
||||||
createIndex("test-idx", "test-idx-closed");
|
createIndex("test-idx", "test-idx-closed");
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
@ -955,7 +955,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())));
|
.put("location", createTempDir())));
|
||||||
|
|
||||||
createIndex("test-idx");
|
createIndex("test-idx");
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
@ -976,7 +976,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())));
|
.put("location", createTempDir())));
|
||||||
|
|
||||||
createIndex("test-idx-1", "test-idx-2", "test-idx-3");
|
createIndex("test-idx-1", "test-idx-2", "test-idx-3");
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
|
@ -1092,7 +1092,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
@Test
|
@Test
|
||||||
public void moveShardWhileSnapshottingTest() throws Exception {
|
public void moveShardWhileSnapshottingTest() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
|
@ -1154,7 +1154,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
@Test
|
@Test
|
||||||
public void deleteRepositoryWhileSnapshottingTest() throws Exception {
|
public void deleteRepositoryWhileSnapshottingTest() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
|
@ -1239,7 +1239,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", repositoryLocation)
|
.put("location", repositoryLocation)
|
||||||
|
@ -1297,7 +1297,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
|
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
boolean throttleSnapshot = randomBoolean();
|
boolean throttleSnapshot = randomBoolean();
|
||||||
boolean throttleRestore = randomBoolean();
|
boolean throttleRestore = randomBoolean();
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
|
@ -1355,7 +1355,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
@Test
|
@Test
|
||||||
public void snapshotStatusTest() throws Exception {
|
public void snapshotStatusTest() throws Exception {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
Path repositoryLocation = newTempDirPath();
|
Path repositoryLocation = createTempDir();
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(
|
||||||
|
@ -1458,7 +1458,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
@ -1506,7 +1506,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
@ -1569,7 +1569,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
|
|
||||||
|
@ -1675,7 +1675,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(ImmutableSettings.settingsBuilder()
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))
|
.put("chunk_size", randomIntBetween(100, 1000))
|
||||||
.put("block_on_init", true)
|
.put("block_on_init", true)
|
||||||
|
@ -1727,7 +1727,7 @@ public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests {
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(ImmutableSettings.settingsBuilder()
|
.setType(MockRepositoryModule.class.getCanonicalName()).setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath())
|
.put("location", createTempDir())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))
|
.put("chunk_size", randomIntBetween(100, 1000))
|
||||||
));
|
));
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class SnapshotBackwardsCompatibilityTest extends ElasticsearchBackwardsCo
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client().admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
.put("location", newTempDirPath().toAbsolutePath())
|
.put("location", createTempDir().toAbsolutePath())
|
||||||
.put("compress", randomBoolean())
|
.put("compress", randomBoolean())
|
||||||
.put("chunk_size", randomIntBetween(100, 1000))));
|
.put("chunk_size", randomIntBetween(100, 1000))));
|
||||||
String[] indicesBefore = new String[randomIntBetween(2,5)];
|
String[] indicesBefore = new String[randomIntBetween(2,5)];
|
||||||
|
@ -165,7 +165,7 @@ public class SnapshotBackwardsCompatibilityTest extends ElasticsearchBackwardsCo
|
||||||
|
|
||||||
public void testSnapshotMoreThanOnce() throws ExecutionException, InterruptedException, IOException {
|
public void testSnapshotMoreThanOnce() throws ExecutionException, InterruptedException, IOException {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
final Path tempDir = newTempDirPath().toAbsolutePath();
|
final Path tempDir = createTempDir().toAbsolutePath();
|
||||||
logger.info("--> creating repository");
|
logger.info("--> creating repository");
|
||||||
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
assertAcked(client.admin().cluster().preparePutRepository("test-repo")
|
||||||
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
.setType("fs").setSettings(ImmutableSettings.settingsBuilder()
|
||||||
|
|
|
@ -22,7 +22,6 @@ import com.carrotsearch.randomizedtesting.LifecycleScope;
|
||||||
import com.carrotsearch.randomizedtesting.RandomizedContext;
|
import com.carrotsearch.randomizedtesting.RandomizedContext;
|
||||||
import com.carrotsearch.randomizedtesting.RandomizedTest;
|
import com.carrotsearch.randomizedtesting.RandomizedTest;
|
||||||
import com.carrotsearch.randomizedtesting.Randomness;
|
import com.carrotsearch.randomizedtesting.Randomness;
|
||||||
import com.carrotsearch.randomizedtesting.SysGlobals;
|
|
||||||
import com.carrotsearch.randomizedtesting.generators.RandomInts;
|
import com.carrotsearch.randomizedtesting.generators.RandomInts;
|
||||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
@ -281,11 +280,6 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
|
||||||
* Default maximum number of shards for an index
|
* Default maximum number of shards for an index
|
||||||
*/
|
*/
|
||||||
protected static final int DEFAULT_MAX_NUM_SHARDS = 10;
|
protected static final int DEFAULT_MAX_NUM_SHARDS = 10;
|
||||||
|
|
||||||
/**
|
|
||||||
* The child JVM ordinal of this JVM. Default is <tt>0</tt>
|
|
||||||
*/
|
|
||||||
public static final int CHILD_JVM_ID = Integer.parseInt(System.getProperty(SysGlobals.CHILDVM_SYSPROP_JVM_ID, "0"));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current cluster depending on the configured {@link Scope}.
|
* The current cluster depending on the configured {@link Scope}.
|
||||||
|
@ -770,7 +764,7 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
|
||||||
}
|
}
|
||||||
// 30% of the time
|
// 30% of the time
|
||||||
if (randomInt(9) < 3) {
|
if (randomInt(9) < 3) {
|
||||||
final Path dataPath = newTempDirPath();
|
final Path dataPath = createTempDir();
|
||||||
logger.info("using custom data_path for index: [{}]", dataPath);
|
logger.info("using custom data_path for index: [{}]", dataPath);
|
||||||
builder.put(IndexMetaData.SETTING_DATA_PATH, dataPath);
|
builder.put(IndexMetaData.SETTING_DATA_PATH, dataPath);
|
||||||
}
|
}
|
||||||
|
@ -1704,7 +1698,7 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
|
||||||
maxNumDataNodes = getMaxNumDataNodes();
|
maxNumDataNodes = getMaxNumDataNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new InternalTestCluster(seed, newTempDirPath(), minNumDataNodes, maxNumDataNodes,
|
return new InternalTestCluster(seed, createTempDir(), minNumDataNodes, maxNumDataNodes,
|
||||||
clusterName(scope.name(), Integer.toString(CHILD_JVM_ID), seed), settingsSource, getNumClientNodes(),
|
clusterName(scope.name(), Integer.toString(CHILD_JVM_ID), seed), settingsSource, getNumClientNodes(),
|
||||||
InternalTestCluster.DEFAULT_ENABLE_HTTP_PIPELINING, CHILD_JVM_ID, nodePrefix);
|
InternalTestCluster.DEFAULT_ENABLE_HTTP_PIPELINING, CHILD_JVM_ID, nodePrefix);
|
||||||
}
|
}
|
||||||
|
@ -1923,7 +1917,7 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
|
||||||
* Return settings that could be used to start a node that has the given zipped home directory.
|
* Return settings that could be used to start a node that has the given zipped home directory.
|
||||||
*/
|
*/
|
||||||
protected Settings prepareBackwardsDataDir(Path backwardsIndex, Object... settings) throws IOException {
|
protected Settings prepareBackwardsDataDir(Path backwardsIndex, Object... settings) throws IOException {
|
||||||
Path indexDir = newTempDirPath();
|
Path indexDir = createTempDir();
|
||||||
Path dataDir = indexDir.resolve("data");
|
Path dataDir = indexDir.resolve("data");
|
||||||
try (InputStream stream = Files.newInputStream(backwardsIndex)) {
|
try (InputStream stream = Files.newInputStream(backwardsIndex)) {
|
||||||
TestUtil.unzip(stream, indexDir);
|
TestUtil.unzip(stream, indexDir);
|
||||||
|
|
|
@ -271,27 +271,6 @@ public abstract class ElasticsearchTestCase extends LuceneTestCase {
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Test facilities and facades for subclasses.
|
// Test facilities and facades for subclasses.
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a {@link Closeable} resource that should be closed after the test
|
|
||||||
* completes.
|
|
||||||
*
|
|
||||||
* @return <code>resource</code> (for call chaining).
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T extends Closeable> T closeAfterTest(T resource) {
|
|
||||||
return RandomizedContext.current().closeAtEnd(resource, LifecycleScope.TEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a {@link Closeable} resource that should be closed after the suite
|
|
||||||
* completes.
|
|
||||||
*
|
|
||||||
* @return <code>resource</code> (for call chaining).
|
|
||||||
*/
|
|
||||||
public static <T extends Closeable> T closeAfterSuite(T resource) {
|
|
||||||
return RandomizedContext.current().closeAtEnd(resource, LifecycleScope.SUITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// old helper stuff, a lot of it is bad news and we should see if its all used
|
// old helper stuff, a lot of it is bad news and we should see if its all used
|
||||||
|
|
||||||
|
@ -900,24 +879,6 @@ public abstract class ElasticsearchTestCase extends LuceneTestCase {
|
||||||
return ThreadPool.terminate(service, 10, TimeUnit.SECONDS);
|
return ThreadPool.terminate(service, 10, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: these method names stink, but are a temporary solution.
|
|
||||||
// see https://github.com/carrotsearch/randomizedtesting/pull/178
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a temporary file
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
|
||||||
public Path newTempFilePath() throws IOException {
|
|
||||||
return createTempFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a temporary directory
|
|
||||||
*/
|
|
||||||
public Path newTempDirPath() {
|
|
||||||
return createTempDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random number of temporary paths.
|
* Returns a random number of temporary paths.
|
||||||
*/
|
*/
|
||||||
|
@ -925,7 +886,7 @@ public abstract class ElasticsearchTestCase extends LuceneTestCase {
|
||||||
final int numPaths = TestUtil.nextInt(random(), 1, 3);
|
final int numPaths = TestUtil.nextInt(random(), 1, 3);
|
||||||
final String[] absPaths = new String[numPaths];
|
final String[] absPaths = new String[numPaths];
|
||||||
for (int i = 0; i < numPaths; i++) {
|
for (int i = 0; i < numPaths; i++) {
|
||||||
absPaths[i] = newTempDirPath().toAbsolutePath().toString();
|
absPaths[i] = createTempDir().toAbsolutePath().toString();
|
||||||
}
|
}
|
||||||
return absPaths;
|
return absPaths;
|
||||||
}
|
}
|
||||||
|
@ -937,7 +898,7 @@ public abstract class ElasticsearchTestCase extends LuceneTestCase {
|
||||||
public NodeEnvironment newNodeEnvironment(Settings settings) throws IOException {
|
public NodeEnvironment newNodeEnvironment(Settings settings) throws IOException {
|
||||||
Settings build = ImmutableSettings.builder()
|
Settings build = ImmutableSettings.builder()
|
||||||
.put(settings)
|
.put(settings)
|
||||||
.put("path.home", newTempDirPath().toAbsolutePath())
|
.put("path.home", createTempDir().toAbsolutePath())
|
||||||
.putArray("path.data", tmpPaths()).build();
|
.putArray("path.data", tmpPaths()).build();
|
||||||
return new NodeEnvironment(build, new Environment(build));
|
return new NodeEnvironment(build, new Environment(build));
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class FileUtilsTests extends ElasticsearchTestCase {
|
||||||
assertThat(yamlSuites.get("index").size(), greaterThan(1));
|
assertThat(yamlSuites.get("index").size(), greaterThan(1));
|
||||||
|
|
||||||
//files can be loaded from classpath and from file system too
|
//files can be loaded from classpath and from file system too
|
||||||
Path dir = newTempDirPath();
|
Path dir = createTempDir();
|
||||||
Path file = dir.resolve("test_loading.yaml");
|
Path file = dir.resolve("test_loading.yaml");
|
||||||
Files.createFile(file);
|
Files.createFile(file);
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class InternalTestClusterTests extends ElasticsearchTestCase {
|
||||||
int jvmOrdinal = randomIntBetween(0, 10);
|
int jvmOrdinal = randomIntBetween(0, 10);
|
||||||
String nodePrefix = randomRealisticUnicodeOfCodepointLengthBetween(1, 10);
|
String nodePrefix = randomRealisticUnicodeOfCodepointLengthBetween(1, 10);
|
||||||
|
|
||||||
Path baseDir = newTempDirPath();
|
Path baseDir = createTempDir();
|
||||||
InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
||||||
InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
||||||
assertClusters(cluster0, cluster1, true);
|
assertClusters(cluster0, cluster1, true);
|
||||||
|
@ -99,7 +99,7 @@ public class InternalTestClusterTests extends ElasticsearchTestCase {
|
||||||
int jvmOrdinal = randomIntBetween(0, 10);
|
int jvmOrdinal = randomIntBetween(0, 10);
|
||||||
String nodePrefix = "foobar";
|
String nodePrefix = "foobar";
|
||||||
|
|
||||||
Path baseDir = newTempDirPath();
|
Path baseDir = createTempDir();
|
||||||
InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
||||||
InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName1, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, baseDir, minNumDataNodes, maxNumDataNodes, clusterName1, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSimpleFileOperations() throws IOException {
|
public void testSimpleFileOperations() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testFile = tempDir.resolve("test.txt");
|
Path testFile = tempDir.resolve("test.txt");
|
||||||
touch(testFile);
|
touch(testFile);
|
||||||
|
@ -127,7 +127,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSimpleDirectoryOperations() throws IOException {
|
public void testSimpleDirectoryOperations() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testDir = tempDir.resolve("test-dir");
|
Path testDir = tempDir.resolve("test-dir");
|
||||||
Files.createDirectories(testDir);
|
Files.createDirectories(testDir);
|
||||||
|
@ -217,7 +217,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNestedDirectoryOperations() throws IOException {
|
public void testNestedDirectoryOperations() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testDir = tempDir.resolve("test-dir");
|
Path testDir = tempDir.resolve("test-dir");
|
||||||
Files.createDirectories(testDir);
|
Files.createDirectories(testDir);
|
||||||
|
@ -283,7 +283,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFileReplacingDirectory() throws IOException {
|
public void testFileReplacingDirectory() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testDir = tempDir.resolve("test-dir");
|
Path testDir = tempDir.resolve("test-dir");
|
||||||
Files.createDirectories(testDir);
|
Files.createDirectories(testDir);
|
||||||
|
@ -330,7 +330,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEmptyDirectory() throws IOException {
|
public void testEmptyDirectory() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testDir = tempDir.resolve("test-dir");
|
Path testDir = tempDir.resolve("test-dir");
|
||||||
Files.createDirectories(testDir);
|
Files.createDirectories(testDir);
|
||||||
|
@ -353,7 +353,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNoDirectoryOnInit() throws IOException {
|
public void testNoDirectoryOnInit() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testDir = tempDir.resolve("test-dir");
|
Path testDir = tempDir.resolve("test-dir");
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ public class FileWatcherTest extends ElasticsearchTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNoFileOnInit() throws IOException {
|
public void testNoFileOnInit() throws IOException {
|
||||||
Path tempDir = newTempDirPath();
|
Path tempDir = createTempDir();
|
||||||
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
RecordingChangeListener changes = new RecordingChangeListener(tempDir);
|
||||||
Path testFile = tempDir.resolve("testfile.txt");
|
Path testFile = tempDir.resolve("testfile.txt");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue