/** * Creates the ColumnBuilder to use in accessing the profile data. * @param global The global configuration. */ private RowKeyBuilder getRowKeyBuilder(Map<String, Object> global) { Integer saltDivisor = PROFILER_SALT_DIVISOR.get(global, Integer.class); return new SaltyRowKeyBuilder(saltDivisor, getPeriodDurationInMillis(global), TimeUnit.MILLISECONDS); }
/** * Creates the ColumnBuilder to use in accessing the profile data. * @param global The global configuration. */ private RowKeyBuilder getRowKeyBuilder(Map<String, Object> global) { // how long is the profile period? long duration = PROFILER_PERIOD.get(global, Long.class); LOG.debug("profiler client: {}={}", PROFILER_PERIOD, duration); // which units are used to define the profile period? String configuredUnits = PROFILER_PERIOD_UNITS.get(global, String.class); TimeUnit units = TimeUnit.valueOf(configuredUnits); LOG.debug("profiler client: {}={}", PROFILER_PERIOD_UNITS, units); // what is the salt divisor? Integer saltDivisor = PROFILER_SALT_DIVISOR.get(global, Integer.class); LOG.debug("profiler client: {}={}", PROFILER_SALT_DIVISOR, saltDivisor); return new SaltyRowKeyBuilder(saltDivisor, duration, units); }
public ProfileHBaseMapper() { setRowKeyBuilder(new SaltyRowKeyBuilder()); setColumnBuilder(new ValueOnlyColumnBuilder()); }
public HBaseWriterFunction(Properties properties) { tableName = HBASE_TABLE_NAME.get(properties, String.class); durability = HBASE_WRITE_DURABILITY.get(properties, Durability.class); // row key builder int saltDivisor = HBASE_SALT_DIVISOR.get(properties, Integer.class); int periodDuration = PERIOD_DURATION.get(properties, Integer.class); TimeUnit periodDurationUnits = TimeUnit.valueOf(PERIOD_DURATION_UNITS.get(properties, String.class)); rowKeyBuilder = new SaltyRowKeyBuilder(saltDivisor, periodDuration, periodDurationUnits); // column builder String columnFamily = HBASE_COLUMN_FAMILY.get(properties, String.class); columnBuilder = new ValueOnlyColumnBuilder(columnFamily); // hbase table provider String providerImpl = HBASE_TABLE_PROVIDER.get(properties, String.class); tableProvider = createTableProvider(providerImpl); }