org.opensearch.migrations.replay.datahandlers.TransformedPacketReceiver Maven / Gradle / Ivy
package org.opensearch.migrations.replay.datahandlers;
import org.opensearch.migrations.replay.datatypes.ByteBufList;
import org.opensearch.migrations.replay.util.TrackedFuture;
import io.netty.buffer.ByteBuf;
public class TransformedPacketReceiver implements IPacketFinalizingConsumer {
public final ByteBufList packets = new ByteBufList();
@Override
public TrackedFuture consumeBytes(ByteBuf nextRequestPacket) {
packets.add(nextRequestPacket);
return TrackedFuture.Factory.completedFuture(null, () -> "TransformedPacketReceiver.consume...");
}
@Override
public TrackedFuture finalizeRequest() {
return TrackedFuture.Factory.completedFuture(packets, () -> "TransformedPacketReceiver.finalize...");
}
}