Package com.dp.nebula.wormhole.common.interfaces

Examples of com.dp.nebula.wormhole.common.interfaces.IParam


  @Override
  public List<IParam> split(){
    List<IParam> result = new ArrayList<IParam>();
    int concurrency = param.getIntValue(ParamKey.concurrency);
    for (int i = 0; i < concurrency; i++){
      IParam p = param.clone();
      result.add(p);
    }
    log.info("the number of split: " + result.size());
    return result;
  }
View Full Code Here


    return wmInstance;
  }

  public int getFailedLinesThreshold(String writerID) {
    IParam jobParam = writerToJobParamsMap.get(writerID);
    if (jobParam == null) {
      return 0;
    }
    return jobParam.getIntValue(JOB_PARAM_FAILED_LINES_THRESHOLD, 0);
  }
View Full Code Here

      Map<String, IParam> pluginParamsMap) throws TimeoutException,
      ExecutionException, InterruptedException {
    for (JobPluginConf jobPluginConf : jobPluginList) {

      String writerID = jobPluginConf.getId();
      IParam jobParams = jobPluginConf.getPluginParam();
      writerToJobParamsMap.put(writerID, jobParams);
      IParam pluginParams = pluginParamsMap.get(jobPluginConf
          .getPluginName());
      jobParams.putValue(AbstractPlugin.PLUGINID, writerID);
      String writerPath = pluginParams.getValue(PluginConfParamKey.PATH);
      String writerPeripheryClassName = pluginParams
          .getValue(PluginConfParamKey.PERIPHERY_CLASS_NAME);
      IWriterPeriphery writerPeriphery = null;
      if (StringUtils.isEmpty(writerPeripheryClassName)) {
        writerPeriphery = new DefaultWriterPeriphery();
      } else {
        writerPeriphery = ReflectionUtil
            .createInstanceByDefaultConstructor(
                writerPeripheryClassName,
                IWriterPeriphery.class,
                JarLoader.getInstance(writerPath));
      }
      writerPeripheryMap.put(writerID, writerPeriphery);

      String splitterClassName = pluginParams
          .getValue(PluginConfParamKey.SPLITTER_CLASS_NAME);
      ISplitter splitter = null;
      if (StringUtils.isEmpty(splitterClassName)) {
        splitter = new DefaultSplitter();
      } else {
        splitter = ReflectionUtil.createInstanceByDefaultConstructor(
            splitterClassName, ISplitter.class,
            JarLoader.getInstance(writerPath));
      }

      WritePrepareCallable<List<IParam>> writerCallable = new WritePrepareCallable<List<IParam>>();
      writerCallable.writerPeriphery = writerPeriphery;
      writerCallable.jobParams = jobParams;
      runWithTimeout(new FutureTask<List<IParam>>(writerCallable));
      splitter.init(jobParams);

      WriteSplitCallable<List<IParam>> splitCallable = new WriteSplitCallable<List<IParam>>();
      splitCallable.splitter = splitter;
      List<IParam> splittedParam = (List<IParam>) runWithTimeout(new FutureTask<List<IParam>>(
          splitCallable));

      int concurrency = getConcurrency(jobParams, pluginParams);
      String writeClassName = pluginParams
          .getValue(PluginConfParamKey.PLUGIN_CLASS_NAME);
      ExecutorService writerPool = createThreadPool(concurrency);
      writerPoolMap.put(writerID, writerPool);

      List<Future<Integer>> resultList = new ArrayList<Future<Integer>>();
View Full Code Here

    IWriterPeriphery writerPeriphery = writerPeripheryMap.get(writerID);
    if (writerPeriphery == null) {
      s_logger.error("can not find any writer periphery for " + writerID);
      return;
    }
    IParam jobParams = writerToJobParamsMap.get(writerID);
    if (jobParams == null) {
      s_logger.error("can not find any job parameters for " + writerID);
      return;
    }
View Full Code Here

    IWriterPeriphery writerPeriphery = writerPeripheryMap.get(writerID);
    if (writerPeriphery == null) {
      s_logger.error("can not find any writer periphery for " + writerID);
      return;
    }
    IParam jobParams = writerToJobParamsMap.get(writerID);
    if (jobParams == null) {
      s_logger.error("can not find any job parameters for " + writerID);
      return;
    }
View Full Code Here

TOP

Related Classes of com.dp.nebula.wormhole.common.interfaces.IParam

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.