Skip to content

Commit

Permalink
add transform node role
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Muhs committed Mar 16, 2020
1 parent 4f48e05 commit 870c5eb
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
Expand Down Expand Up @@ -112,6 +113,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;

Expand Down Expand Up @@ -157,6 +159,15 @@ public class Transform extends Plugin implements SystemIndexPlugin, PersistentTa
Property.NodeScope
);

public static final DiscoveryNodeRole TRANSFORM_ROLE = new DiscoveryNodeRole("transform", "t") {

@Override
protected Setting<Boolean> roleSetting() {
return TRANSFORM_ENABLED_NODE;
}

};

public Transform(Settings settings) {
this.settings = settings;
this.enabled = XPackSettings.TRANSFORM_ENABLED.get(settings);
Expand Down Expand Up @@ -362,6 +373,11 @@ public Settings additionalSettings() {
return additionalSettings.build();
}

@Override
public Set<DiscoveryNodeRole> getRoles() {
return Collections.singleton(TRANSFORM_ROLE);
}

@Override
public void close() {
if (transformServices.get() != null) {
Expand Down

0 comments on commit 870c5eb

Please sign in to comment.