Skip to content

Commit 2f24ad8

Browse files
committed
rename
1 parent 6f1a70c commit 2f24ad8

File tree

10 files changed

+86
-86
lines changed

10 files changed

+86
-86
lines changed

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
import org.elasticsearch.xpack.ccr.action.ShardFollowTask;
5353
import org.elasticsearch.xpack.ccr.action.ShardFollowTasksExecutor;
5454
import org.elasticsearch.xpack.ccr.action.TransportCcrStatsAction;
55-
import org.elasticsearch.xpack.ccr.action.TransportFollowAction;
55+
import org.elasticsearch.xpack.ccr.action.TransportPutFollowAction;
5656
import org.elasticsearch.xpack.ccr.action.TransportDeleteAutoFollowPatternAction;
5757
import org.elasticsearch.xpack.ccr.action.TransportResumeFollowAction;
5858
import org.elasticsearch.xpack.ccr.action.TransportPutAutoFollowPatternAction;
@@ -61,15 +61,15 @@
6161
import org.elasticsearch.xpack.ccr.action.bulk.TransportBulkShardOperationsAction;
6262
import org.elasticsearch.xpack.ccr.index.engine.FollowingEngineFactory;
6363
import org.elasticsearch.xpack.ccr.rest.RestCcrStatsAction;
64-
import org.elasticsearch.xpack.ccr.rest.RestFollowAction;
64+
import org.elasticsearch.xpack.ccr.rest.RestPutFollowAction;
6565
import org.elasticsearch.xpack.ccr.rest.RestDeleteAutoFollowPatternAction;
6666
import org.elasticsearch.xpack.ccr.rest.RestResumeFollowAction;
6767
import org.elasticsearch.xpack.ccr.rest.RestPutAutoFollowPatternAction;
6868
import org.elasticsearch.xpack.ccr.rest.RestPauseFollowAction;
6969
import org.elasticsearch.xpack.core.XPackPlugin;
7070
import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus;
7171
import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction;
72-
import org.elasticsearch.xpack.core.ccr.action.FollowAction;
72+
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
7373
import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction;
7474
import org.elasticsearch.xpack.core.ccr.action.PauseFollowAction;
7575

