当前位置: 首页>>代码示例>>Java>>正文


Java ImplType类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType的典型用法代码示例。如果您正苦于以下问题:Java ImplType类的具体用法?Java ImplType怎么用?Java ImplType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ImplType类属于org.apache.hadoop.hbase.thrift.ThriftServerRunner包,在下文中一共展示了ImplType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParameters

import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> getParameters() {
  Collection<Object[]> parameters = new ArrayList<Object[]>();
  for (ImplType implType : ImplType.values()) {
    for (boolean specifyFramed : new boolean[] {false, true}) {
      for (boolean specifyBindIP : new boolean[] {false, true}) {
        if (specifyBindIP && !implType.canSpecifyBindIP) {
          continue;
        }
        for (boolean specifyCompact : new boolean[] {false, true}) {
          parameters.add(new Object[]{implType, specifyFramed,
              specifyBindIP, specifyCompact});
        }
      }
    }
  }
  return parameters;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:TestThriftServerCmdLine.java

示例2: getParameters

import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> getParameters() {
  Collection<Object[]> parameters = new ArrayList<Object[]>();
  for (ImplType implType : ImplType.values()) {
    for (boolean specifyFramed : new boolean[] {false, true}) {
      for (boolean specifyBindIP : new boolean[] {false, true}) {
        if (specifyBindIP && !implType.canSpecifyBindIP) {
          continue;
        }
        for (boolean specifyCompact : new boolean[] {false, true}) {
          parameters.add(new Object[]{implType, new Boolean(specifyFramed),
              new Boolean(specifyBindIP), new Boolean(specifyCompact)});
        }
      }
    }
  }
  return parameters;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:19,代码来源:TestThriftServerCmdLine.java

示例3: getParameters

import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> getParameters() {
  Collection<Object[]> parameters = new ArrayList<>();
  for (ImplType implType : ImplType.values()) {
    for (boolean specifyFramed : new boolean[] {false, true}) {
      for (boolean specifyBindIP : new boolean[] {false, true}) {
        if (specifyBindIP && !implType.canSpecifyBindIP) {
          continue;
        }
        for (boolean specifyCompact : new boolean[] {false, true}) {
          parameters.add(new Object[] {
            implType, specifyFramed, specifyBindIP, specifyCompact
          });
        }
      }
    }
  }
  return parameters;
}
 
开发者ID:apache,项目名称:hbase,代码行数:20,代码来源:TestThriftServerCmdLine.java

示例4: TestThriftServerCmdLine

import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; //导入依赖的package包/类
public TestThriftServerCmdLine(ImplType implType, boolean specifyFramed,
    boolean specifyBindIP, boolean specifyCompact) {
  this.implType = implType;
  this.specifyFramed = specifyFramed;
  this.specifyBindIP = specifyBindIP;
  this.specifyCompact = specifyCompact;
  LOG.debug(getParametersString());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TestThriftServerCmdLine.java

示例5: TestThriftServerCmdLine

import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; //导入依赖的package包/类
public TestThriftServerCmdLine(ImplType implType, boolean specifyFramed,
    boolean specifyBindIP, boolean specifyCompact) {
  this.implType = implType;
  this.specifyFramed = specifyFramed;
  this.specifyBindIP = specifyBindIP;
  this.specifyCompact = specifyCompact;
  LOG.debug("implType=" + implType + ", " +
      "specifyFramed=" + specifyFramed + ", " +
      "specifyBindIP=" + specifyBindIP + ", " +
      "specifyCompact=" + specifyCompact);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:12,代码来源:TestThriftServerCmdLine.java

示例6: processOptions

import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType; //导入依赖的package包/类
/**
 * Parse the command line options to set parameters the conf.
 */
private void processOptions(final String[] args) throws Exception {
  Options options = new Options();
  options.addOption("b", BIND_OPTION, true, "Address to bind " +
      "the Thrift server to. [default: " + DEFAULT_BIND_ADDR + "]");
  options.addOption("p", PORT_OPTION, true, "Port to bind to [default: " +
      DEFAULT_LISTEN_PORT + "]");
  options.addOption("f", FRAMED_OPTION, false, "Use framed transport");
  options.addOption("c", COMPACT_OPTION, false, "Use the compact protocol");
  options.addOption("h", "help", false, "Print help information");

  options.addOption("m", MIN_WORKERS_OPTION, true,
      "The minimum number of worker threads for " +
      ImplType.THREAD_POOL.simpleClassName());

  options.addOption("w", MAX_WORKERS_OPTION, true,
      "The maximum number of worker threads for " +
      ImplType.THREAD_POOL.simpleClassName());

  options.addOption("q", MAX_QUEUE_SIZE_OPTION, true,
      "The maximum number of queued requests in " +
      ImplType.THREAD_POOL.simpleClassName());

  options.addOption("k", KEEP_ALIVE_SEC_OPTION, true,
      "The amount of time in secods to keep a thread alive when idle in " +
      ImplType.THREAD_POOL.simpleClassName());

  options.addOptionGroup(ImplType.createOptionGroup());

  CommandLineParser parser = new PosixParser();
  CommandLine cmd = parser.parse(options, args);

  // This is so complicated to please both bin/hbase and bin/hbase-daemon.
  // hbase-daemon provides "start" and "stop" arguments
  // hbase should print the help if no argument is provided
  List<String> commandLine = Arrays.asList(args);
  boolean stop = commandLine.contains("stop");
  boolean start = commandLine.contains("start");
  boolean invalidStartStop = (start && stop) || (!start && !stop);
  if (cmd.hasOption("help") || invalidStartStop) {
    if (invalidStartStop) {
      LOG.error("Exactly one of 'start' and 'stop' has to be specified");
    }
    printUsageAndExit(options, 1);
  }

  // Get port to bind to
  try {
    int listenPort = Integer.parseInt(cmd.getOptionValue(PORT_OPTION,
        String.valueOf(DEFAULT_LISTEN_PORT)));
    conf.setInt(ThriftServerRunner.PORT_CONF_KEY, listenPort);
  } catch (NumberFormatException e) {
    LOG.error("Could not parse the value provided for the port option", e);
    printUsageAndExit(options, -1);
  }

  // Make optional changes to the configuration based on command-line options
  optionToConf(cmd, MIN_WORKERS_OPTION,
      conf, TBoundedThreadPoolServer.MIN_WORKER_THREADS_CONF_KEY);
  optionToConf(cmd, MAX_WORKERS_OPTION,
      conf, TBoundedThreadPoolServer.MAX_WORKER_THREADS_CONF_KEY);
  optionToConf(cmd, MAX_QUEUE_SIZE_OPTION,
      conf, TBoundedThreadPoolServer.MAX_QUEUED_REQUESTS_CONF_KEY);
  optionToConf(cmd, KEEP_ALIVE_SEC_OPTION,
      conf, TBoundedThreadPoolServer.THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY);

  // Set general thrift server options
  conf.setBoolean(
      ThriftServerRunner.COMPACT_CONF_KEY, cmd.hasOption(COMPACT_OPTION));
  conf.setBoolean(
      ThriftServerRunner.FRAMED_CONF_KEY, cmd.hasOption(FRAMED_OPTION));
  if (cmd.hasOption(BIND_OPTION)) {
    conf.set(
        ThriftServerRunner.BIND_CONF_KEY, cmd.getOptionValue(BIND_OPTION));
  }

  ImplType.setServerImpl(cmd, conf);
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:81,代码来源:ThriftServer.java


注:本文中的org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。