@Test public void indexUsedWhereFormerIndexWas() { RecordMetaDataBuilder metaDataBuilder = RecordMetaData.newBuilder().setRecords(TestRecords1Proto.getDescriptor()); metaDataBuilder.removeIndex("MySimpleRecord$str_value_indexed"); RecordMetaData metaData1 = metaDataBuilder.getRecordMetaData(); RecordMetaDataBuilder metaData2Builder = RecordMetaData.newBuilder().setRecords( metaData1.toProto().toBuilder().clearFormerIndexes().build() ); Index newIndex = new Index("newIndex", "str_value_indexed"); newIndex.setSubspaceKey("MySimpleRecord$str_value_indexed"); metaData2Builder.addIndex("MySimpleRecord", newIndex); RecordMetaData metaData2 = metaData2Builder.getRecordMetaData(); assertInvalid("former index key used for new index in meta-data", metaData1, metaData2); }
@Nonnull public static Builder newBuilder() { return new Builder(DEFAULT_INSTANCE); }
MetaDataEvolutionValidator { @Nonnull public static Builder newBuilder() { return new Builder(DEFAULT_INSTANCE); } }
MetaDataEvolutionValidator { @Nonnull public static Builder newBuilder() { return new Builder(DEFAULT_INSTANCE); } private  MetaDataEvolutionValidator(); private  MetaDataEvolutionValidator(@Nonnull Builder builder); }
MetaDataEvolutionValidator { @Nonnull public static Builder newBuilder() { return new Builder(DEFAULT_INSTANCE); } private  MetaDataEvolutionValidator(); private  MetaDataEvolutionValidator(@Nonnull Builder builder); void validate(@Nonnull RecordMetaData oldMetaData, @Nonnull RecordMetaData newMetaData); @SuppressWarnings("PMD.CompareObjectsWithEquals") void validateUnion(@Nonnull Descriptor oldUnionDescriptor, @Nonnull Descriptor newUnionDescriptor); @Nonnull IndexMaintainerRegistry getIndexMaintainerRegistry(); boolean allowsNoVersionChange(); boolean allowsNoSinceVersion(); boolean allowsIndexRebuilds(); boolean allowsMissingFormerIndexNames(); boolean allowsOlderFormerIndexAddedVersions(); boolean allowsUnsplitToSplit(); boolean disallowsTypeRenames(); @Nonnull Builder asBuilder(); @Nonnull static Builder newBuilder(); @Nonnull static MetaDataEvolutionValidator getDefaultInstance(); }
MetaDataEvolutionValidator { @Nonnull public static Builder newBuilder() { return new Builder(DEFAULT_INSTANCE); } private  MetaDataEvolutionValidator(); private  MetaDataEvolutionValidator(@Nonnull Builder builder); void validate(@Nonnull RecordMetaData oldMetaData, @Nonnull RecordMetaData newMetaData); @SuppressWarnings("PMD.CompareObjectsWithEquals") void validateUnion(@Nonnull Descriptor oldUnionDescriptor, @Nonnull Descriptor newUnionDescriptor); @Nonnull IndexMaintainerRegistry getIndexMaintainerRegistry(); boolean allowsNoVersionChange(); boolean allowsNoSinceVersion(); boolean allowsIndexRebuilds(); boolean allowsMissingFormerIndexNames(); boolean allowsOlderFormerIndexAddedVersions(); boolean allowsUnsplitToSplit(); boolean disallowsTypeRenames(); @Nonnull Builder asBuilder(); @Nonnull static Builder newBuilder(); @Nonnull static MetaDataEvolutionValidator getDefaultInstance();  }