@Override public void init(String[] args) { try { conf = Configuration.create(); cConf = CConfiguration.create(); cConf.addResource("coopr-default.xml"); cConf.addResource("coopr-site.xml"); securityEnabled = conf.getBoolean(co.cask.cdap.common.conf.Constants.Security.ENABLED); if (securityEnabled) { // Enable Kerberos login SecurityUtil.enableKerberosLogin(cConf); } String zkQuorum = conf.get(Constants.ZOOKEEPER_QUORUM); if (zkQuorum == null) { String dataPath = conf.get(Constants.LOCAL_DATA_DIR) + "/zookeeper"; inMemoryZKServer = InMemoryZKServer.builder().setDataDir(new File(dataPath)).setTickTime(2000).build(); LOG.warn(Constants.ZOOKEEPER_QUORUM + " not specified, defaulting to in memory zookeeper with data dir " + dataPath); } else { zkClientService = getZKService(conf.get(Constants.ZOOKEEPER_QUORUM)); } solverNumThreads = conf.getInt(Constants.SOLVER_NUM_THREADS); } catch (Exception e) { LOG.error("Exception initializing server", e); } }
@BeforeClass public static void setupBase() throws Exception { zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(5000).build(); zkServer.startAndWait();
@Before public void before() throws IOException { zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(30000).build(); zkServer.startAndWait(); zkClient = ZKClientService.Builder.of(zkServer.getConnectionStr()).build(); zkClient.startAndWait(); Injector injector = Guice.createInjector( new ZookeeperModule(zkClient), new QueueModule(zkClient) ); zkQueueGroupService = injector.getInstance(ZKQueueService.class); zkQueueGroupService.startAndWait(); }
@Before public void before() throws IOException { zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(1000).build(); zkServer.startAndWait(); zkClient = ZKClientService.Builder.of(zkServer.getConnectionStr()).build(); zkClient.startAndWait(); }
@Before public void before() throws IOException { zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(1000).build(); zkServer.startAndWait(); zkClient = ZKClientService.Builder.of(zkServer.getConnectionStr()).build(); zkClient.startAndWait(); }
@BeforeClass public static void beforeClass() throws SQLException, ClassNotFoundException, IOException { zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(1000).build(); zkServer.startAndWait(); zkClient = ZKClientService.Builder.of(zkServer.getConnectionStr()).build(); zkClient.startAndWait(); }