public final class AvroConfigurationSerializer extends Object implements ConfigurationSerializer
Constructor and Description |
---|
AvroConfigurationSerializer() |
Modifier and Type | Method and Description |
---|---|
void |
configurationBuilderFromString(String theString,
ConfigurationBuilder configBuilder)
Converts a given serialized string to ConfigurationBuilder from which Configuration can be produced.
|
Configuration |
fromAvro(AvroConfiguration avroConfiguration)
Converts a given AvroConfiguration to Configuration.
|
Configuration |
fromAvro(AvroConfiguration avroConfiguration,
ClassHierarchy classHierarchy)
Converts a given AvroConfiguration to Configuration.
|
Configuration |
fromByteArray(byte[] theBytes)
Loads a Configuration from a byte[] created with toByteArray().
|
Configuration |
fromByteArray(byte[] theBytes,
ClassHierarchy classHierarchy)
Loads a Configuration from a byte[] created with toByteArray().
|
Configuration |
fromFile(File file)
Loads a Configuration from a File created with toFile().
|
Configuration |
fromFile(File file,
ClassHierarchy classHierarchy)
Loads a Configuration from a File created with toFile().
|
Configuration |
fromString(String theString)
Decodes a String generated via toString().
|
Configuration |
fromString(String theString,
ClassHierarchy classHierarchy)
Decodes a String generated via toString().
|
Configuration |
fromTextFile(File file)
Loads a Configuration from a File created with toFile().
|
Configuration |
fromTextFile(File file,
ClassHierarchy classHierarchy)
Loads a Configuration from a File created with toFile() with ClassHierarchy.
|
AvroConfiguration |
toAvro(Configuration configuration) |
byte[] |
toByteArray(Configuration conf)
Writes the Configuration to a byte[].
|
void |
toFile(Configuration conf,
File file)
Stores the given Configuration in the given File.
|
String |
toString(Configuration configuration)
Writes the Configuration as a String.
|
void |
toTextFile(Configuration conf,
File file)
Stores the given Configuration in the given Text File.
|
@Inject public AvroConfigurationSerializer()
public AvroConfiguration toAvro(Configuration configuration)
public void toFile(Configuration conf, File file) throws IOException
ConfigurationSerializer
toFile
in interface ConfigurationSerializer
conf
- the Configuration to storefile
- the file to store the Configuration inIOException
- if there is an IO error in the process.public void toTextFile(Configuration conf, File file) throws IOException
ConfigurationSerializer
toTextFile
in interface ConfigurationSerializer
conf
- the Configuration to storefile
- the file to store the Configuration inIOException
- if there is an IO error in the process.public byte[] toByteArray(Configuration conf) throws IOException
ConfigurationSerializer
toByteArray
in interface ConfigurationSerializer
IOException
public String toString(Configuration configuration)
ConfigurationSerializer
toString
in interface ConfigurationSerializer
public Configuration fromAvro(AvroConfiguration avroConfiguration) throws BindException
avroConfiguration
- BindException
public Configuration fromAvro(AvroConfiguration avroConfiguration, ClassHierarchy classHierarchy) throws BindException
avroConfiguration
- classHierarchy
- the class hierarchy used for validation.BindException
public Configuration fromFile(File file) throws IOException, BindException
ConfigurationSerializer
fromFile
in interface ConfigurationSerializer
file
- the File to read from.IOException
- if the File can't be read or parsedBindException
- if the file contains an illegal Configurationpublic Configuration fromFile(File file, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializer
fromFile
in interface ConfigurationSerializer
file
- the File to read from.classHierarchy
- used to validate the configuration againstIOException
- if the File can't be read or parsedBindException
- if the file contains an illegal Configurationpublic Configuration fromTextFile(File file) throws IOException, BindException
ConfigurationSerializer
fromTextFile
in interface ConfigurationSerializer
file
- the File to read from.IOException
- if the File can't be read or parsedBindException
- if the file contains an illegal Configurationpublic Configuration fromTextFile(File file, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializer
fromTextFile
in interface ConfigurationSerializer
IOException
BindException
public Configuration fromByteArray(byte[] theBytes) throws IOException, BindException
ConfigurationSerializer
fromByteArray
in interface ConfigurationSerializer
theBytes
- the bytes to deserialize.IOException
- if the byte[] can't be deserializedBindException
- if the byte[] contains an illegal Configuration.public Configuration fromByteArray(byte[] theBytes, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializer
fromByteArray
in interface ConfigurationSerializer
theBytes
- the bytes to deserialize.classHierarchy
- used to validate the configuration againstIOException
- if the byte[] can't be deserializedBindException
- if the byte[] contains an illegal Configuration.public Configuration fromString(String theString) throws IOException, BindException
ConfigurationSerializer
fromString
in interface ConfigurationSerializer
theString
- to be parsedIOException
- if theString can't be parsed.BindException
- if theString contains an illegal Configuration.public Configuration fromString(String theString, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializer
fromString
in interface ConfigurationSerializer
theString
- to be parsedclassHierarchy
- used to validate the configuration againstIOException
- if theString can't be parsed.BindException
- if theString contains an illegal Configuration.public void configurationBuilderFromString(String theString, ConfigurationBuilder configBuilder) throws IOException, BindException
theString
- configBuilder
- IOException
BindException
Copyright © 2015 The Apache Software Foundation. All rights reserved.