Package com.odiago.flumebase.lang

Examples of com.odiago.flumebase.lang.Timestamp


  }

  @Override
  public Object eval(EventWrapper event, Object... args) {
    Event e = event.getEvent();
    return new Timestamp(e.getTimestamp(), e.getNanos());
  }
View Full Code Here


    return Type.getPrimitive(Type.TypeName.TIMESTAMP);
  }

  @Override
  public Object eval(EventWrapper event, Object... args) {
    return new Timestamp(System.currentTimeMillis());
  }
View Full Code Here

      // If we get any GenericRecord types, convert them to our own specific types
      // if we can figure out which to use. This makes toString'ing prettier.
      if (fieldVal instanceof GenericRecord) {
        GenericRecord record = (GenericRecord) fieldVal;
        if (record.getSchema().equals(TimestampBase.SCHEMA$)) {
          fieldVal = new Timestamp((Long) record.get("milliseconds"),
              (Long) record.get("nanos"));
        }
      }

      if (null == fieldVal) {
View Full Code Here

      }
      break;
    case TIMESTAMP:
      out = CharBufferUtils.parseLong(chars);
      if (null != out) {
        out = new Timestamp((Long) out);
      }
      break;
    case TIMESPAN:
      // TODO: This should return a TimeSpan object, which is actually two
      // fields. We need to work on this... it should not just be a 'long'
View Full Code Here

            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

TOP

Related Classes of com.odiago.flumebase.lang.Timestamp

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.