Class HDFSSchemaSource
java.lang.Object
com.linkedin.venice.hadoop.schema.HDFSSchemaSource
- All Implemented Interfaces:
SchemaSource,AutoCloseable
HDFSSchemaSource caches the Value schemes and RMD schemas for a given store on the HDFS and serve them during the Mapper
stage. It will make API calls on Venice controller to retrieve all RMD schemes and all value schemas.
-
Constructor Summary
ConstructorsConstructorDescriptionHDFSSchemaSource(String valueSchemaDir, String rmdSchemaDir) HDFSSchemaSource(String valueSchemaDir, String rmdSchemaDir, String storeName) HDFSSchemaSource(org.apache.hadoop.fs.Path valueSchemaDir, org.apache.hadoop.fs.Path rmdSchemaDir, String storeName) HDFSSchemaSource(org.apache.hadoop.fs.Path valueSchemaDir, org.apache.hadoop.fs.Path rmdSchemaDir, org.apache.hadoop.fs.Path keySchemaDir, String storeName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.avro.SchemaMap<RmdVersionId,org.apache.avro.Schema> Fetch all rmd schemas under thermdSchemaDirif available.Fetch all value schemas under thermdSchemaDirif available.voidsaveSchemasOnDisk(ControllerClient controllerClient) This method loads related configs, gets store value and RMD schemas from Venice controllers, and then write them on HDFS.
-
Constructor Details
-
HDFSSchemaSource
public HDFSSchemaSource(org.apache.hadoop.fs.Path valueSchemaDir, org.apache.hadoop.fs.Path rmdSchemaDir, org.apache.hadoop.fs.Path keySchemaDir, String storeName) throws IOException - Throws:
IOException
-
HDFSSchemaSource
public HDFSSchemaSource(org.apache.hadoop.fs.Path valueSchemaDir, org.apache.hadoop.fs.Path rmdSchemaDir, String storeName) throws IOException - Throws:
IOException
-
HDFSSchemaSource
public HDFSSchemaSource(String valueSchemaDir, String rmdSchemaDir, String storeName) throws IOException - Throws:
IOException
-
HDFSSchemaSource
- Throws:
IOException
-
-
Method Details
-
getKeySchemaPath
-
getRmdSchemaPath
-
getValueSchemaPath
-
saveSchemasOnDisk
public void saveSchemasOnDisk(ControllerClient controllerClient) throws IOException, IllegalStateException This method loads related configs, gets store value and RMD schemas from Venice controllers, and then write them on HDFS.- Throws:
IOExceptionIllegalStateException
-
fetchRmdSchemas
Fetch all rmd schemas under thermdSchemaDirif available.- Specified by:
fetchRmdSchemasin interfaceSchemaSource- Returns:
- RMD schemas mapping
- Throws:
IOException
-
fetchValueSchemas
Fetch all value schemas under thermdSchemaDirif available.- Specified by:
fetchValueSchemasin interfaceSchemaSource- Returns:
- RMD schemas mapping
- Throws:
IOException
-
fetchKeySchema
- Specified by:
fetchKeySchemain interfaceSchemaSource- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-