You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/04/09 08:00:27 UTC
[jira] [Created] (PHOENIX-1832) Move TransactionService setup code
into ConnectionQueryServicesTestImpl and/or BaseTest
James Taylor created PHOENIX-1832:
-------------------------------------
Summary: Move TransactionService setup code into ConnectionQueryServicesTestImpl and/or BaseTest
Key: PHOENIX-1832
URL: https://issues.apache.org/jira/browse/PHOENIX-1832
Project: Phoenix
Issue Type: Sub-task
Reporter: James Taylor
Assignee: Thomas D'Silva
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)
{code}
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();
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)