Package com.dp.nebula.wormhole.common

Examples of com.dp.nebula.wormhole.common.DefaultParam


    SftpDirSplitter s = new SftpDirSplitter();
    HashMap<String, String> paramMap = new HashMap<String, String>();
    paramMap.put(ParamKey.dir,
        "sftp://hadoop@192.168.7.80:58422/home/hadoop/wormhole-sftp-test/test*");
    paramMap.put(ParamKey.password, "hadoopdev");
    IParam params = new DefaultParam(paramMap);
    s.init(params);
    s.split();
  }
View Full Code Here


        Map<String,String> params = new HashMap<String,String>();
        params.put(ParamKey.dir, "sftp://username@localhost:58424" + rootName);
        params.put(ParamKey.password, "password");
        params.put(ParamKey.colFilter, "#0,#1");
       
        IParam param = new DefaultParam(params);
       
        SftpDirSplitter splitter = new SftpDirSplitter();
        splitter.init(param);
        List<IParam> list = splitter.split();
        BufferedLineExchanger exchanger=BufferedLineExchangerTest.getLineExchanger();
View Full Code Here

        Map<String,String> params = new HashMap<String,String>();
        params.put(ParamKey.dir, "sftp://username@localhost:58424" + rootName);
        params.put(ParamKey.password, "password");
        params.put(ParamKey.concurrency, "3");

        IParam param = new DefaultParam(params);
        periphery.prepare(param, null);
        splitter.init(param);
        List<IParam> paramList = splitter.split();
      BufferedLineExchanger exchanger=BufferedLineExchangerTest.getLineExchanger();
      for(ILine line:datas) {
View Full Code Here

   
    Map<String, String> params = new HashMap<String, String>();
    params.put(ParamKey.path, "jdbc:hsqldb:mem:" + DB_NAME);
    params.put(ParamKey.username, "sa");
    params.put(ParamKey.sql, "SELECT str_col, num_col FROM sample_table WHERE num_col < 250");
    IParam iParam = new DefaultParam(params);
    hiveReader.setParam(iParam);
    BufferedLineExchanger bufLineExchanger = HiveReaderTest.getBufferedLineExchangerInstance();
   
    IPluginMonitor pluginMonitor = mock(IPluginMonitor.class);
    hiveReader.setMonitor(pluginMonitor);
View Full Code Here

    readerJobConf.setPluginName(readerName);
    readerJobConf.setId(readerId == null ? "reader-id-" + readerName
        : readerId.trim());
    Map<String, String> readerPluginParamMap = getParamMap(readerE);

    IParam readerPluginParam = new DefaultParam(readerPluginParamMap);
    readerJobConf.setPluginParam(readerPluginParam);

    List<JobPluginConf> writerJobConfs = new ArrayList<JobPluginConf>();
    List<Element> writerEs = (List<Element>) document.selectNodes(xpath
        + "/writer");

    for (Element writerE : writerEs) {
      JobPluginConf writerPluginConf = new JobPluginConf();

      Element writerPluginE = (Element) writerE
          .selectSingleNode("plugin");
      String writerName = writerPluginE.getStringValue().trim()
          .toLowerCase();
      String writerId = writerE.attributeValue("id");
      writerPluginConf.setPluginName(writerName);
      writerPluginConf.setId(writerId == null ? "writer-id-"
          + writerEs.indexOf(writerE) + "-" + writerName : writerId
          .trim());

      Map<String, String> writerPluginParamMap = getParamMap(writerE);

      IParam writerPluginParam = new DefaultParam(writerPluginParamMap);

      writerPluginConf.setPluginParam(writerPluginParam);
      writerJobConfs.add(writerPluginConf);
    }
View Full Code Here

    List<Element> pluginsEs = (List<Element>) doc.selectNodes(xpath);
    for (Element pluginsE : pluginsEs) {
      Map<String, String> pluginParamsMap = getParamMap(pluginsE);

      if (pluginParamsMap.containsKey("name")) {
        IParam plugin = new DefaultParam(pluginParamsMap);
        pluginsMap.put(pluginParamsMap.get("name"), plugin);
      } else {
        LOG.error(String
            .format("WormHole plugin configure file can't find xpath \"%s\" plugin name",
                pluginsE.getPath()));
View Full Code Here

    String xpath = "/engine";
    Element engineE = (Element) doc.selectSingleNode(xpath);
    Map<String, String> engineParam = getParamMap(engineE);

    return new DefaultParam(engineParam);
  }
View Full Code Here

   
    Map<String, String> params = new HashMap<String, String>();
    params.put(ParamKey.url, "jdbc:hsqldb:mem:" + DB_NAME);
    params.put(ParamKey.username, "sa");
    params.put(ParamKey.sql, "SELECT str_col, num_col FROM sample_table WHERE num_col < 250");
    IParam iParam = new DefaultParam(params);
   
   
    periphery.prepare(iParam, null);
    splitter.init(iParam);
    splitter.split();
View Full Code Here

    params.put(ParamKey.dbname, "dianpingdw");
    params.put(ParamKey.username, "tempuser_201302211841");
    params.put(ParamKey.password,"dp!@g0Y8bRfvL");

    params.put(ParamKey.sql, "copy (select * from dpmid.mid_dp_shop_info_his where cal_dt = '2012-01-01' limit 20) to stdout WITH DELIMITER E'\t' ");
    IParam iParam = new DefaultParam(params);
   
    gpPeriphery.prepare(iParam,null);
    gpReader.setParam(iParam);
    BufferedLineExchanger bufLineExchanger = getLineExchanger();
   
View Full Code Here

     
    MongoReader mongoReader = new MongoReader();
    Map<String, String> params = new HashMap<String, String>();
    params.put(ParamKey.inputUri, "mongodb://localhost:" + MONGODB_PORT + "/embedded.testCollection");
    params.put(ParamKey.inputFields, "{ msg : 1 }");
    IParam iParam = new DefaultParam(params);
    mongoReader.setParam(iParam);
    BufferedLineExchanger bufLineExchanger = HiveReaderTest.getBufferedLineExchangerInstance();
   
    IPluginMonitor pluginMonitor = mock(IPluginMonitor.class);
    mongoReader.setMonitor(pluginMonitor);
View Full Code Here

TOP

Related Classes of com.dp.nebula.wormhole.common.DefaultParam

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.