|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cloudera.sqoop.io.LobReaderCache
public final class LobReaderCache
A cache of open LobFile.Reader objects. This maps from filenames to the open Reader, if any. This uses the Singleton pattern. While nothing prevents multiple LobReaderCache instances, it is most useful to have a single global cache. This cache is internally synchronized; only one thread can insert or retrieve a reader from the cache at a time.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Method Summary | |
---|---|
protected void |
finalize()
|
LobFile.Reader |
get(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Open a LobFile for read access, returning a cached reader if one is available, or a new reader otherwise. |
static LobReaderCache |
getCache()
|
static org.apache.hadoop.fs.Path |
qualify(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Created a fully-qualified path object. |
void |
recycle(LobFile.Reader reader)
Return a reader back to the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Method Detail |
---|
public static LobReaderCache getCache()
public static org.apache.hadoop.fs.Path qualify(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
path
- the path to fully-qualify with its fs URI.conf
- the current Hadoop FS configuration.
java.io.IOException
public LobFile.Reader get(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
path
- the path to the LobFile to openconf
- the configuration to use to access the FS.
java.io.IOException
- if there's an error opening the file.public void recycle(LobFile.Reader reader) throws java.io.IOException
reader
- the opened reader. Any record-specific subreaders should be
closed.
java.io.IOException
- if there's an error accessing the path's filesystem.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |