org.apache.accumulo.core.client.NamespaceExistsException Java Examples

The following examples show how to use org.apache.accumulo.core.client.NamespaceExistsException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IngestJob.java    From datawave with Apache License 2.0 5 votes vote down vote up
private void createNamespaceIfNecessary(NamespaceOperations namespaceOperations, String table) throws AccumuloException, AccumuloSecurityException {
    // if the table has a namespace in it that doesn't already exist, create it
    if (table.contains(".")) {
        String namespace = table.split("\\.")[0];
        try {
            if (!namespaceOperations.exists(namespace)) {
                namespaceOperations.create(namespace);
            }
        } catch (NamespaceExistsException e) {
            // in this case, somebody else must have created the namespace after our existence check
            log.info("Tried to create " + namespace + " but somebody beat us to the punch");
        }
    }
}
 
Example #2
Source File: BaseTableCache.java    From datawave with Apache License 2.0 5 votes vote down vote up
private void createNamespaceIfNecessary(NamespaceOperations namespaceOperations, String table) throws AccumuloException, AccumuloSecurityException {
    // if the table has a namespace in it that doesn't already exist, create it
    if (table.contains(".")) {
        String namespace = table.split("\\.")[0];
        try {
            if (!namespaceOperations.exists(namespace)) {
                namespaceOperations.create(namespace);
            }
        } catch (NamespaceExistsException e) {
            // in this case, somebody else must have created the namespace after our existence check
            log.info("Tried to create Accumulo namespace," + namespace + ", but it already exists");
        }
    }
}