Products | Versions |
---|---|
TIBCO Streaming | 10 |
What Java type and statement can be used to set a StreamBase EventFlow Timestamp value in a custom Java operator or adapter?
ArrayList<Schema.Field> fields = new ArrayList<Schema.Field>(); fields.add(new Schema.Field("Time",CompleteDataType.forTimestamp())); schema0 = new Schema("", fields); setOutputSchema(0, schema0);
Tuple tuple = getOutputSchema(0).createTuple();
tuple.setTimestamp("Time", Timestamp.msecs( Timestamp.TIMESTAMP, System.currentTimeMillis()) );or as an interval timestamp (with no date information):
tuple.setTimestamp("Time", Timestamp.msecs( Timestamp.INTERVAL, 2000l ); // two seconds, long