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
ConstructorDescriptionHDFSSchemaSource
(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 TypeMethodDescriptionvoid
close()
org.apache.avro.Schema
Map<RmdVersionId,
org.apache.avro.Schema> Fetch all rmd schemas under thermdSchemaDir
if available.Fetch all value schemas under thermdSchemaDir
if available.void
saveSchemasOnDisk
(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:
IOException
IllegalStateException
-
fetchRmdSchemas
Fetch all rmd schemas under thermdSchemaDir
if available.- Specified by:
fetchRmdSchemas
in interfaceSchemaSource
- Returns:
- RMD schemas mapping
- Throws:
IOException
-
fetchValueSchemas
Fetch all value schemas under thermdSchemaDir
if available.- Specified by:
fetchValueSchemas
in interfaceSchemaSource
- Returns:
- RMD schemas mapping
- Throws:
IOException
-
fetchKeySchema
- Specified by:
fetchKeySchema
in interfaceSchemaSource
- Throws:
IOException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-