All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.stargate.grpc.service.streaming.StreamingBatchHandlerFactory Maven / Gradle / Ivy

There is a newer version: 2.1.0-BETA-19
Show newest version
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