rpc

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package rpc provides the interface to invoke UDFs (map, mapstream and reduce). structs in this package implements the Applier interface defined in pkg/forward/applier and pkg/reduce/applier. Which will be used by the map and reduce forwarders to invoke the UDFs and return the results. In case of errors if converts grpc errors to udf errors defined in pkg/udf/rpc/errors.go and sends them back to the forwarders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyUDFErr

type ApplyUDFErr struct {
	UserUDFErr bool
	Message    string
	InternalErr
}

ApplyUDFErr represents any mapUDF related error

func (*ApplyUDFErr) Error

func (e *ApplyUDFErr) Error() string

func (*ApplyUDFErr) Is added in v1.1.6

func (e *ApplyUDFErr) Is(target error) bool

Is checks if the error is of the same type

func (*ApplyUDFErr) IsInternalErr

func (e *ApplyUDFErr) IsInternalErr() bool

IsInternalErr is true if this is a platform issue. This is a blocking error.

func (*ApplyUDFErr) IsUserUDFErr

func (e *ApplyUDFErr) IsUserUDFErr() bool

IsUserUDFErr is true if the problem is due to the user code in the UDF.

type GRPCBasedAlignedReduce added in v1.2.0

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

GRPCBasedAlignedReduce is a reduce applier that uses gRPC client to invoke the aligned reduce UDF. It implements the applier.ReduceApplier interface.

func NewUDSgRPCAlignedReduce added in v1.2.0

func NewUDSgRPCAlignedReduce(vertexName string, vertexReplica int32, client reducer.Client) *GRPCBasedAlignedReduce

func (*GRPCBasedAlignedReduce) ApplyReduce added in v1.2.0

func (u *GRPCBasedAlignedReduce) ApplyReduce(ctx context.Context, partitionID *partition.ID, requestsStream <-chan *window.TimedWindowRequest) (<-chan *window.TimedWindowResponse, <-chan error)

ApplyReduce accepts a channel of timedWindowRequest and returns the result in a channel of timedWindowResponse

func (*GRPCBasedAlignedReduce) CloseConn added in v1.2.0

func (u *GRPCBasedAlignedReduce) CloseConn(ctx context.Context) error

CloseConn closes the gRPC client connection.

func (*GRPCBasedAlignedReduce) IsHealthy added in v1.2.0

func (u *GRPCBasedAlignedReduce) IsHealthy(ctx context.Context) error

IsHealthy checks if the map udf is healthy.

func (*GRPCBasedAlignedReduce) WaitUntilReady added in v1.2.0

func (u *GRPCBasedAlignedReduce) WaitUntilReady(ctx context.Context) error

WaitUntilReady waits until the reduce udf is connected.

type GRPCBasedMap

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

GRPCBasedMap is a map applier that uses gRPC client to invoke the map UDF. It implements the applier.MapApplier interface.

func NewUDSgRPCBasedMap

func NewUDSgRPCBasedMap(client mapper.Client) *GRPCBasedMap

func (*GRPCBasedMap) ApplyMap

func (u *GRPCBasedMap) ApplyMap(ctx context.Context, readMessage *isb.ReadMessage) ([]*isb.WriteMessage, error)

func (*GRPCBasedMap) CloseConn

func (u *GRPCBasedMap) CloseConn(ctx context.Context) error

CloseConn closes the gRPC client connection.

func (*GRPCBasedMap) IsHealthy

func (u *GRPCBasedMap) IsHealthy(ctx context.Context) error

IsHealthy checks if the map udf is healthy.

func (*GRPCBasedMap) WaitUntilReady

func (u *GRPCBasedMap) WaitUntilReady(ctx context.Context) error

WaitUntilReady waits until the map udf is connected.

type GRPCBasedMapStream

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

GRPCBasedMapStream is a map stream applier that uses gRPC client to invoke the map stream UDF. It implements the applier.MapStreamApplier interface.

func NewUDSgRPCBasedMapStream

func NewUDSgRPCBasedMapStream(client mapstreamer.Client) *GRPCBasedMapStream

func (*GRPCBasedMapStream) ApplyMapStream

func (u *GRPCBasedMapStream) ApplyMapStream(ctx context.Context, message *isb.ReadMessage, writeMessageCh chan<- isb.WriteMessage) error

func (*GRPCBasedMapStream) CloseConn

func (u *GRPCBasedMapStream) CloseConn(ctx context.Context) error

CloseConn closes the gRPC client connection.

func (*GRPCBasedMapStream) IsHealthy

func (u *GRPCBasedMapStream) IsHealthy(ctx context.Context) error

IsHealthy checks if the map stream udf is healthy.

func (*GRPCBasedMapStream) WaitUntilReady

func (u *GRPCBasedMapStream) WaitUntilReady(ctx context.Context) error

WaitUntilReady waits until the map stream udf is connected.

type GRPCBasedUnalignedReduce added in v1.2.0

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

GRPCBasedUnalignedReduce is a reduce applier that uses gRPC client to invoke the session reduce UDF. It implements the applier.ReduceApplier interface.

func NewGRPCBasedUnalignedReduce added in v1.2.0

func NewGRPCBasedUnalignedReduce(client sessionreducer.Client) *GRPCBasedUnalignedReduce

func (*GRPCBasedUnalignedReduce) ApplyReduce added in v1.2.0

func (u *GRPCBasedUnalignedReduce) ApplyReduce(ctx context.Context, partitionID *partition.ID, requestsStream <-chan *window.TimedWindowRequest) (<-chan *window.TimedWindowResponse, <-chan error)

ApplyReduce accepts a channel of timedWindowRequest and returns the result in a channel of timedWindowResponse. ApplyReduce will never return for unAligned (for-loops ever break) because we only have one single partition. Windows are handled outside.

func (*GRPCBasedUnalignedReduce) CloseConn added in v1.2.0

func (u *GRPCBasedUnalignedReduce) CloseConn(ctx context.Context) error

CloseConn closes the gRPC client connection.

func (*GRPCBasedUnalignedReduce) IsHealthy added in v1.2.0

func (u *GRPCBasedUnalignedReduce) IsHealthy(ctx context.Context) error

IsHealthy checks if the map udf is healthy.

func (*GRPCBasedUnalignedReduce) WaitUntilReady added in v1.2.0

func (u *GRPCBasedUnalignedReduce) WaitUntilReady(ctx context.Context) error

WaitUntilReady waits until the reduce udf is connected.

type InternalErr

type InternalErr struct {
	Flag        bool
	MainCarDown bool
}

InternalErr represents errors internal to the platform

Jump to

Keyboard shortcuts

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