You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2015/04/16 01:33:58 UTC

[jira] [Resolved] (PHOENIX-1832) Move TransactionService setup code into ConnectionQueryServicesTestImpl and/or BaseTest

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

Thomas D'Silva resolved PHOENIX-1832.
-------------------------------------
    Resolution: Fixed

> 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)