private DefaultRawMemcacheClient()

in folsom/src/main/java/com/spotify/folsom/client/DefaultRawMemcacheClient.java [201:231]


  private DefaultRawMemcacheClient(
      final HostAndPort address,
      final Channel channel,
      final int outstandingRequestLimit,
      final int eventLoopThreadFlushMaxBatchSize,
      final Executor executor,
      final long connectionTimeoutMillis,
      final Metrics metrics,
      int maxSetLength) {
    this.address = address;
    this.executor = executor;
    this.connectionTimeoutMillis = connectionTimeoutMillis;
    this.metrics = metrics;
    this.maxSetLength = maxSetLength;
    this.channel = requireNonNull(channel, "channel");
    this.flusher = new BatchFlusher(channel, eventLoopThreadFlushMaxBatchSize);
    this.outstandingRequestLimit = outstandingRequestLimit;

    // Since we are reusing the pendingCounter to detect disconnects, set the limit to something
    // high.
    // It might be enough to just use outstandingRequestLimit instead, if we can be sure we never
    // decrease it
    // after a disconnect.
    this.pendingCounterLimit = Math.max(Integer.MAX_VALUE / 2, outstandingRequestLimit);

    GLOBAL_CONNECTION_COUNT.incrementAndGet();

    metrics.registerOutstandingRequestsGauge(pendingRequestGauge);

    channel.pipeline().addLast("handler", new ConnectionHandler());
  }