udsink

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WriteToFallbackErr error = &ApplyUDSinkErr{
		UserUDSinkErr: true,
		Message:       "write to fallback sink",
	}

	UnknownUDSinkErr error = &ApplyUDSinkErr{
		UserUDSinkErr: true,
		Message:       "unknown error in udsink",
	}
	NotFoundErr error = &ApplyUDSinkErr{
		UserUDSinkErr: true,
		Message:       "not found in response",
	}
)

Functions

This section is empty.

Types

type ApplyUDSinkErr

type ApplyUDSinkErr struct {
	UserUDSinkErr bool
	Message       string
	InternalErr
}

ApplyUDSinkErr represents any UDSink related error

func (*ApplyUDSinkErr) Error

func (e *ApplyUDSinkErr) Error() string

func (*ApplyUDSinkErr) IsInternalErr

func (e *ApplyUDSinkErr) IsInternalErr() bool

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

func (*ApplyUDSinkErr) IsUserUDSinkErr

func (e *ApplyUDSinkErr) IsUserUDSinkErr() bool

IsUserUDSinkErr is true if the problem is due to the user code in the UDSink.

type InternalErr

type InternalErr struct {
	Flag        bool
	MainCarDown bool
}

InternalErr represents errors internal to the platform

type SinkApplier added in v0.10.0

type SinkApplier interface {
	ApplySink(ctx context.Context, requests []*sinkpb.SinkRequest) []error
}

SinkApplier applies the sink on the read message and gives back a response. Any UserError will be retried here, while InternalErr can be returned and could be retried by the callee.

type UDSgRPCBasedUDSink added in v0.7.1

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

UDSgRPCBasedUDSink applies user-defined sink over gRPC (over Unix Domain Socket) client/server where server is the UDSink.

func NewUDSgRPCBasedUDSink added in v0.7.1

func NewUDSgRPCBasedUDSink(client sinkclient.Client) *UDSgRPCBasedUDSink

NewUDSgRPCBasedUDSink returns UDSgRPCBasedUDSink

func (*UDSgRPCBasedUDSink) ApplySink added in v0.10.0

func (u *UDSgRPCBasedUDSink) ApplySink(ctx context.Context, requests []*sinkpb.SinkRequest) []error

func (*UDSgRPCBasedUDSink) CloseConn added in v0.7.1

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

CloseConn closes the gRPC client connection.

func (*UDSgRPCBasedUDSink) IsHealthy added in v0.7.1

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

IsHealthy checks if the udsink is healthy.

func (*UDSgRPCBasedUDSink) WaitUntilReady added in v0.7.1

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

WaitUntilReady waits until the udsink is connected.

type UserDefinedSink added in v0.6.0

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

func NewUserDefinedSink

func NewUserDefinedSink(ctx context.Context, vertexInstance *dfv1.VertexInstance, udsink SinkApplier) (*UserDefinedSink, error)

NewUserDefinedSink returns genericSink type.

func (*UserDefinedSink) Close added in v0.6.0

func (s *UserDefinedSink) Close() error

func (*UserDefinedSink) GetName added in v0.6.0

func (s *UserDefinedSink) GetName() string

func (*UserDefinedSink) GetPartitionIdx added in v0.9.0

func (s *UserDefinedSink) GetPartitionIdx() int32

GetPartitionIdx returns the partition index. for sink it is always 0.

func (*UserDefinedSink) IsFull added in v0.6.0

func (s *UserDefinedSink) IsFull() bool

func (*UserDefinedSink) Write added in v0.6.0

func (s *UserDefinedSink) Write(ctx context.Context, messages []isb.Message) ([]isb.Offset, []error)

Write writes to the UDSink container.

Jump to

Keyboard shortcuts

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