@Override public void init() { StellarFunctions.initialize(this.context); // notify listeners about the available specials for(SpecialCommand command : specials) { notifySpecialListeners(command); } // notify listeners about the available functions for(StellarFunctionInfo fn : functionResolver.getFunctionInfo()) { notifyFunctionListeners(fn); } }
public DefaultMessageRouter(Context context) { this.executor = new DefaultStellarStatefulExecutor(); StellarFunctions.initialize(context); executor.setContext(context); clockFactory = new DefaultClockFactory(); }
/** * Private constructor. Use the {@link Builder} to create a new {@link ProfileBuilder). */ private DefaultProfileBuilder(ProfileConfig definition, String entity, long periodDurationMillis, Context stellarContext) { this.isInitialized = false; this.definition = definition; this.profileName = definition.getProfile(); this.entity = entity; this.periodDurationMillis = periodDurationMillis; this.executor = new DefaultStellarStatefulExecutor(); StellarFunctions.initialize(stellarContext); this.executor.setContext(stellarContext); this.maxTimestamp = 0; }
/** * Create the execution context for running Stellar. */ public static Context getContext(Map<String, String> globals) { Context context = new Context.Builder() .with(Context.Capabilities.GLOBAL_CONFIG, () -> globals) .with(Context.Capabilities.STELLAR_CONFIG, () -> globals) .build(); StellarFunctions.initialize(context); return context; } }
protected void initializeStellar() { stellarContext = new Context.Builder() .with(Context.Capabilities.ZOOKEEPER_CLIENT, () -> client) .with(Context.Capabilities.GLOBAL_CONFIG, () -> getConfigurations().getGlobalConfig()) .with(Context.Capabilities.STELLAR_CONFIG, () -> getConfigurations().getGlobalConfig()) .build(); StellarFunctions.initialize(stellarContext); }
protected void initializeStellar() { stellarContext = new Context.Builder() .with(Context.Capabilities.ZOOKEEPER_CLIENT, () -> client) .with(Context.Capabilities.GLOBAL_CONFIG, () -> getConfigurations().getGlobalConfig()) .with(Context.Capabilities.STELLAR_CONFIG, () -> getConfigurations().getGlobalConfig()) .build(); StellarFunctions.initialize(stellarContext); }
protected Context initializeStellar() { Map<String, Object> cacheConfig = new HashMap<>(); for (String sensorType: this.parserRunner.getSensorTypes()) { SensorParserConfig config = getSensorParserConfig(sensorType); if (config != null) { cacheConfig.putAll(config.getCacheConfig()); } } Cache<CachingStellarProcessor.Key, Object> cache = CachingStellarProcessor.createCache(cacheConfig); Context.Builder builder = new Context.Builder() .with(Context.Capabilities.ZOOKEEPER_CLIENT, () -> client) .with(Context.Capabilities.GLOBAL_CONFIG, () -> getConfigurations().getGlobalConfig()) .with(Context.Capabilities.STELLAR_CONFIG, () -> getConfigurations().getGlobalConfig()) ; if(cache != null) { builder = builder.with(Context.Capabilities.CACHE, () -> cache); } Context stellarContext = builder.build(); StellarFunctions.initialize(stellarContext); return stellarContext; }
protected void initializeStellar() { this.stellarContext = new Context.Builder() .with(Context.Capabilities.ZOOKEEPER_CLIENT, () -> client) .with(Context.Capabilities.GLOBAL_CONFIG, () -> getConfigurations().getGlobalConfig()) .with(Context.Capabilities.STELLAR_CONFIG, () -> getConfigurations().getGlobalConfig()) .build(); StellarFunctions.initialize(stellarContext); this.functionResolver = StellarFunctions.FUNCTION_RESOLVER(); }
@BeforeClass public static void setup() { ConcurrencyContext infrastructure = new ConcurrencyContext(); infrastructure.initialize(5, 100, 10, null, null, false); stellarContext = new Context.Builder() .build(); StellarFunctions.initialize(stellarContext); StellarAdapter adapter = new AccessLoggingStellarAdapter().ofType("ENRICHMENT"); adapter.initializeAdapter(new HashMap<>()); EnrichmentAdapter<CacheKey> dummy = new DummyEnrichmentAdapter(); enrichmentsByType = ImmutableMap.of("stellar", adapter, "dummy", dummy); enricher = new ParallelEnricher(enrichmentsByType, infrastructure, false); }
this.globalConfig = getGlobalConfig(zkClient); this.stellarContext = createContext(zkClient); StellarFunctions.initialize(stellarContext); this.transformProcessor = new StellarProcessor(); this.filterProcessor = new StellarPredicateProcessor();