Examples of ParsingEventWrapper


Examples of com.odiago.flumebase.exec.ParsingEventWrapper

    //LOG.debug("Delivering to " + mContextSourceName + ": Input event in rtsqlsink: "
    //    + new String(e.getBody()));
    try {
      e.set(FlowElement.STREAM_NAME_ATTR, mStreamSymbol.getName().getBytes());
      EventWrapper wrapper = new ParsingEventWrapper(mStreamSymbol.getEventParser(),
          mFieldNames);
      wrapper.reset(e);
      mWriteContext.emit(wrapper);
    } catch (InterruptedException ie) {
      // TODO(aaron): When Flume's api lets us throw InterruptedException, do so directly.
      throw new IOException(ie);
    }
View Full Code Here

Examples of com.odiago.flumebase.exec.ParsingEventWrapper

    symbols.addSymbol(new AssignedSymbol("x", Type.getPrimitive(Type.TypeName.INT), "x",
        IdentifierExpr.AccessType.FIELD));

    ArrayList<String> symbolNames = new ArrayList<String>();
    symbolNames.add("x");
    EventWrapper wrapper = new ParsingEventWrapper(new DelimitedEventParser(),
        symbolNames);
    wrapper.reset(new EventImpl("4".getBytes()));

    // This is expected to succeed.
    binExpr = new BinExpr(
        new IdentifierExpr("x"),
        BinOp.Times,
View Full Code Here

Examples of com.odiago.flumebase.exec.ParsingEventWrapper

          }

          try {
            FileSourceEvent event = new FileSourceEvent(line.getBytes());
            event.set(STREAM_NAME_ATTR, mStream.getName().getBytes());
            ParsingEventWrapper wrapper = new ParsingEventWrapper(mStream.getEventParser(),
                mFieldNames);
            wrapper.reset(event);

            if (timestampField == null) {
              event.setTimestamp(System.currentTimeMillis());
            } else {
              Timestamp timestamp = (Timestamp) wrapper.getField(timestampField);
              if (null == timestamp) {
                event.setTimestamp(System.currentTimeMillis());
              } else {
                event.setTimestamp(timestamp.milliseconds);
              }
View Full Code Here

Examples of com.odiago.flumebase.exec.ParsingEventWrapper

import com.odiago.flumebase.io.DelimitedEventParser;

public class ExprTestCase {
  /** Create an event wrapper for an empty record. */
  protected EventWrapper getEmptyEventWrapper() {
    return new ParsingEventWrapper(new DelimitedEventParser(), new ArrayList<String>());
  }
View Full Code Here

Examples of com.odiago.flumebase.exec.ParsingEventWrapper

        // Iterate over all the input events, and wrap them in
        // a parsing EventWrapper; advance these to the output.
        while (iter.hasNext()) {
          Event rawEvent = iter.next();
          rawEvent.set(STREAM_NAME_ATTR, mStreamSymbol.getName().getBytes());
          EventWrapper wrapper = new ParsingEventWrapper(mStreamSymbol.getEventParser(),
              mFieldNames);
          wrapper.reset(rawEvent);
          context.emit(wrapper);
        }
      } catch (IOException ioe) {
        LOG.error("IOException emitting event: " + ioe);
      } catch (InterruptedException ie) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.