Class: Avro::SchemaCompatibility::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/avro-patches/schema_compatibility/schema_compatibility.rb

Constant Summary collapse

SIMPLE_CHECKS =
Avro::Schema::PRIMITIVE_TYPES_SYM.dup.add(:fixed).freeze

Instance Method Summary collapse

Constructor Details

#initializeChecker

Returns a new instance of Checker.



67
68
69
# File 'lib/avro-patches/schema_compatibility/schema_compatibility.rb', line 67

def initialize
  @recursion_set = Set.new
end

Instance Method Details

#can_read?(writers_schema, readers_schema) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/avro-patches/schema_compatibility/schema_compatibility.rb', line 71

def can_read?(writers_schema, readers_schema)
  full_match_schemas(writers_schema, readers_schema)
end

#mutual_read?(writers_schema, readers_schema) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/avro-patches/schema_compatibility/schema_compatibility.rb', line 75

def mutual_read?(writers_schema, readers_schema)
  can_read?(writers_schema, readers_schema) && can_read?(readers_schema, writers_schema)
end