Search in sources :

Example 1 with PooledClientProvider

use of org.apache.tephra.distributed.PooledClientProvider in project phoenix by apache.

the class ConnectionQueryServicesImpl method initTxServiceClient.

private void initTxServiceClient() {
    String zkQuorumServersString = this.getProps().get(TxConstants.Service.CFG_DATA_TX_ZOOKEEPER_QUORUM);
    if (zkQuorumServersString == null) {
        zkQuorumServersString = connectionInfo.getZookeeperQuorum() + ":" + connectionInfo.getPort();
    }
    int timeOut = props.getInt(HConstants.ZK_SESSION_TIMEOUT, HConstants.DEFAULT_ZK_SESSION_TIMEOUT);
    // Create instance of the tephra zookeeper client
    txZKClientService = ZKClientServices.delegate(ZKClients.reWatchOnExpire(ZKClients.retryOnFailure(new TephraZKClientService(zkQuorumServersString, timeOut, null, ArrayListMultimap.<String, byte[]>create()), RetryStrategies.exponentialDelay(500, 2000, TimeUnit.MILLISECONDS))));
    txZKClientService.startAndWait();
    ZKDiscoveryService zkDiscoveryService = new ZKDiscoveryService(txZKClientService);
    PooledClientProvider pooledClientProvider = new PooledClientProvider(config, zkDiscoveryService);
    this.txServiceClient = new TransactionServiceClient(config, pooledClientProvider);
}
Also used : ZKDiscoveryService(org.apache.twill.discovery.ZKDiscoveryService) PTinyint(org.apache.phoenix.schema.types.PTinyint) PUnsignedTinyint(org.apache.phoenix.schema.types.PUnsignedTinyint) MultiRowMutationEndpoint(org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint) TephraZKClientService(org.apache.tephra.zookeeper.TephraZKClientService) PooledClientProvider(org.apache.tephra.distributed.PooledClientProvider) TransactionServiceClient(org.apache.tephra.distributed.TransactionServiceClient)

Aggregations

MultiRowMutationEndpoint (org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint)1 PTinyint (org.apache.phoenix.schema.types.PTinyint)1 PUnsignedTinyint (org.apache.phoenix.schema.types.PUnsignedTinyint)1 PooledClientProvider (org.apache.tephra.distributed.PooledClientProvider)1 TransactionServiceClient (org.apache.tephra.distributed.TransactionServiceClient)1 TephraZKClientService (org.apache.tephra.zookeeper.TephraZKClientService)1 ZKDiscoveryService (org.apache.twill.discovery.ZKDiscoveryService)1