當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。