io.airlift.command.Option.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(14.2k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中io.airlift.command.Option.<init>()方法的一些代码示例,展示了Option.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Option.<init>()方法的具体详情如下:
包路径:io.airlift.command.Option
类名称:Option
方法名:<init>

Option.<init>介绍

暂无

代码示例

代码示例来源:origin: facebookarchive/hive-io-experimental

/**
 * Options for table
 */
public class TableOptions {
 // CHECKSTYLE: stop VisibilityModifier
 /** Database name */
 @Option(name = "--database", description = "Database to use")
 public String database = Defaults.DATABASE;

 /** Table name */
 @Option(name = { "-t", "--table" }, description = "Table to read from")
 public String table;
 // CHECKSTYLE: resume VisibilityModifier
}

代码示例来源:origin: com.atlassian.sdk/ap3-api

/**
 * @since version
 */
public abstract class AbstractProductStartCommand extends AbstractStartCommand
{
  @Option(name = {"-v", "--version"}, title = "Version", description = "The product version to use")
  protected String version = "";

  @Option(name = {"-ch", "--clean-home"}, title = "Clean Home", description = "TCleans the product home directory")
  protected boolean cleanHome = false;

  @Option(name = {"-pdv", "--product-data-version"}, title = "Product Data Version", description = "The product data version to use")
  protected String dataVersion = "";

  @Option(name = {"-pdp", "--product-data-path"}, title = "Product Data Path", description = "A path to a product home zip file to use")
  protected String dataPath = "";
}

代码示例来源:origin: facebookarchive/hive-io-experimental

/**
 * Options for SOCKS proxy
 */
public class SocksProxyOptions {
 // CHECKSTYLE: stop VisibilityModifier
 /** Host */
 @Option(name = "--socks-proxy-host", hidden = true)
 public String host = "localhost";

 /** Port */
 @Option(name = "--socks-proxy-port", hidden = true)
 public int port = -1;
 // CHECKSTYLE: resume VisibilityModifier
}

代码示例来源:origin: facebookarchive/hive-io-experimental

/**
 * Options for multi-threaded
 */
public class MultiThreadOptions {
 // CHECKSTYLE: stop VisibilityModifier
 /** Number of threads to use */
 @Option(name = "--threads", description = "Number of threads to use")
 public int threads = 1;
 // CHECKSTYLE: resume VisibilityModifier

 public boolean isMultiThreaded() {
  return threads > 1;
 }

 public boolean isSingleThreaded() {
  return threads == 1;
 }
}

代码示例来源:origin: facebookarchive/hive-io-experimental

/**
 * Options for parser
 */
public class ParserOptions {
 // CHECKSTYLE: stop VisibilityModifier
 /** Parse only, don't print */
 @Option(name = { "--parse-only", "--dont-print" },
   description = "Don't print, just measure performance")
 public boolean parseOnly = false;

 /** Name of Java bean parser */
 @Option(name = "--bean-parser", description = "Use bean parser")
 public boolean beanParser = false;

 /** Name of row class */
 @Option(name = "--row-class", description = "class which represents a row")
 public String rowClassName = IdIdSimRow.class.getName();
 // CHECKSTYLE: stop VisibilityModifier
}

代码示例来源:origin: io.airlift.airship/airship-cli

public class GlobalOptions
{
  @Option(type = GLOBAL, name = {"-e", "--environment"}, description = "Airship environment")
  public String environment;

  @Option(type = GLOBAL, name = "--batch", description = "Do not prompt")
  public boolean batch;

  @Option(type = GLOBAL, name = "--debug", description = "Enable debug messages")
  public boolean debug = false;

  @Override
  public String toString()
  {
    final StringBuilder sb = new StringBuilder();
    sb.append("GlobalOptions");
    sb.append("{environment=").append(environment);
    sb.append(", batch=").append(batch);
    sb.append(", debug=").append(debug);
    sb.append('}');
    return sb.toString();
  }
}

代码示例来源:origin: prezi/pride

public abstract class AbstractConfiguredCommand extends AbstractCommand {
  @Option(name = "--gradle-version",
      title = "version",
      description = "Use specified Gradle version (can be a version number, a URL of a distribution, or a location of an installation)")
  private String explicitGradleVersion;

  @Option(name = "--gradle-home",
      title = "directory",
      description = "Use specified Gradle home")
  private String explicitGradleHome;

  @Override
  final public Integer call() throws Exception {
    PropertiesConfiguration globalConfiguration = loadGlobalConfiguration();
    RuntimeConfiguration config = DefaultRuntimeConfiguration.create(globalConfiguration);

    config.override(GRADLE_VERSION, explicitGradleVersion);
    config.override(GRADLE_HOME, explicitGradleHome);

    executeWithConfiguration(config);
    return 0;
  }

  abstract protected void executeWithConfiguration(RuntimeConfiguration config) throws Exception;
}

代码示例来源:origin: com.atlassian.sdk/ap3-api

public class GlobalOptions
{
  @Option(type = GLOBAL, name = {"-o", "--offline"}, description = "Offline mode")
  private boolean offline = false;

  @Option(type = GLOBAL, name = {"-u", "--update"}, description = "Force update of the AP3 SDK")
  private boolean update = false;

  @Option(type = GLOBAL, name = {"-ud", "--update-develop"}, hidden = true)
  private boolean updateDevelop = false;

  public boolean isOffline()
  {
    return offline;
  }

  public boolean doUpdate()
  {
    return update;
  }

  public boolean doUpdateDevelop()
  {
    return updateDevelop;
  }
}

代码示例来源:origin: facebookarchive/hive-io-experimental

/**
 * Options for output table
 */
public class OutputTableOptions extends TableOptions {
 // CHECKSTYLE: stop VisibilityModifier
 /** Is the table partitioned */
 @Option(name = "--partitioned", description = "Write to a table partitioned by ds")
 public boolean partitioned = false;
  // CHECKSTYLE: stop VisibilityModifier

 /** Constructor */
 public OutputTableOptions() {
  table = "hiveio_output_test";
 }

 /** Process options */
 public void process() {
  if (partitioned) {
   table = "hiveio_output_test_partitioned";
  }
 }
}

代码示例来源:origin: jsevellec/cassandra-unit

@Command(name = "compactionhistory", description = "Print history of compaction")
public class CompactionHistory extends NodeToolCmd
{
  @Option(title = "format",
      name = {"-F", "--format"},
      description = "Output format (json, yaml)")
  private String outputFormat = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
    {
      throw new IllegalArgumentException("arguments for -F are json,yaml only.");
    }
    StatsHolder data = new CompactionHistoryHolder(probe);
    StatsPrinter printer = CompactionHistoryPrinter.from(outputFormat);
    printer.print(data, System.out);
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Command(name = "tpstats", description = "Print usage statistics of thread pools")
public class TpStats extends NodeToolCmd
{
  @Option(title = "format",
      name = {"-F", "--format"},
      description = "Output format (json, yaml)")
  private String outputFormat = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
    {
      throw new IllegalArgumentException("arguments for -F are json,yaml only.");
    }

    StatsHolder data = new TpStatsHolder(probe);
    StatsPrinter printer = TpStatsPrinter.from(outputFormat);
    printer.print(data, System.out);
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

@Command(name = "tpstats", description = "Print usage statistics of thread pools")
public class TpStats extends NodeToolCmd
{
  @Option(title = "format",
      name = {"-F", "--format"},
      description = "Output format (json, yaml)")
  private String outputFormat = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
    {
      throw new IllegalArgumentException("arguments for -F are json,yaml only.");
    }

    StatsHolder data = new TpStatsHolder(probe);
    StatsPrinter printer = TpStatsPrinter.from(outputFormat);
    printer.print(data, System.out);
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Command(name = "compactionhistory", description = "Print history of compaction")
public class CompactionHistory extends NodeToolCmd
{
  @Option(title = "format",
      name = {"-F", "--format"},
      description = "Output format (json, yaml)")
  private String outputFormat = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
    {
      throw new IllegalArgumentException("arguments for -F are json,yaml only.");
    }
    StatsHolder data = new CompactionHistoryHolder(probe);
    StatsPrinter printer = CompactionHistoryPrinter.from(outputFormat);
    printer.print(data, System.out);
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Command(name = "compactionhistory", description = "Print history of compaction")
public class CompactionHistory extends NodeToolCmd
{
  @Option(title = "format",
      name = {"-F", "--format"},
      description = "Output format (json, yaml)")
  private String outputFormat = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
    {
      throw new IllegalArgumentException("arguments for -F are json,yaml only.");
    }
    StatsHolder data = new CompactionHistoryHolder(probe);
    StatsPrinter printer = CompactionHistoryPrinter.from(outputFormat);
    printer.print(data, System.out);
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Command(name = "tpstats", description = "Print usage statistics of thread pools")
public class TpStats extends NodeToolCmd
{
  @Option(title = "format",
      name = {"-F", "--format"},
      description = "Output format (json, yaml)")
  private String outputFormat = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
    {
      throw new IllegalArgumentException("arguments for -F are json,yaml only.");
    }

    StatsHolder data = new TpStatsHolder(probe);
    StatsPrinter printer = TpStatsPrinter.from(outputFormat);
    printer.print(data, System.out);
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Command(name = "rebuild_index", description = "A full rebuild of native secondary indexes for a given table")
public class RebuildIndex extends NodeToolCmd
{
  @Option(name = "--threads", description = "Number of indexing threads (default = 1)")
  public int indexingThreads = 1;
  
  @Arguments(usage = "<keyspace> <table> <indexName...>", description = "The keyspace and table name followed by a list of index names")
  List<String> args = new ArrayList<>();

  @Override
  public void execute(NodeProbe probe)
  {
    checkArgument(args.size() >= 3, "rebuild_index requires ks, cf and idx args");
    probe.rebuildIndex(indexingThreads, args.get(0), args.get(1), toArray(args.subList(2, args.size()), String.class));
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Command(name = "stop", description = "Stop compaction")
public class Stop extends NodeToolCmd
{
  @Arguments(title = "compaction_type",
       usage = "<compaction type>",
       description = "Supported types are COMPACTION, VALIDATION, CLEANUP, SCRUB, VERIFY, INDEX_BUILD",
       required = false)
  private OperationType compactionType = OperationType.UNKNOWN;

  @Option(title = "compactionId",
      name = {"-id", "--compaction-id"},
      description = "Use -id to stop a compaction by the specified id. Ids can be found in the transaction log files whose name starts with compaction_, located in the table transactions folder.",
      required = false)
  private String compactionId = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!compactionId.isEmpty())
      probe.stopById(compactionId);
    else
      probe.stop(compactionType.name());
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

@Command(name = "getsstables", description = "Print the sstable filenames that own the key")
public class GetSSTables extends NodeToolCmd
{
  @Option(title = "hex_format",
      name = {"-hf", "--hex-format"},
      description = "Specify the key in hexadecimal string format")
  private boolean hexFormat = false;

  @Arguments(usage = "<keyspace> <cfname> <key>", description = "The keyspace, the column family, and the key")
  private List<String> args = new ArrayList<>();

  @Override
  public void execute(NodeProbe probe)
  {
    checkArgument(args.size() == 3, "getsstables requires ks, cf and key args");
    String ks = args.get(0);
    String cf = args.get(1);
    String key = args.get(2);

    List<String> sstables = probe.getSSTables(ks, cf, key, hexFormat);
    for (String sstable : sstables)
    {
      System.out.println(sstable);
    }
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

@Command(name = "stop", description = "Stop compaction")
public class Stop extends NodeToolCmd
{
  @Arguments(title = "compaction_type",
       usage = "<compaction type>",
       description = "Supported types are COMPACTION, VALIDATION, CLEANUP, SCRUB, VERIFY, INDEX_BUILD",
       required = false)
  private OperationType compactionType = OperationType.UNKNOWN;

  @Option(title = "compactionId",
      name = {"-id", "--compaction-id"},
      description = "Use -id to stop a compaction by the specified id. Ids can be found in the transaction log files whose name starts with compaction_, located in the table transactions folder.",
      required = false)
  private String compactionId = "";

  @Override
  public void execute(NodeProbe probe)
  {
    if (!compactionId.isEmpty())
      probe.stopById(compactionId);
    else
      probe.stop(compactionType.name());
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Command(name = "getsstables", description = "Print the sstable filenames that own the key")
public class GetSSTables extends NodeToolCmd
{
  @Option(title = "hex_format",
      name = {"-hf", "--hex-format"},
      description = "Specify the key in hexadecimal string format")
  private boolean hexFormat = false;

  @Arguments(usage = "<keyspace> <cfname> <key>", description = "The keyspace, the column family, and the key")
  private List<String> args = new ArrayList<>();

  @Override
  public void execute(NodeProbe probe)
  {
    checkArgument(args.size() == 3, "getsstables requires ks, cf and key args");
    String ks = args.get(0);
    String cf = args.get(1);
    String key = args.get(2);

    List<String> sstables = probe.getSSTables(ks, cf, key, hexFormat);
    for (String sstable : sstables)
    {
      System.out.println(sstable);
    }
  }
}

相关文章

Option类方法