use of org.apache.metron.stellar.common.DefaultStellarStatefulExecutor in project metron by apache.
the class BatchProfilerIntegrationTest method setup.
@BeforeEach
public void setup() {
readerProperties = new Properties();
profilerProperties = new Properties();
// the output will be written to a mock HBase table
String tableName = HBASE_TABLE_NAME.get(profilerProperties, String.class);
String columnFamily = HBASE_COLUMN_FAMILY.get(profilerProperties, String.class);
profilerProperties.put(HBASE_TABLE_PROVIDER.getKey(), MockHBaseTableProvider.class.getName());
// create the mock hbase table
MockHBaseTableProvider.addToCache(tableName, columnFamily);
// define the globals required by `PROFILE_GET`
Map<String, Object> global = new HashMap<String, Object>() {
{
put(PROFILER_HBASE_TABLE.getKey(), tableName);
put(PROFILER_COLUMN_FAMILY.getKey(), columnFamily);
put(PROFILER_HBASE_TABLE_PROVIDER.getKey(), MockHBaseTableProvider.class.getName());
}
};
// create the stellar execution environment
executor = new DefaultStellarStatefulExecutor(new SimpleFunctionResolver().withClass(GetProfile.class).withClass(FixedLookback.class).withClass(WindowLookback.class).withClass(DataStructureFunctions.Length.class).withClass(StringFunctions.GetFirst.class).withClass(StellarStatisticsFunctions.Count.class).withClass(StellarStatisticsFunctions.Sum.class), new Context.Builder().with(Context.Capabilities.GLOBAL_CONFIG, () -> global).build());
}
Aggregations