forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
95 additions
and
85 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyInfoTransportAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.cluster.coordination.votingonly; | ||
|
||
import org.elasticsearch.action.support.ActionFilters; | ||
import org.elasticsearch.injection.guice.Inject; | ||
import org.elasticsearch.transport.TransportService; | ||
import org.elasticsearch.xpack.core.XPackField; | ||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; | ||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureTransportAction; | ||
|
||
public class VotingOnlyInfoTransportAction extends XPackInfoFeatureTransportAction { | ||
|
||
@Inject | ||
public VotingOnlyInfoTransportAction(TransportService transportService, ActionFilters actionFilters) { | ||
super(XPackInfoFeatureAction.VOTING_ONLY.name(), transportService, actionFilters); | ||
} | ||
|
||
@Override | ||
protected String name() { | ||
return XPackField.VOTING_ONLY; | ||
} | ||
|
||
@Override | ||
protected boolean available() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected boolean enabled() { | ||
return true; | ||
} | ||
} |
83 changes: 0 additions & 83 deletions
83
...main/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodeFeatureSet.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...ava/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyUsageTransportAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.cluster.coordination.votingonly; | ||
|
||
import org.elasticsearch.action.ActionListener; | ||
import org.elasticsearch.action.support.ActionFilters; | ||
import org.elasticsearch.cluster.ClusterState; | ||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; | ||
import org.elasticsearch.cluster.service.ClusterService; | ||
import org.elasticsearch.injection.guice.Inject; | ||
import org.elasticsearch.protocol.xpack.XPackUsageRequest; | ||
import org.elasticsearch.tasks.Task; | ||
import org.elasticsearch.threadpool.ThreadPool; | ||
import org.elasticsearch.transport.TransportService; | ||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; | ||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; | ||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureTransportAction; | ||
import org.elasticsearch.xpack.core.votingonly.VotingOnlyNodeFeatureSetUsage; | ||
|
||
public class VotingOnlyUsageTransportAction extends XPackUsageFeatureTransportAction { | ||
|
||
@Inject | ||
public VotingOnlyUsageTransportAction( | ||
TransportService transportService, | ||
ClusterService clusterService, | ||
ThreadPool threadPool, | ||
ActionFilters actionFilters, | ||
IndexNameExpressionResolver indexNameExpressionResolver | ||
) { | ||
super( | ||
XPackUsageFeatureAction.VOTING_ONLY.name(), | ||
transportService, | ||
clusterService, | ||
threadPool, | ||
actionFilters, | ||
indexNameExpressionResolver | ||
); | ||
} | ||
|
||
@Override | ||
protected void masterOperation( | ||
Task task, | ||
XPackUsageRequest request, | ||
ClusterState state, | ||
ActionListener<XPackUsageFeatureResponse> listener | ||
) { | ||
final VotingOnlyNodeFeatureSetUsage usage = new VotingOnlyNodeFeatureSetUsage(); | ||
listener.onResponse(new XPackUsageFeatureResponse(usage)); | ||
} | ||
} |