Examples of ProjectionFactory


Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

    public TridentOperationContext(TridentOperationContext parent, TridentTuple.Factory factory) {
        this(parent._topoContext, factory);
    }   
   
    public ProjectionFactory makeProjectionFactory(Fields fields) {
        return new ProjectionFactory(_factory, fields);
    }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

        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));
    }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

        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));
    }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

    public TridentMultiReducerContext(List<TridentTuple.Factory> factories) {
        _factories = factories;       
    }
   
    public ProjectionFactory makeProjectionFactory(int streamIndex, Fields fields) {
        return new ProjectionFactory(_factories.get(streamIndex), fields);
    }   
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

        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));
    }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

        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)));
    }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

        return new HashMap();
    }

    @Override
    public void execute(Map<TridentTuple, Object> state, int streamIndex, TridentTuple full, TridentCollector collector) {
        ProjectionFactory groupFactory = _groupFactories.get(streamIndex);
        ProjectionFactory inputFactory = _inputFactories.get(streamIndex);
       
        TridentTuple group = groupFactory.create(full);
        TridentTuple input = inputFactory.create(full);
       
        Object curr;
        if(!state.containsKey(group)) {
            curr = _reducer.init(collector, group);
            state.put(group, curr);
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

            // how to distinguish "batch" streams from non-batch streams?
            _stream = stream;
            _factory = new RootFactory(allFields);
            List<String> projected = new ArrayList(allFields.toList());
            projected.remove(0);
            _project = new ProjectionFactory(_factory, new Fields(projected));
        }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

    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);
    }
View Full Code Here

Examples of storm.trident.tuple.TridentTupleView.ProjectionFactory

        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));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.