Search in sources :

Example 1 with Padding

use of io.pravega.shared.protocol.netty.WireCommands.Padding in project pravega by pravega.

the class CommandEncoder method breakFromAppend.

private void breakFromAppend(ByteBuf out) {
    if (bytesLeftInBlock != 0) {
        writeMessage(new Padding(bytesLeftInBlock - TYPE_PLUS_LENGTH_SIZE), out);
        Session session = setupSegments.get(segmentBeingAppendedTo);
        writeMessage(new AppendBlockEnd(session.id, currentBlockSize - bytesLeftInBlock, null, session.eventCount, session.lastEventNumber, 0L), out);
        bytesLeftInBlock = 0;
        currentBlockSize = 0;
        session.eventCount = 0;
    }
    segmentBeingAppendedTo = null;
}
Also used : AppendBlockEnd(io.pravega.shared.protocol.netty.WireCommands.AppendBlockEnd) Padding(io.pravega.shared.protocol.netty.WireCommands.Padding)

Aggregations

AppendBlockEnd (io.pravega.shared.protocol.netty.WireCommands.AppendBlockEnd)1 Padding (io.pravega.shared.protocol.netty.WireCommands.Padding)1