public class PathSchemaProvider extends Object implements SchemaProvider
| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectReader |
READER
Reader used to read JSON schema from file into into
SchemaContainer. |
static com.fasterxml.jackson.databind.ObjectWriter |
WRITER
Writer used to write content from
SchemaContainer into JSON file. |
DEFAULT_SCHEMA_NAME| Constructor and Description |
|---|
PathSchemaProvider(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
PathSchemaProvider(org.apache.hadoop.fs.Path path) |
| Modifier and Type | Method and Description |
|---|---|
protected SchemaContainer |
createTableSchema(String schema,
Map<String,String> properties) |
void |
delete()
Deletes schema.
|
boolean |
exists()
Checks if schema exists.
|
SchemaContainer |
read()
Reads schema into
SchemaContainer. |
void |
store(String schema,
Map<String,String> properties,
StorageProperties storageProperties)
Stores given schema definition and properties.
|
public static final com.fasterxml.jackson.databind.ObjectReader READER
SchemaContainer.
Allows comment inside the JSON file.public static final com.fasterxml.jackson.databind.ObjectWriter WRITER
SchemaContainer into JSON file.public PathSchemaProvider(org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionpublic PathSchemaProvider(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionpublic void delete()
throws IOException
SchemaProviderdelete in interface SchemaProviderIOExceptionpublic void store(String schema, Map<String,String> properties, StorageProperties storageProperties) throws IOException
SchemaProviderstore in interface SchemaProviderschema - schema definitionproperties - map of propertiesstorageProperties - storage propertiesIOExceptionpublic SchemaContainer read() throws IOException
SchemaProviderSchemaContainer. Depending on implementation, can read from a file
or from the given input.read in interface SchemaProviderIOExceptionpublic boolean exists()
throws IOException
SchemaProviderexists in interface SchemaProviderIOExceptionprotected SchemaContainer createTableSchema(String schema, Map<String,String> properties) throws IOException
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.