Reads something from HBase. A note on passing byte arrays in argument None of the method that receive a byte[] in argument will copy it. For more info, please refer to the documentation of HBaseRpc. A note on passing Strings in argument All strings
| 44 | * All strings are assumed to use the platform's default charset. |
| 45 | */ |
| 46 | public final class GetRequest extends BatchableRpc |
| 47 | implements HBaseRpc.HasTable, HBaseRpc.HasKey, |
| 48 | HBaseRpc.HasFamily, HBaseRpc.HasQualifiers { |
| 49 | |
| 50 | private static final byte[] GET = new byte[] { 'g', 'e', 't' }; |
| 51 | static final byte[] GGET = new byte[] { 'G', 'e', 't' }; // HBase 0.95+ |
| 52 | private static final byte[] EXISTS = |
| 53 | new byte[] { 'e', 'x', 'i', 's', 't', 's' }; |
| 54 | |
| 55 | private byte[][] qualifiers; |
| 56 | private long lockid = RowLock.NO_LOCK; |
| 57 | private boolean populate_blockcache = true; |
| 58 | |
| 59 | /** |
| 60 | * How many versions of each cell to retrieve. |
| 61 | * The least significant bit is used as a flag to indicate when |
| 62 | * this Get request is in fact an Exist request (i.e. like Get |
| 63 | * except that instead of returning a result the RPC returns a |
| 64 | * boolean indicating whether the row exists or not). |
| 65 | */ |
| 66 | private int versions = 1 << 1; |
| 67 | |
| 68 | /** Minimum {@link KeyValue} cell timestamp. */ |
| 69 | private long min_timestamp = 0; |
| 70 | |
| 71 | /** Maximum {@link KeyValue} cell timestamp. */ |
| 72 | private long max_timestamp = Long.MAX_VALUE; |
| 73 | |
| 74 | /** Filter to apply on the scanner. */ |
| 75 | private ScanFilter filter; |
| 76 | |
| 77 | /** When set in the `versions' field, this is an Exist RPC. */ |
| 78 | private static final int EXIST_FLAG = 0x1; |
| 79 | |
| 80 | /** |
| 81 | * Constructor. |
| 82 | * <strong>These byte arrays will NOT be copied.</strong> |
| 83 | * @param table The non-empty name of the table to use. |
| 84 | * @param key The row key to get in that table. |
| 85 | */ |
| 86 | public GetRequest(final byte[] table, final byte[] key) { |
| 87 | super(table, key); |
| 88 | this.bufferable = false; //don't buffer get request |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Constructor. |
| 93 | * @param table The non-empty name of the table to use. |
| 94 | * @param key The row key to get in that table. |
| 95 | * <strong>This byte array will NOT be copied.</strong> |
| 96 | */ |
| 97 | public GetRequest(final String table, final byte[] key) { |
| 98 | this(table.getBytes(), key); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Constructor. |
| 103 | * @param table The non-empty name of the table to use. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…