Package com.linkedin.venice.schema
Class SchemaEntry
java.lang.Object
com.linkedin.venice.schema.SchemaEntry
- Direct Known Subclasses:
GeneratedSchemaEntry
SchemaEntry
is composed of a schema and its corresponding id.
Internally, this class will maintain a parsed Schema
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSchemaEntry
(int id, byte[] bytes) SchemaEntry
(int id, String schemaStr) Primary constructor taking a literal id and schema.SchemaEntry
(int id, org.apache.avro.Schema schema) -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
int
getId()
org.apache.avro.Schema
byte[]
int
hashCode()
boolean
isNewSchemaCompatible
(SchemaEntry newSchemaEntry, DirectionalSchemaCompatibilityType expectedCompatibilityType) This function will check whether a new schema is compatible with this one according to the passed in .toString()
toString
(boolean pretty)
-
Field Details
-
DEFAULT_SCHEMA_CREATION_COMPATIBILITY_TYPE
-
-
Constructor Details
-
SchemaEntry
Primary constructor taking a literal id and schema. -
SchemaEntry
public SchemaEntry(int id, org.apache.avro.Schema schema) -
SchemaEntry
public SchemaEntry(int id, byte[] bytes)
-
-
Method Details
-
getSchemaStr
-
getCanonicalSchemaStr
-
getId
public int getId()- Returns:
- the id
-
getSchema
public org.apache.avro.Schema getSchema() -
hashCode
public int hashCode() -
equals
-
clone
-
toString
-
toString
-
getSchemaBytes
public byte[] getSchemaBytes() -
isNewSchemaCompatible
public boolean isNewSchemaCompatible(SchemaEntry newSchemaEntry, DirectionalSchemaCompatibilityType expectedCompatibilityType) This function will check whether a new schema is compatible with this one according to the passed in . Right now, this function is using the util function provided by avro-1.7+ to check compatibility. We need to remove the util class manually copied when venice is able to use avro-1.7+- Returns:
- true if compatible, false otherwise
-