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 long
getCreationTime()
The creation time in UTC millisecondslong
getLastModified()
The last modified time in UTC millisecondsString
getName()
Get the file namelong
getSize()
The size in bytes.InputStream
openInputStream(boolean lock)
Open a stream for readingOutputStream
openOutputStream(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
-
getName
public String getName()
Description copied from interface:VirtualFile
Get the file name- Specified by:
getName
in interfaceVirtualFile
-
openInputStream
public InputStream openInputStream(boolean lock) throws IOException
Description copied from interface:VirtualFile
Open a stream for reading- Specified by:
openInputStream
in 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:VirtualFile
Open a stream for writing- Specified by:
openOutputStream
in 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:VirtualFile
The last modified time in UTC milliseconds- Specified by:
getLastModified
in interfaceVirtualFile
-
getCreationTime
public long getCreationTime()
Description copied from interface:VirtualFile
The creation time in UTC milliseconds- Specified by:
getCreationTime
in interfaceVirtualFile
-
getSize
public long getSize()
Description copied from interface:VirtualFile
The size in bytes.- Specified by:
getSize
in interfaceVirtualFile
- Returns:
- the size or -1 if unknown.
-
-