Class 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 Hadoop Configurations 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) and readExternal(java.io.ObjectInput) are run at the same time, or the Configuration is changed outside during writeExternal.

    See Also:
    Serialized Form
    • Constructor Detail

      • SerializableConfiguration

        public SerializableConfiguration()
      • SerializableConfiguration

        public SerializableConfiguration​(org.apache.hadoop.conf.Configuration conf)
    • 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 interface java.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 interface java.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 configured Job 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 populated Configuration object.