Documentation ¶
Index ¶
- Variables
- func BeginDatanodeReplication(datanodeUuid uuid.UUID) (err error)
- func BeginFullReplication(sourceFileInfo FileInfo, targetFileInfo FileInfo) (err error)
- func ChangeDatanodeStatus(datanodeUuid uuid.UUID, active bool) error
- func CopyFile(fileName string, copyName string) error
- func InitNamespace() error
- func MoveFile(fileName string, newFileName string) error
- func RegisterDatanode(info *DatanodeInfo) (datanodeUuid uuid.UUID, err error)
- func RemoveDir(dirName string, withForce bool) error
- func RemoveFile(fileName string) error
- func RunDatanodesCleanup(datanodesInfo []*DatanodeInfo, deletionMode bool)
- func UnregisterDatanode(datanodeUuid uuid.UUID) error
- type DatanodeInfo
- type DirInfo
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var MinimumReplicaCount = func() int { valStr, found := os.LookupEnv("MIN_REPLICA_COUNT") var val int if !found { val = defaultMinimumReplicaCount } else { var err error val, err = strconv.Atoi(valStr) if err != nil { println("Unable to parse MIN_REPLICA_COUNT: ", err) println("Falling back to default value ", defaultMinimumReplicaCount) val = defaultMinimumReplicaCount } } return val }()
View Source
var RedisAddress = func() string { val, found := os.LookupEnv("REDIS_ADDRESS") if !found { val = defaultRedisAddress } return val }()
View Source
var RedisDb = func() int { valStr, found := os.LookupEnv("REDIS_DB") var val int if !found { val = defaultRedisDB } else { var err error val, err = strconv.Atoi(valStr) if err != nil { println("Unable to parse REDIS_DB: ", err) println("Falling back to default value ", defaultRedisDB) val = defaultRedisDB } } return val }()
View Source
var RedisPassword = func() string { val, found := os.LookupEnv("REDIS_PASSWORD") if !found { val = defaultRedisPassword } return val }()
Functions ¶
func BeginFullReplication ¶
func InitNamespace ¶
func InitNamespace() error
func RegisterDatanode ¶
func RegisterDatanode(info *DatanodeInfo) (datanodeUuid uuid.UUID, err error)
func RemoveFile ¶
func RunDatanodesCleanup ¶
func RunDatanodesCleanup(datanodesInfo []*DatanodeInfo, deletionMode bool)
func UnregisterDatanode ¶
Types ¶
type DatanodeInfo ¶
addr:<address>:<public port>:id -> uuid of node addr:<address>:<private port>:id -> uuid of node id:<uuid>:type -> type of entity (DATANODE) id:<uuid>:status -> current status of the datanode id:<uuid>:info -> string to string map to store datanode info list:datanodes -> list of uuid strings of datanodes list:files:<datanode uuid>:id -> list of uuid strings of files
func GetAllDatanodes ¶
func GetAllDatanodes() (datanodes []*DatanodeInfo, err error)
func GetDatanodeInfo ¶
func GetDatanodeInfo(uuidStr string) (info *DatanodeInfo, err error)
func GetDatanodeInfoByUuid ¶
func GetDatanodeInfoByUuid(uuid uuid.UUID) (info *DatanodeInfo, err error)
type DirInfo ¶
type DirInfo struct { // full path of the directory FullName string // uuid of the directory (may be unused) DirUUID uuid.UUID SubDirList []string // list of file names whose are located in this directory FileList []string }
func GetDirInfo ¶
Click to show internal directories.
Click to hide internal directories.