/** * See {@link Services#startAndWait(Service, long, TimeUnit, String)} */ public static void startAndWait(Service service, long timeout, TimeUnit timeoutUnit) throws TimeoutException, InterruptedException, ExecutionException { startAndWait(service, timeout, timeoutUnit, null); } }
/** * See {@link Services#startAndWait(Service, long, TimeUnit, String)} */ public static void startAndWait(Service service, long timeout, TimeUnit timeoutUnit) throws TimeoutException, InterruptedException, ExecutionException { startAndWait(service, timeout, timeoutUnit, null); } }
@Override public void start() throws Exception { LOG.info("Starting Router..."); co.cask.cdap.common.service.Services.startAndWait(zkClientService, cConf.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS), TimeUnit.MILLISECONDS, String.format("Connection timed out while trying to start " + "ZooKeeper client. Please verify that the " + "ZooKeeper quorum settings are correct in " + "cdap-site.xml. Currently configured as: %s", cConf.get(Constants.Zookeeper.QUORUM))); router.startAndWait(); LOG.info("Router started."); }
co.cask.cdap.common.service.Services.startAndWait(zkClientService, configuration.getLong( Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS),
/** * Do the start up work * Note: includeNewDatasets boolean is required because upgrade tool has two mode: 1. Normal CDAP upgrade and * 2. Upgrading co processor for tables after hbase upgrade. This parameter specifies whether new system dataset * which were added in the current release needs to be added in the dataset framework or not. * During Normal CDAP upgrade (1) we don't need these datasets to be added in the ds framework as they will get * created during upgrade rather than when cdap starts after upgrade which is what we want. * Whereas during Hbase upgrade (2) we want these new tables to be added so that the co processor of these tables * can be upgraded when the user runs CDAP's Hbase Upgrade after upgrading to a newer version of Hbase. * @param includeNewDatasets boolean which specifies whether to add new datasets in ds framework or not */ private void startUp(boolean includeNewDatasets) throws Exception { // Start all the services. LOG.info("Starting Zookeeper Client..."); Services.startAndWait(zkClientService, cConf.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS), TimeUnit.MILLISECONDS, String.format("Connection timed out while trying to start ZooKeeper client. Please " + "verify that the ZooKeeper quorum settings are correct in cdap-site.xml. " + "Currently configured as: %s", cConf.get(Constants.Zookeeper.QUORUM))); LOG.info("Starting Transaction Service..."); txService.startAndWait(); LOG.info("Initializing Dataset Framework..."); initializeDSFramework(cConf, dsFramework, includeNewDatasets); LOG.info("Building and uploading new HBase coprocessors..."); coprocessorManager.ensureCoprocessorExists(); }
ZKClientService client = ZKClientService.Builder.of(zkConnectStr).build(); try { Services.startAndWait(client, cConf.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS), TimeUnit.MILLISECONDS, String.format("Connection timed out while trying to start ZooKeeper client. Please " +
ZKClientService client = ZKClientService.Builder.of(zkConnectStr).build(); try { Services.startAndWait(client, cConf.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS), TimeUnit.MILLISECONDS, String.format("Connection timed out while trying to start ZooKeeper client. Please " +
@Override public void start() throws Exception { logAppenderInitializer.initialize(); resetShutdownTime(); createDirectory("twill"); createSystemHBaseNamespace(); updateConfigurationTable(); Services.startAndWait(zkClient, cConf.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS), TimeUnit.MILLISECONDS, String.format("Connection timed out while trying to start ZooKeeper client. Please " + "verify that the ZooKeeper quorum settings are correct in cdap-site.xml. " + "Currently configured as: %s", cConf.get(Constants.Zookeeper.QUORUM))); // Tries to create the ZK root node (which can be namespaced through the zk connection string) Futures.getUnchecked(ZKOperations.ignoreError(zkClient.create("/", null, CreateMode.PERSISTENT), KeeperException.NodeExistsException.class, null)); electionInfoService.startAndWait(); leaderElection.startAndWait(); }