@Override public List<Option> getOptions() { List<Option> options = super.getOptions(); options.add(repositoryOpt); return options; }
@Override protected void cleanup() { Closer.close(lilyClient); super.cleanup(); }
@Override protected int processOptions(CommandLine cmd) throws Exception { int result = super.processOptions(cmd); if (result != 0) { return result; } if (cmd.hasOption(repositoryOpt.getLongOpt())) { repositoryName = cmd.getOptionValue(repositoryOpt.getLongOpt()); } else { repositoryName = RepoAndTableUtil.DEFAULT_REPOSITORY; } return 0; }
@Override public int run(CommandLine cmd) throws Exception { int result = super.run(cmd); if (result != 0) { return result; } zk = new StateWatchingZooKeeper(zkConnectionString, zkSessionTimeout); boolean lilyNodeExists = zk.retryOperation(new ZooKeeperOperation<Boolean>() { @Override public Boolean execute() throws KeeperException, InterruptedException { return zk.exists("/lily", false) != null; } }); if (!lilyNodeExists) { if (!cmd.hasOption(forceOption.getOpt())) { System.out.println("No /lily node found in ZooKeeper. Are you sure you are connecting to the right"); System.out.println("ZooKeeper? If so, use the option --" + forceOption.getLongOpt() + " to bypass this check."); return 1; } else { System.out.println("No /lily node found in ZooKeeper. Will continue anyway since you supplied --" + forceOption.getLongOpt()); System.out.println(); } } repositoryModel = new RepositoryModelImpl(zk); return 0; }
@Override public int run(CommandLine cmd) throws Exception { int result = super.run(cmd); if (result != 0) { return result;
@Override public List<Option> getOptions() { List<Option> options = super.getOptions(); options.add(pythonMapperPathArg); options.add(pythonSymbolArg); options.add(repositoryArg); options.add(outputTableArg); options.add(disableBulkOption); return options; }
@Override public int run(CommandLine cmd) throws Exception { int status = super.run(cmd); if (status != 0) { return status; } LilyClient lilyClient = new LilyClient(zkConnectionString, 30000); TableManager tableManager = lilyClient.getRepository(repositoryName).getTableManager(); try { status = execute(tableManager); } finally { lilyClient.close(); } return status; }
@Override protected void cleanup() { Closer.close(repositoryModel); Closer.close(zk); super.cleanup(); } }
@Override protected int processOptions(CommandLine cmd) throws Exception { int status = super.processOptions(cmd); if (status != 0) { return status;
@Override @SuppressWarnings("static-access") public List<Option> getOptions() { List<Option> options = super.getOptions(); recordIdOption = OptionBuilder .withArgName("record-id") .hasArg() .withDescription("A Lily record ID: UUID.something or USER.something") .withLongOpt("record-id") .create("r"); options.add(recordIdOption); tableOption = OptionBuilder .withArgName("table") .hasArg() .withDescription("Repository table name (defaults to record)") .withLongOpt("table") .create("t"); options.add(tableOption); return options; }
@Override public int run(CommandLine cmd) throws Exception { int result = super.run(cmd); if (result != 0) { return result;
@Override protected void cleanup() { Closer.close(typeMgr); Closer.close(zk); HConnectionManager.deleteAllConnections(true); super.cleanup(); }
@Override @SuppressWarnings("static-access") public List<Option> getOptions() { List<Option> options = super.getOptions();