Codota Logo
BootstrapResult
Code IndexAdd Codota to your IDE (free)

How to use
BootstrapResult
in
co.cask.cdap.proto.bootstrap

Best Java code snippets using co.cask.cdap.proto.bootstrap.BootstrapResult (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: co.cask.cdap/cdap-app-fabric

/**
 * Execute the steps in the loaded bootstrap config.
 *
 * @param shouldSkip predicate that determines whether to skip a step
 * @return the result of executing the bootstrap steps.
 * @throws IllegalStateException if bootstrapping is already in progress
 * @throws InterruptedException if bootstrapping was interrupted
 */
public BootstrapResult bootstrap(Predicate<BootstrapStep> shouldSkip) throws InterruptedException {
 List<BootstrapStepResult> results = new ArrayList<>(config.getSteps().size());
 if (!bootstrapping.compareAndSet(false, true)) {
  throw new IllegalStateException("Bootstrap already in progress.");
 }
 try {
  for (BootstrapStep step : config.getSteps()) {
   results.add(executeStep(step, shouldSkip));
  }
  if (!config.getSteps().isEmpty()) {
   bootstrapStore.bootstrapped();
  }
  return new BootstrapResult(results);
 } finally {
  bootstrapping.set(false);
 }
}
origin: cdapio/cdap

/**
 * Execute the steps in the loaded bootstrap config.
 *
 * @param shouldSkip predicate that determines whether to skip a step
 * @return the result of executing the bootstrap steps.
 * @throws IllegalStateException if bootstrapping is already in progress
 * @throws InterruptedException if bootstrapping was interrupted
 */
public BootstrapResult bootstrap(Predicate<BootstrapStep> shouldSkip) throws InterruptedException {
 List<BootstrapStepResult> results = new ArrayList<>(config.getSteps().size());
 if (!bootstrapping.compareAndSet(false, true)) {
  throw new IllegalStateException("Bootstrap already in progress.");
 }
 try {
  for (BootstrapStep step : config.getSteps()) {
   results.add(executeStep(step, shouldSkip));
  }
  if (!config.getSteps().isEmpty()) {
   bootstrapStore.bootstrapped();
  }
  return new BootstrapResult(results);
 } finally {
  bootstrapping.set(false);
 }
}
origin: cdapio/cdap

@Test
public void testRetries() throws Exception {
 EXECUTOR1.setNumRetryableFailures(3);
 BootstrapResult result = bootstrapService.bootstrap();
 List<BootstrapStepResult> expectedStepResults = new ArrayList<>();
 for (BootstrapStep step : bootstrapConfig.getSteps()) {
  expectedStepResults.add(new BootstrapStepResult(step.getLabel(), BootstrapStepResult.Status.SUCCEEDED));
 }
 BootstrapResult expected = new BootstrapResult(expectedStepResults);
 Assert.assertEquals(expected, result);
}
origin: cdapio/cdap

@Test
public void testRunCondition() throws Exception {
 BootstrapResult result =
  bootstrapService.bootstrap(step -> step.getRunCondition() == BootstrapStep.RunCondition.ONCE);
 List<BootstrapStepResult> stepResults = new ArrayList<>(3);
 stepResults.add(new BootstrapStepResult(STEP1.getLabel(), BootstrapStepResult.Status.SKIPPED));
 stepResults.add(new BootstrapStepResult(STEP2.getLabel(), BootstrapStepResult.Status.SUCCEEDED));
 stepResults.add(new BootstrapStepResult(STEP3.getLabel(), BootstrapStepResult.Status.SKIPPED));
 Assert.assertEquals(new BootstrapResult(stepResults), result);
}
origin: cdapio/cdap

@Test
public void testContinuesAfterFailures() throws Exception {
 EXECUTOR1.shouldFail();
 BootstrapResult result = bootstrapService.bootstrap();
 List<BootstrapStepResult> stepResults = new ArrayList<>(3);
 stepResults.add(new BootstrapStepResult(STEP1.getLabel(), BootstrapStepResult.Status.FAILED));
 stepResults.add(new BootstrapStepResult(STEP2.getLabel(), BootstrapStepResult.Status.SUCCEEDED));
 stepResults.add(new BootstrapStepResult(STEP3.getLabel(), BootstrapStepResult.Status.SUCCEEDED));
 BootstrapResult expected = new BootstrapResult(stepResults);
 Assert.assertEquals(expected, result);
}
origin: cdapio/cdap

@Test
public void testAllSuccess() throws Exception  {
 BootstrapResult result = bootstrapService.bootstrap();
 List<BootstrapStepResult> expectedStepResults = new ArrayList<>();
 for (BootstrapStep step : bootstrapConfig.getSteps()) {
  expectedStepResults.add(new BootstrapStepResult(step.getLabel(), BootstrapStepResult.Status.SUCCEEDED));
 }
 BootstrapResult expected = new BootstrapResult(expectedStepResults);
 Assert.assertEquals(expected, result);
 Assert.assertTrue(bootstrapService.isBootstrapped());
}
co.cask.cdap.proto.bootstrapBootstrapResult

Javadoc

Result of executing bootstrap steps.

Most used methods

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now