28
28
import org .apache .cassandra .sidecar .common .response .GetPreemptiveOpenIntervalResponse ;
29
29
import org .apache .cassandra .sidecar .common .server .StorageOperations ;
30
30
import org .apache .cassandra .sidecar .concurrent .ExecutorPools ;
31
- import org .apache .cassandra .sidecar .metrics .JmxOperationsMetrics ;
32
31
import org .apache .cassandra .sidecar .metrics .SidecarMetrics ;
33
32
import org .apache .cassandra .sidecar .routes .AbstractHandler ;
34
33
import org .apache .cassandra .sidecar .utils .CassandraInputValidator ;
40
39
@ Singleton
41
40
public class GetPreemptiveOpenIntervalHandler extends AbstractHandler <Void >
42
41
{
43
- private final JmxOperationsMetrics jmxOperationsMetrics ;
44
42
45
43
@ Inject
46
44
protected GetPreemptiveOpenIntervalHandler (InstanceMetadataFetcher metadataFetcher ,
@@ -49,7 +47,6 @@ protected GetPreemptiveOpenIntervalHandler(InstanceMetadataFetcher metadataFetch
49
47
SidecarMetrics sidecarMetrics )
50
48
{
51
49
super (metadataFetcher , executorPools , validator );
52
- this .jmxOperationsMetrics = sidecarMetrics .server ().jmxOperationsMetrics ();
53
50
}
54
51
55
52
@ Override
@@ -65,20 +62,13 @@ protected void handleInternal(RoutingContext context,
65
62
SocketAddress remoteAddress ,
66
63
Void request )
67
64
{
68
- getSSTablePreemptiveOpenInterval (host , remoteAddress )
69
- .onSuccess (context ::json )
70
- .onFailure (cause -> processFailure (cause , context , host , remoteAddress , request ));
71
- }
72
-
73
- protected Future <GetPreemptiveOpenIntervalResponse > getSSTablePreemptiveOpenInterval (String host , SocketAddress remoteAddress )
74
- {
75
- long startTime = System .nanoTime ();
76
65
StorageOperations storageOperations = getStorageOperations (host );
77
66
logger .debug ("Retrieving SSTable's preemptiveOpenInterval, remoteAddress={}, instance={}" ,
78
67
remoteAddress , host );
79
68
80
- return executorPools .service ()
81
- .executeBlocking (storageOperations ::getSSTablePreemptiveOpenIntervalInMB )
82
- .onComplete (ar -> updateJmxMetric (ar , jmxOperationsMetrics , "getSSTablePreemptiveOpenInterval" , startTime ));
69
+ executorPools .service ()
70
+ .executeBlocking (storageOperations ::getSSTablePreemptiveOpenIntervalInMB )
71
+ .onSuccess (context ::json )
72
+ .onFailure (cause -> processFailure (cause , context , host , remoteAddress , request ));
83
73
}
84
74
}
0 commit comments