HBASE-18824 Add meaningful comment to HConstants.LATEST_TIMESTAMP to explain why it is MAX_VALUE

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Xiang Li 2017-09-19 23:10:31 +08:00 committed by Chia-Ping Tsai
parent 38879fb3ff
commit 2ee8690b47
1 changed files with 19 additions and 2 deletions

View File

@ -549,8 +549,25 @@ public final class HConstants {
/** /**
* Timestamp to use when we want to refer to the latest cell. * Timestamp to use when we want to refer to the latest cell.
* This is the timestamp sent by clients when no timestamp is specified on *
* commit. * On client side, this is the timestamp set by default when no timestamp is specified, to refer to the latest.
* On server side, this acts as a notation.
* (1) For a cell of Put, which has this notation,
* its timestamp will be replaced with server's current time.
* (2) For a cell of Delete, which has this notation,
* A. If the cell is of {@link KeyValue.Type#Delete}, HBase issues a Get operation firstly.
* a. When the count of cell it gets is less than the count of cell to delete,
* the timestamp of Delete cell will be replaced with server's current time.
* b. When the count of cell it gets is equal to the count of cell to delete,
* the timestamp of Delete cell will be replaced with the latest timestamp of cell it gets.
* (c. It is invalid and an exception will be thrown,
* if the count of cell it gets is greater than the count of cell to delete,
* as the max version of Get is set to the count of cell to delete.)
* B. If the cell is of other Delete types, like {@link KeyValue.Type#DeleteFamilyVersion},
* {@link KeyValue.Type#DeleteColumn}, or {@link KeyValue.Type#DeleteFamily},
* the timestamp of Delete cell will be replaced with server's current time.
*
* So that is why it is named as "latest" but assigned as the max value of Long.
*/ */
public static final long LATEST_TIMESTAMP = Long.MAX_VALUE; public static final long LATEST_TIMESTAMP = Long.MAX_VALUE;