@Test public void testGetSaltingByte() { Set<Byte> saltBytes = Sets.newHashSet(); for (int i = 0; i < 100; i++) { saltBytes.add(SaltingUtil.getSaltingByte(Bytes.toBytes(i), 0, Bytes.SIZEOF_INT, 3)); } assertEquals(ImmutableSet.of((byte)0, (byte)1, (byte)2), saltBytes); }
public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) { int hash = calculateHashCode(value, offset, length); return (byte) Math.abs(hash % bucketNum); }
SaltingUtil { public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) { int hash = calculateHashCode(value, offset, length); return (byte) Math.abs(hash % bucketNum); } }
SaltingUtil { public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) { int hash = calculateHashCode(value, offset, length); return (byte) Math.abs(hash % bucketNum); }  }
SaltingUtil { public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) { int hash = calculateHashCode(value, offset, length); return (byte) Math.abs(hash % bucketNum); }  static List<KeyRange> generateAllSaltingRanges(int bucketNum); static byte[][] getSalteByteSplitPoints(int saltBucketNum); static byte[] getSaltedKey(ImmutableBytesWritable key, int bucketNum); static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum); static KeyRange addSaltByte(byte[] startKey, KeyRange minMaxRange); static void addRegionStartKeyToScanStartAndStopRows(byte[] startKey, byte[] endKey, Scan scan); }
SaltingUtil { public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) { int hash = calculateHashCode(value, offset, length); return (byte) Math.abs(hash % bucketNum); }  static List<KeyRange> generateAllSaltingRanges(int bucketNum); static byte[][] getSalteByteSplitPoints(int saltBucketNum); static byte[] getSaltedKey(ImmutableBytesWritable key, int bucketNum); static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum); static KeyRange addSaltByte(byte[] startKey, KeyRange minMaxRange); static void addRegionStartKeyToScanStartAndStopRows(byte[] startKey, byte[] endKey, Scan scan); static final int NUM_SALTING_BYTES; static final Integer MAX_BUCKET_NUM; static final String SALTING_COLUMN_NAME; static final String SALTED_ROW_KEY_NAME; static final PColumnImpl SALTING_COLUMN; static final RowKeySchema VAR_BINARY_SALTED_SCHEMA; }