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


Java PipelineServiceFactory类代码示例

本文整理汇总了Java中com.google.appengine.tools.pipeline.PipelineServiceFactory的典型用法代码示例。如果您正苦于以下问题:Java PipelineServiceFactory类的具体用法?Java PipelineServiceFactory怎么用?Java PipelineServiceFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: waitToFinish

import com.google.appengine.tools.pipeline.PipelineServiceFactory; //导入依赖的package包/类
protected JobInfo waitToFinish(final String phase, final String handle) throws Exception {
    PipelineService pipelineService = PipelineServiceFactory.newPipelineService();
    JobInfo jobInfo = getJobInfo(pipelineService, phase, handle);
    JobInfo.State state = jobInfo.getJobState();
    int N = 24; // 2min
    while (isRunning(state) && N > 0) {
        N--;
        sync(5 * 1000L); // 5sec
        // new info lookup
        jobInfo = getJobInfo(pipelineService, phase, handle);
        state = jobInfo.getJobState();
    }
    if (N == 0 && isRunning(state)) {
        throw new IllegalStateException("Failed to finish the job [ " + phase + " ]: " + handle + ", info: " + toInfo(jobInfo));
    }
    if (state != JobInfo.State.COMPLETED_SUCCESSFULLY) {
        throw new IllegalStateException("Job " + handle + " failed [ " + phase + " ]: " + toInfo(jobInfo));
    }
    return jobInfo;
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:21,代码来源:MapReduceTestBase.java

示例2: createMapreduce

import com.google.appengine.tools.pipeline.PipelineServiceFactory; //导入依赖的package包/类
private static String createMapreduce(String jobName) throws Exception {
  MapReduceJob<String, String, String, String, List<List<String>>> mapReduceJob =
      new MapReduceJob<>(
          new MapReduceSpecification.Builder<String, String, String, String, List<List<String>>>()
              .setJobName(jobName)
              .setInput(input)
              .setMapper(new TestMapper())
              .setReducer(new TestReducer())
              .setOutput(new InMemoryOutput<>())
              .setNumReducers(2)
              .build(),
          new MapReduceSettings.Builder().setWorkerQueueName(QUEUE_NAME).build());
  PipelineService pipelineService = PipelineServiceFactory.newPipelineService();
  return pipelineService.startNewPipeline(mapReduceJob, new JobSetting.OnQueue(QUEUE_NAME));
}
 
开发者ID:google,项目名称:nomulus,代码行数:16,代码来源:MapreduceEntityCleanupActionTest.java

示例3: execute

import com.google.appengine.tools.pipeline.PipelineServiceFactory; //导入依赖的package包/类
private void execute() throws NoSuchObjectException {
    PipelineService service = PipelineServiceFactory.newPipelineService();
    State state = getJobInfo(service);
    if (state == COMPLETED_SUCCESSFULLY) {
        logger.info("Cleanig pipeline: " + pipelineId);
        service.deletePipelineRecords(pipelineId);
        return;
    }

    if (state == RUNNING || state == WAITING_TO_RETRY) {
        enqueue(pipelineId);
    }
}
 
开发者ID:feroult,项目名称:yawp,代码行数:14,代码来源:ClearPipelineTask.java

示例4: reload

import com.google.appengine.tools.pipeline.PipelineServiceFactory; //导入依赖的package包/类
@Override
public void reload(Class<? extends Pipe> pipeClazz) {
    PipelineService service = PipelineServiceFactory.newPipelineService();
    String pipelineId = service.startNewPipeline(new ReloadPipeJob(), pipeClazz);
    ClearPipelineTask.enqueue(pipelineId);
}
 
开发者ID:feroult,项目名称:yawp,代码行数:7,代码来源:AppenginePipesDriver.java

示例5: getJobInfo

import com.google.appengine.tools.pipeline.PipelineServiceFactory; //导入依赖的package包/类
protected JobInfo getJobInfo(final String phase, final String handle) throws Exception {
    PipelineService pipelineService = PipelineServiceFactory.newPipelineService();
    return getJobInfo(pipelineService, phase, handle);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:5,代码来源:MapReduceTestBase.java


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