Gateway: Default to `local` gateway (replace `none` gateway), closes #347.
This commit is contained in:
parent
0de24218ff
commit
042af200e8
|
@ -25,7 +25,7 @@ import org.elasticsearch.common.inject.Module;
|
|||
import org.elasticsearch.common.inject.Modules;
|
||||
import org.elasticsearch.common.inject.SpawnModules;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.gateway.none.NoneGatewayModule;
|
||||
import org.elasticsearch.gateway.local.LocalGatewayModule;
|
||||
|
||||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
|
@ -39,7 +39,7 @@ public class GatewayModule extends AbstractModule implements SpawnModules {
|
|||
}
|
||||
|
||||
@Override public Iterable<? extends Module> spawnModules() {
|
||||
return ImmutableList.of(Modules.createModule(settings.getAsClass("gateway.type", NoneGatewayModule.class, "org.elasticsearch.gateway.", "GatewayModule"), settings));
|
||||
return ImmutableList.of(Modules.createModule(settings.getAsClass("gateway.type", LocalGatewayModule.class, "org.elasticsearch.gateway.", "GatewayModule"), settings));
|
||||
}
|
||||
|
||||
@Override protected void configure() {
|
||||
|
|
|
@ -62,7 +62,7 @@ jar << {
|
|||
copy(file: jarjarArchivePath, tofile: jar.archivePath)
|
||||
delete(file: jarjarArchivePath)
|
||||
|
||||
// seems like empty dirst still exists, unjar and clean them
|
||||
// seems like empty dirs still exists, unjar and clean them
|
||||
unjar(src: jar.archivePath, dest: "build/tmp/extracted")
|
||||
delete(dir: "build/tmp/extracted/jsr166y")
|
||||
delete(dir: "build/tmp/extracted/gnu/trove")
|
||||
|
|
|
@ -59,6 +59,12 @@ public abstract class AbstractNodesTests {
|
|||
.put(settings)
|
||||
.put("name", id)
|
||||
.build();
|
||||
|
||||
if (finalSettings.get("gateway.type") == null) {
|
||||
// default to non gateway
|
||||
finalSettings = settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
|
||||
}
|
||||
|
||||
Node node = nodeBuilder()
|
||||
.settings(finalSettings)
|
||||
.build();
|
||||
|
|
|
@ -42,6 +42,9 @@ class BuilderActionsTests {
|
|||
node {
|
||||
local = true
|
||||
}
|
||||
gateway {
|
||||
type = "none"
|
||||
}
|
||||
}
|
||||
|
||||
node = nodeBuilder.node()
|
||||
|
|
|
@ -45,6 +45,9 @@ class DifferentApiExecutionTests {
|
|||
node {
|
||||
local = true
|
||||
}
|
||||
gateway {
|
||||
type = "none"
|
||||
}
|
||||
}
|
||||
|
||||
node = nodeBuilder.node()
|
||||
|
|
|
@ -41,6 +41,9 @@ class SimpleActionsTests {
|
|||
node {
|
||||
local = true
|
||||
}
|
||||
gateway {
|
||||
type = "none"
|
||||
}
|
||||
}
|
||||
|
||||
node = nodeBuilder.node()
|
||||
|
|
|
@ -47,7 +47,7 @@ public class SimpleAttachmentIntegrationTests {
|
|||
private Node node;
|
||||
|
||||
@BeforeClass public void setupServer() {
|
||||
node = nodeBuilder().local(true).node();
|
||||
node = nodeBuilder().local(true).settings(settingsBuilder().put("gateway.type", "none")).node();
|
||||
}
|
||||
|
||||
@AfterClass public void closeServer() {
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.io.IOException;
|
|||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.elasticsearch.common.settings.ImmutableSettings.*;
|
||||
import static org.elasticsearch.common.xcontent.XContentFactory.*;
|
||||
import static org.elasticsearch.node.NodeBuilder.*;
|
||||
import static org.hamcrest.MatcherAssert.*;
|
||||
|
@ -47,7 +48,7 @@ public abstract class AbstractMemcachedActionsTests {
|
|||
|
||||
@BeforeMethod
|
||||
public void setup() throws IOException {
|
||||
node = nodeBuilder().node();
|
||||
node = nodeBuilder().settings(settingsBuilder().put("gateway.type", "none")).node();
|
||||
memcachedClient = createMemcachedClient();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue