Init the connection to the Kafka server.
501486
def init(self):
        """"""
        if not self.export_enable:
            return None

        # Build the server URI with host and port
        server_uri = '{}:{}'.format(self.host, self.port)

        try:
            s = KafkaProducer(bootstrap_servers=server_uri,
                              value_serializer=lambda v: json.dumps(v).encode('utf-8'),
                              compression_type=self.compression)
        except Exception as e:
            logger.critical("Cannot connect to Kafka server %s (%s)" % (server_uri, e))
            sys.exit(2)
        else:
            logger.info("Connected to the Kafka server %s" % server_uri)

        return s
283877
def _initialize_connection(api_key, app_key):
    '''
    
    '''
    if api_key is None:
        raise SaltInvocationError('api_key must be specified')
    if app_key is None:
        raise SaltInvocationError('app_key must be specified')
    options = {
        'api_key': api_key,
        'app_key': app_key
    }
    datadog.initialize(**options)
940931
public KafkaQueue<ID, DATA> init() throws Exception {
        if (kafkaClient == null) {
            setKafkaClient(buildKafkaClient(), true);
        }

        super.init();

        if (kafkaClient == null) {
            throw new IllegalStateException("Kafka client is null.");
        }

        return this;
    }
637767
@PostConstruct
    public void init() {
        //init Bus and LifeCycle listeners
        if (bus != null && sendLifecycleEvent ) {
                ServerLifeCycleManager slcm = bus.getExtension(ServerLifeCycleManager.class);
                if (null != slcm) {
                    ServiceListenerImpl svrListener = new ServiceListenerImpl();
                    svrListener.setSendLifecycleEvent(sendLifecycleEvent);
                    svrListener.setQueue(queue);
                    svrListener.setMonitoringServiceClient(monitoringServiceClient);
                    slcm.registerListener(svrListener);
                }

                ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
                if (null != clcm) {
                    ClientListenerImpl cltListener = new ClientListenerImpl();
                    cltListener.setSendLifecycleEvent(sendLifecycleEvent);
                    cltListener.setQueue(queue);
                    cltListener.setMonitoringServiceClient(monitoringServiceClient);
                    clcm.registerListener(cltListener);
                }
        }

        if(executorQueueSize == 0) {
        	executor = Executors.newFixedThreadPool(this.executorPoolSize);
        }else{
            executor = new ThreadPoolExecutor(executorPoolSize, executorPoolSize, 0, TimeUnit.SECONDS, 
            		new LinkedBlockingQueue<Runnable>(executorQueueSize), Executors.defaultThreadFactory(), 
            			new RejectedExecutionHandlerImpl());
        }

        scheduler = new Timer();
        scheduler.scheduleAtFixedRate(new TimerTask() {
            public void run() {
                sendEventsFromQueue();
            }
        }, 0, getDefaultInterval());
    }
1064159
private function init()
    {
        if ($this->encoder === null) {
            // Send the adapter config as JSON payload to the host
            $config = new AdapterConfig(
                $this->codec->getName(),
                $this->getAdapterType(),
                $this->getExtraConfig()
            );
            Codecs::json()->newEncoder($this->output)->useNewlines(false)->encode($config);

            // Set up encoder / decoder for further communication
            $this->decoder = $this->codec->newDecoder($this->input);
            $this->encoder = $this->codec->newEncoder($this->output);
        }
    }
642798
public synchronized void init() {
		for (SocketBinding binding : socketBindings) {
			socketBindingsMap.put(binding.getName(), binding);
		}
		for (SecurityRealm realm : securityRealms) {
			securityRealmsMap.put(realm.getName(), realm);
		}
		for (Interface iface : interfaces) {
			interfacesMap.put(iface.getName(), iface);
		}
		if (subsystem != null) {
			for (UndertowSubsystem.FileHandler handler : subsystem.getFileHandlers()) {
				handlersMap.put(handler.getName(), handler);
			}
			if (subsystem.getFilters() != null) {
				for (UndertowSubsystem.ResponseHeaderFilter filter : subsystem.getFilters().getResponseHeaders()) {
					filtersMap.put(filter.getName(), filter);
				}
				for (UndertowSubsystem.ErrorPageFilter filter : subsystem.getFilters().getErrorPages()) {
					filtersMap.put(filter.getName(), filter);
				}
				for (UndertowSubsystem.CustomFilter filter : subsystem.getFilters().getCustomFilters()) {
					filtersMap.put(filter.getName(), filter);
				}
			}
		}
	}
1249244
void establishConnection () throws IOException {
        synchronized (operationOnConnectionMonitor) {
            if (state == State.CLOSED) {
                throw new IOException("Attempt to establish a connection with a closed connection factory");
            } else if (state == State.CONNECTED) {
                LOGGER.warn("Establishing new connection although a connection is already established");
            }
            try {
                LOGGER.info("Trying to establish connection to {}:{}", getHost(), getPort());
                connection = super.newConnection(executorService);
                connection.addShutdownListener(connectionShutdownListener);
                LOGGER.info("Established connection to {}:{}", getHost(), getPort());
                changeState(State.CONNECTED);
            } catch (IOException e) {
                LOGGER.error("Failed to establish connection to {}:{}", getHost(), getPort());
                throw e;
            }
        }
    }
1338018
public function init()
    {
        if ($this->isEnabled()) {
            $this->asteriskclient = Pool::getInstance($this->config->asteriskclientname->value);
        }
    }
1106831
def init():
    '''  '''
    globals()["sock"] = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    globals()["sockfd"] = globals()["sock"].fileno()
522555
def init(self, db=RDB_DB, host=RDB_HOST, port=RDB_PORT):
        """"""
        self.RDB_HOST = host
        self.RDB_PORT = port
        self.RDB_DB = db

        from .connection import RethinkDB
        self.rdb = RethinkDB()
        self.rdb.init()
629143
private void initPool() {
        if (logger.isWarnEnabled()) {
            logger.warn("Start to initialize connection pool with url: " + url + " ...");
        }

        for (int i = 0; (i < initialSize) && (xpool.size() < initialSize); i++) {
            pool.lock();

            try {
                if (pool.isClosed()) {
                    break;
                }

                if ((i < initialSize) && (xpool.size() < initialSize)) {
                    PoolableConnection poolableConn = newConnection();

                    if (!pool.add(poolableConn)) {
                        detroyConnection(poolableConn);
                    }
                }
            } finally {
                pool.unlock();
            }
        }

        if (logger.isWarnEnabled()) {
            logger.warn("End to initialize connection pool with url: " + url + " ...");
        }
    }
838689
protected function init()
    {
        if ($this->container) {
            return;
        }

        $this->container = new Container();
        $this->connectionPool = new Pool();
        $this->cacheComponent = new CacheComponent();

        $this->container->instance(Pool::class, $this->connectionPool);
        $this->container->instance(CacheComponentInterface::class, $this->cacheComponent);
        Ioc::setContainer($this->container);

        static::$singleton = $this;
    }
1204597
def init(self):
        """"""
        if not self.export_enable:
            return None
        try:
            client = bernhard.Client(host=self.host, port=self.port)
            return client
        except Exception as e:
            logger.critical("Connection to Riemann failed : %s " % e)
            return None
691809
def _initialize(self, request):
        """"""

        # Add node information on the first request dispatched on a stream.
        request.node.MergeFrom(self._node)
        request.resource.MergeFrom(self._resource)
        self._initial_request = request

        self._rpc.open()
        self._initialized = True
744073
private void init() {
        assertUnlocked();
        
        lock.lock();
        try {
            httpSender.init(cfg);

            LOG.info(
                "Starting with "
                    + DEFAULT_REQ_PROC_COUNT + " request processors");

            procThreads = new RequestProcessor[DEFAULT_REQ_PROC_COUNT];

            for (int i = 0; i < procThreads.length; i++) {
                procThreads[i] = new RequestProcessor(i);
                procThreads[i].start();
            }

        } finally {
            lock.unlock();
        }
    }
1135467
def threaded_start(self, no_init=False):
        '''
        
        '''
        thread = Thread(target=self.init_connections, kwargs={
                        'no_init': no_init})
        thread.setDaemon(True)
        thread.start()
        thread.join()
1038880
async def init(self, *args, dialect=None, **kwargs):
        
        self.__pool = await create_pool(*args, dialect=dialect, **kwargs)