MetaDataUtil { public static boolean areClientAndServerCompatible(long version) { return areClientAndServerCompatible(MetaDataUtil.decodePhoenixVersion(version), MetaDataProtocol.PHOENIX_MAJOR_VERSION); }  static boolean areClientAndServerCompatible(long version); static int decodePhoenixVersion(long version); static long encodeMutableIndexConfiguredProperly(long version, boolean isValid); static boolean decodeMutableIndexConfiguredProperly(long version); static int decodeHBaseVersion(long version); static String decodeHBaseVersionAsString(int version); static long encodeHBaseAndPhoenixVersions(String hbaseVersion); static void getTenantIdAndSchemaAndTableName(List<Mutation> tableMetadata, byte[][] rowKeyMetaData); static byte[] getParentTableName(List<Mutation> tableMetadata); static long getSequenceNumber(Mutation tableMutation); static long getSequenceNumber(List<Mutation> tableMetaData); static PTableType getTableType(List<Mutation> tableMetaData, KeyValueBuilder builder,
      ImmutableBytesPtr value); static long getParentSequenceNumber(List<Mutation> tableMetaData); static Mutation getTableHeaderRow(List<Mutation> tableMetaData); static boolean getMutationValue(Mutation headerRow, byte[] key,
      KeyValueBuilder builder, ImmutableBytesWritable ptr); static Mutation getPutOnlyTableHeaderRow(List<Mutation> tableMetaData); static Mutation getParentTableHeaderRow(List<Mutation> tableMetaData); static long getClientTimeStamp(List<Mutation> tableMetadata); static long getClientTimeStamp(Mutation m); static byte[] getParentLinkKey(String tenantId, String schemaName, String tableName, String indexName); static byte[] getParentLinkKey(byte[] tenantId, byte[] schemaName, byte[] tableName, byte[] indexName); static boolean isMultiTenant(Mutation m, KeyValueBuilder builder, ImmutableBytesWritable ptr); static boolean isSalted(Mutation m, KeyValueBuilder builder, ImmutableBytesWritable ptr); static byte[] getViewIndexPhysicalName(byte[] physicalTableName); static String getViewIndexTableName(String tableName); static String getViewIndexSchemaName(String schemaName); static byte[] getLocalIndexPhysicalName(byte[] physicalTableName); static String getLocalIndexTableName(String tableName); static String getLocalIndexSchemaName(String schemaName); static String getUserTableName(String localIndexTableName); static String getViewIndexSchemaName(PName physicalName); static SequenceKey getViewIndexSequenceKey(String tenantId, PName physicalName, int nSaltBuckets); static PDataType getViewIndexIdDataType(); static String getViewIndexIdColumnName(); static boolean hasViewIndexTable(PhoenixConnection connection, PName name); static boolean hasViewIndexTable(PhoenixConnection connection, String schemaName, String tableName); static boolean hasViewIndexTable(PhoenixConnection connection, byte[] physicalTableName); static boolean hasLocalIndexTable(PhoenixConnection connection, PName name); static boolean hasLocalIndexTable(PhoenixConnection connection, String schemaName, String tableName); static boolean hasLocalIndexTable(PhoenixConnection connection, byte[] physicalTableName); static void deleteViewIndexSequences(PhoenixConnection connection, PName name); static boolean tableRegionsOnline(Configuration conf, PTable table); static Scan newTableRowsScan(byte[] key, long startTimeStamp, long stopTimeStamp); static final String VIEW_INDEX_TABLE_PREFIX; static final byte[] VIEW_INDEX_TABLE_PREFIX_BYTES; static final String LOCAL_INDEX_TABLE_PREFIX; static final byte[] LOCAL_INDEX_TABLE_PREFIX_BYTES; static final String VIEW_INDEX_SEQUENCE_PREFIX; static final String VIEW_INDEX_SEQUENCE_NAME_PREFIX; static final byte[] VIEW_INDEX_SEQUENCE_PREFIX_BYTES; static final String VIEW_INDEX_ID_COLUMN_NAME; static final String PARENT_TABLE_KEY; static final byte[] PARENT_TABLE_KEY_BYTES; static final String IS_VIEW_INDEX_TABLE_PROP_NAME; static final byte[] IS_VIEW_INDEX_TABLE_PROP_BYTES; static final String IS_LOCAL_INDEX_TABLE_PROP_NAME; static final byte[] IS_LOCAL_INDEX_TABLE_PROP_BYTES; }
@Test public void testCompatibility() { assertTrue(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(1,2,1), 1)); assertTrue(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(1,2,10), 1)); assertTrue(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(1,2,0), 1)); assertTrue(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(1,2,255), 1)); assertTrue(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(2,2,0), 2)); assertTrue(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(2,10,36), 2)); assertFalse(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(3,1,10), 4)); assertFalse(MetaDataUtil.areClientAndServerCompatible(VersionUtil.encodeVersion(3,1,10), 2)); }