@Override public boolean isCompatibleWithAllVersions(String schemaBranchName, String schemaName, String toSchemaText) throws SchemaNotFoundException, SchemaBranchNotFoundException { return checkCompatibility(schemaBranchName,schemaName, toSchemaText).isCompatible(); }
@Override public CompatibilityResult validate(T toSchema, T existingSchema) { CompatibilityResult compatibilityResult = schemaValidator.validate(toSchema, existingSchema); if (compatibilityResult.isCompatible()) { compatibilityResult = schemaValidator.validate(existingSchema, toSchema); } return compatibilityResult; } }
@Override public CompatibilityResult validate(T toSchema, T existingSchema) { CompatibilityResult compatibilityResult = schemaValidator.validate(toSchema, existingSchema); if (compatibilityResult.isCompatible()) { compatibilityResult = schemaValidator.validate(existingSchema, toSchema); } return compatibilityResult; } }
@Override public boolean isCompatibleWithAllVersions(String schemaName, String toSchemaText) throws SchemaNotFoundException, SchemaBranchNotFoundException { return schemaRegistry.checkCompatibility(schemaName, toSchemaText).isCompatible(); }
private static void checkCompatibility(SchemaVersionService schemaVersionService, SchemaMetadata schemaMetadata, String toSchemaText, String fromSchemaText) throws IncompatibleSchemaException { CompatibilityResult compatibilityResult = schemaVersionService.checkForCompatibility(schemaMetadata, toSchemaText, fromSchemaText); if (!compatibilityResult.isCompatible()) { String errMsg = String.format("Given schema is not compatible with latest schema versions. \n" + "Error location: [%s] \n" + "Error encountered is: [%s]", compatibilityResult.getErrorLocation(), compatibilityResult.getErrorMessage()); throw new IncompatibleSchemaException(errMsg); } }
private static void checkCompatibility(SchemaVersionService schemaVersionService, SchemaMetadata schemaMetadata, String toSchemaText, String fromSchemaText) throws IncompatibleSchemaException { CompatibilityResult compatibilityResult = schemaVersionService.checkForCompatibility(schemaMetadata, toSchemaText, fromSchemaText); if (!compatibilityResult.isCompatible()) { String errMsg = String.format("Given schema is not compatible with latest schema versions. \n" + "Error location: [%s] \n" + "Error encountered is: [%s]", compatibilityResult.getErrorLocation(), compatibilityResult.getErrorMessage()); throw new IncompatibleSchemaException(errMsg); } }
latestSchemaVersionInfo.getSchemaText(), schemaMetadata.getCompatibility()); if (!compatibilityResult.isCompatible()) { LOG.info("Received schema is not compatible with the latest schema versions [{}] with schema name [{}]", latestSchemaVersionInfo.getVersion(), schemaName); schemaVersionInfo.getSchemaText(), schemaMetadata.getCompatibility()); if (!compatibilityResult.isCompatible()) { LOG.info("Received schema is not compatible with one of the schema versions [{}] with schema name [{}]", schemaVersionInfo.getVersion(), schemaName);
CompatibilityResult compatibilityResult = checkCompatibility(schemaBranchName, schemaName, schemaVersion .getSchemaText()); if (!compatibilityResult.isCompatible()) { String errMsg = String.format("Given schema is not compatible with latest schema versions. \n" + "Error location: [%s] \n" +