Gateway: Default to `local` gateway (replace `none` gateway), closes #347.

This commit is contained in:
kimchy 2010-09-01 23:21:26 +03:00
parent 0de24218ff
commit 042af200e8
8 changed files with 21 additions and 5 deletions

View File

@ -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() {

View File

@ -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")

View File

@ -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();

View File

@ -42,6 +42,9 @@ class BuilderActionsTests {
node {
local = true
}
gateway {
type = "none"
}
}
node = nodeBuilder.node()

View File

@ -45,6 +45,9 @@ class DifferentApiExecutionTests {
node {
local = true
}
gateway {
type = "none"
}
}
node = nodeBuilder.node()

View File

@ -41,6 +41,9 @@ class SimpleActionsTests {
node {
local = true
}
gateway {
type = "none"
}
}
node = nodeBuilder.node()

View File

@ -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() {

View File

@ -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();
}