@Test public void testCheckRowKeyForAllNulls() { byte[] pk = new byte[] { 'a', 'b', 'z' }; byte[] result = EMPTY_INDEX_KEY; assertTrue("Didn't correctly read single element as being null in row key", CoveredColumnIndexCodec.checkRowKeyForAllNulls(result)); result = CoveredColumnIndexCodec.composeRowKey(pk, 0, Lists.newArrayList(toColumnEntry(new byte[0]), toColumnEntry(new byte[0]))); assertTrue("Didn't correctly read two elements as being null in row key", CoveredColumnIndexCodec.checkRowKeyForAllNulls(result)); result = CoveredColumnIndexCodec.composeRowKey(pk, 2, Arrays.asList(toColumnEntry(new byte[] { 1, 2 }))); assertFalse("Found a null key, when it wasn't!", CoveredColumnIndexCodec.checkRowKeyForAllNulls(result)); result = CoveredColumnIndexCodec.composeRowKey(pk, 2, Arrays.asList(toColumnEntry(new byte[] { 1, 2 }), toColumnEntry(new byte[0]))); assertFalse("Found a null key, when it wasn't!", CoveredColumnIndexCodec.checkRowKeyForAllNulls(result)); }
public static boolean checkRowKeyForAllNulls(byte[] bytes) { int keyCount = CoveredColumnIndexCodec.getPreviousInteger(bytes, bytes.length); int pos = bytes.length - Bytes.SIZEOF_INT; for (int i = 0; i < keyCount; i++) { int next = CoveredColumnIndexCodec.getPreviousInteger(bytes, pos); if (next > 0) { return false; } pos -= Bytes.SIZEOF_INT; } return true; }
CoveredColumnIndexCodec extends BaseIndexCodec { public static boolean checkRowKeyForAllNulls(byte[] bytes) { int keyCount = CoveredColumnIndexCodec.getPreviousInteger(bytes, bytes.length); int pos = bytes.length - Bytes.SIZEOF_INT; for (int i = 0; i < keyCount; i++) { int next = CoveredColumnIndexCodec.getPreviousInteger(bytes, pos); if (next > 0) { return false; } pos -= Bytes.SIZEOF_INT; } return true; } }
CoveredColumnIndexCodec extends BaseIndexCodec { public static boolean checkRowKeyForAllNulls(byte[] bytes) { int keyCount = CoveredColumnIndexCodec.getPreviousInteger(bytes, bytes.length); int pos = bytes.length - Bytes.SIZEOF_INT; for (int i = 0; i < keyCount; i++) { int next = CoveredColumnIndexCodec.getPreviousInteger(bytes, pos); if (next > 0) { return false; } pos -= Bytes.SIZEOF_INT; } return true; }  }
CoveredColumnIndexCodec extends BaseIndexCodec { public static boolean checkRowKeyForAllNulls(byte[] bytes) { int keyCount = CoveredColumnIndexCodec.getPreviousInteger(bytes, bytes.length); int pos = bytes.length - Bytes.SIZEOF_INT; for (int i = 0; i < keyCount; i++) { int next = CoveredColumnIndexCodec.getPreviousInteger(bytes, pos); if (next > 0) { return false; } pos -= Bytes.SIZEOF_INT; } return true; }  static CoveredColumnIndexCodec getCodecForTesting(List<ColumnGroup> groups); @Override void initialize(RegionCoprocessorEnvironment env); @Override Iterable<IndexUpdate> getIndexUpserts(TableState state); @Override Iterable<IndexUpdate> getIndexDeletes(TableState state); static List<KeyValue> getIndexKeyValueForTesting(byte[] pk, long timestamp,
      List<Pair<byte[], CoveredColumn>> values); static List<byte[]> getValues(byte[] bytes); static boolean checkRowKeyForAllNulls(byte[] bytes); @Override boolean isEnabled(Mutation m); }
CoveredColumnIndexCodec extends BaseIndexCodec { public static boolean checkRowKeyForAllNulls(byte[] bytes) { int keyCount = CoveredColumnIndexCodec.getPreviousInteger(bytes, bytes.length); int pos = bytes.length - Bytes.SIZEOF_INT; for (int i = 0; i < keyCount; i++) { int next = CoveredColumnIndexCodec.getPreviousInteger(bytes, pos); if (next > 0) { return false; } pos -= Bytes.SIZEOF_INT; } return true; }  static CoveredColumnIndexCodec getCodecForTesting(List<ColumnGroup> groups); @Override void initialize(RegionCoprocessorEnvironment env); @Override Iterable<IndexUpdate> getIndexUpserts(TableState state); @Override Iterable<IndexUpdate> getIndexDeletes(TableState state); static List<KeyValue> getIndexKeyValueForTesting(byte[] pk, long timestamp,
      List<Pair<byte[], CoveredColumn>> values); static List<byte[]> getValues(byte[] bytes); static boolean checkRowKeyForAllNulls(byte[] bytes); @Override boolean isEnabled(Mutation m); static final byte[] INDEX_ROW_COLUMN_FAMILY; }