WireCommands.DeleteSegment request = new WireCommands.DeleteSegment(requestId, qualifiedName, delegationToken); sendRequestAsync(request, replyProcessor, result, clientCF, ModelHelper.encode(uri)); return result;
return t instanceof WireCommands.StreamSegmentInfo && ((WireCommands.StreamSegmentInfo) t).exists(); })); processor.deleteSegment(new WireCommands.DeleteSegment(3, transactionName, "")); order.verify(connection).send(new WireCommands.SegmentDeleted(3, transactionName)); processor.getStreamSegmentInfo(new WireCommands.GetStreamSegmentInfo(4, transactionName, ""));
processor.deleteSegment(new WireCommands.DeleteSegment(6, streamSegmentName, "")); assertFalse(append(streamSegmentName, 4, store));
WireCommands.DeleteSegment request = new WireCommands.DeleteSegment(idGenerator.get(), transactionName, delegationToken); sendRequestAsync(request, replyProcessor, result, clientCF, ModelHelper.encode(uri)); return result;
sendRequestOverNewConnection(new DeleteSegment(idGenerator.get(), transactionName, ""), replyProcessor, result); return result;
DeleteSegment command = new WireCommands.DeleteSegment(idGenerator.get(), name, ""); sendRequestOverNewConnection(command, replyProcessor, result); return getAndHandleExceptions(result, RuntimeException::new);
@Override public void deleteSegment(DeleteSegment deleteSegment) { String segment = deleteSegment.getSegment(); final String operation = "deleteSegment"; if (!verifyToken(segment, deleteSegment.getRequestId(), deleteSegment.getDelegationToken(), operation)) { return; } log.info(deleteSegment.getRequestId(), "Deleting segment {} ", deleteSegment); segmentStore.deleteStreamSegment(segment, TIMEOUT) .thenRun(() -> { connection.send(new SegmentDeleted(deleteSegment.getRequestId(), segment)); dynamicLogger.freezeCounter(nameFromSegment(SEGMENT_WRITE_BYTES, segment)); dynamicLogger.freezeCounter(nameFromSegment(SEGMENT_WRITE_EVENTS, segment)); dynamicLogger.freezeCounter(nameFromSegment(SEGMENT_READ_BYTES, segment)); }) .exceptionally(e -> handleException(deleteSegment.getRequestId(), segment, operation, e)); }
@Test public void testDeleteSegment() throws IOException { testCommand(new WireCommands.DeleteSegment(l, testString1, "")); }
@Test public void deleteSegment() { processor.deleteSegment(new WireCommands.DeleteSegment(100L, "segment", "token")); verify(connection).send(new WireCommands.AuthTokenCheckFailed(100L, "")); }
public static WireCommand readFrom(DataInput in, int length) throws IOException { long requestId = in.readLong(); String segment = in.readUTF(); String delegationToken = in.readUTF(); return new DeleteSegment(requestId, segment, delegationToken); } }