public static Collection < IteratorSetting > getMetricIterators ( AccumuloTable table ) { String cardQualifier = new String ( CARDINALITY_CQ ) ; String rowsFamily = new String ( METRICS_TABLE_ROWS_CF . array ( ) ) ; // Build a string for all columns where the summing combiner should be applied, // i.e. all indexed columns StringBuilder cardBuilder = new StringBuilder ( rowsFamily + ":" + cardQualifier + "," ) ; for ( String s : getLocalityGroups ( table ) . keySet ( ) ) { cardBuilder . append ( s ) . append ( ":" ) . append ( cardQualifier ) . append ( ' ' ) ; } cardBuilder . deleteCharAt ( cardBuilder . length ( ) - 1 ) ; // Configuration rows for the Min/Max combiners String firstRowColumn = rowsFamily + ":" + new String ( METRICS_TABLE_FIRST_ROW_CQ . array ( ) ) ; String lastRowColumn = rowsFamily + ":" + new String ( METRICS_TABLE_LAST_ROW_CQ . array ( ) ) ; // Summing combiner for cardinality columns IteratorSetting s1 = new IteratorSetting ( 1 , SummingCombiner . class , ImmutableMap . of ( "columns" , cardBuilder . toString ( ) , "type" , "STRING" ) ) ; // Min/Max combiner for the first/last rows of the table IteratorSetting s2 = new IteratorSetting ( 2 , MinByteArrayCombiner . class , ImmutableMap . of ( "columns" , firstRowColumn ) ) ; IteratorSetting s3 = new IteratorSetting ( 3 , MaxByteArrayCombiner . class , ImmutableMap . of ( "columns" , lastRowColumn ) ) ; return ImmutableList . of ( s1 , s2 , s3 ) ; }
Gets a collection of iterator settings that should be added to the metric table for the given Accumulo table . Don t forget! Please!