<p>
Deletes the DocumentStore instance.
</p>

@throws DocumentStoreNotDeletedException if the DocumentStore doesn't exist on disk or
if there was an error deleting the DocumentStore directory.
497328
public void delete() throws DocumentStoreNotDeletedException {
        try {
            this.close();
        } catch (Exception e) {
            // caught exception could be something benign like DocumentStore already closed, so just log
            logger.log(Level.WARNING, "Caught exception whilst closing DocumentStore in delete()", e);
        }
        if (!location.exists()) {
            String msg = String.format("DocumentStore %s doesn't exist on disk", location);
            logger.warning(msg);
            throw new DocumentStoreNotDeletedException(msg);
        } else {
            try {
                FileUtils.deleteDirectory(location);
            } catch (IOException ioe) {
                String msg = String.format("DocumentStore %s not deleted", location);
                logger.log(Level.WARNING, msg, ioe);
                throw new DocumentStoreNotDeletedException(msg, ioe);
            }
            eventBus.post(new DocumentStoreDeleted(databaseName));
        }
    }
84860
@Override
  public void delete(DBIDRef id) {
    assert (!ids.contains(id)) : "Object still in DBIDs.";
    if(!(content instanceof WritableDataStore)) {
      throw new AbortException("Data is stored in a non-writable data store. Modifications are not possible.");
    }
    for(It<Index> it = this.getHierarchy().iterDescendants(this).filter(Index.class); it.valid(); it.advance()) {
      if(!(it.get() instanceof DynamicIndex)) {
        throw new AbortException("A non-dynamic index was added to this database. Modifications are not allowed, unless this index is removed.");
      }
      ((DynamicIndex) it.get()).delete(id);
    }
    ((WritableDataStore<O>) content).delete(id);
  }
957848
private void deleteEntity(String type, String id) throws StorageException {
        try {
            JestResult response = esClient.execute(new Delete.Builder(id).index(getIndexName()).type(type).build());
            if (!response.isSucceeded()) {
                throw new StorageException("Document could not be deleted because it did not exist:" + response.getErrorMessage()); //$NON-NLS-1$
            }
        } catch (StorageException e) {
            throw e;
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
859055
@Override
    public void removeStorageEngine(StorageEngine<ByteArray, byte[], byte[]> engine) {
        String storeName = engine.getName();
        BdbStorageEngine bdbEngine = (BdbStorageEngine) engine;

        synchronized(lock) {

            // Only cleanup the environment if it is per store. We cannot
            // cleanup a shared 'Environment' object
            if(useOneEnvPerStore) {

                Environment environment = this.environments.get(storeName);
                if(environment == null) {
                    // Nothing to clean up.
                    return;
                }

                // Remove from the set of unreserved stores if needed.
                if(this.unreservedStores.remove(environment)) {
                    logger.info("Removed environment for store name: " + storeName
                                + " from unreserved stores");
                } else {
                    logger.info("No environment found in unreserved stores for store name: "
                                + storeName);
                }

                // Try to delete the BDB directory associated
                File bdbDir = environment.getHome();
                if(bdbDir.exists() && bdbDir.isDirectory()) {
                    String bdbDirPath = bdbDir.getPath();
                    try {
                        FileUtils.deleteDirectory(bdbDir);
                        logger.info("Successfully deleted BDB directory : " + bdbDirPath
                                    + " for store name: " + storeName);
                    } catch(IOException e) {
                        logger.error("Unable to delete BDB directory: " + bdbDirPath
                                     + " for store name: " + storeName);
                    }
                }

                // Remove the reference to BdbEnvironmentStats, which holds a
                // reference to the Environment
                BdbEnvironmentStats bdbEnvStats = bdbEngine.getBdbEnvironmentStats();
                this.aggBdbStats.unTrackEnvironment(bdbEnvStats);

                // Unregister the JMX bean for Environment
                if(voldemortConfig.isJmxEnabled()) {
                    ObjectName name = JmxUtils.createObjectName(JmxUtils.getPackageName(bdbEnvStats.getClass()),
                                                                storeName);
                    // Un-register the environment stats mbean
                    JmxUtils.unregisterMbean(name);
                }

                // Cleanup the environment
                environment.close();
                this.environments.remove(storeName);
                logger.info("Successfully closed the environment for store name : " + storeName);

            }
        }
    }
272947
public <T> void delete(T entity) {
        if (entity == null) {
            throw new IllegalArgumentException("Entity cannot be null");
        }

        DocumentInfo value = documentsByEntity.get(entity);
        if (value == null) {
            throw new IllegalStateException(entity + " is not associated with the session, cannot delete unknown entity instance");
        }

        deletedEntities.add(entity);
        includedDocumentsById.remove(value.getId());
        if (_countersByDocId != null) {
            _countersByDocId.remove(value.getId());
        }
        _knownMissingIds.add(value.getId());
    }
97995
protected void unsetFileMonitorRegistration() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "unsetFileMonitorRegistration");
        }
        if (keyStoreFileMonitorRegistration != null) {
            keyStoreFileMonitorRegistration.unregister();
            keyStoreFileMonitorRegistration = null;
        }
    }
