public class NanoTimestamp extends Object
INT64 number of
nanoseconds past epoch, and for defining a Kafka Connect Schema for timestamp values with no timezone
information.Timestamp,
MicroTimestamp,
ZonedTimestamp| Modifier and Type | Field and Description |
|---|---|
static String |
SCHEMA_NAME |
| Modifier | Constructor and Description |
|---|---|
private |
NanoTimestamp() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kafka.connect.data.SchemaBuilder |
builder()
Returns a
SchemaBuilder for a NanoTimestamp. |
static org.apache.kafka.connect.data.Schema |
schema()
Returns a Schema for a
NanoTimestamp but with all other default Schema settings. |
private static long |
toEpochNanos(LocalDate date)
Get the number of nanoseconds past epoch of the given
LocalDate. |
private static long |
toEpochNanos(LocalDateTime timestamp)
Get the number of nanoseconds past epoch of the given
LocalDateTime. |
static long |
toEpochNanos(Object value,
TemporalAdjuster adjuster)
|
public static final String SCHEMA_NAME
public static org.apache.kafka.connect.data.SchemaBuilder builder()
SchemaBuilder for a NanoTimestamp. The resulting schema will describe a field
with the "io.debezium.time.NanoTimestamp" as the name and INT64 for the literal
type storing the number of nanoseconds past midnight.
You can use the resulting SchemaBuilder to set or override additional schema settings such as required/optional, default value, and documentation.
public static org.apache.kafka.connect.data.Schema schema()
NanoTimestamp but with all other default Schema settings. The schema describes a field
with the "io.debezium.time.NanoTimestamp" as the name and INT64 for the literal
type storing the number of nanoseconds past midnight.builder()public static long toEpochNanos(Object value, TemporalAdjuster adjuster)
LocalDateTime, LocalDate,
LocalTime, Date, Date, Time, or
Timestamp.value - the local or SQL date, time, or timestamp value; may not be nulladjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessaryIllegalArgumentException - if the value is not an instance of the acceptable typesprivate static long toEpochNanos(LocalDateTime timestamp)
LocalDateTime.timestamp - the Java timestamp valueCopyright © 2020 JBoss by Red Hat. All rights reserved.