Skip to content
This repository was archived by the owner on Oct 14, 2021. It is now read-only.
This repository was archived by the owner on Oct 14, 2021. It is now read-only.

Add Tcp behavior inside the endpoint pair #7

@bokket

Description

@bokket

hdfs usually use the New(address string) method to access a namenode node, the user will be the user running the code. If the address is an empty string, it will try to get the NameNode address from the Hadoop configuration file.

I proposal to add endpoint pair. It makes utils.go NewStorage method like

ep,err := endpoint.Parse(opt.Endpoint)
	if err != nil {
		return nil, err
	}

	var address string
	switch ep.Protocol() {
	case endpoint.ProtocolTcp:
		address = ep.Tcp()
	default:
		return nil,services.PairUnsupportedError{Pair: ps.WithEndpoint(opt.Endpoint)}
	}
	store.hdfs,err = hdfs.New(address)
	if err != nil {
		return nil, errors.New("hdfs address is not exist")
	}
	
	return store,nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions