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

RFC-8: Add TCP protocol #8

Merged
merged 10 commits into from
Jul 17, 2021
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/rfcs/8-add-tcp-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
- 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 `alias` of `ProtocolTCP` should follow [go-endpoint](https://github.com/beyondstorage/go-endpoint/blob/master/README.md)
Xuanwo marked this conversation as resolved.
Show resolved Hide resolved
- 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)`)
Xuanwo marked this conversation as resolved.
Show resolved Hide resolved
- Implement protocol tcp parser (`func Parse(cfg string) (p Endpoint, err error)`)
- Implement protocol tcp object (`func NewTCP(host string,port int) Endpoint `)