Class LocalTableSchemaStore
- java.lang.Object
-
- org.apache.cassandra.cdc.schemastore.LocalTableSchemaStore
-
- All Implemented Interfaces:
SchemaStore
public class LocalTableSchemaStore extends java.lang.Object implements SchemaStore
This is an example implementation of a Schema Store. In this particular implementation, we rely on avro schemas placed under the resources folder, inside the table_schemas folder. They will be used as schemas for the tables that have CDC enabled.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLocalTableSchemaStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalTableSchemaStoregetInstance()org.apache.avro.generic.GenericDatumReader<org.apache.avro.generic.GenericRecord>getReader(java.lang.String namespace, java.lang.String name)Get the datum readerorg.apache.avro.SchemagetSchema(java.lang.String namespace, java.lang.String name)Expects cassandra keyspace name for namespace and cassandra table name for name.org.apache.avro.generic.GenericDatumWriter<org.apache.avro.generic.GenericRecord>getWriter(java.lang.String namespace, java.lang.String name)Get the datum writerprotected voidloadFromResource()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cdc.schemastore.SchemaStore
getVersion
-
-
-
-
Method Detail
-
getInstance
public static LocalTableSchemaStore getInstance()
-
getSchema
public org.apache.avro.Schema getSchema(java.lang.String namespace, java.lang.String name)Expects cassandra keyspace name for namespace and cassandra table name for name.- Specified by:
getSchemain interfaceSchemaStore- Returns:
- the schema, or throws
-
getWriter
public org.apache.avro.generic.GenericDatumWriter<org.apache.avro.generic.GenericRecord> getWriter(java.lang.String namespace, java.lang.String name)Description copied from interface:SchemaStoreGet the datum writer- Specified by:
getWriterin interfaceSchemaStore- Returns:
- the writer, or throws if schema is not found
-
getReader
public org.apache.avro.generic.GenericDatumReader<org.apache.avro.generic.GenericRecord> getReader(java.lang.String namespace, java.lang.String name)Description copied from interface:SchemaStoreGet the datum reader- Specified by:
getReaderin interfaceSchemaStore- Returns:
- the reader, or throws if schema is not found
-
loadFromResource
protected void loadFromResource()
-
-