io.stargate.grpc.service.streaming.StreamingBatchHandlerFactory Maven / Gradle / Ivy
package io.stargate.grpc.service.streaming;
import io.stargate.db.Persistence;
import io.stargate.grpc.service.ExceptionHandler;
import io.stargate.grpc.service.MessageHandler;
import io.stargate.grpc.service.StreamingSuccessHandler;
import io.stargate.proto.QueryOuterClass;
/** Constructs the {@link StreamingBatchHandler}. */
public class StreamingBatchHandlerFactory
implements StreamingHandlerFactory {
private final Persistence.Connection connection;
private final Persistence persistence;
public StreamingBatchHandlerFactory(Persistence.Connection connection, Persistence persistence) {
this.connection = connection;
this.persistence = persistence;
}
@Override
public MessageHandler create(
QueryOuterClass.Batch batch,
StreamingSuccessHandler streamingSuccessHandler,
ExceptionHandler exceptionHandler) {
return new StreamingBatchHandler(
batch, connection, persistence, streamingSuccessHandler, exceptionHandler);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy