Package org.apache.sqoop.lib
Class LargeObjectLoader
- java.lang.Object
-
- org.apache.sqoop.lib.LargeObjectLoader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class LargeObjectLoader extends java.lang.Object implements java.io.CloseableContains a set of methods which can read db columns from a ResultSet into Java types, and do serialization of these types to/from DataInput/DataOutput for use with Hadoop's Writable implementation. This supports null values for all types. This is a singleton instance class; only one may exist at a time. However, its lifetime is limited to the current TaskInputOutputContext's life.
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_MAX_LOB_LENGTHstatic org.apache.commons.logging.LogLOGstatic java.lang.StringMAX_INLINE_LOB_LEN_KEY
-
Constructor Summary
Constructors Constructor Description LargeObjectLoader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path workPath)Create a new LargeObjectLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidfinalize()BlobRefreadBlobRef(int colNum, java.sql.ResultSet r)Actually read a BlobRef instance from the ResultSet and materialize the data either inline or to a file.ClobRefreadClobRef(int colNum, java.sql.ResultSet r)Actually read a ClobRef instance from the ResultSet and materialize the data either inline or to a file.
-
-
-
Field Detail
-
LOG
public static final org.apache.commons.logging.Log LOG
-
DEFAULT_MAX_LOB_LENGTH
public static final long DEFAULT_MAX_LOB_LENGTH
- See Also:
- Constant Field Values
-
MAX_INLINE_LOB_LEN_KEY
public static final java.lang.String MAX_INLINE_LOB_LEN_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
readBlobRef
public BlobRef readBlobRef(int colNum, java.sql.ResultSet r) throws java.io.IOException, java.lang.InterruptedException, java.sql.SQLException
Actually read a BlobRef instance from the ResultSet and materialize the data either inline or to a file.- Parameters:
colNum- the column of the ResultSet's current row to read.r- the ResultSet to read from.- Returns:
- a BlobRef encapsulating the data in this field.
- Throws:
java.io.IOException- if an error occurs writing to the FileSystem.java.sql.SQLException- if an error occurs reading from the database.java.lang.InterruptedException
-
readClobRef
public ClobRef readClobRef(int colNum, java.sql.ResultSet r) throws java.io.IOException, java.lang.InterruptedException, java.sql.SQLException
Actually read a ClobRef instance from the ResultSet and materialize the data either inline or to a file.- Parameters:
colNum- the column of the ResultSet's current row to read.r- the ResultSet to read from.- Returns:
- a ClobRef encapsulating the data in this field.
- Throws:
java.io.IOException- if an error occurs writing to the FileSystem.java.sql.SQLException- if an error occurs reading from the database.java.lang.InterruptedException
-
-