Package com.google.appengine.tools.mapreduce.impl.shardedjob

Examples of com.google.appengine.tools.mapreduce.impl.shardedjob.ShardedJobService.cleanupJob()


  }

  @Test
  public void testCleanupJob() throws Exception {
    ShardedJobService jobService = ShardedJobServiceFactory.getShardedJobService();
    assertTrue(jobService.cleanupJob("testCleanupJob")); // No such job yet
    ShardedJobSettings settings = new ShardedJobSettings.Builder().build();
    ShardedJobController<TestTask> controller = new DummyWorkerController();
    byte[] bytes = new byte[1024 * 1024];
    new Random().nextBytes(bytes);
    TestTask s1 = new TestTask(0, 2, 2, 2, bytes);
View Full Code Here


    byte[] bytes = new byte[1024 * 1024];
    new Random().nextBytes(bytes);
    TestTask s1 = new TestTask(0, 2, 2, 2, bytes);
    TestTask s2 = new TestTask(1, 2, 2, 1);
    jobService.startJob("testCleanupJob", ImmutableList.of(s1, s2), controller, settings);
    assertFalse(jobService.cleanupJob("testCleanupJob"));
    executeTasksUntilEmpty();
    DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
    assertEquals(3, ds.prepare(new Query()).countEntities(FetchOptions.Builder.withDefaults()));
    assertTrue(jobService.cleanupJob("testCleanupJob"));
    executeTasksUntilEmpty();
View Full Code Here

    jobService.startJob("testCleanupJob", ImmutableList.of(s1, s2), controller, settings);
    assertFalse(jobService.cleanupJob("testCleanupJob"));
    executeTasksUntilEmpty();
    DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
    assertEquals(3, ds.prepare(new Query()).countEntities(FetchOptions.Builder.withDefaults()));
    assertTrue(jobService.cleanupJob("testCleanupJob"));
    executeTasksUntilEmpty();
    assertEquals(0, ds.prepare(new Query()).countEntities(FetchOptions.Builder.withDefaults()));
  }

  // Tests that an job that has just been initialized returns a reasonable job detail.
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.