if (debug) { System.out.println("Adding field/value " + entry.getKey() + "/" + Bytes.pretty(entry.getValue().toArray()) + " to put request");
if (debug) { System.out.println("Got scan result for key: " + Bytes.pretty(column.key()));
/** * Constructor. * @param table The table that wasn't found. */ TableNotFoundException(final byte[] table) { super(Bytes.pretty(table)); this.table = table; }
/** * Constructor. * @param region The region that was found to be offline. */ RegionOfflineException(final byte[] region) { super(Bytes.pretty(region)); this.region = region; }
private static int findCommaFromEnd(final byte[] b, final int offset) { for (int i = b.length - 1; i > offset; i--) { if (b[i] == ',') { return i; } } throw new IllegalArgumentException("No comma found in " + Bytes.pretty(b) + " after offset " + offset); }
/** * Validates a column family. * @throws IllegalArgumentException if the family name is too big. * @throws NullPointerException if the family is {@code null}. */ static void checkFamily(final byte[] family) { if (family.length > Byte.MAX_VALUE) { throw new IllegalArgumentException("column family too long: " + family.length + " bytes long " + Bytes.pretty(family)); } }
private static void byteArrayToString(StringBuilder sb, byte[][] self) { for (byte[] aSelf : self) { sb.append(Bytes.pretty(aSelf)); } }
/** * Validates a row key. * @throws IllegalArgumentException if the key is too big. * @throws NullPointerException if the key is {@code null}. */ static void checkKey(final byte[] key) { if (key.length > Short.MAX_VALUE) { throw new IllegalArgumentException("row key too long: " + key.length + " bytes long " + Bytes.pretty(key)); } }
/** * Pretty-prints a byte array into a human-readable string. * @param array The (possibly {@code null}) array to pretty-print. * @return The array in a pretty-printed string. */ public static String pretty(final byte[] array) { if (array == null) { return "null"; } final StringBuilder buf = new StringBuilder(1 + array.length + 1); pretty(buf, array); return buf.toString(); }
@Override public String toString() { return String.format("%s(%s)", getClass().getSimpleName(), Bytes.pretty(value)); } }
@Override public String toString() { return String.format("%s(%s)", getClass().getSimpleName(), Bytes.pretty(value)); } }
@Override public String toString() { return String.format("%s(%s)", getClass().getSimpleName(), Bytes.pretty(value)); } }
@Override public String toString() { if (this.columnOffset != null) { return (this.getClass().getSimpleName() + "(" + this.limit + ", " + Bytes.pretty(this.columnOffset) + ")"); } return String.format("%s (%d, %d): predict:%d serialize:%d %s", this.getClass().getSimpleName(), this.limit, this.offset, predictSerializedSize(), serialize().length, Bytes.pretty(serialize())); }
/** * Callback that retries the given RPC and returns its argument unchanged. */ final class RetryRpc<T> implements Callback<T, T> { private final HBaseRpc rpc; RetryRpc(final HBaseRpc rpc) { this.rpc = rpc; } public T call(final T arg) { sendRpc(rpc); return arg; } }