@Override public void cleanup() { _updater.cleanup(); }
@Override public void cleanup() { _function.cleanup(); }
public Options<T> withTransactionalJSONBinaryState(String fieldName) { this.stateMapper = new SerializedStateMapper<>(fieldName, new JSONTransactionalSerializer()); return this; }
@Override public Values toValues(T value) { if (value == null) { return null; } switch (stateType) { case NON_TRANSACTIONAL: return new Values(value); case TRANSACTIONAL: TransactionalValue transactional = (TransactionalValue) value; return new Values(transactional.getTxid(), transactional.getVal()); case OPAQUE: OpaqueValue opaque = (OpaqueValue) value; return new Values(opaque.getCurrTxid(), opaque.getCurr(), opaque.getPrev()); default: throw new IllegalStateException("Unknown state type " + stateType); } }
public TridentState persistentAggregate(StateFactory stateFactory, Fields inputFields, CombinerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), inputFields, agg, functionFields); }
@SuppressWarnings("unchecked") public MapStateFactoryBuilder<T> withJSONBinaryState(String stateField) { switch (stateType) { case OPAQUE: return withBinaryState(stateField, (Serializer) new JSONOpaqueSerializer()); case TRANSACTIONAL: return withBinaryState(stateField, (Serializer) new JSONTransactionalSerializer()); case NON_TRANSACTIONAL: return withBinaryState(stateField, new JSONNonTransactionalSerializer()); default: throw new IllegalArgumentException("State type " + stateType + " is unknown."); } }
@Override public List<Iterator<List<Object>>> batchRetrieve(State state, List<TridentTuple> args) { List<Iterator<List<Object>>> ret = new ArrayList<>(args.size()); for (TridentTuple arg : args) { ret.add(((ITupleCollection) state).getTuples()); } return ret; }
public Options<T> withOpaqueJSONBinaryState(String fieldName) { this.stateMapper = new SerializedStateMapper<>(fieldName, new JSONOpaqueSerializer()); return this; }
public Options<T> withNonTransactionalJSONBinaryState(String fieldName) { this.stateMapper = new SerializedStateMapper<>(fieldName, new JSONNonTransactionalSerializer()); return this; }
private void print(List<List<Object>> keys, List<ValueUpdater> updaters) { for (int i = 0; i < keys.size(); i++) { ValueUpdater valueUpdater = updaters.get(i); Object arg = ((CombinerValueUpdater) valueUpdater).getArg(); LOG.info("updateCount = {}, keys = {} => updaterArgs = {}", updateCount, keys.get(i), arg); } }
public TridentState persistentAggregate(StateFactory stateFactory, ReducerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), agg, functionFields); }
public TridentState newStaticState(StateFactory factory) { return newStaticState(new StateSpec(factory)); }
public TridentState partitionPersist(StateFactory stateFactory, Fields inputFields, StateUpdater updater, Fields functionFields) { return partitionPersist(new StateSpec(stateFactory), inputFields, updater, functionFields); }
public TridentState partitionPersist(StateFactory stateFactory, StateUpdater updater, Fields functionFields) { return partitionPersist(new StateSpec(stateFactory), updater, functionFields); }
public TridentState persistentAggregate(StateFactory stateFactory, CombinerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), agg, functionFields); }
public TridentState persistentAggregate(StateFactory stateFactory, ReducerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), agg, functionFields); }
public TridentState persistentAggregate(StateFactory stateFactory, Fields inputFields, ReducerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), inputFields, agg, functionFields); }
public TridentState persistentAggregate(StateFactory stateFactory, CombinerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), agg, functionFields); }
public TridentState persistentAggregate(StateFactory stateFactory, Fields inputFields, CombinerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), inputFields, agg, functionFields); }
public TridentState persistentAggregate(StateFactory stateFactory, Fields inputFields, ReducerAggregator agg, Fields functionFields) { return persistentAggregate(new StateSpec(stateFactory), inputFields, agg, functionFields); }