public class JsonStringTimeBasedWriterPartitioner extends org.apache.gobblin.writer.partitioner.TimeBasedWriterPartitioner<String>
TimeBasedWriterPartitioner
for byte[] containing json.
The json field that contains the timestamp can be specified using TIMESTAMP_COLUMN_KEY.
The format of the json field that contains the timestamp can be specified using TIMESTAMP_FORMAT_KEY.
If a record doesn't contain the specified field, or if no field is specified, the current timestamp will be used.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TIMESTAMP_COLUMN |
static String |
DEFAULT_TIMESTAMP_FORMAT |
static String |
TIMESTAMP_COLUMNS_KEY |
static String |
TIMESTAMP_FORMAT_KEY |
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 |
---|
JsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state) |
JsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state,
int numBranches,
int branchId) |
Modifier and Type | Method and Description |
---|---|
long |
getRecordTimestamp(String rec) |
static List<String> |
getWriterPartitionerTimestampColumns(org.apache.gobblin.configuration.State state,
int numBranches,
int branchId)
Utility function facilitating getting a timestamp-column.
|
static String |
getWriterPartitionerTimestampFormat(org.apache.gobblin.configuration.State state,
int numBranches,
int branchId)
Utility function facilitating getting a timestamp-format.
|
public static final String TIMESTAMP_COLUMNS_KEY
public static final String DEFAULT_TIMESTAMP_COLUMN
public static final String TIMESTAMP_FORMAT_KEY
public static final String DEFAULT_TIMESTAMP_FORMAT
public JsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state)
public JsonStringTimeBasedWriterPartitioner(org.apache.gobblin.configuration.State state, int numBranches, int branchId)
public long getRecordTimestamp(String rec)
getRecordTimestamp
in class org.apache.gobblin.writer.partitioner.TimeBasedWriterPartitioner<String>
public static List<String> getWriterPartitionerTimestampColumns(org.apache.gobblin.configuration.State state, int numBranches, int branchId)
public static String getWriterPartitionerTimestampFormat(org.apache.gobblin.configuration.State state, int numBranches, int branchId)
Copyright © 2021. All rights reserved.