Class ClobRef

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.io.Writable

    public class ClobRef
    extends LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
    ClobRef is a wrapper that holds a CLOB either directly, or a reference to a file that holds the CLOB data.
    • Constructor Detail

      • ClobRef

        public ClobRef()
      • ClobRef

        public ClobRef​(java.lang.String chars)
      • ClobRef

        public ClobRef​(java.lang.String file,
                       long offset,
                       long length)
        Initialize a clobref to an external CLOB.
        Parameters:
        file - the filename to the CLOB. May be relative to the job dir.
        offset - the offset (in bytes) into the LobFile for this record.
        length - the length of the record in characters.
    • Method Detail

      • getExternalSource

        protected java.io.Reader getExternalSource​(org.apache.sqoop.io.LobFile.Reader reader)
                                            throws java.io.IOException
        Description copied from class: LobRef
        Using the LobFile reader, get an accessor InputStream or Reader to the underlying data.
        Specified by:
        getExternalSource in class LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
        Throws:
        java.io.IOException
      • getInternalSource

        protected java.io.Reader getInternalSource​(java.lang.String data)
        Description copied from class: LobRef
        Wrap the materialized data in an InputStream or Reader.
        Specified by:
        getInternalSource in class LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
      • deepCopyData

        protected java.lang.String deepCopyData​(java.lang.String data)
        Description copied from class: LobRef
        Make a copy of the materialized data.
        Specified by:
        deepCopyData in class LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
      • getInternalData

        protected java.lang.String getInternalData​(java.lang.String data)
        Specified by:
        getInternalData in class LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
        Returns:
        the materialized data itself.
      • readFieldsInternal

        public void readFieldsInternal​(java.io.DataInput in)
                                throws java.io.IOException
        Description copied from class: LobRef
        Perform the readFields() operation on a fully-materializable record.
        Specified by:
        readFieldsInternal in class LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
        Parameters:
        in - the DataInput to deserialize from.
        Throws:
        java.io.IOException
      • writeInternal

        public void writeInternal​(java.io.DataOutput out)
                           throws java.io.IOException
        Description copied from class: LobRef
        Perform the write() operation on a fully-materializable record.
        Specified by:
        writeInternal in class LobRef<java.lang.String,​java.lang.String,​java.io.Reader>
        Parameters:
        out - the DataOutput to deserialize to.
        Throws:
        java.io.IOException
      • parse

        public static ClobRef parse​(java.lang.String inputString)
        Create a ClobRef based on parsed data from a line of text.
        Parameters:
        inputString - the text-based input data to parse.
        Returns:
        a ClobRef to the given data.