Package org.teiid.hdfs
Class HdfsVirtualFile
- java.lang.Object
-
- org.teiid.hdfs.HdfsVirtualFile
-
- All Implemented Interfaces:
VirtualFile
public class HdfsVirtualFile extends Object implements VirtualFile
-
-
Constructor Summary
Constructors Constructor Description HdfsVirtualFile(org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.FileStatus fileStatus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCreationTime()The creation time in UTC millisecondslonggetLastModified()The last modified time in UTC millisecondsStringgetName()Get the file nameStringgetPath()The full virtual path to the file including file name It is not well-defined if this must start with a leading /longgetSize()The size in bytes.booleanisDirectory()InputStreamopenInputStream(boolean lock)Open a stream for readingOutputStreamopenOutputStream(boolean lock)Open a stream for writing-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.teiid.file.VirtualFile
createInputStreamFactory, getStorageMode
-
-
-
-
Method Detail
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectoryin interfaceVirtualFile
-
getPath
public String getPath()
Description copied from interface:VirtualFileThe full virtual path to the file including file name It is not well-defined if this must start with a leading /- Specified by:
getPathin interfaceVirtualFile- Returns:
-
getName
public String getName()
Description copied from interface:VirtualFileGet the file name- Specified by:
getNamein interfaceVirtualFile
-
openInputStream
public InputStream openInputStream(boolean lock) throws IOException
Description copied from interface:VirtualFileOpen a stream for reading- Specified by:
openInputStreamin interfaceVirtualFile- Parameters:
lock- true if a lock is requested. It's up to the implementation whether to actually honor the lock.- Throws:
IOException
-
openOutputStream
public OutputStream openOutputStream(boolean lock) throws IOException
Description copied from interface:VirtualFileOpen a stream for writing- Specified by:
openOutputStreamin interfaceVirtualFile- Parameters:
lock- true if a lock is requested. It's up to the implementation whether to actually honor the lock.- Throws:
IOException
-
getLastModified
public long getLastModified()
Description copied from interface:VirtualFileThe last modified time in UTC milliseconds- Specified by:
getLastModifiedin interfaceVirtualFile
-
getCreationTime
public long getCreationTime()
Description copied from interface:VirtualFileThe creation time in UTC milliseconds- Specified by:
getCreationTimein interfaceVirtualFile
-
getSize
public long getSize()
Description copied from interface:VirtualFileThe size in bytes.- Specified by:
getSizein interfaceVirtualFile- Returns:
- the size or -1 if unknown.
-
-