Example #1
0
  public TCPReceiver(
      CollectorConfiguration configuration,
      DispatchHandler dispatchHandler,
      PinpointServerAcceptor serverAcceptor,
      ZookeeperClusterService service) {
    if (configuration == null) {
      throw new NullPointerException("collector configuration must not be null");
    }
    if (dispatchHandler == null) {
      throw new NullPointerException("dispatchHandler must not be null");
    }

    this.dispatchHandler = dispatchHandler;
    this.bindAddress = configuration.getTcpListenIp();
    this.port = configuration.getTcpListenPort();
    this.l4ipList = configuration.getL4IpList();
    this.worker =
        ExecutorFactory.newFixedThreadPool(
            configuration.getTcpWorkerThread(),
            configuration.getTcpWorkerQueueSize(),
            tcpWorkerThreadFactory);

    this.serverAcceptor = serverAcceptor;
    if (service != null && service.isEnable()) {
      this.serverAcceptor.addStateChangeEventHandler(service.getChannelStateChangeEventHandler());
    }
  }
Example #2
0
 public ClusterManager(
     CollectorConfiguration configuration, ClusterPointLocator clusterPointLocator) {
   this.enableCluster = configuration.isClusterEnable();
   this.clusterPointLocator = clusterPointLocator;
 }