private void addSlidingUnifiers() { OperatorMeta sourceOM = streamMeta.getSource().getOperatorMeta(); if (sourceOM.getAttributes().contains(Context.OperatorContext.SLIDE_BY_WINDOW_COUNT)) { if (sourceOM.getValue(Context.OperatorContext.SLIDE_BY_WINDOW_COUNT) < sourceOM.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT)) { plan.undeployOpers.addAll(slidingUnifiers); slidingUnifiers.clear(); List<PTOutput> newUpstream = Lists.newArrayList(); PTOperator slidingUnifier; for (PTOutput source : upstream) { slidingUnifier = StreamMapping.createSlidingUnifier(streamMeta, plan, sourceOM.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT), sourceOM.getValue(Context.OperatorContext.SLIDE_BY_WINDOW_COUNT)); addInput(slidingUnifier, source, null); this.slidingUnifiers.add(slidingUnifier); newUpstream.add(slidingUnifier.outputs.get(0)); } upstream.clear(); upstream.addAll(newUpstream); } else { LOG.warn("Sliding Window Count {} should be less than APPLICATION WINDOW COUNT {}", sourceOM.getValue(Context.OperatorContext.SLIDE_BY_WINDOW_COUNT), sourceOM.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT)); } } }
Partitioner<Operator> partitioner = m.logicalOperator.getAttributes().contains(OperatorContext.PARTITIONER) ? (Partitioner<Operator>)m.logicalOperator.getValue(OperatorContext.PARTITIONER) : operator instanceof Partitioner ? (Partitioner<Operator>)operator : null;
if (sourceOM.getAttributes().contains(Context.OperatorContext.SLIDE_BY_WINDOW_COUNT)) { if (sourceOM.getValue(Context.OperatorContext.SLIDE_BY_WINDOW_COUNT) < sourceOM.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT)) {
|| n.attributes != null && !n.attributes.contains(OperatorContext.PARTITIONER) && Partitioner.class.isAssignableFrom(n.getOperator().getClass())) { throw new ValidationException("Operator " + n.getName() + " provides partitioning capabilities but the annotation on the operator class declares it non partitionable!");
private Partitioner<Operator> getPartitioner(PMapping currentMapping) { Operator operator = currentMapping.logicalOperator.getOperator(); Partitioner<Operator> partitioner = null; if (currentMapping.logicalOperator.getAttributes().contains(OperatorContext.PARTITIONER)) { @SuppressWarnings("unchecked") Partitioner<Operator> tmp = (Partitioner<Operator>)currentMapping.logicalOperator.getValue(OperatorContext.PARTITIONER); partitioner = tmp; } else if (operator instanceof Partitioner) { @SuppressWarnings("unchecked") Partitioner<Operator> tmp = (Partitioner<Operator>)operator; partitioner = tmp; } return partitioner; }
@Override public void setup(Context.PortContext context) { if (context.getAttributes().contains(Context.PortContext.TUPLE_CLASS)) { pojoClass = context.getAttributes().get(Context.PortContext.TUPLE_CLASS); } }
@Override public void setup(Context.PortContext context) { if (context.getAttributes().contains(Context.PortContext.TUPLE_CLASS)) { pojoClass = context.getAttributes().get(Context.PortContext.TUPLE_CLASS); } }