Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
We should move the setup code from TransactionIT into ConnectionQueryServicesTestImpl (or BaseTest) and the properties being set into BaseTest so that other tests can test transactions as well (see TxGlobalMutableIndexIT which is trying to test mutable indexes on transactional tables)
public class TransactionIT extends BaseHBaseManagedTimeIT { @BeforeClass public static void setupBeforeClass() throws Exception { config.setBoolean(TxConstants.Manager.CFG_DO_PERSIST, false); // config.set(TxConstants.Service.CFG_DATA_TX_ZOOKEEPER_QUORUM, ConnectionInfo.getZookeeperConnectionString(getUrl())); config.set(TxConstants.Service.CFG_DATA_TX_CLIENT_RETRY_STRATEGY, "n-times"); config.setInt(TxConstants.Service.CFG_DATA_TX_CLIENT_ATTEMPTS, 1); ConnectionInfo connInfo = ConnectionInfo.create(getUrl()); 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); final TransactionManager txManager = new TransactionManager(config, new InMemoryTransactionStateStorage(), new TxMetricsCollector()); TransactionService txService = new TransactionService(config, zkClient, discovery, txManager); txService.startAndWait(); }