Package org.apache.sqoop.lib
Class ClobRef
- java.lang.Object
-
- org.apache.sqoop.lib.LobRef<java.lang.String,java.lang.String,java.io.Reader>
-
- org.apache.sqoop.lib.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.
-
-
Field Summary
-
Fields inherited from class org.apache.sqoop.lib.LobRef
EXTERNAL_MATCHER, LOG
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringdeepCopyData(java.lang.String data)Make a copy of the materialized data.protected java.io.ReadergetExternalSource(org.apache.sqoop.io.LobFile.Reader reader)Using the LobFile reader, get an accessor InputStream or Reader to the underlying data.protected java.lang.StringgetInternalData(java.lang.String data)protected java.io.ReadergetInternalSource(java.lang.String data)Wrap the materialized data in an InputStream or Reader.static ClobRefparse(java.lang.String inputString)Create a ClobRef based on parsed data from a line of text.voidreadFieldsInternal(java.io.DataInput in)Perform the readFields() operation on a fully-materializable record.voidwriteInternal(java.io.DataOutput out)Perform the write() operation on a fully-materializable record.-
Methods inherited from class org.apache.sqoop.lib.LobRef
clone, close, finalize, getData, getDataObj, getDataStream, getDataStream, isExternal, readFields, setDataObj, toString, write
-
-
-
-
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.IOExceptionDescription copied from class:LobRefUsing the LobFile reader, get an accessor InputStream or Reader to the underlying data.- Specified by:
getExternalSourcein classLobRef<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:LobRefWrap the materialized data in an InputStream or Reader.- Specified by:
getInternalSourcein classLobRef<java.lang.String,java.lang.String,java.io.Reader>
-
deepCopyData
protected java.lang.String deepCopyData(java.lang.String data)
Description copied from class:LobRefMake a copy of the materialized data.- Specified by:
deepCopyDatain classLobRef<java.lang.String,java.lang.String,java.io.Reader>
-
getInternalData
protected java.lang.String getInternalData(java.lang.String data)
- Specified by:
getInternalDatain classLobRef<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.IOExceptionDescription copied from class:LobRefPerform the readFields() operation on a fully-materializable record.- Specified by:
readFieldsInternalin classLobRef<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.IOExceptionDescription copied from class:LobRefPerform the write() operation on a fully-materializable record.- Specified by:
writeInternalin classLobRef<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.
-
-