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 onS1(int value) { String output = "S1-" + value; graphContext.submitPort(0, new Object[]{output}); } }
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 submit(Object object) { dataFlowEmitter.submit(object); }
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); } } } }
public void processSignal(EPDataFlowSignal signal) { context.submitSignal(signal); } });
first = false; if (bofProcessor != null) { graphContext.submitPort(1, bofProcessor.processXOF(filenameOrUri)); graphContext.submitPort(0, lineProcessor.process(line, filenameOrUri)); } else { graphContext.submit(lineProcessor.process(line, filenameOrUri)); graphContext.submitPort(port, eofProcessor.processXOF(filenameOrUri)); graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { });
public void onSignal(EPDataFlowSignal signal) { log.debug("Received punctuation, submitting totals: " + aggregate); graphContext.submit(aggregate); } }
public void submitSignal(EPDataFlowSignal signal) { facility.submitSignal(signal); }
first = false; if (bofProcessor != null) { graphContext.submitPort(1, bofProcessor.processXOF(filenameOrUri)); graphContext.submitPort(0, lineProcessor.process(line, filenameOrUri)); } else { graphContext.submit(lineProcessor.process(line, filenameOrUri)); graphContext.submitPort(port, eofProcessor.processXOF(filenameOrUri)); graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { });
public void next() { if (lines.hasNext()) { dataFlowEmitter.submit(new Object[]{lines.next()}); } else { dataFlowEmitter.submitSignal(new EPDataFlowSignalFinalMarker() { }); } }
private void submitAndDone(Object row) { graphContext.submit(row); if (periodDelayMSec > 0) { lastSendTime = System.nanoTime(); } }
public void onTemp(int current, long temp) { if (current == 1) { graphContext.submitPort(1, new Object[]{temp}); // we are done } else { current--; long result = temp * current; graphContext.submitPort(0, new Object[]{current, result}); } } }
public void submitSignal(EPDataFlowSignal signal) { dataFlowEmitter.submitSignal(signal); }
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() { }); } }
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 onS0(String value) { String output = "S0-" + value; graphContext.submitPort(1, new Object[]{output}); }
Thread.sleep(initialDelayMSec, 0); } catch (InterruptedException e) { graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { }); Thread.sleep(sleepTime); } catch (InterruptedException e) { graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { }); graphContext.submitSignal(new EPDataFlowSignalFinalMarker() { }); } else {
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 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}); } }