public void createCluster ( final String className , final String clusterName ) { final ODatabaseDocumentInternal currentDB = ODatabaseRecordThreadLocal . instance ( ) . getIfDefined ( ) ; try { final ODatabaseDocumentInternal sysdb = openSystemDatabase ( ) ; try { if ( ! sysdb . existsCluster ( clusterName ) ) { OSchema schema = sysdb . getMetadata ( ) . getSchema ( ) ; OClass cls = schema . getClass ( className ) ; if ( cls != null ) { cls . addCluster ( clusterName ) ; } else { OLogManager . instance ( ) . error ( this , "createCluster() Class name %s does not exist" , null , className ) ; } } } finally { sysdb . close ( ) ; } } finally { if ( currentDB != null ) ODatabaseRecordThreadLocal . instance ( ) . set ( currentDB ) ; else ODatabaseRecordThreadLocal . instance ( ) . remove ( ) ; } }
Adds the specified cluster to the class if it doesn t already exist .