@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { if (tridentContext.getParentTupleFactories().size() != 1) { throw new RuntimeException("Projection processor can only have one parent"); } _context = tridentContext; _factory = new ProjectionFactory(tridentContext.getParentTupleFactories().get(0), _projectFields); }
public AppendCollector(TridentContext context) { _triContext = context; _factory = new OperationOutputFactory(context.getParentTupleFactories().get(0), context.getSelfOutputFields()); }
@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); _context = tridentContext; _streamToIndex = new HashMap<>(); List<String> parentStreams = tridentContext.getParentStreams(); for (int i = 0; i < parentStreams.size(); i++) { _streamToIndex.put(parentStreams.get(i), i); } _projectionFactories = new ProjectionFactory[_projectFields.size()]; for (int i = 0; i < _projectFields.size(); i++) { _projectionFactories[i] = new ProjectionFactory(parents.get(i), _projectFields.get(i)); } _collector = new FreshCollector(tridentContext); _reducer.prepare(conf, new TridentMultiReducerContext((List) Arrays.asList(_projectionFactories))); }
@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("Aggregate operation can only have one parent"); } _context = tridentContext; _collector = new FreshCollector(tridentContext); _projection = new ProjectionFactory(parents.get(0), _inputFields); _agg.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { List<TridentTuple.Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("Map operation can only have one parent"); } _context = tridentContext; _collector = new FreshCollector(tridentContext); _projection = new TridentTupleView.ProjectionFactory(parents.get(0), _inputFields); _function.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("Each operation can only have one parent"); } _context = tridentContext; _collector = new AppendCollector(tridentContext); _projection = new ProjectionFactory(parents.get(0), _inputFields); _function.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("Partition persist operation can only have one parent"); } _context = tridentContext; _state = (State) context.getTaskData(_stateId); _projection = new ProjectionFactory(parents.get(0), _inputFields); _collector = new FreshCollector(tridentContext); _updater.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map<String, Object> conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("State query operation can only have one parent"); } _context = tridentContext; _state = (State) context.getTaskData(_stateId); _projection = new ProjectionFactory(parents.get(0), _inputFields); _collector = new AppendCollector(tridentContext); _function.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map<String, Object> topoConf, TopologyContext context, TridentContext tridentContext) { this.topologyContext = context; List<TridentTuple.Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("Aggregation related operation can only have one parent"); } Long maxTuplesCacheSize = getWindowTuplesCacheSize(topoConf); this.tridentContext = tridentContext; collector = new FreshCollector(tridentContext); projection = new TridentTupleView.ProjectionFactory(parents.get(0), inputFields); windowStore = windowStoreFactory.create(topoConf); windowTaskId = windowId + WindowsStore.KEY_SEPARATOR + topologyContext.getThisTaskId() + WindowsStore.KEY_SEPARATOR; windowTriggerInprocessId = getWindowTriggerInprocessIdPrefix(windowTaskId); tridentWindowManager = storeTuplesInStore ? new StoreBasedTridentWindowManager(windowConfig, windowTaskId, windowStore, aggregator, tridentContext.getDelegateCollector(), maxTuplesCacheSize, inputFields) : new InMemoryTridentWindowManager(windowConfig, windowTaskId, windowStore, aggregator, tridentContext.getDelegateCollector()); tridentWindowManager.prepare(); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { if(tridentContext.getParentTupleFactories().size()!=1) { throw new RuntimeException("Projection processor can only have one parent"); } _context = tridentContext; _factory = new ProjectionFactory(tridentContext.getParentTupleFactories().get(0), _projectFields); }
public AppendCollector(TridentContext context) { _triContext = context; _factory = new OperationOutputFactory(context.getParentTupleFactories().get(0), context.getSelfOutputFields()); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if(parents.size()!=1) { throw new RuntimeException("Aggregate operation can only have one parent"); } _context = tridentContext; _collector = new FreshCollector(tridentContext); _projection = new ProjectionFactory(parents.get(0), _inputFields); _agg.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); _context = tridentContext; _streamToIndex = new HashMap<>(); List<String> parentStreams = tridentContext.getParentStreams(); for(int i=0; i<parentStreams.size(); i++) { _streamToIndex.put(parentStreams.get(i), i); } _projectionFactories = new ProjectionFactory[_projectFields.size()]; for(int i=0; i<_projectFields.size(); i++) { _projectionFactories[i] = new ProjectionFactory(parents.get(i), _projectFields.get(i)); } _collector = new FreshCollector(tridentContext); _reducer.prepare(conf, new TridentMultiReducerContext((List) Arrays.asList(_projectionFactories))); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if(parents.size()!=1) { throw new RuntimeException("Each operation can only have one parent"); } _context = tridentContext; _collector = new AppendCollector(tridentContext); _projection = new ProjectionFactory(parents.get(0), _inputFields); _function.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { List<TridentTuple.Factory> parents = tridentContext.getParentTupleFactories(); if(parents.size()!=1) { throw new RuntimeException("Map operation can only have one parent"); } _context = tridentContext; _collector = new FreshCollector(tridentContext); _projection = new TridentTupleView.ProjectionFactory(parents.get(0), _inputFields); _function.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if(parents.size()!=1) { throw new RuntimeException("State query operation can only have one parent"); } _context = tridentContext; _state = (State) context.getTaskData(_stateId); _projection = new ProjectionFactory(parents.get(0), _inputFields); _collector = new AppendCollector(tridentContext); _function.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) { List<Factory> parents = tridentContext.getParentTupleFactories(); if(parents.size()!=1) { throw new RuntimeException("Partition persist operation can only have one parent"); } _context = tridentContext; _state = (State) context.getTaskData(_stateId); _projection = new ProjectionFactory(parents.get(0), _inputFields); _collector = new FreshCollector(tridentContext); _updater.prepare(conf, new TridentOperationContext(context, _projection)); }
@Override public void prepare(Map stormConf, TopologyContext context, TridentContext tridentContext) { this.topologyContext = context; List<TridentTuple.Factory> parents = tridentContext.getParentTupleFactories(); if (parents.size() != 1) { throw new RuntimeException("Aggregation related operation can only have one parent"); } Long maxTuplesCacheSize = getWindowTuplesCacheSize(stormConf); this.tridentContext = tridentContext; collector = new FreshCollector(tridentContext); projection = new TridentTupleView.ProjectionFactory(parents.get(0), inputFields); windowStore = windowStoreFactory.create(stormConf); windowTaskId = windowId + WindowsStore.KEY_SEPARATOR + topologyContext.getThisTaskId() + WindowsStore.KEY_SEPARATOR; windowTriggerInprocessId = getWindowTriggerInprocessIdPrefix(windowTaskId); tridentWindowManager = storeTuplesInStore ? new StoreBasedTridentWindowManager(windowConfig, windowTaskId, windowStore, aggregator, tridentContext.getDelegateCollector(), maxTuplesCacheSize, inputFields) : new InMemoryTridentWindowManager(windowConfig, windowTaskId, windowStore, aggregator, tridentContext.getDelegateCollector()); tridentWindowManager.prepare(); }