@Test public void testContainPreservedCharacter() { Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("#family"), Bytes.toBytes("qualifier")))); Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("fam#ily"), Bytes.toBytes("qualifier")))); Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family#"), Bytes.toBytes("qualifier")))); Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family"), Bytes.toBytes("#qualifier")))); Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family"), Bytes.toBytes("qua#lifier")))); Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family"), Bytes.toBytes("qualifier#")))); Assert.assertFalse(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family"), Bytes.toBytes("qualifier")))); byte[] qualifier = new byte[]{0x00, 0x00, 0x07, (byte)((int)0xDC)}; Assert.assertFalse(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family"), qualifier))); qualifier = new byte[] { 0x00, 0x00, 0x07, (byte) ((int) 0xDC), ColumnUtil.PRESERVED_COLUMN_CHARACTER_BYTES[0] }; Assert.assertTrue(ColumnUtil.containPreservedCharacter(new Column(Bytes.toBytes("family"), qualifier))); }
public static boolean containPreservedCharacter(Column column) { for (int i = 0; i < column.getFamily().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getFamily()[i]) { return true; } } if (isCommitToSameFamily()) { for (int i = 0; i < column.getQualifier().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getQualifier()[i]) { return true; } } } return false; }
ColumnUtil { public static boolean containPreservedCharacter(Column column) { for (int i = 0; i < column.getFamily().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getFamily()[i]) { return true; } } if (isCommitToSameFamily()) { for (int i = 0; i < column.getQualifier().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getQualifier()[i]) { return true; } } } return false; } }
ColumnUtil { public static boolean containPreservedCharacter(Column column) { for (int i = 0; i < column.getFamily().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getFamily()[i]) { return true; } } if (isCommitToSameFamily()) { for (int i = 0; i < column.getQualifier().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getQualifier()[i]) { return true; } } } return false; }  }
ColumnUtil { public static boolean containPreservedCharacter(Column column) { for (int i = 0; i < column.getFamily().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getFamily()[i]) { return true; } } if (isCommitToSameFamily()) { for (int i = 0; i < column.getQualifier().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getQualifier()[i]) { return true; } } } return false; }  static void init(Configuration conf); static boolean isCommitToSameFamily(); static boolean isCommitToDifferentFamily(); static boolean isPreservedColumn(Column column); static boolean containPreservedCharacter(Column column); static boolean isLockColumn(Column column); static boolean isCommitFamily(byte[] family); static boolean isLockColumn(byte[] family, byte[] qualifier); static boolean isPutColumn(byte[] family, byte[] qualifier); static boolean isPutColumn(Column column); static boolean isDeleteColumn(Column column); static boolean isDeleteColumn(byte[] family, byte[] qualifier); static boolean isWriteColumn(byte[] family, byte[] qualifier); static boolean isWriteColumn(Column column); static boolean isDataColumn(Column column); static Column getLockColumn(byte[] family, byte[] qualifier); static Column getLockColumn(Column dataColumn); static Column getPutColumn(Column dataColumn); static Column getDeleteColumn(Column dataColumn); static Column getDataColumn(Column lockOrWriteColumn); static Column getDataColumnFromConstructedQualifier(Column lockColumn); }
ColumnUtil { public static boolean containPreservedCharacter(Column column) { for (int i = 0; i < column.getFamily().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getFamily()[i]) { return true; } } if (isCommitToSameFamily()) { for (int i = 0; i < column.getQualifier().length; ++i) { if (PRESERVED_COLUMN_CHARACTER_BYTES[0] == column.getQualifier()[i]) { return true; } } } return false; }  static void init(Configuration conf); static boolean isCommitToSameFamily(); static boolean isCommitToDifferentFamily(); static boolean isPreservedColumn(Column column); static boolean containPreservedCharacter(Column column); static boolean isLockColumn(Column column); static boolean isCommitFamily(byte[] family); static boolean isLockColumn(byte[] family, byte[] qualifier); static boolean isPutColumn(byte[] family, byte[] qualifier); static boolean isPutColumn(Column column); static boolean isDeleteColumn(Column column); static boolean isDeleteColumn(byte[] family, byte[] qualifier); static boolean isWriteColumn(byte[] family, byte[] qualifier); static boolean isWriteColumn(Column column); static boolean isDataColumn(Column column); static Column getLockColumn(byte[] family, byte[] qualifier); static Column getLockColumn(Column dataColumn); static Column getPutColumn(Column dataColumn); static Column getDeleteColumn(Column dataColumn); static Column getDataColumn(Column lockOrWriteColumn); static Column getDataColumnFromConstructedQualifier(Column lockColumn); static final char PRESERVED_COLUMN_CHARACTER; static final byte[] PRESERVED_COLUMN_CHARACTER_BYTES; static final String PUT_QUALIFIER_SUFFIX; static final byte[] PUT_QUALIFIER_SUFFIX_BYTES; static final String DELETE_QUALIFIER_SUFFIX; static final byte[] DELETE_QUALIFIER_SUFFIX_BYTES; static final String PRESERVED_QUALIFIER_SUFFIX; static final byte[] LOCK_FAMILY_NAME; static final String LOCK_FAMILY_NAME_STRING; static final String PUT_FAMILY_NAME; static final byte[] PUT_FAMILY_NAME_BYTES; static final String DELETE_FAMILY_NAME; static final byte[] DELETE_FAMILY_NAME_BYTES; static final byte[][] COMMIT_FAMILY_NAME_BYTES; static final String THEMIS_COMMIT_FAMILY_TYPE; }