public class TimestampNanosProvider extends Object implements TimestampProvider
Note: Nanosecond precision is achieved using combination of the System.currentTimeMillis()
and
System.nanoTime()
methods, with synchronization against System.currentTimeMillis()
only at the beginning.
Please note that it may have some precision loss.
final TimestampProvider timestampProvider = new TimestampNanosProvider();
session.setTimestampProvider(timestampProvider);
Modifier and Type | Field and Description |
---|---|
static int |
TIMESTAMP_LENGTH |
Constructor and Description |
---|
TimestampNanosProvider() |
Modifier and Type | Method and Description |
---|---|
long |
getTimestamp()
Returns timestamp.
|
byte[] |
getTimestampBytes()
Returns timestamp.
|
public static final int TIMESTAMP_LENGTH
public byte[] getTimestampBytes()
TimestampProvider
Note: Timestamp should not contains space character.
getTimestampBytes
in interface TimestampProvider
public long getTimestamp()
TimestampProvider
getTimestamp
in interface TimestampProvider
Copyright © 2005–2024 Onix Solutions. All rights reserved.