An intermediate abstract class for all RPC requests that can be batched. This class is internal only and doesn't provide any user-facing API other than guaranteeing that the RPC has a family and a timestamp.
| 37 | * than guaranteeing that the RPC has a family and a timestamp. |
| 38 | */ |
| 39 | abstract class BatchableRpc extends HBaseRpc |
| 40 | implements HBaseRpc.HasFamily, HBaseRpc.HasTimestamp { |
| 41 | |
| 42 | // Attributes should have `protected' visibility, but doing so exposes |
| 43 | // them as part of the public API and in Javadoc, which we don't want. |
| 44 | // So instead we make them package-private so that subclasses can still |
| 45 | // access them directly. |
| 46 | |
| 47 | /** Family affected by this RPC. */ |
| 48 | /*protected*/ byte[] family; |
| 49 | |
| 50 | /** The timestamp to use for {@link KeyValue}s of this RPC. */ |
| 51 | /*protected*/ final long timestamp; |
| 52 | |
| 53 | /** |
| 54 | * Explicit row lock to use, if any. |
| 55 | * @see RowLock |
| 56 | */ |
| 57 | /*protected*/ final long lockid; |
| 58 | |
| 59 | /** |
| 60 | * Whether or not this batchable RPC can be buffered on the client side. |
| 61 | * Please call {@link #canBuffer} to check if this RPC can be buffered, |
| 62 | * don't test this field directly. |
| 63 | */ |
| 64 | /*protected*/ boolean bufferable = true; |
| 65 | |
| 66 | /** |
| 67 | * Whether or not the RegionServer must write to its WAL (Write Ahead Log). |
| 68 | */ |
| 69 | /*protected*/ boolean durable = true; |
| 70 | |
| 71 | /** |
| 72 | * Package private constructor. |
| 73 | * @param table The name of the table this RPC is for. |
| 74 | * @param row The name of the row this RPC is for. |
| 75 | * @param family The column family to edit in that table. Subclass must |
| 76 | * validate, this class doesn't perform any validation on the family. |
| 77 | * @param timestamp The timestamp to use for {@link KeyValue}s of this RPC. |
| 78 | * @param lockid Explicit row lock to use, or {@link RowLock#NO_LOCK}. |
| 79 | */ |
| 80 | BatchableRpc(final byte[] table, |
| 81 | final byte[] key, final byte[] family, |
| 82 | final long timestamp, final long lockid) { |
| 83 | super(table, key); |
| 84 | this.family = family; |
| 85 | this.timestamp = timestamp; |
| 86 | this.lockid = lockid; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Package private constructor overload. |
| 91 | * @param table The name of the table this RPC is for. |
| 92 | * @param key The row key for this RPC. |
| 93 | * @since 1.8 |
| 94 | */ |
| 95 | BatchableRpc(final byte[] table, final byte[] key) { |
| 96 | super(table, key); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…