/** * This method can be used to check if the environment has been stopped prematurely by e.g. a timeout. * * @return true if has been stopped forcefully. */ public Boolean hasBeenStopped() { return runner.hasBeenStopped(); }
/** * Getter for the timeout interval * after the test execution gets stopped. * * @return timeout in milliseconds */ public Long getTimeoutInterval() { return runner.getTimeoutInterval(); }
/** * Receives a byte array. * Will block until data is available! * * @return received byte array. */ public byte[] recv() { return getNextMessage(); }
/** * Setter for the timeout interval after the test execution gets stopped. * * @param interval in milliseconds. */ public void setTimeoutInterval(long interval) { runner.setTimeoutInterval(interval); }
public void executeTest() throws Throwable { runner.executeTest(); }
@Override public void open(int taskNumber, int numTasks) throws IOException { this.taskNumber = taskNumber; this.numTasks = numTasks; //open a socket to push data handler = new OutputPublisher(instance, ringBuffer); }
@Override public void close() throws IOException { //signal close to output receiver handler.sendClose(taskNumber); } }
private boolean feedVerifier(byte[] bytes) throws IOException, FlinkTestFailedException { OUT elem = SerializeUtil.deserialize(bytes, typeSerializer); numRecords++; try { verifier.receive(elem); } catch (Exception e) { throw new FlinkTestFailedException(e); } return trigger.onRecord(elem) || trigger.onRecordCount(numRecords); }
public OutputHandler(int instance, Disruptor<OutputEvent> disruptor, OutputVerifier<OUT> verifier, VerifyFinishedTrigger<? super OUT> trigger) { subscriber = new OutputSubscriber(instance, disruptor); this.verifier = verifier; this.trigger = trigger; }
@Override public void finish() throws Exception { verifier.finish(); } }
public void run() { stopExecution(); } };
@Override public void init() { verifier.init(); }
@Override public void finish() throws FlinkTestFailedException { verify(output); }
public OutputEvent newInstance() { return new OutputEvent(); }
public void send(byte[] bytes) { queueMessage(bytes); }
public void close() { subscriber.close(); }
/** * This method can be used to check if the environment has been * stopped prematurely by e.g. a timeout. * * @return true if has been stopped forcefully. */ public Boolean hasBeenStopped() { return runner.hasBeenStopped(); }
/** * Getter for the timeout interval after the test execution gets stopped. * * @return timeout in milliseconds */ public Long getTimeoutInterval() { return runner.getTimeoutInterval(); }
/** * Setter for the timeout interval * after the test execution gets stopped. * * @param interval in milliseconds. */ public void setTimeoutInterval(long interval) { runner.setTimeoutInterval(interval); }
public void executeTest() throws Throwable { runner.executeTest(); }