Skip to content

Commit 504bf03

Browse files
committed
refactoring getter/setters for package action.admin.cluster.node.hotthreads #2657
1 parent 8d3c7b0 commit 504bf03

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public NodeHotThreads(DiscoveryNode node, String hotThreads) {
4040
this.hotThreads = hotThreads;
4141
}
4242

43-
public String hotThreads() {
43+
public String getHotThreads() {
4444
return this.hotThreads;
4545
}
4646

src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,38 @@ public NodesHotThreadsRequest(String... nodesIds) {
4444
super(nodesIds);
4545
}
4646

47-
public int threads() {
47+
public int getThreads() {
4848
return this.threads;
4949
}
5050

51-
public NodesHotThreadsRequest threads(int threads) {
51+
public NodesHotThreadsRequest setThreads(int threads) {
5252
this.threads = threads;
5353
return this;
5454
}
5555

56-
public NodesHotThreadsRequest type(String type) {
56+
public NodesHotThreadsRequest setType(String type) {
5757
this.type = type;
5858
return this;
5959
}
6060

61-
public String type() {
61+
public String getType() {
6262
return this.type;
6363
}
6464

65-
public NodesHotThreadsRequest interval(TimeValue interval) {
65+
public NodesHotThreadsRequest setInterval(TimeValue interval) {
6666
this.interval = interval;
6767
return this;
6868
}
6969

70-
public TimeValue interval() {
70+
public TimeValue getInterval() {
7171
return this.interval;
7272
}
7373

74-
public int snapshots() {
74+
public int getSnapshots() {
7575
return this.snapshots;
7676
}
7777

78-
public NodesHotThreadsRequest snapshots(int snapshots) {
78+
public NodesHotThreadsRequest setSnapshots(int snapshots) {
7979
this.snapshots = snapshots;
8080
return this;
8181
}

src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequestBuilder.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ public NodesHotThreadsRequestBuilder(ClusterAdminClient clusterClient) {
3434
}
3535

3636
public NodesHotThreadsRequestBuilder setThreads(int threads) {
37-
request.threads(threads);
37+
request.setThreads(threads);
3838
return this;
3939
}
4040

4141
public NodesHotThreadsRequestBuilder setType(String type) {
42-
request.type(type);
42+
request.setType(type);
4343
return this;
4444
}
4545

4646
public NodesHotThreadsRequestBuilder setInterval(TimeValue interval) {
47-
request.interval(interval);
47+
request.setInterval(interval);
4848
return this;
4949
}
5050

src/main/java/org/elasticsearch/rest/action/admin/cluster/node/hotthreads/RestNodesHotThreadsAction.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ public RestNodesHotThreadsAction(Settings settings, Client client, RestControlle
5555
public void handleRequest(final RestRequest request, final RestChannel channel) {
5656
String[] nodesIds = RestActions.splitNodes(request.param("nodeId"));
5757
NodesHotThreadsRequest nodesHotThreadsRequest = new NodesHotThreadsRequest(nodesIds);
58-
nodesHotThreadsRequest.threads(request.paramAsInt("threads", nodesHotThreadsRequest.threads()));
59-
nodesHotThreadsRequest.type(request.param("type", nodesHotThreadsRequest.type()));
60-
nodesHotThreadsRequest.interval(TimeValue.parseTimeValue(request.param("interval"), nodesHotThreadsRequest.interval()));
61-
nodesHotThreadsRequest.snapshots(request.paramAsInt("snapshots", nodesHotThreadsRequest.snapshots()));
58+
nodesHotThreadsRequest.setThreads(request.paramAsInt("threads", nodesHotThreadsRequest.getThreads()));
59+
nodesHotThreadsRequest.setType(request.param("type", nodesHotThreadsRequest.getType()));
60+
nodesHotThreadsRequest.setInterval(TimeValue.parseTimeValue(request.param("interval"), nodesHotThreadsRequest.getInterval()));
61+
nodesHotThreadsRequest.setSnapshots(request.paramAsInt("snapshots", nodesHotThreadsRequest.getSnapshots()));
6262
client.admin().cluster().nodesHotThreads(nodesHotThreadsRequest, new ActionListener<NodesHotThreadsResponse>() {
6363
@Override
6464
public void onResponse(NodesHotThreadsResponse response) {
6565
try {
6666
StringBuilder sb = new StringBuilder();
6767
for (NodeHotThreads node : response) {
6868
sb.append("::: ").append(node.node().toString()).append("\n");
69-
Strings.spaceify(3, node.hotThreads(), sb);
69+
Strings.spaceify(3, node.getHotThreads(), sb);
7070
sb.append('\n');
7171
}
7272
channel.sendResponse(new StringRestResponse(RestStatus.OK, sb.toString()));

0 commit comments

Comments
 (0)