Exemplo n.º 1
0
  @Override
  public void cleanup(FlowProcess flowProcess, OperationCall<TupleEntryCollector> operationCall) {
    if (!flushCalled) throw new RuntimeException("flush never called");

    if (path == null) return;

    operationCall.getContext().close();
  }
Exemplo n.º 2
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<TupleEntryCollector> operationCall) {
    if (path == null) return;

    try {
      operationCall.setContext(flowProcess.openTapForWrite(path));
    } catch (IOException exception) {
      exception.printStackTrace();
    }
  }
Exemplo n.º 3
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<DocumentBuilder> operationCall) {
    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

      factory.setNamespaceAware(true);

      operationCall.setContext(factory.newDocumentBuilder());
    } catch (ParserConfigurationException exception) {
      throw new OperationException("could not create document builder", exception);
    }
  }
Exemplo n.º 4
0
 @Override
 public void prepare(FlowProcess flowProcess, OperationCall<Matcher> operationCall) {
   operationCall.setContext(getPattern().matcher(""));
 }
Exemplo n.º 5
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<Random> operationCall) {
    super.prepare(flowProcess, operationCall);

    operationCall.setContext(new Random(seed));
  }