Documentation ¶
Index ¶
- func IsDir(filepath string) bool
- func SplitS3URL(url string) (prefix, bucket, key string, err error)
- type FileLocation
- type FileType
- type HdfsFileSystem
- type LocalFileSystem
- type S3FileSystem
- type VirtualFile
- type VirtualFileHdfs
- func (self *VirtualFileHdfs) Close() (err error)
- func (self *VirtualFileHdfs) Read(p []byte) (n int, err error)
- func (self *VirtualFileHdfs) ReadAt(b []byte, off int64) (n int, err error)
- func (self *VirtualFileHdfs) Seek(offset int64, whence int) (int64, error)
- func (self *VirtualFileHdfs) Size() int64
- type VirtualFileLocal
- type VirtualFileS3
- type VirtualFileSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitS3URL ¶
Types ¶
type FileLocation ¶
func List ¶
func List(filepath string) ([]*FileLocation, error)
func NewFileLocation ¶
func NewFileLocation(loc string, ft FileType) *FileLocation
type HdfsFileSystem ¶
type HdfsFileSystem struct { }
Get the namenode from 1) the hdfs://namenode/... string 2) Or from env HADOOP_NAMENODE. 3) Or based on env HADOOP_CONF_DIR or HADOOP_HOME to locate hdfs-site.xml and core-site.xml
func (*HdfsFileSystem) Accept ¶
func (fs *HdfsFileSystem) Accept(fl *FileLocation) bool
func (*HdfsFileSystem) IsDir ¶
func (fs *HdfsFileSystem) IsDir(fl *FileLocation) bool
func (*HdfsFileSystem) List ¶
func (fs *HdfsFileSystem) List(fl *FileLocation) (fileLocations []*FileLocation, err error)
List generates a full list of file locations under the given location, which should have a prefix of hdfs://
func (*HdfsFileSystem) Open ¶
func (fs *HdfsFileSystem) Open(fl *FileLocation) (VirtualFile, error)
type LocalFileSystem ¶
type LocalFileSystem struct { }
func (*LocalFileSystem) Accept ¶
func (fs *LocalFileSystem) Accept(fl *FileLocation) bool
func (*LocalFileSystem) IsDir ¶
func (fs *LocalFileSystem) IsDir(fl *FileLocation) bool
func (*LocalFileSystem) List ¶
func (fs *LocalFileSystem) List(fl *FileLocation) (fileLocations []*FileLocation, err error)
func (*LocalFileSystem) Open ¶
func (fs *LocalFileSystem) Open(fl *FileLocation) (VirtualFile, error)
type S3FileSystem ¶
type S3FileSystem struct { }
func (*S3FileSystem) Accept ¶
func (self *S3FileSystem) Accept(fl *FileLocation) bool
func (*S3FileSystem) IsDir ¶
func (self *S3FileSystem) IsDir(fl *FileLocation) bool
func (*S3FileSystem) List ¶
func (self *S3FileSystem) List(fl *FileLocation) (fileLocations []*FileLocation, err error)
func (*S3FileSystem) Open ¶
func (self *S3FileSystem) Open(fl *FileLocation) (VirtualFile, error)
type VirtualFile ¶
func Open ¶
func Open(filepath string) (VirtualFile, error)
type VirtualFileHdfs ¶
type VirtualFileHdfs struct { FileReader *hdfs.FileReader Client *hdfs.Client }
/////////////////////////////////
func (*VirtualFileHdfs) Close ¶
func (self *VirtualFileHdfs) Close() (err error)
func (*VirtualFileHdfs) ReadAt ¶
func (self *VirtualFileHdfs) ReadAt(b []byte, off int64) (n int, err error)
func (*VirtualFileHdfs) Seek ¶
func (self *VirtualFileHdfs) Seek(offset int64, whence int) (int64, error)
func (*VirtualFileHdfs) Size ¶
func (self *VirtualFileHdfs) Size() int64
type VirtualFileLocal ¶
func (*VirtualFileLocal) Size ¶
func (vf *VirtualFileLocal) Size() int64
type VirtualFileS3 ¶
func (*VirtualFileS3) Close ¶
func (self *VirtualFileS3) Close() error
func (*VirtualFileS3) Size ¶
func (self *VirtualFileS3) Size() int64
type VirtualFileSystem ¶
type VirtualFileSystem interface { Accept(*FileLocation) bool Open(*FileLocation) (VirtualFile, error) List(*FileLocation) ([]*FileLocation, error) IsDir(*FileLocation) bool }
Click to show internal directories.
Click to hide internal directories.