Package org.apache.beam.sdk.io.hadoop
Class SerializableConfiguration
- java.lang.Object
-
- org.apache.beam.sdk.io.hadoop.SerializableConfiguration
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
@NotThreadSafe public class SerializableConfiguration extends java.lang.Object implements java.io.Externalizable
A wrapper to allow HadoopConfiguration
s to be serialized using Java's standard serialization mechanisms.SerializableConfiguration is not thread safe. For example, serialized configuration could be corrupted if
writeExternal(java.io.ObjectOutput)
andreadExternal(java.io.ObjectInput)
are run at the same time, or theConfiguration
is changed outside during writeExternal.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SerializableConfiguration()
SerializableConfiguration(org.apache.hadoop.conf.Configuration conf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SerializableConfiguration
fromMap(java.util.Map<java.lang.String,java.lang.String> entries)
Returns a new configuration instance using provided flags.org.apache.hadoop.conf.Configuration
get()
static org.apache.hadoop.conf.Configuration
newConfiguration(@Nullable SerializableConfiguration conf)
Returns new populatedConfiguration
object.static org.apache.hadoop.mapreduce.Job
newJob(@Nullable SerializableConfiguration conf)
Returns new configuredJob
object.void
readExternal(java.io.ObjectInput in)
void
writeExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
get
public org.apache.hadoop.conf.Configuration get()
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
newJob
public static org.apache.hadoop.mapreduce.Job newJob(@Nullable SerializableConfiguration conf) throws java.io.IOException
Returns new configuredJob
object.- Throws:
java.io.IOException
-
fromMap
public static SerializableConfiguration fromMap(java.util.Map<java.lang.String,java.lang.String> entries)
Returns a new configuration instance using provided flags.
-
newConfiguration
public static org.apache.hadoop.conf.Configuration newConfiguration(@Nullable SerializableConfiguration conf)
Returns new populatedConfiguration
object.
-
-