use of io.pravega.shared.protocol.netty.WireCommands.SegmentDeleted in project pravega by pravega.
the class PravegaRequestProcessor method deleteTableSegment.
@Override
public void deleteTableSegment(final DeleteTableSegment deleteTableSegment) {
String segment = deleteTableSegment.getSegment();
final String operation = "deleteTableSegment";
if (!verifyToken(segment, deleteTableSegment.getRequestId(), deleteTableSegment.getDelegationToken(), operation)) {
return;
}
log.info(deleteTableSegment.getRequestId(), "Deleting table segment {}.", deleteTableSegment);
val timer = new Timer();
tableStore.deleteSegment(segment, deleteTableSegment.isMustBeEmpty(), TIMEOUT).thenRun(() -> {
connection.send(new SegmentDeleted(deleteTableSegment.getRequestId(), segment));
this.tableStatsRecorder.deleteTableSegment(segment, timer.getElapsed());
}).exceptionally(e -> handleException(deleteTableSegment.getRequestId(), segment, operation, e));
}
Aggregations