congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BootstrapStore
Code IndexAdd Tabnine to your IDE (free)

How to use
BootstrapStore
in
co.cask.cdap.internal.bootstrap

Best Java code snippets using co.cask.cdap.internal.bootstrap.BootstrapStore (Showing top 11 results out of 315)

origin: cdapio/cdap

/**
 * @return whether the system is bootstrapped or not
 */
public boolean isBootstrapped() {
 return bootstrapStore.isBootstrapped();
}
origin: cdapio/cdap

/**
 * Clear bootstrap state. This should only be called in tests.
 */
@VisibleForTesting
void clear() {
 Transactionals.execute(transactional, dsContext -> {
  MetadataStoreDataset ds = get(dsContext, datasetFramework);
  ds.delete(KEY);
 });
}
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

@After
public void cleanupTest() {
 bootstrapStore.clear();
 EXECUTOR1.reset();
 EXECUTOR2.reset();
 EXECUTOR3.reset();
}
origin: co.cask.cdap/cdap-app-fabric

/**
 * Clear bootstrap state. This should only be called in tests.
 */
@VisibleForTesting
void clear() {
 Transactionals.execute(transactional, dsContext -> {
  MetadataStoreDataset ds = get(dsContext, datasetFramework);
  ds.delete(KEY);
 });
}
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: co.cask.cdap/cdap-app-fabric

/**
 * @return whether the CDAP instance is bootstrapped.
 */
public boolean isBootstrapped() {
 return Transactionals.execute(transactional, dsContext -> {
  MetadataStoreDataset ds = get(dsContext, datasetFramework);
  return ds.exists(KEY);
 });
}
origin: co.cask.cdap/cdap-app-fabric

/**
 * @return whether the system is bootstrapped or not
 */
public boolean isBootstrapped() {
 return bootstrapStore.isBootstrapped();
}
origin: co.cask.cdap/cdap-app-fabric

/**
 * Mark the CDAP instance as bootstrapped.
 */
public void bootstrapped() {
 Transactionals.execute(transactional, dsContext -> {
  MetadataStoreDataset ds = get(dsContext, datasetFramework);
  ds.write(KEY, Boolean.TRUE);
 });
}
origin: cdapio/cdap

/**
 * Mark the CDAP instance as bootstrapped.
 */
public void bootstrapped() {
 Transactionals.execute(transactional, dsContext -> {
  MetadataStoreDataset ds = get(dsContext, datasetFramework);
  ds.write(KEY, Boolean.TRUE);
 });
}
origin: cdapio/cdap

/**
 * @return whether the CDAP instance is bootstrapped.
 */
public boolean isBootstrapped() {
 return Transactionals.execute(transactional, dsContext -> {
  MetadataStoreDataset ds = get(dsContext, datasetFramework);
  return ds.exists(KEY);
 });
}
co.cask.cdap.internal.bootstrapBootstrapStore

Javadoc

Fetches and stores bootstrap state. Making the store in charge of starting transactions is generally discouraged. However, this store contains a single key that is isolated from everything else, so it is easier to have it start transactions.

Most used methods

  • bootstrapped
    Mark the CDAP instance as bootstrapped.
  • clear
    Clear bootstrap state. This should only be called in tests.
  • get
  • isBootstrapped

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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