Examples of JobExecutor


Examples of com.asakusafw.testdriver.JobExecutor

            public int run(String[] args, Configuration conf) {
                return 1;
            }
        });

        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(job(MockHadoopJob.class.getName()), Collections.<String, String>emptyMap());
            throw new IOException();
        } catch (IOException e) {
            throw new AssertionError(e);
        } catch (AssertionError e) {
            // ok.
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutor

            public int run(String[] args, Configuration conf) throws Exception {
                throw new InterruptedException();
            }
        });

        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(job(MockHadoopJob.class.getName()), Collections.<String, String>emptyMap());
            throw new IOException();
        } catch (IOException e) {
            throw new AssertionError(e);
        } catch (AssertionError e) {
            // ok.
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutor

            public void run(List<String> args) throws IOException, InterruptedException {
                call.set(true);
                assertThat(args, contains("hello", "world"));
            }
        });
        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(command("mock", "hello", "world"), Collections.<String, String>emptyMap());
        } catch (IOException e) {
            throw new AssertionError(e);
        }
        assertThat(call.get(), is(true));
    }
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutor

            @Override
            public void run(List<String> args) throws IOException, InterruptedException {
                throw new IOException();
            }
        });
        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(command("mock"), Collections.<String, String>emptyMap());
            throw new IllegalStateException();
        } catch (IOException e) {
            // ok.
        } catch (AssertionError e) {
            // ok.
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutor

            @Override
            public void run(List<String> args) throws IOException, InterruptedException {
                throw new InterruptedException();
            }
        });
        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(command("mock"), Collections.<String, String>emptyMap());
            throw new IllegalStateException();
        } catch (IOException e) {
            // ok.
        } catch (AssertionError e) {
            // ok.
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutor

        File target = new File(framework.getWork("working"), "target");
        Assume.assumeFalse(target.exists());

        // exec: touch .../target
        TestExecutionPlan.Command command = command("generic", touch.getPath(), target.getAbsolutePath());
        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(command, Collections.<String, String>emptyMap());
        } catch (IOException e) {
            throw new AssertionError(e);
        }
        assertThat(target.exists(), is(true));
        assertThat(call.get(), is(false));
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutor

    }

    private void executePlan(TestExecutionPlan plan) throws IOException {
        assert plan != null;
        TestDriverContext context = configuration.context;
        JobExecutor executor = context.getJobExecutor();
        LOG.info("Executing plan: batchId={}, flowId={}, execId={}, args={}, executor={}", new Object[] {
                context.getCurrentBatchId(),
                context.getCurrentFlowId(),
                context.getExecutionId(),
                context.getBatchArgs(),
                executor.getClass().getName(),
        });
        try {
            runJobFlowCommands(executor, plan.getInitializers());
            runJobFlowCommands(executor, plan.getImporters());
            runJobflowJobs(executor, plan.getJobs());
View Full Code Here

Examples of com.thenetcircle.comsumerdispatcher.job.JobExecutor

              String queueName = getNodeValue(String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER_QBINDS_QUEUE, domain, queueJobNodeName));
              String exchange = getNodeValue(String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER_QBINDS_EXCHANGE, domain, queueJobNodeName));
              String type = getNodeValue(String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER_QBINDS_TYPE, domain, queueJobNodeName));
             
              QueueConf qc = DispatcherConfig.getInstance().getServers().get(mqserver);
              JobExecutor je = new JobExecutor();
              try {
                je.setCount(Integer.valueOf(count));
              } catch (Exception e) {
                je.setCount(1);
              }
              je.setEncoding(encoding);
              je.setExchange(exchange);
              je.setFetcherQConf(qc);
              je.setName(jobName);
              je.setQueue(queueName);
              je.setTimeout(Integer.valueOf(timeout));
              je.setType(type);
              je.setUrl(url);
              je.setUrlhost(host);
             
              allJobs.add(je);
              _logger.info("[Distributed Data Loader] loaded Job definition for " + queueJobNodeName + " on domain:" + domain);
            } catch (Exception e) {
              _logger.error(e, e);
View Full Code Here

Examples of com.thenetcircle.comsumerdispatcher.job.JobExecutor

    this.pool = pool;
    this.zk = DistributionManager.getInstance().getZk();
  }
 
  protected String getQueueJobNodeName() {
    JobExecutor job = pool.getJobDefinition();
    return String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER, getDomainName(), job.getLogicName());
  }
View Full Code Here

Examples of com.thenetcircle.comsumerdispatcher.job.JobExecutor

    JobExecutor job = pool.getJobDefinition();
    return String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER, getDomainName(), job.getLogicName());
  }
 
  protected String getDomainName() {
    JobExecutor job = pool.getJobDefinition();
    String domain = null;
    try {
      domain = HttpUtil.convertUrlToHostNameAsNodeName(job.getUrl());
    } catch (MalformedURLException e) {
    }
    return domain;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.