rpc

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package rpc implements some of the lower-level functionality required to communicate with the namenode and datanodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatanodeError

type DatanodeError struct {
}

type NamenodeConnection

type NamenodeConnection struct {
	ClientID   []byte
	ClientName string
	User       string
	// contains filtered or unexported fields
}

NamenodeConnection represents an open connection to a namenode.

func NewNamenodeConnection

func NewNamenodeConnection(options NamenodeConnectionOptions) (*NamenodeConnection, error)

NewNamenodeConnectionWithOptions creates a new connection to a namenode with the given options and performs an initial handshake.

func (*NamenodeConnection) Close

func (c *NamenodeConnection) Close() error

Close terminates all underlying socket connections to remote server.

func (*NamenodeConnection) Execute

func (c *NamenodeConnection) Execute(method string, req proto.Message, resp proto.Message) error

Execute performs an rpc call. It does this by sending req over the wire and unmarshaling the result into resp.

type NamenodeConnectionOptions

type NamenodeConnectionOptions struct {
	// Addresses specifies the namenode(s) to connect to.
	Addresses []string
	// User specifies which HDFS user the client will act as. It is required
	// unless kerberos authentication is enabled, in which case it will be
	// determined from the provided credentials if empty.
	User string
	// DialFunc is used to connect to the namenodes. If nil, then
	// (&net.Dialer{}).DialContext is used.
	DialFunc func(ctx context.Context, network, addr string) (net.Conn, error)
	// KerberosClient is used to connect to kerberized HDFS clusters. If provided,
	// the NamenodeConnection will always mutually athenticate when connecting
	// to the namenode(s).
	KerberosClient *krb.Client
	// KerberosServicePrincipleName specifiesthe Service Principle Name
	// (<SERVICE>/<FQDN>) for the namenode(s). Like in the
	// dfs.namenode.kerberos.principal property of core-site.xml, the special
	// string '_HOST' can be substituted for the hostname in a multi-namenode
	// setup (for example: 'nn/_HOST@EXAMPLE.COM'). It is required if
	// KerberosClient is provided.
	KerberosServicePrincipleName string
}

NamenodeConnectionOptions represents the configurable options available for a NamenodeConnection.

type NamenodeError

type NamenodeError struct {
	// contains filtered or unexported fields
}

NamenodeError represents an interepreted error from the Namenode, including the error code and the java backtrace. It implements hdfs.Error.

func (*NamenodeError) Desc

func (err *NamenodeError) Desc() string

func (*NamenodeError) Error

func (err *NamenodeError) Error() string

func (*NamenodeError) Exception

func (err *NamenodeError) Exception() string

func (*NamenodeError) Message

func (err *NamenodeError) Message() string

func (*NamenodeError) Method

func (err *NamenodeError) Method() string

Jump to

Keyboard shortcuts

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