use of org.apache.metron.profiler.hbase.ValueOnlyColumnBuilder in project metron by apache.
the class ProfileWriter method main.
public static void main(String[] args) {
RowKeyBuilder rowKeyBuilder = new SaltyRowKeyBuilder();
ColumnBuilder columnBuilder = new ValueOnlyColumnBuilder();
Configuration config = HBaseConfiguration.create();
config.set("hbase.master.hostname", "node1");
config.set("hbase.regionserver.hostname", "node1");
config.set("hbase.zookeeper.quorum", "node1");
HTableProvider provider = new HTableProvider();
String tableName = "profiler";
long periodDurationMillis = TimeUnit.MINUTES.toMillis(15);
long when = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(2);
ProfileMeasurement measure = new ProfileMeasurement().withProfileName("profile1").withEntity("192.168.66.121").withPeriod(when, periodDurationMillis, TimeUnit.MILLISECONDS);
ProfileWriter writer = new ProfileWriter(rowKeyBuilder, columnBuilder, provider, periodDurationMillis, tableName, config);
writer.write(measure, 2 * 24 * 4, Collections.emptyList(), val -> new Random().nextInt(10));
}
Aggregations