Package com.linkedin.venice.schema
Class SchemaData
- java.lang.Object
-
- com.linkedin.venice.schema.SchemaData
-
public final class SchemaData extends java.lang.Object
This class is used to store all the schemas related to a given store: 1. key schema 2. value schemas 3. partial update schemas 4. replication metadata schemas
-
-
Field Summary
Fields Modifier and Type Field Description static int
DUPLICATE_VALUE_SCHEMA_CODE
static int
INVALID_VALUE_SCHEMA_ID
static int
UNKNOWN_SCHEMA_ID
-
Constructor Summary
Constructors Constructor Description SchemaData(java.lang.String storeName, SchemaEntry keySchema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDerivedSchema(DerivedSchemaEntry derivedSchemaEntry)
void
addReplicationMetadataSchema(RmdSchemaEntry rmdSchemaEntry)
void
addValueSchema(SchemaEntry valueSchema)
void
deleteValueSchema(SchemaEntry valueSchema)
DerivedSchemaEntry
getDerivedSchema(int valueSchemaId, int derivedSchemaId)
GeneratedSchemaID
getDerivedSchemaId(java.lang.String schemaStr)
java.util.Collection<DerivedSchemaEntry>
getDerivedSchemas()
SchemaEntry
getKeySchema()
int
getMaxValueSchemaId()
RmdSchemaEntry
getReplicationMetadataSchema(int valueSchemaId, int replicationMetadataVersionId)
java.util.Collection<RmdSchemaEntry>
getReplicationMetadataSchemas()
int
getSchemaID(SchemaEntry entry)
Return the schema ID of any schema that has the same parsing canonical form as the schema provided.java.lang.String
getStoreName()
SchemaEntry
getValueSchema(int id)
java.util.Collection<SchemaEntry>
getValueSchemas()
boolean
hasRmdSchema(int valueSchemaId)
boolean
hasUpdateSchema(int valueSchemaId)
void
setKeySchema(SchemaEntry keySchema)
-
-
-
Field Detail
-
UNKNOWN_SCHEMA_ID
public static final int UNKNOWN_SCHEMA_ID
- See Also:
- Constant Field Values
-
INVALID_VALUE_SCHEMA_ID
public static final int INVALID_VALUE_SCHEMA_ID
- See Also:
- Constant Field Values
-
DUPLICATE_VALUE_SCHEMA_CODE
public static final int DUPLICATE_VALUE_SCHEMA_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SchemaData
public SchemaData(java.lang.String storeName, SchemaEntry keySchema)
-
-
Method Detail
-
getStoreName
public java.lang.String getStoreName()
-
getKeySchema
public SchemaEntry getKeySchema()
- Returns:
- the key
SchemaEntry
, which may temporarily be null soon after store initialization...
-
setKeySchema
public void setKeySchema(SchemaEntry keySchema)
-
getValueSchema
public SchemaEntry getValueSchema(int id)
-
addValueSchema
public void addValueSchema(SchemaEntry valueSchema)
-
getDerivedSchema
public DerivedSchemaEntry getDerivedSchema(int valueSchemaId, int derivedSchemaId)
-
getDerivedSchemas
public java.util.Collection<DerivedSchemaEntry> getDerivedSchemas()
-
getDerivedSchemaId
public GeneratedSchemaID getDerivedSchemaId(java.lang.String schemaStr)
-
addDerivedSchema
public void addDerivedSchema(DerivedSchemaEntry derivedSchemaEntry)
-
getMaxValueSchemaId
public int getMaxValueSchemaId()
-
getSchemaID
public int getSchemaID(SchemaEntry entry)
Return the schema ID of any schema that has the same parsing canonical form as the schema provided.- Parameters:
entry
- TheSchemaEntry
for which the schema ID is needed- Returns:
- The ID of the schema that has the same parsing canonical form as the schema provided
-
getValueSchemas
public java.util.Collection<SchemaEntry> getValueSchemas()
-
getReplicationMetadataSchema
public RmdSchemaEntry getReplicationMetadataSchema(int valueSchemaId, int replicationMetadataVersionId)
-
getReplicationMetadataSchemas
public java.util.Collection<RmdSchemaEntry> getReplicationMetadataSchemas()
-
addReplicationMetadataSchema
public void addReplicationMetadataSchema(RmdSchemaEntry rmdSchemaEntry)
-
hasUpdateSchema
public boolean hasUpdateSchema(int valueSchemaId)
-
hasRmdSchema
public boolean hasRmdSchema(int valueSchemaId)
-
deleteValueSchema
public void deleteValueSchema(SchemaEntry valueSchema)
-
-