Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NoneGateway, NoneGatewayAllocator, & NoneGatewayModule #8537

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions config/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,9 @@
# in the gateway, and when the cluster starts up for the first time,
# it will read its state from the gateway.

# There are several types of gateway implementations. For more information, see
# For more information, see
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.

# The default gateway type is the "local" gateway (recommended):
#
#gateway.type: local

# Settings below control how and when to start the initial recovery process on
# a full cluster restart (to reuse as much local data as possible when using shared
# gateway).
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/modules/gateway.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ added or deleted), those changes will be persisted using the gateway.
When the cluster first starts up, the state will be read from the
gateway and applied.

The gateway set on the node level will automatically control the index
gateway that will be used. For example, if the `local` gateway is used,
then automatically, each index created on the node will also use its own
respective index level `local` gateway. In this case, if an index should
not persist its state, it should be explicitly set to `none` (which is
the only other value it can be set to).
The gateway set on the node level will automatically control the index gateway
that will be used. For example, if the `local` gateway is used (the default),
then each index created on the node will automatically use its own respective
index level `local` gateway.

The default gateway used is the
<<modules-gateway-local,local>> gateway.

The `none` gateway option was removed in Elasticsearch 2.0.

[float]
[[recover-after]]
=== Recovery After Nodes / Time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.gateway.none.NoneGatewayAllocator;
import org.elasticsearch.gateway.local.LocalGatewayAllocator;

/**
*/
Expand All @@ -37,7 +37,7 @@ public class ShardsAllocatorModule extends AbstractModule {

private Class<? extends ShardsAllocator> shardsAllocator;

private Class<? extends GatewayAllocator> gatewayAllocator = NoneGatewayAllocator.class;
private Class<? extends GatewayAllocator> gatewayAllocator = LocalGatewayAllocator.class;

public ShardsAllocatorModule(Settings settings) {
this.settings = settings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@

import org.elasticsearch.cluster.routing.MutableShardRouting;
import org.elasticsearch.cluster.routing.RoutingNode;
import org.elasticsearch.cluster.routing.RoutingNodes;
import org.elasticsearch.cluster.routing.allocation.FailedRerouteAllocation;
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.cluster.routing.allocation.StartedRerouteAllocation;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.gateway.none.NoneGatewayAllocator;

/**
* The {@link ShardsAllocator} class offers methods for allocating shard within a cluster.
Expand All @@ -41,12 +39,12 @@ public class ShardsAllocators extends AbstractComponent implements ShardsAllocat
private final GatewayAllocator gatewayAllocator;
private final ShardsAllocator allocator;

public ShardsAllocators() {
this(ImmutableSettings.Builder.EMPTY_SETTINGS);
public ShardsAllocators(GatewayAllocator allocator) {
this(ImmutableSettings.Builder.EMPTY_SETTINGS, allocator);
}

public ShardsAllocators(Settings settings) {
this(settings, new NoneGatewayAllocator(), new BalancedShardsAllocator(settings));
public ShardsAllocators(Settings settings, GatewayAllocator allocator) {
this(settings, allocator, new BalancedShardsAllocator(settings));
}

@Inject
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/elasticsearch/gateway/GatewayModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
public class GatewayModule extends AbstractModule implements SpawnModules {

public static String GATEWAY_TYPE_SETTING = "gateway.type";

private final Settings settings;

public GatewayModule(Settings settings) {
Expand All @@ -40,7 +42,8 @@ public GatewayModule(Settings settings) {

@Override
public Iterable<? extends Module> spawnModules() {
return ImmutableList.of(Modules.createModule(settings.getAsClass("gateway.type", LocalGatewayModule.class, "org.elasticsearch.gateway.", "GatewayModule"), settings));
Class gateway = settings.getAsClass(GATEWAY_TYPE_SETTING, LocalGatewayModule.class, "org.elasticsearch.gateway.", "GatewayModule");
return ImmutableList.of(Modules.createModule(gateway, settings));
}

@Override
Expand Down
134 changes: 0 additions & 134 deletions src/main/java/org/elasticsearch/gateway/none/NoneGateway.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading