Tabnine Logo
ClusterScheduler.run
Code IndexAdd Tabnine to your IDE (free)

How to use
run
method
in
co.cask.coopr.scheduler.ClusterScheduler

Best Java code snippets using co.cask.coopr.scheduler.ClusterScheduler.run (Showing top 16 results out of 315)

origin: caskdata/coopr

clusterScheduler.run();
origin: caskdata/coopr

@Test(timeout = 20000)
public void testFalseOnStartStopsJob() throws Exception {
 String tenantId = "q";
 ClusterScheduler clusterScheduler = injector.getInstance(ClusterScheduler.class);
 clusterQueues.add(tenantId, new Element(cluster.getId(), ClusterAction.CLUSTER_CREATE.name()));
 clusterScheduler.run();
 CallbackScheduler callbackScheduler = injector.getInstance(CallbackScheduler.class);
 // should be no job in the queue until the start callback runs
 Assert.assertEquals(0, jobQueues.size(tenantId));
 // tell mock callback to return false for onStart callback
 mockClusterCallback.setReturnOnStart(false);
 // wait for start callback to finish
 waitForCallback(callbackScheduler);
 Assert.assertEquals(CallbackData.Type.START, mockClusterCallback.getReceivedCallbacks().get(0).getType());
 // wait for fail callback to finish
 if (mockClusterCallback.getReceivedCallbacks().size() < 2) {
  waitForCallback(callbackScheduler);
 }
 Assert.assertEquals(CallbackData.Type.FAILURE, mockClusterCallback.getReceivedCallbacks().get(1).getType());
 // there also should not be any jobs in the queue
 Assert.assertEquals(0, jobQueues.size(tenantId));
}
origin: caskdata/coopr

           ClusterAction.CLUSTER_CREATE, 0, 0);
clusterScheduler.run();
callbackScheduler.run();
origin: caskdata/coopr

           ClusterAction.CLUSTER_CREATE, 0, 0);
clusterScheduler.run();
origin: caskdata/coopr

private void testCallbacks(boolean failJob) throws Exception {
 ClusterScheduler clusterScheduler = injector.getInstance(ClusterScheduler.class);
 String tenantId = cluster.getAccount().getTenantId();
 clusterQueues.add(tenantId, new Element(cluster.getId(), ClusterAction.CLUSTER_CREATE.name()));
 clusterScheduler.run();
 CallbackScheduler callbackScheduler = injector.getInstance(CallbackScheduler.class);
 // should be no job in the queue until the start callback runs
 Assert.assertEquals(0, jobQueues.size(tenantId));
 waitForCallback(callbackScheduler);
 Assert.assertEquals(CallbackData.Type.START, mockClusterCallback.getReceivedCallbacks().get(0).getType());
 JobScheduler jobScheduler = injector.getInstance(JobScheduler.class);
 jobScheduler.run();
 // take tasks until there are no more
 TakeTaskRequest takeRequest = new TakeTaskRequest("consumer1", PROVISIONER_ID, tenantId);
 SchedulableTask task = TestHelper.takeTask(getInternalServerUrl(), takeRequest);
 while (task != null) {
  FinishTaskRequest finishRequest =
   new FinishTaskRequest("consumer1", PROVISIONER_ID, tenantId,
              task.getTaskId(), null, null, failJob ? 1 : 0, null, null, null);
  TestHelper.finishTask(getInternalServerUrl(), finishRequest);
  jobScheduler.run();
  jobScheduler.run();
  task = TestHelper.takeTask(getInternalServerUrl(), takeRequest);
 }
 jobScheduler.run();
 waitForCallback(callbackScheduler);
 // at this point, the failure callback should have run
 Assert.assertEquals(failJob ? CallbackData.Type.FAILURE : CallbackData.Type.SUCCESS,
           mockClusterCallback.getReceivedCallbacks().get(1).getType());
}
origin: caskdata/coopr

clusterScheduler.run();
origin: caskdata/coopr

           ClusterAction.CLUSTER_CREATE, 0, 0);
clusterScheduler.run();
origin: caskdata/coopr

           ClusterAction.CLUSTER_CREATE, 0, 0);
clusterScheduler.run();
callbackScheduler.run();
origin: caskdata/coopr

           ClusterAction.SOLVE_LAYOUT, 0, 0);
clusterScheduler.run();
assertResponseStatus(response, HttpResponseStatus.OK);
clusterScheduler.run();
origin: caskdata/coopr

clusterScheduler.run();
waitForCallback(callbackScheduler);
Assert.assertEquals(1, jobQueues.size(tenantId));
origin: caskdata/coopr

clusterScheduler.run();
callbackScheduler.run();
origin: caskdata/coopr

assertResponseStatus(response, HttpResponseStatus.OK);
clusterScheduler.run();
callbackScheduler.run();
origin: caskdata/coopr

clusterScheduler.run();
origin: caskdata/coopr

           ClusterAction.CLUSTER_CREATE, 0, 0);
clusterScheduler.run();
callbackScheduler.run();
origin: caskdata/coopr

           ClusterAction.CLUSTER_CREATE, 0, 0);
clusterScheduler.run();
callbackScheduler.run();
origin: caskdata/coopr

clusterScheduler.run();
callbackScheduler.run();
co.cask.coopr.schedulerClusterSchedulerrun

Popular methods of ClusterScheduler

  • createClusterTasks

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getContentResolver (Context)
  • putExtra (Intent)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Menu (java.awt)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now