public static void optimizeTable ( FluoConfiguration fluoConfig , TableOptimizations tableOptim ) throws Exception { Connector conn = getConnector ( fluoConfig ) ; TreeSet < Text > splits = new TreeSet <> ( ) ; for ( Bytes split : tableOptim . getSplits ( ) ) { splits . add ( new Text ( split . toArray ( ) ) ) ; } String table = fluoConfig . getAccumuloTable ( ) ; conn . tableOperations ( ) . addSplits ( table , splits ) ; if ( tableOptim . getTabletGroupingRegex ( ) != null && ! tableOptim . getTabletGroupingRegex ( ) . isEmpty ( ) ) { // was going to call : // conn.instanceOperations().testClassLoad(RGB_CLASS, TABLET_BALANCER_CLASS) // but that failed. See ACCUMULO-4068 try { // setting this prop first intentionally because it should fail in 1.6 conn . tableOperations ( ) . setProperty ( table , RGB_PATTERN_PROP , tableOptim . getTabletGroupingRegex ( ) ) ; conn . tableOperations ( ) . setProperty ( table , RGB_DEFAULT_PROP , "none" ) ; conn . tableOperations ( ) . setProperty ( table , TABLE_BALANCER_PROP , RGB_CLASS ) ; } catch ( AccumuloException e ) { logger . warn ( "Unable to setup regex balancer (this is expected to fail in Accumulo 1.6.X) : " + e . getMessage ( ) ) ; logger . debug ( "Unable to setup regex balancer (this is expected to fail in Accumulo 1.6.X)" , e ) ; } } }
Make the requested table optimizations .