1249337
@Override
    public void deleteStoreIfPresent(String storeName) {
        DBConn dbConn = getDBConnection();
        try {
            synchronized (m_schemaLock) {
                if (m_schemaMgr.columnFamilyExists(dbConn, m_keyspace, storeName)) {
                    m_schemaMgr.deleteColumnFamily(dbConn, storeName);
                }
            }
        } finally {
            returnDBConnection(dbConn);
        }
    }
917262
public void delete() throws IOException {

        try {
            load(false);
            ensureLock();
            m_cms.deleteResource(m_cms.getSitePath(m_resource), CmsResource.DELETE_PRESERVE_SIBLINGS);
            if (!m_resource.getState().isNew()) {
                try {
                    m_cms.unlockResource(m_cms.getSitePath(m_resource));
                } catch (CmsException e) {
                    LOG.warn(e.getLocalizedMessage(), e);
                }
            }
        } catch (CmsException e) {
            throw CmsJlanDiskInterface.convertCmsException(e);
        }
    }
1280347
@Override
    public void clearAll() {
        synchronized (this) {
            if (isActive()) {
                deactivateAll();
            }
            activeStore.remove();
            for (Map.Entry<T, ObjectStore> entry : stores.entrySet()) {
                entry.getValue().clear();
            }
            stores.clear();
        }
    }
815220
@CliObjectOption(description = "Delete files in target that don't exist on source.")
  public EmbeddedGobblinDistcp delete() {
    this.setConfiguration(RecursiveCopyableDataset.DELETE_KEY, Boolean.toString(true));
    return this;
  }
1138420
@Nonnull
  public T delete(
      @Nonnull DocumentReference documentReference, @Nonnull Precondition precondition) {
    return performDelete(documentReference, precondition);
  }
1155176
public void delete() throws IOException {
        close();
        if (osFile != null) {
            boolean deleted = osFile.delete();
            while (!deleted) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                    logger.error("{} not deleted.", osFile);
                }
                System.gc();
                deleted = osFile.delete();
            }
        }
    }
1372986
public synchronized void delete() {
		try {
			clear();
		} catch (Exception ign) {
		}
		try {
			close();
		} catch (Exception ign) {
		}
		try {
			fileRedo.delete();
		} catch (Exception ign) {
		}
		try {
			fileStorage.delete();
		} catch (Exception ign) {
		}
		try {
			fileFreeBlocks.delete();
		} catch (Exception ign) {
		}
	}
246402
public void deleteInstance() {
    System.out.println("\nDeleting Instance");
    // [START bigtable_delete_instance]
    try {
      adminClient.deleteInstance(instanceId);
      System.out.println("Instance deleted: " + instanceId);
    } catch (NotFoundException e) {
      System.err.println("Failed to delete non-existent instance: " + e.getMessage());
    }
    // [END bigtable_delete_instance]
  }
1116045
@Override
    public boolean clearRegistry() throws SalException {
        boolean result = this.serviceManager.clearServices();
        // Only try if we could delete the services
        if (result)
            result = result & this.docManager.clearDocuments();

        // Only try if we could delete the services and the docs
        if (result)
            result = result & this.kbManager.clearKnowledgeBase();

        return result;
    }
663161
public void delete() throws CouchbaseLiteException {
        synchronized (lock) {
            mustBeOpen();

            Log.i(DOMAIN, "Deleting %s at path %s", this, getC4Database().getPath());

            if (activeReplications.size() > 0) {
                throw new CouchbaseLiteException(
                    "Cannot delete the database.  Please stop all of the replicators before closing the database.",
                    CBLError.Domain.CBLITE, CBLError.Code.BUSY);
            }


            if (activeLiveQueries.size() > 0) {
                throw new CouchbaseLiteException(
                    "Cannot delete the database.  Please remove all of the query listeners before closing the "
                        + "database.",
                    CBLError.Domain.CBLITE,
                    CBLError.Code.BUSY);
            }

            // cancel purge timer
            cancelPurgeTimer();

            // delete db
            deleteC4DB();

            // release instances
            freeC4Observers();
            freeC4DB();

            // shutdown executor service
            shutdownExecutorService();
        }
    }
1268650
public <T> void delete(T bean) throws StorageException {
        EntityManager entityManager = getActiveEntityManager();
        try {
            entityManager.remove(bean);
        } catch (Throwable t) {
            logger.error(t.getMessage(), t);
            throw new StorageException(t);
        }
    }