hadoop

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// YarnSiteFile show nodemanager special config file
	YarnSiteFile = "yarn-site.xml"
	// HdfsSiteFILE show hdfs special config file
	HdfsSiteFILE = "hdfs-site.xml"
	// CoreSiteFile show nodemanager special config file
	CoreSiteFile = "core-site.xml"
	// YarnEnvFile show nodemanager special config file
	YarnEnvFile = "yarn-env.sh"
)

Variables

This section is empty.

Functions

func GetAllConfig

func GetAllConfig(fileName string) (map[string]string, error)

GetAllConfig get all properties from file

func GetCapacity

func GetCapacity() (global.NMCapacity, error)

GetCapacity get capacity value

func GetConfDataFromFile

func GetConfDataFromFile(xmlfile string, key string) string

GetConfDataFromFile get key value from file @xmlfile: yarn-site.xml, core-site.xml, hdfs-site.xml

func GetConfig

func GetConfig(fileName string, keys []string) (map[string]string, error)

GetConfig get property based on keys

func GetNodeManagerAddress

func GetNodeManagerAddress(cacheAddress bool) string

GetNodeManagerAddress get nodemanager address - cacheAddress: get result from cache, no need to read file

func GetNodeManagerWebAddress

func GetNodeManagerWebAddress(cacheAddress bool) string

GetNodeManagerWebAddress get nodemanager webapp address - cacheAddress: get result from cache, no need to read file

func GetResourceManagerAddress

func GetResourceManagerAddress(cacheAddress bool) string

GetResourceManagerAddress get resource manager address - cacheAddress: get result from cache, no need to read file

func GetXMLFullPath

func GetXMLFullPath(filename string) string

GetXMLFullPath return full path

func SetAddDelConfig

func SetAddDelConfig(fileName string, properties map[string]string, add, del bool) error

SetAddDelConfig set properties for file, may add new or delete old

func SetAddDelMultipleConfDataToFile

func SetAddDelMultipleConfDataToFile(xmlfile string, properties map[string]string, add, del bool) error

SetAddDelMultipleConfDataToFile set many properties to xml file, may add new key or delete old key

func SetCapacity

func SetCapacity(capacity global.NMCapacity) error

SetCapacity set capacity value

func SetConfig

func SetConfig(fileName string, properties map[string]string) error

SetConfig set properties for file

func SetMultipleConfDataToFile

func SetMultipleConfDataToFile(xmlfile string, properties map[string]string) error

SetMultipleConfDataToFile set many properties to xml file

Types

type ConfData

type ConfData struct {
	XMLName    xml.Name       `xml:"configuration"`
	Properties []PropertyData `xml:"property"`
}

ConfData show whole xml properties

func LoadConfDataFromFile

func LoadConfDataFromFile(filename string) (*ConfData, error)

LoadConfDataFromFile load xmf struct from file

func LoadConfDataFromStream

func LoadConfDataFromStream(s io.Reader) (*ConfData, error)

LoadConfDataFromStream load xml struct from io stream

func (*ConfData) Get

func (conf *ConfData) Get(key string) string

Get function get value based on key

func (*ConfData) SaveToStream

func (conf *ConfData) SaveToStream(w io.Writer) error

SaveToStream restore io stream to file

func (*ConfData) Set

func (conf *ConfData) Set(key string, value string)

Set function set value based on key

func (*ConfData) SetAdd

func (conf *ConfData) SetAdd(key string, value string)

SetAdd function set value based on key, including key not exited

type PropertyData

type PropertyData struct {
	XMLName     xml.Name `xml:"property"`
	Name        string   `xml:"name"`
	Value       string   `xml:"value"`
	Description string   `xml:"description,omitempty"`
}

PropertyData show value of signal xml property

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL