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

Add Tcp behavior inside the endpoint pair #7

Closed
bokket opened this issue Jul 16, 2021 · 2 comments
Closed

Add Tcp behavior inside the endpoint pair #7

bokket opened this issue Jul 16, 2021 · 2 comments

Comments

@bokket
Copy link
Member

bokket commented Jul 16, 2021

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
@Xuanwo Xuanwo transferred this issue from beyondstorage/go-service-hdfs Jul 16, 2021
@bokket
Copy link
Member Author

bokket commented Jul 17, 2021

Tracking issue for RFC-8

@Xuanwo
Copy link
Contributor

Xuanwo commented Jul 17, 2021

Proposed as #8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants