Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
dmlc::io::S3FileSystem Class Reference

S3 filesystem. More...

#include <s3_filesys.h>

Inherits dmlc::io::FileSystem.

Public Member Functions

virtual ~S3FileSystem ()
 destructor
 
void SetCredentials (const std::string &s3_access_id, const std::string &s3_secret_key)
 Sets S3 access credentials.
 
virtual FileInfo GetPathInfo (const URI &path)
 get information about a path
 
virtual void ListDirectory (const URI &path, std::vector< FileInfo > *out_list)
 list files in a directory
 
virtual StreamOpen (const URI &path, const char *const flag, bool allow_null)
 open a stream, will report error and exit if bad thing happens NOTE: the Stream can continue to work even when filesystem was destructed
 
virtual SeekStreamOpenForRead (const URI &path, bool allow_null)
 open a seekable stream for read
 

Static Public Member Functions

static S3FileSystemGetInstance (void)
 get a singleton of S3FileSystem when needed
 

Detailed Description

S3 filesystem.

Member Function Documentation

◆ GetInstance()

static S3FileSystem * dmlc::io::S3FileSystem::GetInstance ( void  )
inlinestatic

get a singleton of S3FileSystem when needed

Returns
a singleton instance

◆ GetPathInfo()

FileInfo dmlc::io::S3FileSystem::GetPathInfo ( const URI &  path)
virtual

get information about a path

Parameters
paththe path to the file
Returns
the information about the file

◆ ListDirectory()

void dmlc::io::S3FileSystem::ListDirectory ( const URI &  path,
std::vector< FileInfo > *  out_list 
)
virtual

list files in a directory

Parameters
pathto the file
out_listthe output information about the files

◆ Open()

Stream * dmlc::io::S3FileSystem::Open ( const URI &  path,
const char *const  flag,
bool  allow_null 
)
virtual

open a stream, will report error and exit if bad thing happens NOTE: the Stream can continue to work even when filesystem was destructed

Parameters
pathpath to file
urithe uri of the input
flagcan be "w", "r", "a"
allow_nullwhether NULL can be returned, or directly report error
Returns
the created stream, can be NULL when allow_null == true and file do not exist

◆ OpenForRead()

SeekStream * dmlc::io::S3FileSystem::OpenForRead ( const URI &  path,
bool  allow_null 
)
virtual

open a seekable stream for read

Parameters
paththe path to the file
allow_nullwhether NULL can be returned, or directly report error
Returns
the created stream, can be NULL when allow_null == true and file do not exist

◆ SetCredentials()

void dmlc::io::S3FileSystem::SetCredentials ( const std::string &  s3_access_id,
const std::string &  s3_secret_key 
)

Sets S3 access credentials.

Parameters
s3_access_idThe S3 Access Key ID
s3_secret_keyThe S3 Secret Key
Returns
the information about the file

The documentation for this class was generated from the following files: