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

How to use
DatasetModuleCannotBeDeletedException
in
co.cask.cdap.common

Best Java code snippets using co.cask.cdap.common.DatasetModuleCannotBeDeletedException (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: caskdata/cdap

/**
 * Deletes all dataset modules in a namespace.
 *
 * @throws DatasetModuleCannotBeDeletedException if one of the dataset modules cannot be deleted,
 * usually due to existing dataset instances using the dataset module
 * @throws IOException if a network error occurred
 * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server
 */
public void deleteAll(NamespaceId namespace)
 throws DatasetModuleCannotBeDeletedException, IOException, UnauthenticatedException, UnauthorizedException {
 URL url = config.resolveNamespacedURLV3(namespace, "data/modules");
 HttpResponse response = restClient.execute(HttpMethod.DELETE, url, config.getAccessToken(),
                       HttpURLConnection.HTTP_CONFLICT);
 if (response.getResponseCode() == HttpURLConnection.HTTP_CONFLICT) {
  // TODO: exception for all modules
  throw new DatasetModuleCannotBeDeletedException(null);
 }
}
origin: cdapio/cdap

/**
 * Deletes the specified {@link DatasetModuleId}
 */
@Override
public void delete(DatasetModuleId datasetModuleId) throws Exception {
 NamespaceId namespaceId = datasetModuleId.getParent();
 if (NamespaceId.SYSTEM.equals(namespaceId)) {
  throw new UnsupportedOperationException(
   String.format("Cannot delete module '%s' from '%s' namespace.",
          datasetModuleId.getModule(), datasetModuleId.getNamespace()));
 }
 ensureNamespaceExists(namespaceId);
 DatasetModuleMeta moduleMeta = typeManager.getModule(datasetModuleId);
 if (moduleMeta == null) {
  throw new DatasetModuleNotFoundException(datasetModuleId);
 }
 try {
  typeManager.deleteModule(datasetModuleId);
 } catch (DatasetModuleConflictException e) {
  throw new DatasetModuleCannotBeDeletedException(datasetModuleId, e.getMessage());
 }
}
origin: co.cask.cdap/cdap-data-fabric

/**
 * Deletes the specified {@link DatasetModuleId}
 */
@Override
public void delete(DatasetModuleId datasetModuleId) throws Exception {
 NamespaceId namespaceId = datasetModuleId.getParent();
 if (NamespaceId.SYSTEM.equals(namespaceId)) {
  throw new UnsupportedOperationException(
   String.format("Cannot delete module '%s' from '%s' namespace.",
          datasetModuleId.getModule(), datasetModuleId.getNamespace()));
 }
 ensureNamespaceExists(namespaceId);
 DatasetModuleMeta moduleMeta = typeManager.getModule(datasetModuleId);
 if (moduleMeta == null) {
  throw new DatasetModuleNotFoundException(datasetModuleId);
 }
 try {
  typeManager.deleteModule(datasetModuleId);
 } catch (DatasetModuleConflictException e) {
  throw new DatasetModuleCannotBeDeletedException(datasetModuleId, e.getMessage());
 }
}
origin: caskdata/cdap

/**
 * Deletes a dataset module.
 *
 * @param module the dataset module to delete
 * @throws DatasetModuleCannotBeDeletedException if the dataset module cannot be deleted,
 * usually due to other dataset modules or dataset instances using the dataset module
 * @throws DatasetModuleNotFoundException if the dataset module with the specified name was not found
 * @throws IOException if a network error occurred
 * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server
 */
public void delete(DatasetModuleId module)
 throws DatasetModuleCannotBeDeletedException, DatasetModuleNotFoundException,
 IOException, UnauthenticatedException, UnauthorizedException {
 URL url = config.resolveNamespacedURLV3(module.getParent(), String.format("data/modules/%s", module.getModule()));
 HttpResponse response = restClient.execute(HttpMethod.DELETE, url, config.getAccessToken(),
                       HttpURLConnection.HTTP_CONFLICT,
                       HttpURLConnection.HTTP_NOT_FOUND);
 if (response.getResponseCode() == HttpURLConnection.HTTP_CONFLICT) {
  throw new DatasetModuleCannotBeDeletedException(module);
 } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
  throw new DatasetModuleNotFoundException(module);
 }
}
co.cask.cdap.commonDatasetModuleCannotBeDeletedException

Javadoc

Thrown when a dataset module cannot be deleted.

Most used methods

  • <init>

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • JTable (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 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
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