Documentation ¶
Index ¶
- Constants
- type ContentSummary
- type FileChecksum
- type FileStatus
- type FileStatuses
- type HdfsData
- type Path
- type RemoteException
- type Token
- type Tokens
- type WebHdfs
- func (h *WebHdfs) Append(localfile string, destination string) error
- func (h *WebHdfs) Delete(recursive bool, paths ...string) map[string]error
- func (h *WebHdfs) Get(path string, server *colonycore.Server) ([]byte, error)
- func (h *WebHdfs) GetToLocal(path string, destination string, permission string, server *colonycore.Server) error
- func (h *WebHdfs) List(path string) (*HdfsData, error)
- func (h *WebHdfs) MakeDir(path string, permission string) error
- func (h *WebHdfs) MakeDirs(paths []string, permission string) map[string]error
- func (h *WebHdfs) Put(localfile string, destination string, permission string, ...) error
- func (h *WebHdfs) PutDir(dirname string, destination string, server *colonycore.Server) (error, map[string]error)
- func (h *WebHdfs) Puts(paths []string, destinationFolder string, permission string, ...) map[string]error
- func (h *WebHdfs) Rename(path string, destination string) error
- func (h *WebHdfs) SetOwner(path string, owner string, group string) error
- func (h *WebHdfs) SetPermission(path string, permission string) error
- type WebHdfsConfig
Constants ¶
View Source
const ( OP_OPEN = "OPEN" OP_CREATE = "CREATE" OP_APPEND = "APPEND" OP_CONCAT = "CONCAT" OP_RENAME = "RENAME" OP_DELETE = "DELETE" OP_SETPERMISSION = "SETPERMISSION" OP_SETOWNER = "SETOWNER" OP_SETREPLICATION = "SETREPLICATION" OP_SETTIMES = "SETTIMES" OP_MKDIRS = "MKDIRS" OP_CREATESYMLINK = "CREATESYMLINK" OP_LISTSTATUS = "LISTSTATUS" OP_GETFILESTATUS = "GETFILESTATUS" OP_GETCONTENTSUMMARY = "GETCONTENTSUMMARY" OP_GETFILECHECKSUM = "GETFILECHECKSUM" OP_GETDELEGATIONTOKEN = "GETDELEGATIONTOKEN" OP_GETDELEGATIONTOKENS = "GETDELEGATIONTOKENS" OP_RENEWDELEGATIONTOKEN = "RENEWDELEGATIONTOKEN" OP_CANCELDELEGATIONTOKEN = "CANCELDELEGATIONTOKEN" )
View Source
const WebHdfsApi string = "/webhdfs/v1/"
Constant
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentSummary ¶
type ContentSummary struct { DirectoryCount int64 FileCount int64 Length int64 Quota int64 SpaceConsumed int64 SpaceQuota int64 }
Type for HDFS FileSystem content summary (FileSystem.getContentSummary()) See http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#ContentSummary_JSON_Schema
Example:
{ "ContentSummary": { "directoryCount": 2, "fileCount" : 1, "length" : 24930, "quota" : -1, "spaceConsumed" : 24930, "spaceQuota" : -1 } }
type FileChecksum ¶
Type for HDFS FileSystem.getFileChecksum() See http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#FileChecksum_JSON_Schema
Example:
{ "FileChecksum": { "algorithm": "MD5-of-1MD5-of-512CRC32", "bytes" : "eadb10de24aa315748930df6e185c0d ...", "length" : 28 } }
type FileStatus ¶
type FileStatus struct { AccesTime int64 BlockSize int64 Group string Length int64 ModificationTime int64 Owner string PathSuffix string Permission string Replication int64 Type string }
Represents HDFS FileStatus (FileSystem.getStatus()) See http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#FileStatus_JSON_Schema
Example:
{ "FileStatus": { "accessTime" : 0, // integer "blockSize" : 0, // integer "group" : "grp", // string "length" : 0, // integer - zero for directories "modificationTime": 1320173277227, // integer "owner" : "webuser", // string "pathSuffix" : "", // string "permission" : "777", // string "replication" : 0, // integer "type" : "DIRECTORY" // string - enum {FILE, DIRECTORY, SYMLINK} } }
type FileStatuses ¶
type FileStatuses struct {
FileStatus []FileStatus
}
Container type for multiple FileStatus for directory, etc (see HDFS FileSystem.listStatus()) NOTE: the confusing naming and Plurality is to match WebHDFS schema.
type HdfsData ¶
type HdfsData struct { Boolean bool FileStatus FileStatus FileStatuses FileStatuses FileChecksum FileChecksum ContentSummary ContentSummary Token Token Tokens Tokens Long int64 RemoteException RemoteException }
Root level struct for data JSON data from WebHDFS.
type Path ¶
type Path struct { Name string // Relative path representation (/root/leaf) RefererUrl url.URL // URL related to path (http://server:port/root/leaf) }
Represents a remote webHDFS path
type RemoteException ¶
Example:
{ "RemoteException": { "exception" : "FileNotFoundException", "javaClassName": "java.io.FileNotFoundException", "message" : "File does not exist: /foo/a.patch" } }
func (RemoteException) Error ¶
func (re RemoteException) Error() string
Implementation of error type. Returns string representation of RemoteException.
type Token ¶
type Token struct {
UrlString string
}
Example:
{ "Token": { "urlString": "JQAIaG9y..." } }
type WebHdfs ¶
type WebHdfs struct { Config *WebHdfsConfig // contains filtered or unexported fields }
func NewWebHdfs ¶
func NewWebHdfs(config *WebHdfsConfig) (*WebHdfs, error)
func (*WebHdfs) GetToLocal ¶
type WebHdfsConfig ¶
type WebHdfsConfig struct { Host string UserId string Password string Token string Method string TimeOut time.Duration PoolSize int }
func NewHdfsConfig ¶
func NewHdfsConfig(host, userid string) *WebHdfsConfig
Click to show internal directories.
Click to hide internal directories.