public void ensureNamespace ( String schema ) { try { // If the table schema is not "default" and the namespace does not exist, create it if ( ! schema . equals ( DEFAULT ) && ! connector . namespaceOperations ( ) . exists ( schema ) ) { connector . namespaceOperations ( ) . create ( schema ) ; } } catch ( AccumuloException | AccumuloSecurityException e ) { throw new PrestoException ( UNEXPECTED_ACCUMULO_ERROR , "Failed to check for existence or create Accumulo namespace" , e ) ; } catch ( NamespaceExistsException e ) { // Suppress race condition between test for existence and creation LOG . warn ( "NamespaceExistsException suppressed when creating " + schema ) ; } }
Ensures the given Accumulo namespace exist creating it if necessary