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

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

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

origin: caskdata/coopr

List<Set<ClusterTask>> clusterTasks = createClusterTasks(linearizedTasks, cluster, job,
                             jobPlanner.getServiceMap(),
                             clusterAction, jobPlanner.getNodeMap());
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.schedulerClusterScheduler

Javadoc

Schedule clusters to be provisioned. Polls a queue that contains elements specifying what cluster action needs to be performed on what cluster. The scheduler determines a plan for how to perform the cluster action and stores all plan information into a cluster job, then writes to a queue to tell the JobScheduler to start scheduling tasks to perform the cluster action.

Most used methods

  • createClusterTasks
  • run

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 12 Jupyter Notebook extensions
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