public class TimestampedRecordOrJsonStringTimeBasedWriterPartitioner extends TimestampedRecordTimeBasedWriterPartitioner<String>
TimeBasedWriterPartitioner
for Timestamped byte[] records whose payload contains json.
This class is a superclass of TimestampedRecordTimeBasedWriterPartitioner
overriding the
TimestampedRecordTimeBasedWriterPartitioner.getNonKafkaTimestamp(P)
method only.
This class uses JsonStringTimestampExtractor
to parse the Json and extract the timestamp.
It takes advantage of JsonStringTimeBasedWriterPartitioner
configuration keys for timestamp
column and timestamp format, as well as static classes to extract their values.
Note: If a record doesn't contain the specified field, or if no field is specified,
the current timestamp will be used.DEFAULT_WRITER_PARTITION_GRANULARITY, DEFAULT_WRITER_PARTITION_TIMEUNIT, DEFAULT_WRITER_PARTITION_TIMEZONE, PARTITIONED_PATH, PREFIX, SUFFIX, timeUnit, WRITER_PARTITION_GRANULARITY, WRITER_PARTITION_PATTERN, WRITER_PARTITION_PREFIX, WRITER_PARTITION_SUFFIX, WRITER_PARTITION_TIMEUNIT, WRITER_PARTITION_TIMEZONE
Constructor and Description |
---|
TimestampedRecordOrJsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state) |
TimestampedRecordOrJsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state,
int numBranches,
int branchId) |
Modifier and Type | Method and Description |
---|---|
protected long |
getNonKafkaTimestamp(String payload) |
getRecordTimestamp
public TimestampedRecordOrJsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state)
public TimestampedRecordOrJsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state, int numBranches, int branchId)
protected long getNonKafkaTimestamp(String payload)
getNonKafkaTimestamp
in class TimestampedRecordTimeBasedWriterPartitioner<String>
Copyright © 2021. All rights reserved.