public abstract class LobRef<DATATYPE,CONTAINERTYPE,ACCESSORTYPE>
extends java.lang.Object
implements java.io.Closeable, org.apache.hadoop.io.Writable
Modifier and Type | Field and Description |
---|---|
protected static java.lang.ThreadLocal<java.util.regex.Matcher> |
EXTERNAL_MATCHER |
static org.apache.commons.logging.Log |
LOG |
Modifier | Constructor and Description |
---|---|
protected |
LobRef() |
protected |
LobRef(CONTAINERTYPE container) |
protected |
LobRef(java.lang.String file,
long offset,
long length) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
void |
close() |
protected abstract CONTAINERTYPE |
deepCopyData(CONTAINERTYPE data)
Make a copy of the materialized data.
|
protected void |
finalize() |
DATATYPE |
getData() |
protected CONTAINERTYPE |
getDataObj()
Internal API to retrieve the data object.
|
ACCESSORTYPE |
getDataStream(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path basePath)
Get access to the LOB data itself.
|
ACCESSORTYPE |
getDataStream(org.apache.hadoop.mapreduce.Mapper.Context mapContext)
Convenience method to access #getDataStream(Configuration, Path)
from within a map task that read this LobRef from a file-based
InputSplit.
|
protected abstract ACCESSORTYPE |
getExternalSource(org.apache.sqoop.io.LobFile.Reader reader)
Using the LobFile reader, get an accessor InputStream or Reader to the
underlying data.
|
protected abstract DATATYPE |
getInternalData(CONTAINERTYPE data) |
protected abstract ACCESSORTYPE |
getInternalSource(CONTAINERTYPE data)
Wrap the materialized data in an InputStream or Reader.
|
boolean |
isExternal() |
void |
readFields(java.io.DataInput in) |
protected abstract void |
readFieldsInternal(java.io.DataInput in)
Perform the readFields() operation on a fully-materializable record.
|
protected void |
setDataObj(CONTAINERTYPE data)
Internal API to set the data object.
|
java.lang.String |
toString() |
void |
write(java.io.DataOutput out) |
protected abstract void |
writeInternal(java.io.DataOutput out)
Perform the write() operation on a fully-materializable record.
|
public static final org.apache.commons.logging.Log LOG
protected static final java.lang.ThreadLocal<java.util.regex.Matcher> EXTERNAL_MATCHER
protected LobRef()
protected LobRef(CONTAINERTYPE container)
protected LobRef(java.lang.String file, long offset, long length)
protected CONTAINERTYPE getDataObj()
protected void setDataObj(CONTAINERTYPE data)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public boolean isExternal()
public ACCESSORTYPE getDataStream(org.apache.hadoop.mapreduce.Mapper.Context mapContext) throws java.io.IOException
mapContext
- the Mapper.Context instance that encapsulates
the current map task.java.lang.IllegalArgumentException
- if it cannot find the source
path for this LOB based on the MapContext.java.io.IOException
- if it could not read the LOB from external storage.public ACCESSORTYPE getDataStream(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path basePath) throws java.io.IOException
conf
- the Configuration used to access the filesystembasePath
- the base directory where the table records are
stored.java.io.IOException
- if it could not read the LOB from external storage.protected abstract ACCESSORTYPE getExternalSource(org.apache.sqoop.io.LobFile.Reader reader) throws java.io.IOException
java.io.IOException
protected abstract ACCESSORTYPE getInternalSource(CONTAINERTYPE data)
protected abstract DATATYPE getInternalData(CONTAINERTYPE data)
protected abstract CONTAINERTYPE deepCopyData(CONTAINERTYPE data)
public DATATYPE getData()
public java.lang.String toString()
toString
in class java.lang.Object
public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
java.io.IOException
protected abstract void readFieldsInternal(java.io.DataInput in) throws java.io.IOException
in
- the DataInput to deserialize from.java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
java.io.IOException
protected abstract void writeInternal(java.io.DataOutput out) throws java.io.IOException
out
- the DataOutput to deserialize to.java.io.IOException
Copyright © 2019 The Apache Software Foundation