@Override public PhoenixTransactionClient getTransactionClient(Configuration config, ConnectionInfo connectionInfo) { if (connectionInfo.isConnectionless()) { TransactionManager txnManager = new TransactionManager(config); TransactionSystemClient txClient = new InMemoryTxSystemClient(txnManager); return new TephraTransactionClient(txClient);
@Override public PhoenixTransactionService getTransactionService(Configuration config, ConnectionInfo connInfo, int port) { config.setInt(TxConstants.Service.CFG_DATA_TX_BIND_PORT, port); int retryTimeOut = config.getInt(TxConstants.Service.CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC, TxConstants.Service.DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC); ZKClientService zkClient = ZKClientServices.delegate( ZKClients.reWatchOnExpire( ZKClients.retryOnFailure( ZKClientService.Builder.of(connInfo.getZookeeperConnectionString()) .setSessionTimeout(config.getInt(HConstants.ZK_SESSION_TIMEOUT, HConstants.DEFAULT_ZK_SESSION_TIMEOUT)) .build(), RetryStrategies.exponentialDelay(500, retryTimeOut, TimeUnit.MILLISECONDS) ) ) ); DiscoveryService discovery = new ZKDiscoveryService(zkClient); TransactionManager txManager = new TransactionManager(config, new HDFSTransactionStateStorage(config, new SnapshotCodecProvider(config), new TxMetricsCollector()), new TxMetricsCollector()); TransactionService txService = new TransactionService(config, zkClient, discovery, Providers.of(txManager)); TephraTransactionService service = new TephraTransactionService(zkClient, txService); service.start(); return service; }
@BeforeClass public static void setup() { txManager = new TransactionManager(new Configuration()); txManager.startAndWait(); txClient = new DummyTxClient(txManager); }
this.transactionManager = new TransactionManager();
@Before public void before() { Configuration txConf = HBaseConfiguration.create(); TransactionManager txManager = new TransactionManager(txConf); txManager.startAndWait(); txClient = new InMemoryTxSystemClient(txManager); }
@Override public PhoenixTransactionClient getTransactionClient(Configuration config, ConnectionInfo connectionInfo) { if (connectionInfo.isConnectionless()) { TransactionManager txnManager = new TransactionManager(config); TransactionSystemClient txClient = new InMemoryTxSystemClient(txnManager); return new TephraTransactionClient(txClient);
@Override public PhoenixTransactionClient getTransactionClient(Configuration config, ConnectionInfo connectionInfo) { if (connectionInfo.isConnectionless()) { TransactionManager txnManager = new TransactionManager(config); TransactionSystemClient txClient = new InMemoryTxSystemClient(txnManager); return new TephraTransactionClient(txClient);
@BeforeClass public static void beforeClass() throws DatasetManagementException, IOException { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath()); txManager = new TransactionManager(new Configuration()); txManager.startAndWait(); Injector injector = Guice.createInjector( new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new AbstractModule() { @Override protected void configure() { bind(DatasetDefinitionRegistryFactory.class) .to(DefaultDatasetDefinitionRegistryFactory.class).in(Scopes.SINGLETON); bind(DatasetFramework.class).to(InMemoryDatasetFramework.class); bind(NamespaceQueryAdmin.class).to(InMemoryNamespaceAdmin.class).in(Scopes.SINGLETON); } } ); datasetFramework = injector.getInstance(DatasetFramework.class); }
@BeforeClass public static void beforeClass() { Configuration txConf = HBaseConfiguration.create(); txManager = new TransactionManager(txConf); txManager.startAndWait(); TransactionSystemClient txClient = new InMemoryTxSystemClient(txManager); noSqlTableAdmin = new NoSqlStructuredTableAdmin(dsFrameworkUtil.getFramework()); transactionRunner = new NoSqlTransactionRunner(dsFrameworkUtil.getFramework(), new TransactionSystemClientAdapter(txClient)); }
@Override public PhoenixTransactionService getTransactionService(Configuration config, ConnectionInfo connInfo, int port) { config.setInt(TxConstants.Service.CFG_DATA_TX_BIND_PORT, port); int retryTimeOut = config.getInt(TxConstants.Service.CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC, TxConstants.Service.DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC); ZKClientService zkClient = ZKClientServices.delegate( ZKClients.reWatchOnExpire( ZKClients.retryOnFailure( ZKClientService.Builder.of(connInfo.getZookeeperConnectionString()) .setSessionTimeout(config.getInt(HConstants.ZK_SESSION_TIMEOUT, HConstants.DEFAULT_ZK_SESSION_TIMEOUT)) .build(), RetryStrategies.exponentialDelay(500, retryTimeOut, TimeUnit.MILLISECONDS) ) ) ); DiscoveryService discovery = new ZKDiscoveryService(zkClient); TransactionManager txManager = new TransactionManager(config, new HDFSTransactionStateStorage(config, new SnapshotCodecProvider(config), new TxMetricsCollector()), new TxMetricsCollector()); TransactionService txService = new TransactionService(config, zkClient, discovery, Providers.of(txManager)); TephraTransactionService service = new TephraTransactionService(zkClient, txService); service.start(); return service; }
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath()); txManager = new TransactionManager(new Configuration()); txManager.startAndWait();
@Override public PhoenixTransactionService getTransactionService(Configuration config, ConnectionInfo connInfo) { ZKClientService zkClient = ZKClientServices.delegate( ZKClients.reWatchOnExpire( ZKClients.retryOnFailure( ZKClientService.Builder.of(connInfo.getZookeeperConnectionString()) .setSessionTimeout(config.getInt(HConstants.ZK_SESSION_TIMEOUT, HConstants.DEFAULT_ZK_SESSION_TIMEOUT)) .build(), RetryStrategies.exponentialDelay(500, 2000, TimeUnit.MILLISECONDS) ) ) ); //zkClient.startAndWait(); DiscoveryService discovery = new ZKDiscoveryService(zkClient); TransactionManager txManager = new TransactionManager(config, new HDFSTransactionStateStorage(config, new SnapshotCodecProvider(config), new TxMetricsCollector()), new TxMetricsCollector()); TransactionService txService = new TransactionService(config, zkClient, discovery, Providers.of(txManager)); TephraTransactionService service = new TephraTransactionService(zkClient, txService); //txService.startAndWait(); service.start(); return service; }
TransactionManager txManager = new TransactionManager(txConf); txManager.startAndWait(); try {
txManager = new TransactionManager(txConf); txManager.startAndWait(); InMemoryTxSystemClient txSystemClient = new InMemoryTxSystemClient(txManager);