@@ -161,7 +161,7 @@ public List<PersistentTasksExecutor<?>> getPersistentTasksExecutor(ClusterServic
161161
new ActionHandler<>(CcrStatsAction.INSTANCE, TransportCcrStatsAction.class),
162162
new ActionHandler<>(AutoFollowStatsAction.INSTANCE, TransportAutoFollowStatsAction.class),
163163
// follow actions
164-
new ActionHandler<>(FollowAction.INSTANCE, TransportFollowAction.class),
164+
new ActionHandler<>(PutFollowAction.INSTANCE, TransportPutFollowAction.class),
165165
new ActionHandler<>(ResumeFollowAction.INSTANCE, TransportResumeFollowAction.class),
166166
new ActionHandler<>(PauseFollowAction.INSTANCE, TransportPauseFollowAction.class),
167167
// auto-follow actions
@@ -183,7 +183,7 @@ public List<RestHandler> getRestHandlers(Settings settings, RestController restC
183183
new RestCcrStatsAction(settings, restController),
184184
new RestAutoFollowStatsAction(settings, restController),
185185
// follow APIs
186-
new RestFollowAction(settings, restController),
186+
new RestPutFollowAction(settings, restController),
187187
new RestResumeFollowAction(settings, restController),
188188
new RestPauseFollowAction(settings, restController),
189189
// auto-follow APIs

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
3434
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata.AutoFollowPattern;
3535
import org.elasticsearch.xpack.core.ccr.AutoFollowStats;
36-
import org.elasticsearch.xpack.core.ccr.action.FollowAction;
36+
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
3737
import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction;
3838

3939
import java.util.ArrayList;
@@ -187,9 +187,9 @@ void createAndFollow(Map<String, String> headers,
187187
Runnable successHandler,
188188
Consumer<Exception> failureHandler) {
189189
Client followerClient = CcrLicenseChecker.wrapClient(client, headers);
190-
FollowAction.Request request = new FollowAction.Request(followRequest);
190+
PutFollowAction.Request request = new PutFollowAction.Request(followRequest);
191191
followerClient.execute(
192-
FollowAction.INSTANCE,
192+
PutFollowAction.INSTANCE,
193193
request,
194194
ActionListener.wrap(r -> successHandler.run(), failureHandler)
195195
);
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.elasticsearch.xpack.ccr.Ccr;
3838
import org.elasticsearch.xpack.ccr.CcrLicenseChecker;
3939
import org.elasticsearch.xpack.ccr.CcrSettings;
40-
import org.elasticsearch.xpack.core.ccr.action.FollowAction;
40+
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
4141
import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction;
4242

4343
import java.util.HashMap;
@@ -46,8 +46,8 @@
4646
import java.util.Objects;
4747
import java.util.function.Consumer;
4848

49-
public final class TransportFollowAction
50-
extends TransportMasterNodeAction<FollowAction.Request, FollowAction.Response> {
49+
public final class TransportPutFollowAction
50+
extends TransportMasterNodeAction<PutFollowAction.Request, PutFollowAction.Response> {
5151

5252
private final Client client;
5353
private final AllocationService allocationService;
@@ -56,7 +56,7 @@ public final class TransportFollowAction
5656
private final CcrLicenseChecker ccrLicenseChecker;
5757

5858
@Inject
59-
public TransportFollowAction(
59+
public TransportPutFollowAction(
6060
final Settings settings,
6161
final ThreadPool threadPool,
6262
final TransportService transportService,
@@ -68,13 +68,13 @@ public TransportFollowAction(
6868
final CcrLicenseChecker ccrLicenseChecker) {
6969
super(
7070
settings,
71-
FollowAction.NAME,
71+
PutFollowAction.NAME,
7272
transportService,
7373
clusterService,
7474
threadPool,
7575
actionFilters,
7676
indexNameExpressionResolver,
77-
FollowAction.Request::new);
77+
PutFollowAction.Request::new);
7878
this.client = client;
7979
this.allocationService = allocationService;
8080
this.remoteClusterService = transportService.getRemoteClusterService();
@@ -88,15 +88,15 @@ protected String executor() {
8888
}
8989

9090
@Override
91-
protected FollowAction.Response newResponse() {
92-
return new FollowAction.Response();
91+
protected PutFollowAction.Response newResponse() {
92+
return new PutFollowAction.Response();
9393
}
9494

9595
@Override
9696
protected void masterOperation(
97-
final FollowAction.Request request,
97+
final PutFollowAction.Request request,
9898
final ClusterState state,
99-
final ActionListener<FollowAction.Response> listener) throws Exception {
99+
final ActionListener<PutFollowAction.Response> listener) throws Exception {
100100
if (ccrLicenseChecker.isCcrAllowed() == false) {
101101
listener.onFailure(LicenseUtils.newComplianceException("ccr"));
102102
return;
@@ -116,9 +116,9 @@ protected void masterOperation(
116116
}
117117

118118
private void createFollowerIndexAndFollowLocalIndex(
119-
final FollowAction.Request request,
119+
final PutFollowAction.Request request,
120120
final ClusterState state,
121-
final ActionListener<FollowAction.Response> listener) {
121+
final ActionListener<PutFollowAction.Response> listener) {
122122
// following an index in local cluster, so use local cluster state to fetch leader index metadata
123123
final String leaderIndex = request.getFollowRequest().getLeaderIndex();
124124
final IndexMetaData leaderIndexMetadata = state.getMetaData().index(leaderIndex);
@@ -134,10 +134,10 @@ private void createFollowerIndexAndFollowLocalIndex(
134134
}
135135

136136
private void createFollowerIndexAndFollowRemoteIndex(
137-
final FollowAction.Request request,
137+
final PutFollowAction.Request request,
138138
final String clusterAlias,
139139
final String leaderIndex,
140-
final ActionListener<FollowAction.Response> listener) {
140+
final ActionListener<PutFollowAction.Response> listener) {
141141
ccrLicenseChecker.checkRemoteClusterLicenseAndFetchLeaderIndexMetadataAndHistoryUUIDs(
142142
client,
143143
clusterAlias,
@@ -149,8 +149,8 @@ private void createFollowerIndexAndFollowRemoteIndex(
149149
private void createFollowerIndex(
150150
final IndexMetaData leaderIndexMetaData,
151151
final String[] historyUUIDs,
152-
final FollowAction.Request request,
153-
final ActionListener<FollowAction.Response> listener) {
152+
final PutFollowAction.Request request,
153+
final ActionListener<PutFollowAction.Response> listener) {
154154
if (leaderIndexMetaData == null) {
155155
listener.onFailure(new IllegalArgumentException("leader index [" + request.getFollowRequest().getLeaderIndex() +
156156
"] does not exist"));
@@ -162,7 +162,7 @@ private void createFollowerIndex(
162162
if (result) {
163163
initiateFollowing(request, listener);
164164
} else {
165-
listener.onResponse(new FollowAction.Response(true, false, false));
165+
listener.onResponse(new PutFollowAction.Response(true, false, false));
166166
}
167167
},
168168
listener::onFailure);
@@ -228,23 +228,23 @@ public ClusterState execute(final ClusterState currentState) throws Exception {
228228
}
229229

230230
private void initiateFollowing(
231-
final FollowAction.Request request,
232-
final ActionListener<FollowAction.Response> listener) {
231+
final PutFollowAction.Request request,
232+
final ActionListener<PutFollowAction.Response> listener) {
233233
activeShardsObserver.waitForActiveShards(new String[]{request.getFollowRequest().getFollowerIndex()},
234234
ActiveShardCount.DEFAULT, request.timeout(), result -> {
235235
if (result) {
236236
client.execute(ResumeFollowAction.INSTANCE, request.getFollowRequest(), ActionListener.wrap(
237-
r -> listener.onResponse(new FollowAction.Response(true, true, r.isAcknowledged())),
237+
r -> listener.onResponse(new PutFollowAction.Response(true, true, r.isAcknowledged())),
238238
listener::onFailure
239239
));
240240
} else {
241-
listener.onResponse(new FollowAction.Response(true, false, false));
241+
listener.onResponse(new PutFollowAction.Response(true, false, false));
242242
}
243243
}, listener::onFailure);
244244
}
245245

246246
@Override
247-
protected ClusterBlockException checkBlock(final FollowAction.Request request, final ClusterState state) {
247+
protected ClusterBlockException checkBlock(final PutFollowAction.Request request, final ClusterState state) {
248248
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA_WRITE, request.getFollowRequest().getFollowerIndex());
249249
}
250250

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowAction.java renamed to x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414

1515
import java.io.IOException;
1616

17-
import static org.elasticsearch.xpack.core.ccr.action.FollowAction.INSTANCE;
18-
import static org.elasticsearch.xpack.core.ccr.action.FollowAction.Request;
17+
import static org.elasticsearch.xpack.core.ccr.action.PutFollowAction.INSTANCE;
18+
import static org.elasticsearch.xpack.core.ccr.action.PutFollowAction.Request;
1919

20-
public class RestFollowAction extends BaseRestHandler {
20+
public class RestPutFollowAction extends BaseRestHandler {
2121

22-
public RestFollowAction(Settings settings, RestController controller) {
22+
public RestPutFollowAction(Settings settings, RestController controller) {
2323
super(settings);
2424
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_ccr/follow", this);
2525
}
2626

2727
@Override
2828
public String getName() {
29-
return "ccr_follow_action";
29+
return "ccr_put_follow_action";
3030
}
3131

3232
@Override

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.elasticsearch.test.MockLogAppender;
2424
import org.elasticsearch.xpack.ccr.action.AutoFollowCoordinator;
2525
import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction;
26-
import org.elasticsearch.xpack.core.ccr.action.FollowAction;
26+
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
2727
import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction;
2828
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
2929
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata.AutoFollowPattern;
@@ -67,14 +67,14 @@ public void onFailure(final Exception e) {
6767

6868
public void testThatCreateAndFollowingIndexIsUnavailableWithNonCompliantLicense() throws InterruptedException {
6969
final ResumeFollowAction.Request followRequest = getFollowRequest();
70-
final FollowAction.Request createAndFollowRequest = new FollowAction.Request(followRequest);
70+
final PutFollowAction.Request createAndFollowRequest = new PutFollowAction.Request(followRequest);
7171
final CountDownLatch latch = new CountDownLatch(1);
7272
client().execute(
73-
FollowAction.INSTANCE,
73+
PutFollowAction.INSTANCE,
7474
createAndFollowRequest,
75-
new ActionListener<FollowAction.Response>() {
75+
new ActionListener<PutFollowAction.Response>() {
7676
@Override
77-
public void onResponse(final FollowAction.Response response) {
77+
public void onResponse(final PutFollowAction.Response response) {
7878
latch.countDown();
7979
fail();
8080
}

0 commit comments

Comments
 (0)