/** Specifies a particular column qualifier to get. */ public GetRequest qualifier(final String qualifier) { return qualifier(qualifier.getBytes()); }
/** * Constructor. * @param table The non-empty name of the table to use. * @param key The row key to get in that table. * @param family The column family. * @param qualifier The column qualifier. * @since 1.5 */ public GetRequest(final String table, final String key, final String family, final String qualifier) { this(table, key); this.family(family); this.qualifier(qualifier); this.bufferable = false; //don't buffer get request }
/** * Constructor. * <strong>These byte arrays will NOT be copied.</strong> * @param table The non-empty name of the table to use. * @param key The row key to get in that table. * @param family The column family. * @param qualifier The column qualifier. * @since 1.5 */ public GetRequest(final byte[] table, final byte[] key, final byte[] family, final byte[] qualifier) { super(table, key); this.family(family); this.qualifier(qualifier); this.bufferable = false; //don't buffer get request }
/** * Returns the cell of the specified row key, using family:kind. */ private byte[] hbaseGet(final byte[] key, final byte[] family) throws HBaseException { final GetRequest get = new GetRequest(table, key); get.family(family).qualifier(kind); try { final ArrayList<KeyValue> row = client.get(get).joinUninterruptibly(); if (row == null || row.isEmpty()) { return null; } return row.get(0).value(); } catch (HBaseException e) { throw e; } catch (Exception e) { throw new RuntimeException("Should never be here", e); } }