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

Commit

Permalink
RFC-8: Add TCP protocol (#8)
Browse files Browse the repository at this point in the history
* Add Tcp Pair

Signed-off-by: bokket <[email protected]>

* fix some details

Signed-off-by: bokket <[email protected]>

* Correction of some issues

Signed-off-by: bokket <[email protected]>

* Update docs/rfcs/8-add-tcp-pair.md

* Update and rename 8-add-tcp-pair.md to 8-add-tcp-protocol.md

* commit

* fix issues

Signed-off-by: bokket <[email protected]>

* Update docs/rfcs/8-add-tcp-protocol.md

* Update docs/rfcs/8-add-tcp-protocol.md

Co-authored-by: Xuanwo <[email protected]>
  • Loading branch information
bokket and Xuanwo authored Jul 17, 2021
1 parent 0e0ede7 commit b69ddae
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/rfcs/8-add-tcp-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- Author: bokket <[email protected]>
- Start Date: 2021-07-17
- RFC PR: [beyondstorage/go-endpoint#8](https://github.com/beyondstorage/go-endpoint/pull/8)
- Tracking Issue: [beyondstorage/go-endpoint/issues/9](https://github.com/beyondstorage/go-endpoint/issues/9)

# RFC-8: Add TCP protocol

Releated issue: [beyondstorage/go-endpoint/issues/7](https://github.com/beyondstorage/go-endpoint/issues/7)

## Background

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.

## Proposal

I suggest adding a tcp protocol to allow the user to specify the address.

It likes `tcp:<host>:<port>`

- The `type` of `tcp` should be `String` and is a `const`
- The `value` of `endpoint` should be parsed into `ProtocolTCP` and `args include <host>:<port>`

## Rationale

Now we don't have a pair operation on the `hdfs address` or tcp-like operation

## Compatibility

No compatibility issues at this time.

## Implementation

- Add protocol `tcp`
- Implement protocol tcp formatted (`func (p Endpoint) TCP() (addr, host string, port int)`)
- Implement protocol tcp parser (`func Parse(cfg string) (p Endpoint, err error)`)
- Implement protocol tcp object (`func NewTCP(host string,port int) Endpoint `)

0 comments on commit b69ddae

Please sign in to comment.