public abstract class AbstractMetricsReportingExecutionListener extends com.codahale.metrics.ScheduledReporter implements ExecutionListener
ExecutionListener that reports useful metrics about ongoing bulk read and write
operations. It relies on a delegate MetricsCollectingExecutionListener as its source of
metrics.| Modifier and Type | Field and Description |
|---|---|
protected static double |
BYTES_PER_KB |
protected static double |
BYTES_PER_MB |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMetricsReportingExecutionListener(MetricsCollectingExecutionListener delegate,
String name,
com.codahale.metrics.MetricFilter filter,
TimeUnit rateUnit,
TimeUnit durationUnit) |
protected |
AbstractMetricsReportingExecutionListener(MetricsCollectingExecutionListener delegate,
String name,
com.codahale.metrics.MetricFilter filter,
TimeUnit rateUnit,
TimeUnit durationUnit,
ScheduledExecutorService scheduler) |
| Modifier and Type | Method and Description |
|---|---|
void |
onExecutionFailed(BulkExecutionException exception,
ExecutionContext context)
Called when a statement execution has failed.
|
void |
onExecutionStarted(Statement<?> statement,
ExecutionContext context)
Called when a statement is about to be executed.
|
void |
onExecutionSuccessful(Statement<?> statement,
ExecutionContext context)
Called when a statement has been successfully executed.
|
void |
onReadRequestFailed(Statement<?> statement,
Throwable error,
ExecutionContext context)
Called when a read request has failed.
|
void |
onReadRequestStarted(Statement<?> statement,
ExecutionContext context)
Called when a read request is about to be sent.
|
void |
onReadRequestSuccessful(Statement<?> statement,
ExecutionContext context)
Called when a read request has been completed successfully.
|
void |
onRowReceived(Row row,
ExecutionContext context)
Called when a row has been successfully received.
|
void |
onWriteRequestFailed(Statement<?> statement,
Throwable error,
ExecutionContext context)
Called when a write request has failed.
|
void |
onWriteRequestStarted(Statement<?> statement,
ExecutionContext context)
Called when a write request is about to be sent.
|
void |
onWriteRequestSuccessful(Statement<?> statement,
ExecutionContext context)
Called when a write request has been completed successfully.
|
protected static final double BYTES_PER_KB
protected static final double BYTES_PER_MB
protected AbstractMetricsReportingExecutionListener(MetricsCollectingExecutionListener delegate, String name, com.codahale.metrics.MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit)
protected AbstractMetricsReportingExecutionListener(MetricsCollectingExecutionListener delegate, String name, com.codahale.metrics.MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit, ScheduledExecutorService scheduler)
public void onExecutionStarted(Statement<?> statement, ExecutionContext context)
ExecutionListeneronExecutionStarted in interface ExecutionListenerstatement - the statement to execute.context - the global statement execution context.public void onWriteRequestStarted(Statement<?> statement, ExecutionContext context)
ExecutionListeneronWriteRequestStarted in interface ExecutionListenerstatement - the statement to execute.context - the local request execution context.public void onReadRequestStarted(Statement<?> statement, ExecutionContext context)
ExecutionListeneronReadRequestStarted in interface ExecutionListenerstatement - the statement to execute.context - the local request execution context.public void onWriteRequestSuccessful(Statement<?> statement, ExecutionContext context)
ExecutionListeneronWriteRequestSuccessful in interface ExecutionListenerstatement - the statement to execute.context - the local request execution context.public void onWriteRequestFailed(Statement<?> statement, Throwable error, ExecutionContext context)
ExecutionListeneronWriteRequestFailed in interface ExecutionListenerstatement - the statement to execute.error - the request execution error.context - the local request execution context.public void onReadRequestSuccessful(Statement<?> statement, ExecutionContext context)
ExecutionListeneronReadRequestSuccessful in interface ExecutionListenerstatement - the statement to execute.context - the local request execution context.public void onRowReceived(Row row, ExecutionContext context)
ExecutionListenerNote: this method is called when the row is effectively read and emitted to downstream subscribers, which might be later than the moment when it was made available by the driver.
onRowReceived in interface ExecutionListenerrow - the row.context - the local request execution context.public void onReadRequestFailed(Statement<?> statement, Throwable error, ExecutionContext context)
ExecutionListeneronReadRequestFailed in interface ExecutionListenerstatement - the statement to execute.error - the request execution error.context - the local request execution context.public void onExecutionSuccessful(Statement<?> statement, ExecutionContext context)
ExecutionListeneronExecutionSuccessful in interface ExecutionListenerstatement - the executed statement.context - the global statement execution context.public void onExecutionFailed(BulkExecutionException exception, ExecutionContext context)
ExecutionListeneronExecutionFailed in interface ExecutionListenerexception - the error encountered.context - the statement execution context.Copyright © 2017–2021 DataStax. All rights reserved.