57
57
58
58
@ Path ("/" )
59
59
public class Endpoints {
60
+ /**
61
+ * A {@code String} constant representing supplied resource group in path parameter.
62
+ */
63
+ private static final String GROUP_PARAM_KEY = "group" ;
64
+
65
+ /**
66
+ * A {@code String} constant representing supplied tableId in path parameter.
67
+ */
68
+ private static final String TABLEID_PARAM_KEY = "tableId" ;
60
69
61
70
@ Target (ElementType .METHOD )
62
71
@ Retention (RetentionPolicy .RUNTIME )
@@ -166,10 +175,11 @@ public InstanceSummary getInstanceSummary() {
166
175
}
167
176
168
177
@ GET
169
- @ Path ("compactors/detail/{group }" )
178
+ @ Path ("compactors/detail/{" + GROUP_PARAM_KEY + " }" )
170
179
@ Produces (MediaType .APPLICATION_JSON )
171
180
@ Description ("Returns the metric responses for the Compactors in the supplied resource group" )
172
- public Collection <MetricResponse > getCompactors (@ PathParam ("group" ) String resourceGroup ) {
181
+ public Collection <MetricResponse >
182
+ getCompactors (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
173
183
validateResourceGroup (resourceGroup );
174
184
final Set <ServerId > servers = monitor .getInformationFetcher ().getSummary ()
175
185
.getCompactorResourceGroupServers (resourceGroup );
@@ -180,11 +190,11 @@ public Collection<MetricResponse> getCompactors(@PathParam("group") String resou
180
190
}
181
191
182
192
@ GET
183
- @ Path ("compactors/summary/{group }" )
193
+ @ Path ("compactors/summary/{" + GROUP_PARAM_KEY + " }" )
184
194
@ Produces (MediaType .APPLICATION_JSON )
185
195
@ Description ("Returns an aggregate view of the metric responses for the Compactors in the supplied resource group" )
186
196
public Map <Id ,CumulativeDistributionSummary >
187
- getCompactorResourceGroupMetricSummary (@ PathParam ("group" ) String resourceGroup ) {
197
+ getCompactorResourceGroupMetricSummary (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
188
198
validateResourceGroup (resourceGroup );
189
199
final Map <Id ,CumulativeDistributionSummary > metrics = monitor .getInformationFetcher ()
190
200
.getSummary ().getCompactorResourceGroupMetricSummary (resourceGroup );
@@ -203,10 +213,11 @@ public Map<Id,CumulativeDistributionSummary> getCompactorAllMetricSummary() {
203
213
}
204
214
205
215
@ GET
206
- @ Path ("sservers/detail/{group }" )
216
+ @ Path ("sservers/detail/{" + GROUP_PARAM_KEY + " }" )
207
217
@ Produces (MediaType .APPLICATION_JSON )
208
218
@ Description ("Returns the metric responses for the ScanServers in the supplied resource group" )
209
- public Collection <MetricResponse > getScanServers (@ PathParam ("group" ) String resourceGroup ) {
219
+ public Collection <MetricResponse >
220
+ getScanServers (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
210
221
validateResourceGroup (resourceGroup );
211
222
final Set <ServerId > servers =
212
223
monitor .getInformationFetcher ().getSummary ().getSServerResourceGroupServers (resourceGroup );
@@ -217,11 +228,11 @@ public Collection<MetricResponse> getScanServers(@PathParam("group") String reso
217
228
}
218
229
219
230
@ GET
220
- @ Path ("sservers/summary/{group }" )
231
+ @ Path ("sservers/summary/{" + GROUP_PARAM_KEY + " }" )
221
232
@ Produces (MediaType .APPLICATION_JSON )
222
233
@ Description ("Returns an aggregate view of the metric responses for the ScanServers in the supplied resource group" )
223
234
public Map <Id ,CumulativeDistributionSummary >
224
- getScanServerResourceGroupMetricSummary (@ PathParam ("group" ) String resourceGroup ) {
235
+ getScanServerResourceGroupMetricSummary (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
225
236
validateResourceGroup (resourceGroup );
226
237
final Map <Id ,CumulativeDistributionSummary > metrics = monitor .getInformationFetcher ()
227
238
.getSummary ().getSServerResourceGroupMetricSummary (resourceGroup );
@@ -240,10 +251,11 @@ public Map<Id,CumulativeDistributionSummary> getScanServerAllMetricSummary() {
240
251
}
241
252
242
253
@ GET
243
- @ Path ("tservers/detail/{group }" )
254
+ @ Path ("tservers/detail/{" + GROUP_PARAM_KEY + " }" )
244
255
@ Produces (MediaType .APPLICATION_JSON )
245
256
@ Description ("Returns the metric responses for the TabletServers in the supplied resource group" )
246
- public Collection <MetricResponse > getTabletServers (@ PathParam ("group" ) String resourceGroup ) {
257
+ public Collection <MetricResponse >
258
+ getTabletServers (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
247
259
validateResourceGroup (resourceGroup );
248
260
final Set <ServerId > servers =
249
261
monitor .getInformationFetcher ().getSummary ().getTServerResourceGroupServers (resourceGroup );
@@ -254,11 +266,11 @@ public Collection<MetricResponse> getTabletServers(@PathParam("group") String re
254
266
}
255
267
256
268
@ GET
257
- @ Path ("tservers/summary/{group }" )
269
+ @ Path ("tservers/summary/{" + GROUP_PARAM_KEY + " }" )
258
270
@ Produces (MediaType .APPLICATION_JSON )
259
271
@ Description ("Returns an aggregate view of the metric responses for the TabletServers in the supplied resource group" )
260
272
public Map <Id ,CumulativeDistributionSummary >
261
- getTabletServerResourceGroupMetricSummary (@ PathParam ("group" ) String resourceGroup ) {
273
+ getTabletServerResourceGroupMetricSummary (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
262
274
validateResourceGroup (resourceGroup );
263
275
final Map <Id ,CumulativeDistributionSummary > metrics = monitor .getInformationFetcher ()
264
276
.getSummary ().getTServerResourceGroupMetricSummary (resourceGroup );
@@ -298,10 +310,11 @@ public Map<String,List<TExternalCompaction>> getCompactions() {
298
310
}
299
311
300
312
@ GET
301
- @ Path ("compactions/detail/{group }" )
313
+ @ Path ("compactions/detail/{" + GROUP_PARAM_KEY + " }" )
302
314
@ Produces (MediaType .APPLICATION_JSON )
303
315
@ Description ("Returns a list of the 50 oldest running compactions in the supplied resource group" )
304
- public List <TExternalCompaction > getCompactions (@ PathParam ("group" ) String resourceGroup ) {
316
+ public List <TExternalCompaction >
317
+ getCompactions (@ PathParam (GROUP_PARAM_KEY ) String resourceGroup ) {
305
318
validateResourceGroup (resourceGroup );
306
319
List <TExternalCompaction > compactions =
307
320
monitor .getInformationFetcher ().getSummary ().getCompactions (resourceGroup );
@@ -320,10 +333,10 @@ public Map<TableId,TableSummary> getTables() {
320
333
}
321
334
322
335
@ GET
323
- @ Path ("tables/{tableId }" )
336
+ @ Path ("tables/{" + TABLEID_PARAM_KEY + " }" )
324
337
@ Produces (MediaType .APPLICATION_JSON )
325
338
@ Description ("Returns table details for the supplied TableId" )
326
- public TableSummary getTable (@ PathParam ("tableId" ) String tableId ) {
339
+ public TableSummary getTable (@ PathParam (TABLEID_PARAM_KEY ) String tableId ) {
327
340
TableSummary ts =
328
341
monitor .getInformationFetcher ().getSummary ().getTables ().get (TableId .of (tableId ));
329
342
if (ts == null ) {
@@ -333,10 +346,10 @@ public TableSummary getTable(@PathParam("tableId") String tableId) {
333
346
}
334
347
335
348
@ GET
336
- @ Path ("tables/{tableId }/tablets" )
349
+ @ Path ("tables/{" + TABLEID_PARAM_KEY + " }/tablets" )
337
350
@ Produces (MediaType .APPLICATION_JSON )
338
351
@ Description ("Returns tablet details for the supplied table name" )
339
- public List <TabletInformation > getTablets (@ PathParam ("tableId" ) String tableId ) {
352
+ public List <TabletInformation > getTablets (@ PathParam (TABLEID_PARAM_KEY ) String tableId ) {
340
353
List <TabletInformation > ti =
341
354
monitor .getInformationFetcher ().getSummary ().getTablets (TableId .of (tableId ));
342
355
if (ti == null ) {
0 commit comments