public void submit(Object object) { dataFlowEmitter.submit(object); }
public void next() throws InterruptedException { lifecycle.add("next(numrows=" + numrows + ")"); if (numrows < 2) { numrows++; graphContext.submit("E" + numrows); } else { graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { }); } }
public void next() throws InterruptedException { Object next = emittables.take(); if (next instanceof EPDataFlowSignal) { EPDataFlowSignal signal = (EPDataFlowSignal) next; graphContext.submitSignal(signal); } else if (next instanceof PortAndMessagePair) { PortAndMessagePair pair = (PortAndMessagePair) next; graphContext.submitPort(pair.getPort(), pair.getMessage()); } else { graphContext.submit(next); } }
public void onInput(Object row) { if (log.isDebugEnabled()) { log.debug("Received row for filtering: " + Arrays.toString((Object[]) row)); } if (!(row instanceof EventBeanSPI)) { theEvent.setUnderlying(row); } else { theEvent = (EventBeanSPI) row; } Boolean pass = (Boolean) factory.getFilter().evaluate(eventsPerStream, true, agentInstanceContext); if (pass != null && pass) { if (log.isDebugEnabled()) { log.debug("Submitting row " + Arrays.toString((Object[]) row)); } if (factory.isSingleOutputPort()) { graphContext.submit(row); } else { graphContext.submitPort(0, row); } } else { if (!factory.isSingleOutputPort()) { graphContext.submitPort(1, row); } } } }
graphContext.submitPort(0, lineProcessor.process(line, filenameOrUri)); } else { graphContext.submit(lineProcessor.process(line, filenameOrUri));
public void next() { if (lines.hasNext()) { dataFlowEmitter.submit(new Object[]{lines.next()}); } else { dataFlowEmitter.submitSignal(new EPDataFlowSignalFinalMarker() { }); } }
public void onSignal(EPDataFlowSignal signal) { log.debug("Received punctuation, submitting totals: " + aggregate); graphContext.submit(aggregate); } }
graphContext.submitPort(0, lineProcessor.process(line, filenameOrUri)); } else { graphContext.submit(lineProcessor.process(line, filenameOrUri));
public void next() { if (iterator.hasNext()) { Object[] next = iterator.next(); if (log.isDebugEnabled()) { log.debug("submitting row " + Arrays.toString(next)); } graphContext.submit(next); } else { if (log.isDebugEnabled()) { log.debug("submitting punctuation"); } graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { }); } }
private void submitAndDone(Object row) { graphContext.submit(row); if (periodDelayMSec > 0) { lastSendTime = System.nanoTime(); } }
public void next() throws InterruptedException { currentCount++; if (instructions.length <= currentCount) { graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { }); return; } Object next = instructions[currentCount]; if (next instanceof CountDownLatch) { CountDownLatch latch = (CountDownLatch) next; latch.await(); } else if (next instanceof Long) { long sleepTime = (Long) next; Thread.sleep(sleepTime); } else if (next instanceof RuntimeException) { RuntimeException ex = (RuntimeException) next; throw new RuntimeException("Support-graph-source generated exception: " + ex.getMessage(), ex); } else { graphContext.submit(next); } }
public void next() throws InterruptedException { Thread.sleep(100); final String[] words = new String[]{"this", "is", "a", "test"}; final Random rand = new Random(); final String word = words[rand.nextInt(words.length)]; graphContext.submit(new Object[]{word}); }
public void onInput(String line) { StringTokenizer tokenizer = new StringTokenizer(line, " \t"); int wordCount = tokenizer.countTokens(); int charCount = 0; while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); charCount += token.length(); } log.debug("Submitting stat words[" + wordCount + "] chars[" + charCount + "] for line '" + line + "'"); graphContext.submit(new Object[]{1, wordCount, charCount}); } }
public void next() throws InterruptedException { Object next = emittables.take(); graphContext.submit(next); }
public void collect(EPDataFlowEventBeanCollectorContext context) { this.last = context; context.getEmitter().submit(context.getEvent()); }
public void collect(DataInputToObjectCollectorContext context) throws IOException { int size = context.getDataInput().readInt(); byte[] bytes = new byte[size]; context.getDataInput().readFully(bytes); Object event = SerializerUtil.byteArrToObject(bytes); if (log.isDebugEnabled()) { log.debug("Submitting event " + EventBeanSummarizer.summarizeUnderlying(event)); } context.getEmitter().submit(event); } }
public void onSignal(EPDataFlowSignal signal) { if (factory.isIterate() && signal instanceof EPDataFlowSignalFinalMarker) { Iterator<EventBean> it = startResult.getFinalView().iterator(); if (it != null) { for (; it.hasNext(); ) { EventBean event = it.next(); if (factory.isSubmitEventBean()) { graphContext.submit(event); } else { graphContext.submit(event.getUnderlying()); } } } } }
public void newResult(UniformPair<EventBean[]> result) { if (result == null || result.getFirst() == null || result.getFirst().length == 0) { return; } for (EventBean item : result.getFirst()) { if (factory.isSubmitEventBean()) { graphContext.submit(item); } else { graphContext.submit(item.getUnderlying()); } } } }
public void collect(AMQPToObjectCollectorContext context) { context.getEmitter().submit(SerializerUtil.byteArrToObject(context.getBytes())); } }