Package com.cloudera.flume.core

Examples of com.cloudera.flume.core.EventImpl


      // Schema error -- null output value in non-null field. Drop the record.
      LOG.debug("Dropping output record with NULL value in non-null field: " + npe);
      return;
    }

    Event out = new EventImpl(mOutputBytes.toByteArray());
    mOutputQueue.put(out);
  }
View Full Code Here


    MemStreamBuilder streamBuilder = new MemStreamBuilder("s");

    // Select a user-attached "attribute" of the stream.

    streamBuilder.addField(new TypedField("a", Type.getNullable(Type.TypeName.INT)));
    Event e = new EventImpl("1".getBytes());
    e.set("attr", "val".getBytes());
    streamBuilder.addEvent(e);
    StreamSymbol stream = streamBuilder.build();

    runFreeSelectTest(stream, "SELECT #attr AS a  FROM s",
        Collections.singletonList(new Pair<String, Object>(
View Full Code Here

    // Select a user-attached "attribute" of the stream and convert it to
    // a string.

    streamBuilder.addField(new TypedField("f", Type.getNullable(Type.TypeName.INT)));
    Event e = new EventImpl("1".getBytes());
    e.set("attr", "val".getBytes());
    streamBuilder.addEvent(e);
    StreamSymbol stream = streamBuilder.build();

    runFreeSelectTest(stream, "SELECT bin2str(#attr) AS a  FROM s",
        Collections.singletonList(new Pair<String, Object>(
View Full Code Here

  @Override
  public void append(Event e) throws IOException {
    List<RtsqlSink> sinks = mActiveSinks;

    for (RtsqlSink sink : sinks) {
      sink.append(new EventImpl(e));
    }
  }
View Full Code Here

  public void addEvent(Event e) {
    mEvents.add(e);
  }

  public void addEvent(byte[] eventBody) {
    addEvent(new EventImpl(eventBody));
  }
View Full Code Here

  public void addEvent(String eventBodyText) {
    addEvent(eventBodyText.getBytes());
  }

  public void addEvent(String eventBodyText, long eventTime) {
    mEvents.add(new EventImpl(eventBodyText.getBytes(), eventTime, Priority.INFO, 0, null));
  }
View Full Code Here

    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

  }

  /** {@inheritDoc} */
  @Override
  public void close() throws IOException, InterruptedException {
    EventImpl e = new EventImpl(new byte[0]);
    addBloom(bloom, e);
    super.append(e);

    // then close
    super.close();
View Full Code Here

        "Need to open source before reading from it");
    String s = in.readLine();
    if (s == null)
      return null;

    Event e = new EventImpl(s.getBytes());
    updateEventProcessingStats(e);
    return e;
  }
View Full Code Here

    Preconditions.checkState(rd != null, "Next on unopened sink!");
    String s = rd.readLine();
    if (s == null) {
      return null; // end of stream
    }
    Event e = new EventImpl(s.getBytes(CharEncUtils.RAW));
    updateEventProcessingStats(e);
    return e;
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.core.EventImpl

Copyright © 2018 www.massapicom. 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.