/** * Specifies a particular column family to get. * @param family The column family. * <strong>This byte array will NOT be copied.</strong> * @return {@code this}, always. */ public GetRequest family(final byte[] family) { KeyValue.checkFamily(family); this.family = family; return this; }
/** * Specifies a particular column family to scan. * @param family The column family. * <strong>This byte array will NOT be copied.</strong> * @throws IllegalStateException if scanning already started. */ public void setFamily(final byte[] family) { KeyValue.checkFamily(family); checkScanningNotStarted(); families = new byte[][] { family }; }
/** * Specifies multiple column families to scan. * <p> * NOTE: This will null out the qualifiers list if it was set previously as * well as replace any families that were already set. * @param families A list of one or more family names. * @throws IllegalStateException if scanning already started. * @since 1.5 */ public void setFamilies(final String... families) { checkScanningNotStarted(); this.families = new byte[families.length][]; for (int i = 0; i < families.length; i++) { this.families[i] = families[i].getBytes(); KeyValue.checkFamily(this.families[i]); } qualifiers = null; }
/** * 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 of the value to increment. * @param family The column family of the value to increment. * @param qualifier The column qualifier of the value to increment. * @param amount Amount by which to increment the value in HBase. * If negative, the value in HBase will be decremented. */ public AtomicIncrementRequest(final byte[] table, final byte[] key, final byte[] family, final byte[] qualifier, final long amount) { super(table, key); KeyValue.checkFamily(family); KeyValue.checkQualifier(qualifier); this.family = family; this.qualifier = qualifier; this.amount = amount; }
/** Private constructor. */ private AppendRequest(final byte[] table, final byte[] key, final byte[] family, final byte[][] qualifiers, final byte[][] values, final long timestamp, final long lockid, final boolean return_result) { super(table, key, family, timestamp, lockid); KeyValue.checkFamily(family); if (qualifiers.length != values.length) { throw new IllegalArgumentException("Have " + qualifiers.length + " qualifiers and " + values.length + " values. Should be equal."); } else if (qualifiers.length == 0) { throw new IllegalArgumentException("Need at least one qualifier/value."); } for (int i = 0; i < qualifiers.length; i++) { KeyValue.checkQualifier(qualifiers[i]); KeyValue.checkValue(values[i]); } this.qualifiers = qualifiers; this.values = values; }
final long[] amounts) { super(table, key); KeyValue.checkFamily(family); this.family = family;
/** Private constructor. */ private PutRequest(final byte[] table, final byte[] key, final byte[] family, final byte[][] qualifiers, final byte[][] values, final long timestamp, final long lockid) { super(table, key, family, timestamp, lockid); KeyValue.checkFamily(family); if (qualifiers.length != values.length) { throw new IllegalArgumentException("Have " + qualifiers.length + " qualifiers and " + values.length + " values. Should be equal."); } else if (qualifiers.length == 0) { throw new IllegalArgumentException("Need at least one qualifier/value."); } for (int i = 0; i < qualifiers.length; i++) { KeyValue.checkQualifier(qualifiers[i]); KeyValue.checkValue(values[i]); } this.qualifiers = qualifiers; this.values = values; }
/** * Specifies multiple column families to scan. * <p> * If {@code qualifiers} is not {@code null}, then {@code qualifiers[i]} * is assumed to be the list of qualifiers to scan in the family * {@code families[i]}. If {@code qualifiers[i]} is {@code null}, then * all the columns in the family {@code families[i]} will be scanned. * @param families Array of column families names. * @param qualifiers Array of column qualifiers. Can be {@code null}. * <strong>This array of byte arrays will NOT be copied.</strong> * @throws IllegalStateException if scanning already started. * @since 1.5 */ public void setFamilies(byte[][] families, byte[][][] qualifiers) { checkScanningNotStarted(); for (int i = 0; i < families.length; i++) { KeyValue.checkFamily(families[i]); if (qualifiers != null && qualifiers[i] != null) { for (byte[] qualifier : qualifiers[i]) { KeyValue.checkQualifier(qualifier); } } } this.families = families; this.qualifiers = qualifiers; }
checkFamily(family); checkQualifier(qualifier); checkTimestamp(timestamp);
super(table, key, family == null ? WHOLE_ROW : family, timestamp, lockid); if (family != null) { KeyValue.checkFamily(family);