phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (PHOENIX-1832) Move TransactionService setup code into ConnectionQueryServicesTestImpl and/or BaseTest
Date Fri, 10 Apr 2015 02:24:12 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-1832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Taylor reassigned PHOENIX-1832:
-------------------------------------

    Assignee: James Taylor  (was: Thomas D'Silva)

> 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: James Taylor
>
> 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)

Mime
View raw message