capture

package
v0.0.0-...-8b3bc45 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCapture        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCapture          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCapture = fmt.Errorf("proto: unexpected end of group")
)

Functions

func PullResponseChannel

func PullResponseChannel(stream Driver_PullClient) <-chan PullResponseError

PullResponseChannel spawns a goroutine which receives from the stream and sends responses into the returned channel, which is closed after the first encountered read error. As an optimization, it avoids this read loop if the stream is an in-process adapter.

func RegisterDriverServer

func RegisterDriverServer(s *grpc.Server, srv DriverServer)

func RegisterRuntimeServer

func RegisterRuntimeServer(s *grpc.Server, srv RuntimeServer)

func StagePullDocuments

func StagePullDocuments(
	stream interface {
		Send(*PullResponse) error
	},
	response **PullResponse,
	binding int,
	document json.RawMessage,
) error

StagePullDocuments potentially sends a previously staged Documents into the stream, and then stages its arguments into response.Captured.

func StagePushDocuments

func StagePushDocuments(
	stream interface {
		Send(*PushRequest) error
	},
	request **PushRequest,
	binding int,
	document json.RawMessage,
) error

StagePushDocuments potentially sends a previously staged Documents into the stream, and then stages its arguments into response.Captured.

func WritePullCheckpoint

func WritePullCheckpoint(
	stream interface {
		Send(*PullResponse) error
	},
	response **PullResponse,
	checkpoint *pf.DriverCheckpoint,
) error

WritePullCheckpoint flushes a pending Documents response, and sends a Checkpoint response with the provided driver checkpoint.

func WritePushCheckpoint

func WritePushCheckpoint(
	stream interface {
		Send(*PushRequest) error
	},
	request **PushRequest,
	checkpoint *pf.DriverCheckpoint,
) error

WritePushCheckpoint flushes a pending Documents response, and sends a Checkpoint response with the provided driver checkpoint.

Types

type Acknowledge

type Acknowledge struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Acknowledge is a notification that a Checkpoint has committed to the Flow runtime's recovery log.

func (*Acknowledge) Descriptor

func (*Acknowledge) Descriptor() ([]byte, []int)

func (*Acknowledge) Marshal

func (m *Acknowledge) Marshal() (dAtA []byte, err error)

func (*Acknowledge) MarshalTo

func (m *Acknowledge) MarshalTo(dAtA []byte) (int, error)

func (*Acknowledge) MarshalToSizedBuffer

func (m *Acknowledge) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Acknowledge) ProtoMessage

func (*Acknowledge) ProtoMessage()

func (*Acknowledge) ProtoSize

func (m *Acknowledge) ProtoSize() (n int)

func (*Acknowledge) Reset

func (m *Acknowledge) Reset()

func (*Acknowledge) String

func (m *Acknowledge) String() string

func (*Acknowledge) Unmarshal

func (m *Acknowledge) Unmarshal(dAtA []byte) error

func (*Acknowledge) Validate

func (m *Acknowledge) Validate() error

Validate returns an error if the Acknowledge isn't well-formed.

func (*Acknowledge) XXX_DiscardUnknown

func (m *Acknowledge) XXX_DiscardUnknown()

func (*Acknowledge) XXX_Marshal

func (m *Acknowledge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Acknowledge) XXX_Merge

func (m *Acknowledge) XXX_Merge(src proto.Message)

func (*Acknowledge) XXX_Size

func (m *Acknowledge) XXX_Size() int

func (*Acknowledge) XXX_Unmarshal

func (m *Acknowledge) XXX_Unmarshal(b []byte) error

type ApplyRequest

type ApplyRequest struct {
	// Capture to be applied.
	Capture *flow.CaptureSpec `protobuf:"bytes,1,opt,name=capture,proto3" json:"capture,omitempty"`
	// Version of the CaptureSpec being applied.
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// Is this Apply a dry-run? If so, no action is undertaken and Apply will
	// report only what would have happened.
	DryRun               bool     `protobuf:"varint,3,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ApplyRequest is the request type of the ApplyUpsert and ApplyDelete RPCs.

func (*ApplyRequest) Descriptor

func (*ApplyRequest) Descriptor() ([]byte, []int)

func (*ApplyRequest) Marshal

func (m *ApplyRequest) Marshal() (dAtA []byte, err error)

func (*ApplyRequest) MarshalTo

func (m *ApplyRequest) MarshalTo(dAtA []byte) (int, error)

func (*ApplyRequest) MarshalToSizedBuffer

func (m *ApplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ApplyRequest) ProtoMessage

func (*ApplyRequest) ProtoMessage()

func (*ApplyRequest) ProtoSize

func (m *ApplyRequest) ProtoSize() (n int)

func (*ApplyRequest) Reset

func (m *ApplyRequest) Reset()

func (*ApplyRequest) String

func (m *ApplyRequest) String() string

func (*ApplyRequest) Unmarshal

func (m *ApplyRequest) Unmarshal(dAtA []byte) error

func (*ApplyRequest) XXX_DiscardUnknown

func (m *ApplyRequest) XXX_DiscardUnknown()

func (*ApplyRequest) XXX_Marshal

func (m *ApplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApplyRequest) XXX_Merge

func (m *ApplyRequest) XXX_Merge(src proto.Message)

func (*ApplyRequest) XXX_Size

func (m *ApplyRequest) XXX_Size() int

func (*ApplyRequest) XXX_Unmarshal

func (m *ApplyRequest) XXX_Unmarshal(b []byte) error

type ApplyResponse

type ApplyResponse struct {
	// Human-readable description of the action that the Driver took (or, if
	// dry_run, would have taken). If empty, this Apply is to be considered a
	// "no-op".
	ActionDescription    string   `protobuf:"bytes,1,opt,name=action_description,json=actionDescription,proto3" json:"action_description,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ApplyResponse is the response type of the ApplyUpsert and ApplyDelete RPCs.

func (*ApplyResponse) Descriptor

func (*ApplyResponse) Descriptor() ([]byte, []int)

func (*ApplyResponse) Marshal

func (m *ApplyResponse) Marshal() (dAtA []byte, err error)

func (*ApplyResponse) MarshalTo

func (m *ApplyResponse) MarshalTo(dAtA []byte) (int, error)

func (*ApplyResponse) MarshalToSizedBuffer

func (m *ApplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ApplyResponse) ProtoMessage

func (*ApplyResponse) ProtoMessage()

func (*ApplyResponse) ProtoSize

func (m *ApplyResponse) ProtoSize() (n int)

func (*ApplyResponse) Reset

func (m *ApplyResponse) Reset()

func (*ApplyResponse) String

func (m *ApplyResponse) String() string

func (*ApplyResponse) Unmarshal

func (m *ApplyResponse) Unmarshal(dAtA []byte) error

func (*ApplyResponse) XXX_DiscardUnknown

func (m *ApplyResponse) XXX_DiscardUnknown()

func (*ApplyResponse) XXX_Marshal

func (m *ApplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApplyResponse) XXX_Merge

func (m *ApplyResponse) XXX_Merge(src proto.Message)

func (*ApplyResponse) XXX_Size

func (m *ApplyResponse) XXX_Size() int

func (*ApplyResponse) XXX_Unmarshal

func (m *ApplyResponse) XXX_Unmarshal(b []byte) error

type DiscoverRequest

type DiscoverRequest struct {
	// Endpoint type addressed by this request.
	EndpointType flow.EndpointType `protobuf:"varint,1,opt,name=endpoint_type,json=endpointType,proto3,enum=flow.EndpointType" json:"endpoint_type,omitempty"`
	// Driver specification, as an encoded JSON object.
	EndpointSpecJson     encoding_json.RawMessage `` /* 141-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

DiscoverRequest is the request type of the Discover RPC.

func (*DiscoverRequest) Descriptor

func (*DiscoverRequest) Descriptor() ([]byte, []int)

func (*DiscoverRequest) Marshal

func (m *DiscoverRequest) Marshal() (dAtA []byte, err error)

func (*DiscoverRequest) MarshalTo

func (m *DiscoverRequest) MarshalTo(dAtA []byte) (int, error)

func (*DiscoverRequest) MarshalToSizedBuffer

func (m *DiscoverRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DiscoverRequest) ProtoMessage

func (*DiscoverRequest) ProtoMessage()

func (*DiscoverRequest) ProtoSize

func (m *DiscoverRequest) ProtoSize() (n int)

func (*DiscoverRequest) Reset

func (m *DiscoverRequest) Reset()

func (*DiscoverRequest) String

func (m *DiscoverRequest) String() string

func (*DiscoverRequest) Unmarshal

func (m *DiscoverRequest) Unmarshal(dAtA []byte) error

func (*DiscoverRequest) Validate

func (m *DiscoverRequest) Validate() error

func (*DiscoverRequest) XXX_DiscardUnknown

func (m *DiscoverRequest) XXX_DiscardUnknown()

func (*DiscoverRequest) XXX_Marshal

func (m *DiscoverRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DiscoverRequest) XXX_Merge

func (m *DiscoverRequest) XXX_Merge(src proto.Message)

func (*DiscoverRequest) XXX_Size

func (m *DiscoverRequest) XXX_Size() int

func (*DiscoverRequest) XXX_Unmarshal

func (m *DiscoverRequest) XXX_Unmarshal(b []byte) error

type DiscoverResponse

type DiscoverResponse struct {
	Bindings             []*DiscoverResponse_Binding `protobuf:"bytes,1,rep,name=bindings,proto3" json:"bindings,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

DiscoverResponse is the response type of the Discover RPC.

func (*DiscoverResponse) Descriptor

func (*DiscoverResponse) Descriptor() ([]byte, []int)

func (*DiscoverResponse) Marshal

func (m *DiscoverResponse) Marshal() (dAtA []byte, err error)

func (*DiscoverResponse) MarshalTo

func (m *DiscoverResponse) MarshalTo(dAtA []byte) (int, error)

func (*DiscoverResponse) MarshalToSizedBuffer

func (m *DiscoverResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DiscoverResponse) ProtoMessage

func (*DiscoverResponse) ProtoMessage()

func (*DiscoverResponse) ProtoSize

func (m *DiscoverResponse) ProtoSize() (n int)

func (*DiscoverResponse) Reset

func (m *DiscoverResponse) Reset()

func (*DiscoverResponse) String

func (m *DiscoverResponse) String() string

func (*DiscoverResponse) Unmarshal

func (m *DiscoverResponse) Unmarshal(dAtA []byte) error

func (*DiscoverResponse) Validate

func (m *DiscoverResponse) Validate() error

func (*DiscoverResponse) XXX_DiscardUnknown

func (m *DiscoverResponse) XXX_DiscardUnknown()

func (*DiscoverResponse) XXX_Marshal

func (m *DiscoverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DiscoverResponse) XXX_Merge

func (m *DiscoverResponse) XXX_Merge(src proto.Message)

func (*DiscoverResponse) XXX_Size

func (m *DiscoverResponse) XXX_Size() int

func (*DiscoverResponse) XXX_Unmarshal

func (m *DiscoverResponse) XXX_Unmarshal(b []byte) error

type DiscoverResponse_Binding

type DiscoverResponse_Binding struct {
	// A recommended display name for this discovered binding.
	RecommendedName string `protobuf:"bytes,1,opt,name=recommended_name,json=recommendedName,proto3" json:"recommended_name,omitempty"`
	// JSON-encoded object which specifies the endpoint resource to be captured.
	ResourceSpecJson encoding_json.RawMessage `` /* 141-byte string literal not displayed */
	// JSON schema of documents produced by this binding.
	DocumentSchemaJson encoding_json.RawMessage `` /* 147-byte string literal not displayed */
	// Composite key of documents (if known), as JSON-Pointers.
	KeyPtrs              []string `protobuf:"bytes,4,rep,name=key_ptrs,json=keyPtrs,proto3" json:"key_ptrs,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Potential bindings which the capture could provide. Bindings may be returned in any order.

func (*DiscoverResponse_Binding) Descriptor

func (*DiscoverResponse_Binding) Descriptor() ([]byte, []int)

func (*DiscoverResponse_Binding) Marshal

func (m *DiscoverResponse_Binding) Marshal() (dAtA []byte, err error)

func (*DiscoverResponse_Binding) MarshalTo

func (m *DiscoverResponse_Binding) MarshalTo(dAtA []byte) (int, error)

func (*DiscoverResponse_Binding) MarshalToSizedBuffer

func (m *DiscoverResponse_Binding) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DiscoverResponse_Binding) ProtoMessage

func (*DiscoverResponse_Binding) ProtoMessage()

func (*DiscoverResponse_Binding) ProtoSize

func (m *DiscoverResponse_Binding) ProtoSize() (n int)

func (*DiscoverResponse_Binding) Reset

func (m *DiscoverResponse_Binding) Reset()

func (*DiscoverResponse_Binding) String

func (m *DiscoverResponse_Binding) String() string

func (*DiscoverResponse_Binding) Unmarshal

func (m *DiscoverResponse_Binding) Unmarshal(dAtA []byte) error

func (*DiscoverResponse_Binding) Validate

func (m *DiscoverResponse_Binding) Validate() error

func (*DiscoverResponse_Binding) XXX_DiscardUnknown

func (m *DiscoverResponse_Binding) XXX_DiscardUnknown()

func (*DiscoverResponse_Binding) XXX_Marshal

func (m *DiscoverResponse_Binding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DiscoverResponse_Binding) XXX_Merge

func (m *DiscoverResponse_Binding) XXX_Merge(src proto.Message)

func (*DiscoverResponse_Binding) XXX_Size

func (m *DiscoverResponse_Binding) XXX_Size() int

func (*DiscoverResponse_Binding) XXX_Unmarshal

func (m *DiscoverResponse_Binding) XXX_Unmarshal(b []byte) error

type Documents

type Documents struct {
	// The capture binding for documents of this message.
	Binding uint32 `protobuf:"varint,1,opt,name=binding,proto3" json:"binding,omitempty"`
	// Byte arena of the response.
	Arena github_com_estuary_protocols_flow.Arena `protobuf:"bytes,2,opt,name=arena,proto3,casttype=github.com/estuary/protocols/flow.Arena" json:"arena,omitempty"`
	// Captured JSON documents.
	DocsJson             []flow.Slice `protobuf:"bytes,3,rep,name=docs_json,json=docsJson,proto3" json:"docs_json"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

Documents is a set of documents drawn from a binding of the capture.

func ReadPushCheckpoint

func ReadPushCheckpoint(
	stream interface {
		Recv() (*PushRequest, error)
	},
	maxBytes int,
) ([]Documents, pf.DriverCheckpoint, error)

ReadPushCheckpoint reads Documents from a Push RPC until a checkpoint is countered. It errors if more than |maxBytes| of Document byte content is read.

func (*Documents) Descriptor

func (*Documents) Descriptor() ([]byte, []int)

func (*Documents) Marshal

func (m *Documents) Marshal() (dAtA []byte, err error)

func (*Documents) MarshalTo

func (m *Documents) MarshalTo(dAtA []byte) (int, error)

func (*Documents) MarshalToSizedBuffer

func (m *Documents) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Documents) ProtoMessage

func (*Documents) ProtoMessage()

func (*Documents) ProtoSize

func (m *Documents) ProtoSize() (n int)

func (*Documents) Reset

func (m *Documents) Reset()

func (*Documents) String

func (m *Documents) String() string

func (*Documents) Unmarshal

func (m *Documents) Unmarshal(dAtA []byte) error

func (*Documents) Validate

func (m *Documents) Validate() error

Validate returns an error if the Documents isn't well-formed.

func (*Documents) XXX_DiscardUnknown

func (m *Documents) XXX_DiscardUnknown()

func (*Documents) XXX_Marshal

func (m *Documents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Documents) XXX_Merge

func (m *Documents) XXX_Merge(src proto.Message)

func (*Documents) XXX_Size

func (m *Documents) XXX_Size() int

func (*Documents) XXX_Unmarshal

func (m *Documents) XXX_Unmarshal(b []byte) error

type DriverClient

type DriverClient interface {
	// Spec returns the specification definition of this driver.
	// Notably this includes its endpoint and resource configuration JSON schema.
	Spec(ctx context.Context, in *SpecRequest, opts ...grpc.CallOption) (*SpecResponse, error)
	// Discover returns the set of resources available from this Driver.
	Discover(ctx context.Context, in *DiscoverRequest, opts ...grpc.CallOption) (*DiscoverResponse, error)
	// Validate that store resources and proposed collection bindings are
	// compatible.
	Validate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error)
	// ApplyUpsert applies a new or updated capture to the store.
	ApplyUpsert(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error)
	// ApplyDelete deletes an existing capture from the store.
	ApplyDelete(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error)
	// Pull is a very long lived RPC through which the Flow runtime and a
	// Driver cooperatively execute an unbounded number of transactions.
	//
	// The Pull workflow pulls streams of documents into capturing Flow
	// collections. Streams are incremental and resume-able, with resumption
	// semantics defined by the driver. The Flow Runtime uses a transactional
	// recovery log to support this workflow, and the driver may persist arbitrary
	// driver checkpoints into that log as part of the RPC lifecycle,
	// to power its chosen resumption semantics.
	//
	// Pull tasks are split-able, and many concurrent invocations of the RPC
	// may collectively capture from a source, where each task split has an
	// identified range of keys it's responsible for. The meaning of a "key",
	// and it's application within the remote store being captured from, is up
	// to the driver. The driver might map partitions or shards into the keyspace,
	// and from there to a covering task split. Or, it might map distinct files,
	// or some other unit of scaling.
	//
	// RPC Lifecycle
	// =============
	//
	// :PullRequest.Open:
	//    - The Flow runtime opens the pull stream.
	// :PullResponse.Opened:
	//    - The driver responds with Opened.
	//
	// PullRequest.Open and PullRequest.Opened are sent only once, at the
	// commencement of the stream. Thereafter the protocol loops:
	//
	// :PullResponse.Documents:
	//    - The driver tells the runtime of some documents, which are pending a
	//      future Checkpoint.
	//    - If the driver sends multiple Documents messages without an
	//      interleaving Checkpoint, the Flow runtime MUST commit
	//      documents of all such messages in a single transaction.
	// :PullResponse.Checkpoint:
	//    - The driver tells the runtime of a checkpoint: a watermark in the
	//      captured documents stream which is eligble to be used as a
	//      transaction commit boundary.
	//    - Whether the checkpoint becomes a commit boundary is at the
	//      discretion of the Flow runtime. It may combine multiple checkpoints
	//      into a single transaction.
	// :PullRequest.Acknowledge:
	//    - The Flow runtime tells the driver that its Checkpoint has committed.
	//    - The runtime sends one ordered Acknowledge for each Checkpoint.
	//
	Pull(ctx context.Context, opts ...grpc.CallOption) (Driver_PullClient, error)
}

DriverClient is the client API for Driver service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func AdaptServerToClient

func AdaptServerToClient(srv DriverServer) DriverClient

AdaptServerToClient wraps an in-process DriverServer to provide a DriverClient.

func NewDriverClient

func NewDriverClient(cc *grpc.ClientConn) DriverClient

type DriverServer

type DriverServer interface {
	// Spec returns the specification definition of this driver.
	// Notably this includes its endpoint and resource configuration JSON schema.
	Spec(context.Context, *SpecRequest) (*SpecResponse, error)
	// Discover returns the set of resources available from this Driver.
	Discover(context.Context, *DiscoverRequest) (*DiscoverResponse, error)
	// Validate that store resources and proposed collection bindings are
	// compatible.
	Validate(context.Context, *ValidateRequest) (*ValidateResponse, error)
	// ApplyUpsert applies a new or updated capture to the store.
	ApplyUpsert(context.Context, *ApplyRequest) (*ApplyResponse, error)
	// ApplyDelete deletes an existing capture from the store.
	ApplyDelete(context.Context, *ApplyRequest) (*ApplyResponse, error)
	// Pull is a very long lived RPC through which the Flow runtime and a
	// Driver cooperatively execute an unbounded number of transactions.
	//
	// The Pull workflow pulls streams of documents into capturing Flow
	// collections. Streams are incremental and resume-able, with resumption
	// semantics defined by the driver. The Flow Runtime uses a transactional
	// recovery log to support this workflow, and the driver may persist arbitrary
	// driver checkpoints into that log as part of the RPC lifecycle,
	// to power its chosen resumption semantics.
	//
	// Pull tasks are split-able, and many concurrent invocations of the RPC
	// may collectively capture from a source, where each task split has an
	// identified range of keys it's responsible for. The meaning of a "key",
	// and it's application within the remote store being captured from, is up
	// to the driver. The driver might map partitions or shards into the keyspace,
	// and from there to a covering task split. Or, it might map distinct files,
	// or some other unit of scaling.
	//
	// RPC Lifecycle
	// =============
	//
	// :PullRequest.Open:
	//    - The Flow runtime opens the pull stream.
	// :PullResponse.Opened:
	//    - The driver responds with Opened.
	//
	// PullRequest.Open and PullRequest.Opened are sent only once, at the
	// commencement of the stream. Thereafter the protocol loops:
	//
	// :PullResponse.Documents:
	//    - The driver tells the runtime of some documents, which are pending a
	//      future Checkpoint.
	//    - If the driver sends multiple Documents messages without an
	//      interleaving Checkpoint, the Flow runtime MUST commit
	//      documents of all such messages in a single transaction.
	// :PullResponse.Checkpoint:
	//    - The driver tells the runtime of a checkpoint: a watermark in the
	//      captured documents stream which is eligble to be used as a
	//      transaction commit boundary.
	//    - Whether the checkpoint becomes a commit boundary is at the
	//      discretion of the Flow runtime. It may combine multiple checkpoints
	//      into a single transaction.
	// :PullRequest.Acknowledge:
	//    - The Flow runtime tells the driver that its Checkpoint has committed.
	//    - The runtime sends one ordered Acknowledge for each Checkpoint.
	//
	Pull(Driver_PullServer) error
}

DriverServer is the server API for Driver service.

type Driver_PullClient

type Driver_PullClient interface {
	Send(*PullRequest) error
	Recv() (*PullResponse, error)
	grpc.ClientStream
}

type Driver_PullServer

type Driver_PullServer interface {
	Send(*PullResponse) error
	Recv() (*PullRequest, error)
	grpc.ServerStream
}

type PullClient

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

PullClient is a client of a driver's Pull RPC. It provides a high-level API for executing the pull-based/ capture transaction workflow.

func OpenPull

func OpenPull(
	ctx context.Context,
	driver DriverClient,
	driverCheckpoint json.RawMessage,
	newCombinerFn func(*pf.CaptureSpec_Binding) (pf.Combiner, error),
	range_ pf.RangeSpec,
	spec *pf.CaptureSpec,
	version string,
	tail bool,
) (*PullClient, error)

OpenPull opens a Pull RPC using the provided DriverClient and CaptureSpec.

func (*PullClient) Close

func (c *PullClient) Close() error

Close the Capture. The primary loop must have already initiated a close (due to an error, or context cancellation, or EOF). Close blocks until the error has propagated through the coordinator's loop and has fully stopped.

func (*PullClient) Combiners

func (c *PullClient) Combiners() []pf.Combiner

Combiners returns the Combiners of a transaction which is ready to commit. It's safe to call only after a callback notification from Serve(), and only until a call to SetLogCommitOp(). The caller is responsible for fully draining the combiners.

func (*PullClient) DriverCheckpoint

func (c *PullClient) DriverCheckpoint() pf.DriverCheckpoint

DriverCheckpoint returns the DriverCheckpoint of a transaction which is ready to commit. It's safe to call only after a callback notification from Serve(), and only until a call to SetLogCommitOp().

func (*PullClient) Serve

func (c *PullClient) Serve(startCommitFn func(error))

Serve is a long-lived routine which processes transactions from the Pull RPC. When captured documents are ready to commit, it invokes the startCommitFn callback.

On callback, the caller must drain documents from Combiners() and track the associated DriverCheckpoint(), and then notify the PullClient of a pending commit via SetLogCommittedOp().

While this drain and commit is ongoing, Serve() will accumulate further captured documents and checkpoints. It will then notify the caller of the next transaction only after the resolution of the prior transaction's commit.

Serve will call into startCommitFn with a non-nil error exactly once, as its very last invocation.

func (*PullClient) SetLogCommitOp

func (c *PullClient) SetLogCommitOp(op client.OpFuture) error

SetLogCommitOp tells the PullClient of a future recovery log commit operation which will commit a transaction previously started via a Serve() callback.

type PullRequest

type PullRequest struct {
	Open *PullRequest_Open `protobuf:"bytes,1,opt,name=open,proto3" json:"open,omitempty"`
	// Tell the driver that its Checkpoint has committed to the Flow recovery log.
	Acknowledge          *Acknowledge `protobuf:"bytes,2,opt,name=acknowledge,proto3" json:"acknowledge,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

PullRequest is the request type of a Driver.Pull RPC. It will have exactly one top-level field set, which represents its message type.

func (*PullRequest) Descriptor

func (*PullRequest) Descriptor() ([]byte, []int)

func (*PullRequest) Marshal

func (m *PullRequest) Marshal() (dAtA []byte, err error)

func (*PullRequest) MarshalTo

func (m *PullRequest) MarshalTo(dAtA []byte) (int, error)

func (*PullRequest) MarshalToSizedBuffer

func (m *PullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PullRequest) ProtoMessage

func (*PullRequest) ProtoMessage()

func (*PullRequest) ProtoSize

func (m *PullRequest) ProtoSize() (n int)

func (*PullRequest) Reset

func (m *PullRequest) Reset()

func (*PullRequest) String

func (m *PullRequest) String() string

func (*PullRequest) Unmarshal

func (m *PullRequest) Unmarshal(dAtA []byte) error

func (*PullRequest) Validate

func (m *PullRequest) Validate() error

Validate returns an error if the PullRequest isn't well-formed.

func (*PullRequest) XXX_DiscardUnknown

func (m *PullRequest) XXX_DiscardUnknown()

func (*PullRequest) XXX_Marshal

func (m *PullRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PullRequest) XXX_Merge

func (m *PullRequest) XXX_Merge(src proto.Message)

func (*PullRequest) XXX_Size

func (m *PullRequest) XXX_Size() int

func (*PullRequest) XXX_Unmarshal

func (m *PullRequest) XXX_Unmarshal(b []byte) error

type PullRequest_Open

type PullRequest_Open struct {
	// CaptureSpec to be pulled.
	Capture *flow.CaptureSpec `protobuf:"bytes,1,opt,name=capture,proto3" json:"capture,omitempty"`
	// Version of the opened CaptureSpec.
	// The driver may want to require that this match the version last
	// provided to a successful Apply RPC. It's possible that it won't,
	// due to expected propagation races in Flow's distributed runtime.
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// [key_begin, key_end] inclusive range of keys processed by this
	// transaction stream. Ranges reflect the disjoint chunks of ownership
	// specific to each instance of a scale-out capture implementation.
	KeyBegin uint32 `protobuf:"fixed32,3,opt,name=key_begin,json=keyBegin,proto3" json:"key_begin,omitempty"`
	KeyEnd   uint32 `protobuf:"fixed32,4,opt,name=key_end,json=keyEnd,proto3" json:"key_end,omitempty"`
	// Last-persisted driver checkpoint from a previous capture stream.
	// Or empty, if the driver has cleared or never set its checkpoint.
	DriverCheckpointJson encoding_json.RawMessage `` /* 153-byte string literal not displayed */
	// If true, perform a blocking tail of the capture.
	// If false, produce all ready output and then close the stream.
	Tail                 bool     `protobuf:"varint,6,opt,name=tail,proto3" json:"tail,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Open opens a Pull of the driver, and is sent exactly once as the first message of the stream.

func (*PullRequest_Open) Descriptor

func (*PullRequest_Open) Descriptor() ([]byte, []int)

func (*PullRequest_Open) Marshal

func (m *PullRequest_Open) Marshal() (dAtA []byte, err error)

func (*PullRequest_Open) MarshalTo

func (m *PullRequest_Open) MarshalTo(dAtA []byte) (int, error)

func (*PullRequest_Open) MarshalToSizedBuffer

func (m *PullRequest_Open) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PullRequest_Open) ProtoMessage

func (*PullRequest_Open) ProtoMessage()

func (*PullRequest_Open) ProtoSize

func (m *PullRequest_Open) ProtoSize() (n int)

func (*PullRequest_Open) Reset

func (m *PullRequest_Open) Reset()

func (*PullRequest_Open) String

func (m *PullRequest_Open) String() string

func (*PullRequest_Open) Unmarshal

func (m *PullRequest_Open) Unmarshal(dAtA []byte) error

func (*PullRequest_Open) Validate

func (m *PullRequest_Open) Validate() error

Validate returns an error if the PullRequest_Open isn't well-formed.

func (*PullRequest_Open) XXX_DiscardUnknown

func (m *PullRequest_Open) XXX_DiscardUnknown()

func (*PullRequest_Open) XXX_Marshal

func (m *PullRequest_Open) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PullRequest_Open) XXX_Merge

func (m *PullRequest_Open) XXX_Merge(src proto.Message)

func (*PullRequest_Open) XXX_Size

func (m *PullRequest_Open) XXX_Size() int

func (*PullRequest_Open) XXX_Unmarshal

func (m *PullRequest_Open) XXX_Unmarshal(b []byte) error

type PullResponse

type PullResponse struct {
	Opened *PullResponse_Opened `protobuf:"bytes,1,opt,name=opened,proto3" json:"opened,omitempty"`
	// Captured documents of the stream.
	Documents *Documents `protobuf:"bytes,2,opt,name=documents,proto3" json:"documents,omitempty"`
	// Checkpoint all preceeding Documents of this stream.
	Checkpoint           *flow.DriverCheckpoint `protobuf:"bytes,3,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

PullResponse is the response type of a Driver.Pull RPC. It will have exactly one top-level field set, which represents its message type.

func Rx

func Rx(ch <-chan PullResponseError, block bool) (*PullResponse, error)

Rx receives from a PullResponseError channel. It de-structures PullResponseError into its parts, and also returns an explicit io.EOF for channel closures.

func (*PullResponse) Descriptor

func (*PullResponse) Descriptor() ([]byte, []int)

func (*PullResponse) Marshal

func (m *PullResponse) Marshal() (dAtA []byte, err error)

func (*PullResponse) MarshalTo

func (m *PullResponse) MarshalTo(dAtA []byte) (int, error)

func (*PullResponse) MarshalToSizedBuffer

func (m *PullResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PullResponse) ProtoMessage

func (*PullResponse) ProtoMessage()

func (*PullResponse) ProtoSize

func (m *PullResponse) ProtoSize() (n int)

func (*PullResponse) Reset

func (m *PullResponse) Reset()

func (*PullResponse) String

func (m *PullResponse) String() string

func (*PullResponse) Unmarshal

func (m *PullResponse) Unmarshal(dAtA []byte) error

func (*PullResponse) Validate

func (m *PullResponse) Validate() error

Validate returns an error if the PullResponse isn't well-formed.

func (*PullResponse) XXX_DiscardUnknown

func (m *PullResponse) XXX_DiscardUnknown()

func (*PullResponse) XXX_Marshal

func (m *PullResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PullResponse) XXX_Merge

func (m *PullResponse) XXX_Merge(src proto.Message)

func (*PullResponse) XXX_Size

func (m *PullResponse) XXX_Size() int

func (*PullResponse) XXX_Unmarshal

func (m *PullResponse) XXX_Unmarshal(b []byte) error

type PullResponseError

type PullResponseError struct {
	*PullResponse
	Error error
}

PullResponseError is a channel-oriented wrapper of PullResponse.

type PullResponse_Opened

type PullResponse_Opened struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Opened responds to PullRequest.Open of the runtime, and is sent exactly once as the first message of the stream.

func (*PullResponse_Opened) Descriptor

func (*PullResponse_Opened) Descriptor() ([]byte, []int)

func (*PullResponse_Opened) Marshal

func (m *PullResponse_Opened) Marshal() (dAtA []byte, err error)

func (*PullResponse_Opened) MarshalTo

func (m *PullResponse_Opened) MarshalTo(dAtA []byte) (int, error)

func (*PullResponse_Opened) MarshalToSizedBuffer

func (m *PullResponse_Opened) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PullResponse_Opened) ProtoMessage

func (*PullResponse_Opened) ProtoMessage()

func (*PullResponse_Opened) ProtoSize

func (m *PullResponse_Opened) ProtoSize() (n int)

func (*PullResponse_Opened) Reset

func (m *PullResponse_Opened) Reset()

func (*PullResponse_Opened) String

func (m *PullResponse_Opened) String() string

func (*PullResponse_Opened) Unmarshal

func (m *PullResponse_Opened) Unmarshal(dAtA []byte) error

func (*PullResponse_Opened) Validate

func (m *PullResponse_Opened) Validate() error

Validate is currently a no-op.

func (*PullResponse_Opened) XXX_DiscardUnknown

func (m *PullResponse_Opened) XXX_DiscardUnknown()

func (*PullResponse_Opened) XXX_Marshal

func (m *PullResponse_Opened) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PullResponse_Opened) XXX_Merge

func (m *PullResponse_Opened) XXX_Merge(src proto.Message)

func (*PullResponse_Opened) XXX_Size

func (m *PullResponse_Opened) XXX_Size() int

func (*PullResponse_Opened) XXX_Unmarshal

func (m *PullResponse_Opened) XXX_Unmarshal(b []byte) error

type PushRequest

type PushRequest struct {
	Open *PushRequest_Open `protobuf:"bytes,1,opt,name=open,proto3" json:"open,omitempty"`
	// Captured documents of the stream.
	Documents *Documents `protobuf:"bytes,2,opt,name=documents,proto3" json:"documents,omitempty"`
	// Checkpoint all preceeding Documents of this stream.
	Checkpoint           *flow.DriverCheckpoint `protobuf:"bytes,3,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

PushRequest is the request message of the Runtime.Push RPC.

func (*PushRequest) Descriptor

func (*PushRequest) Descriptor() ([]byte, []int)

func (*PushRequest) Marshal

func (m *PushRequest) Marshal() (dAtA []byte, err error)

func (*PushRequest) MarshalTo

func (m *PushRequest) MarshalTo(dAtA []byte) (int, error)

func (*PushRequest) MarshalToSizedBuffer

func (m *PushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PushRequest) ProtoMessage

func (*PushRequest) ProtoMessage()

func (*PushRequest) ProtoSize

func (m *PushRequest) ProtoSize() (n int)

func (*PushRequest) Reset

func (m *PushRequest) Reset()

func (*PushRequest) String

func (m *PushRequest) String() string

func (*PushRequest) Unmarshal

func (m *PushRequest) Unmarshal(dAtA []byte) error

func (*PushRequest) Validate

func (m *PushRequest) Validate() error

Validate returns an error if the PushRequest isn't well-formed.

func (*PushRequest) XXX_DiscardUnknown

func (m *PushRequest) XXX_DiscardUnknown()

func (*PushRequest) XXX_Marshal

func (m *PushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PushRequest) XXX_Merge

func (m *PushRequest) XXX_Merge(src proto.Message)

func (*PushRequest) XXX_Size

func (m *PushRequest) XXX_Size() int

func (*PushRequest) XXX_Unmarshal

func (m *PushRequest) XXX_Unmarshal(b []byte) error

type PushRequest_Open

type PushRequest_Open struct {
	// Header identifies a specific Shard and Route to which this stream is
	// directed. It's optional, and is typically attached by a proxying peer.
	Header *protocol.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// Name of the capture under which we're pushing.
	Capture              github_com_estuary_protocols_flow.Capture `protobuf:"bytes,2,opt,name=capture,proto3,casttype=github.com/estuary/protocols/flow.Capture" json:"capture,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                  `json:"-"`
	XXX_unrecognized     []byte                                    `json:"-"`
	XXX_sizecache        int32                                     `json:"-"`
}

Open opens a Push of the runtime, and is sent exactly once as the first message of the stream.

func (*PushRequest_Open) Descriptor

func (*PushRequest_Open) Descriptor() ([]byte, []int)

func (*PushRequest_Open) Marshal

func (m *PushRequest_Open) Marshal() (dAtA []byte, err error)

func (*PushRequest_Open) MarshalTo

func (m *PushRequest_Open) MarshalTo(dAtA []byte) (int, error)

func (*PushRequest_Open) MarshalToSizedBuffer

func (m *PushRequest_Open) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PushRequest_Open) ProtoMessage

func (*PushRequest_Open) ProtoMessage()

func (*PushRequest_Open) ProtoSize

func (m *PushRequest_Open) ProtoSize() (n int)

func (*PushRequest_Open) Reset

func (m *PushRequest_Open) Reset()

func (*PushRequest_Open) String

func (m *PushRequest_Open) String() string

func (*PushRequest_Open) Unmarshal

func (m *PushRequest_Open) Unmarshal(dAtA []byte) error

func (*PushRequest_Open) Validate

func (m *PushRequest_Open) Validate() error

Validate returns an error if the PushRequest_Open isn't well-formed.

func (*PushRequest_Open) XXX_DiscardUnknown

func (m *PushRequest_Open) XXX_DiscardUnknown()

func (*PushRequest_Open) XXX_Marshal

func (m *PushRequest_Open) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PushRequest_Open) XXX_Merge

func (m *PushRequest_Open) XXX_Merge(src proto.Message)

func (*PushRequest_Open) XXX_Size

func (m *PushRequest_Open) XXX_Size() int

func (*PushRequest_Open) XXX_Unmarshal

func (m *PushRequest_Open) XXX_Unmarshal(b []byte) error

type PushResponse

type PushResponse struct {
	Opened *PushResponse_Opened `protobuf:"bytes,1,opt,name=opened,proto3" json:"opened,omitempty"`
	// Tell the driver that its Checkpoint has committed to the Flow recovery log.
	Acknowledge          *Acknowledge `protobuf:"bytes,2,opt,name=acknowledge,proto3" json:"acknowledge,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

PushResponse is the response message of the Runtime.Push RPC.

func (*PushResponse) Descriptor

func (*PushResponse) Descriptor() ([]byte, []int)

func (*PushResponse) Marshal

func (m *PushResponse) Marshal() (dAtA []byte, err error)

func (*PushResponse) MarshalTo

func (m *PushResponse) MarshalTo(dAtA []byte) (int, error)

func (*PushResponse) MarshalToSizedBuffer

func (m *PushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PushResponse) ProtoMessage

func (*PushResponse) ProtoMessage()

func (*PushResponse) ProtoSize

func (m *PushResponse) ProtoSize() (n int)

func (*PushResponse) Reset

func (m *PushResponse) Reset()

func (*PushResponse) String

func (m *PushResponse) String() string

func (*PushResponse) Unmarshal

func (m *PushResponse) Unmarshal(dAtA []byte) error

func (*PushResponse) Validate

func (m *PushResponse) Validate() error

Validate returns an error if the PushResponse isn't well-formed.

func (*PushResponse) XXX_DiscardUnknown

func (m *PushResponse) XXX_DiscardUnknown()

func (*PushResponse) XXX_Marshal

func (m *PushResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PushResponse) XXX_Merge

func (m *PushResponse) XXX_Merge(src proto.Message)

func (*PushResponse) XXX_Size

func (m *PushResponse) XXX_Size() int

func (*PushResponse) XXX_Unmarshal

func (m *PushResponse) XXX_Unmarshal(b []byte) error

type PushResponse_Opened

type PushResponse_Opened struct {
	// Status of the Push open.
	Status protocol1.Status `protobuf:"varint,1,opt,name=status,proto3,enum=consumer.Status" json:"status,omitempty"`
	// Header of the response.
	Header protocol.Header `protobuf:"bytes,2,opt,name=header,proto3" json:"header"`
	// CaptureSpec to be pushed.
	Capture *flow.CaptureSpec `protobuf:"bytes,3,opt,name=capture,proto3" json:"capture,omitempty"`
	// Version of the opened CaptureSpec.
	// The driver may want to require that this match the version last
	// provided to a successful Apply RPC. It's possible that it won't,
	// due to expected propagation races in Flow's distributed runtime.
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// [key_begin, key_end] inclusive range of keys processed by this
	// transaction stream. Ranges reflect the disjoint chunks of ownership
	// specific to each instance of a scale-out capture implementation.
	KeyBegin uint32 `protobuf:"fixed32,5,opt,name=key_begin,json=keyBegin,proto3" json:"key_begin,omitempty"`
	KeyEnd   uint32 `protobuf:"fixed32,6,opt,name=key_end,json=keyEnd,proto3" json:"key_end,omitempty"`
	// Last-persisted driver checkpoint from a previous capture stream.
	// Or empty, if the driver has cleared or never set its checkpoint.
	DriverCheckpointJson encoding_json.RawMessage `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

Opened responds to PushRequest.Open of the driver, and is sent exactly once as the first message of the stream.

func (*PushResponse_Opened) Descriptor

func (*PushResponse_Opened) Descriptor() ([]byte, []int)

func (*PushResponse_Opened) Marshal

func (m *PushResponse_Opened) Marshal() (dAtA []byte, err error)

func (*PushResponse_Opened) MarshalTo

func (m *PushResponse_Opened) MarshalTo(dAtA []byte) (int, error)

func (*PushResponse_Opened) MarshalToSizedBuffer

func (m *PushResponse_Opened) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PushResponse_Opened) ProtoMessage

func (*PushResponse_Opened) ProtoMessage()

func (*PushResponse_Opened) ProtoSize

func (m *PushResponse_Opened) ProtoSize() (n int)

func (*PushResponse_Opened) Reset

func (m *PushResponse_Opened) Reset()

func (*PushResponse_Opened) String

func (m *PushResponse_Opened) String() string

func (*PushResponse_Opened) Unmarshal

func (m *PushResponse_Opened) Unmarshal(dAtA []byte) error

func (*PushResponse_Opened) Validate

func (m *PushResponse_Opened) Validate() error

Validate returns an error if the PushResponse_Opened isn't well-formed.

func (*PushResponse_Opened) XXX_DiscardUnknown

func (m *PushResponse_Opened) XXX_DiscardUnknown()

func (*PushResponse_Opened) XXX_Marshal

func (m *PushResponse_Opened) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PushResponse_Opened) XXX_Merge

func (m *PushResponse_Opened) XXX_Merge(src proto.Message)

func (*PushResponse_Opened) XXX_Size

func (m *PushResponse_Opened) XXX_Size() int

func (*PushResponse_Opened) XXX_Unmarshal

func (m *PushResponse_Opened) XXX_Unmarshal(b []byte) error

type PushServer

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

PullServer is a server which aides implementations of the Runtime.Push RPC.

func NewPushServer

func NewPushServer(
	ctx context.Context,
	newCombinerFn func(*pf.CaptureSpec_Binding) (pf.Combiner, error),
	range_ pf.RangeSpec,
	spec *pf.CaptureSpec,
	version string,
) (*PushServer, error)

NewPushServer builds a new *PushServer using the provided CaptureSpec.

func (*PushServer) Close

func (c *PushServer) Close() error

Close the Capture. The primary loop must have already initiated a close (due to an error, or context cancellation, or EOF). Close blocks until the error has propagated through the coordinator's loop and has fully stopped.

func (*PushServer) Combiners

func (c *PushServer) Combiners() []pf.Combiner

Combiners returns the Combiners of a transaction which is ready to commit. It's safe to call only after a callback notification from Serve(), and only until a call to SetLogCommitOp(). The caller is responsible for fully draining the combiners.

func (*PushServer) DriverCheckpoint

func (c *PushServer) DriverCheckpoint() pf.DriverCheckpoint

DriverCheckpoint returns the DriverCheckpoint of a transaction which is ready to commit. It's safe to call only after a callback notification from Serve(), and only until a call to SetLogCommitOp().

func (*PushServer) Push

func (c *PushServer) Push(
	docs []Documents,
	checkpoint pf.DriverCheckpoint,
	ackCh chan<- struct{},
) error

Push Documents and an accompanying DriverCheckpoint into the capture. Push returns an error if the Serve loop isn't running. Otherwise, Push returns immediately and |ackCh| will be signaled one time when the Push has fully committed. The caller must also monitor ServeOp to determine if the Serve loop has exited, in which case |achCh| will never be notified.

func (*PushServer) Serve

func (c *PushServer) Serve(startCommitFn func(error))

Serve is a long-lived routine which processes Push transactions. When captured documents are ready to commit, it invokes the startCommitFn callback.

On callback, the caller must drain documents from Combiners() and track the associated DriverCheckpoint(), and then notify the PushServer of a pending commit via SetLogCommittedOp().

While this drain and commit is ongoing, Serve() will accumulate further pushed documents and checkpoints. It will then notify the caller of the next transaction only after the resolution of the prior transaction's commit.

Serve will call into startCommitFn with a non-nil error exactly once, as its very last invocation.

func (*PushServer) ServeOp

func (c *PushServer) ServeOp() client.OpFuture

ServeOp returns the Serve loop future of this PushServer. It resolves with its terminal error when the Serve loop has stopped running. An error of io.EOF is expected upon a graceful cancellation.

func (*PushServer) SetLogCommitOp

func (c *PushServer) SetLogCommitOp(op client.OpFuture) error

SetLogCommitOp tells the PullClient of a future recovery log commit operation which will commit a transaction previously started via a Serve() callback.

type RuntimeClient

type RuntimeClient interface {
	// Push may be a short or very long lived RPC through which the Flow runtime
	// and a driver cooperatively execute an unbounded number of transactions.
	//
	// The Push workflow pushes streams of documents into capturing Flow
	// collections. The driver is responsible for initiation and resumption of
	// push streams. The Flow runtime uses a transactional recovery log to support
	// this workflow, and the driver may persist arbitrary driver checkpoints into
	// that log as part of the RPC lifecycle, to power its chosen resumption
	// semantics.
	//
	// A push RPC is evaluated against a specific task shard split, which is
	// encoded in the PushRequest.Open.Header. A driver may perform its own load
	// balancing by obtain a shard listing and embedding a selected shard into
	// that header. Or, it may leave it empty and an arbitary shard will be
	// randomly chosen for it.
	//
	// RPC Lifecycle
	// =============
	//
	// :PushRequest.Open:
	//    - The driver opens the push stream, naming its capture and
	//      optional routing header.
	// :PushResponse.Opened:
	//    - The Flow runtime responds with Opened, which tells the driver
	//      of the specific CaptureSpec and [key_begin, key_end] range of
	//      this RPC, as well as the last driver checkpoint.
	//    - The semantics and treatment of the key range is up to the driver.
	//
	// PushRequest.Open and PushRequest.Opened are sent only once, at the
	// commencement of the stream. Thereafter the protocol loops:
	//
	// :PushRequest.Documents:
	//    - The driver tells the runtime of some documents, which are pending a
	//      future Checkpoint.
	//    - If the driver sends multiple Documents messages without an
	//      interleaving Checkpoint, the Flow runtime MUST commit
	//      documents of all such messages in a single transaction.
	// :PushRequest.Checkpoint:
	//    - The driver tells the runtime of a checkpoint: a watermark in the
	//      captured documents stream which is eligble to be used as a
	//      transaction commit boundary.
	//    - Whether the checkpoint becomes a commit boundary is at the
	//      discretion of the Flow runtime. It may combine multiple checkpoints
	//      into a single transaction.
	// :PushResponse.Acknowledge:
	//    - The Flow runtime tells the driver that its Checkpoint has committed.
	//    - The runtime sends one ordered Acknowledge for each Checkpoint.
	//
	Push(ctx context.Context, opts ...grpc.CallOption) (Runtime_PushClient, error)
}

RuntimeClient is the client API for Runtime service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRuntimeClient

func NewRuntimeClient(cc *grpc.ClientConn) RuntimeClient

type RuntimeServer

type RuntimeServer interface {
	// Push may be a short or very long lived RPC through which the Flow runtime
	// and a driver cooperatively execute an unbounded number of transactions.
	//
	// The Push workflow pushes streams of documents into capturing Flow
	// collections. The driver is responsible for initiation and resumption of
	// push streams. The Flow runtime uses a transactional recovery log to support
	// this workflow, and the driver may persist arbitrary driver checkpoints into
	// that log as part of the RPC lifecycle, to power its chosen resumption
	// semantics.
	//
	// A push RPC is evaluated against a specific task shard split, which is
	// encoded in the PushRequest.Open.Header. A driver may perform its own load
	// balancing by obtain a shard listing and embedding a selected shard into
	// that header. Or, it may leave it empty and an arbitary shard will be
	// randomly chosen for it.
	//
	// RPC Lifecycle
	// =============
	//
	// :PushRequest.Open:
	//    - The driver opens the push stream, naming its capture and
	//      optional routing header.
	// :PushResponse.Opened:
	//    - The Flow runtime responds with Opened, which tells the driver
	//      of the specific CaptureSpec and [key_begin, key_end] range of
	//      this RPC, as well as the last driver checkpoint.
	//    - The semantics and treatment of the key range is up to the driver.
	//
	// PushRequest.Open and PushRequest.Opened are sent only once, at the
	// commencement of the stream. Thereafter the protocol loops:
	//
	// :PushRequest.Documents:
	//    - The driver tells the runtime of some documents, which are pending a
	//      future Checkpoint.
	//    - If the driver sends multiple Documents messages without an
	//      interleaving Checkpoint, the Flow runtime MUST commit
	//      documents of all such messages in a single transaction.
	// :PushRequest.Checkpoint:
	//    - The driver tells the runtime of a checkpoint: a watermark in the
	//      captured documents stream which is eligble to be used as a
	//      transaction commit boundary.
	//    - Whether the checkpoint becomes a commit boundary is at the
	//      discretion of the Flow runtime. It may combine multiple checkpoints
	//      into a single transaction.
	// :PushResponse.Acknowledge:
	//    - The Flow runtime tells the driver that its Checkpoint has committed.
	//    - The runtime sends one ordered Acknowledge for each Checkpoint.
	//
	Push(Runtime_PushServer) error
}

RuntimeServer is the server API for Runtime service.

type Runtime_PushClient

type Runtime_PushClient interface {
	Send(*PushRequest) error
	Recv() (*PushResponse, error)
	grpc.ClientStream
}

type Runtime_PushServer

type Runtime_PushServer interface {
	Send(*PushResponse) error
	Recv() (*PushRequest, error)
	grpc.ServerStream
}

type SpecRequest

type SpecRequest struct {
	// Endpoint type addressed by this request.
	EndpointType flow.EndpointType `protobuf:"varint,1,opt,name=endpoint_type,json=endpointType,proto3,enum=flow.EndpointType" json:"endpoint_type,omitempty"`
	// Driver specification, as an encoded JSON object.
	// This may be a partial specification (for example, a Docker image),
	// providing only enough information to fetch the remainder of the
	// specification schema.
	EndpointSpecJson     encoding_json.RawMessage `` /* 141-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

SpecRequest is the request type of the Spec RPC.

func (*SpecRequest) Descriptor

func (*SpecRequest) Descriptor() ([]byte, []int)

func (*SpecRequest) Marshal

func (m *SpecRequest) Marshal() (dAtA []byte, err error)

func (*SpecRequest) MarshalTo

func (m *SpecRequest) MarshalTo(dAtA []byte) (int, error)

func (*SpecRequest) MarshalToSizedBuffer

func (m *SpecRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SpecRequest) ProtoMessage

func (*SpecRequest) ProtoMessage()

func (*SpecRequest) ProtoSize

func (m *SpecRequest) ProtoSize() (n int)

func (*SpecRequest) Reset

func (m *SpecRequest) Reset()

func (*SpecRequest) String

func (m *SpecRequest) String() string

func (*SpecRequest) Unmarshal

func (m *SpecRequest) Unmarshal(dAtA []byte) error

func (*SpecRequest) Validate

func (m *SpecRequest) Validate() error

func (*SpecRequest) XXX_DiscardUnknown

func (m *SpecRequest) XXX_DiscardUnknown()

func (*SpecRequest) XXX_Marshal

func (m *SpecRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SpecRequest) XXX_Merge

func (m *SpecRequest) XXX_Merge(src proto.Message)

func (*SpecRequest) XXX_Size

func (m *SpecRequest) XXX_Size() int

func (*SpecRequest) XXX_Unmarshal

func (m *SpecRequest) XXX_Unmarshal(b []byte) error

type SpecResponse

type SpecResponse struct {
	// JSON schema of an endpoint specification.
	EndpointSpecSchemaJson encoding_json.RawMessage `` /* 161-byte string literal not displayed */
	// JSON schema of a resource specification.
	ResourceSpecSchemaJson encoding_json.RawMessage `` /* 161-byte string literal not displayed */
	// URL for connector's documention.
	DocumentationUrl     string   `protobuf:"bytes,3,opt,name=documentation_url,json=documentationUrl,proto3" json:"documentation_url,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SpecResponse is the response type of the Spec RPC.

func (*SpecResponse) Descriptor

func (*SpecResponse) Descriptor() ([]byte, []int)

func (*SpecResponse) Marshal

func (m *SpecResponse) Marshal() (dAtA []byte, err error)

func (*SpecResponse) MarshalTo

func (m *SpecResponse) MarshalTo(dAtA []byte) (int, error)

func (*SpecResponse) MarshalToSizedBuffer

func (m *SpecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SpecResponse) ProtoMessage

func (*SpecResponse) ProtoMessage()

func (*SpecResponse) ProtoSize

func (m *SpecResponse) ProtoSize() (n int)

func (*SpecResponse) Reset

func (m *SpecResponse) Reset()

func (*SpecResponse) String

func (m *SpecResponse) String() string

func (*SpecResponse) Unmarshal

func (m *SpecResponse) Unmarshal(dAtA []byte) error

func (*SpecResponse) XXX_DiscardUnknown

func (m *SpecResponse) XXX_DiscardUnknown()

func (*SpecResponse) XXX_Marshal

func (m *SpecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SpecResponse) XXX_Merge

func (m *SpecResponse) XXX_Merge(src proto.Message)

func (*SpecResponse) XXX_Size

func (m *SpecResponse) XXX_Size() int

func (*SpecResponse) XXX_Unmarshal

func (m *SpecResponse) XXX_Unmarshal(b []byte) error

type UnimplementedDriverServer

type UnimplementedDriverServer struct {
}

UnimplementedDriverServer can be embedded to have forward compatible implementations.

func (*UnimplementedDriverServer) ApplyDelete

func (*UnimplementedDriverServer) ApplyUpsert

func (*UnimplementedDriverServer) Discover

func (*UnimplementedDriverServer) Pull

func (*UnimplementedDriverServer) Spec

func (*UnimplementedDriverServer) Validate

type UnimplementedRuntimeServer

type UnimplementedRuntimeServer struct {
}

UnimplementedRuntimeServer can be embedded to have forward compatible implementations.

func (*UnimplementedRuntimeServer) Push

type ValidateRequest

type ValidateRequest struct {
	// Name of the capture being validated.
	Capture github_com_estuary_protocols_flow.Capture `protobuf:"bytes,1,opt,name=capture,proto3,casttype=github.com/estuary/protocols/flow.Capture" json:"capture,omitempty"`
	// Endpoint type addressed by this request.
	EndpointType flow.EndpointType `protobuf:"varint,2,opt,name=endpoint_type,json=endpointType,proto3,enum=flow.EndpointType" json:"endpoint_type,omitempty"`
	// Driver specification, as an encoded JSON object.
	EndpointSpecJson     encoding_json.RawMessage   `` /* 141-byte string literal not displayed */
	Bindings             []*ValidateRequest_Binding `protobuf:"bytes,4,rep,name=bindings,proto3" json:"bindings,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

ValidateRequest is the request type of the Validate RPC.

func (*ValidateRequest) Descriptor

func (*ValidateRequest) Descriptor() ([]byte, []int)

func (*ValidateRequest) Marshal

func (m *ValidateRequest) Marshal() (dAtA []byte, err error)

func (*ValidateRequest) MarshalTo

func (m *ValidateRequest) MarshalTo(dAtA []byte) (int, error)

func (*ValidateRequest) MarshalToSizedBuffer

func (m *ValidateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidateRequest) ProtoMessage

func (*ValidateRequest) ProtoMessage()

func (*ValidateRequest) ProtoSize

func (m *ValidateRequest) ProtoSize() (n int)

func (*ValidateRequest) Reset

func (m *ValidateRequest) Reset()

func (*ValidateRequest) String

func (m *ValidateRequest) String() string

func (*ValidateRequest) Unmarshal

func (m *ValidateRequest) Unmarshal(dAtA []byte) error

func (*ValidateRequest) Validate

func (m *ValidateRequest) Validate() error

Validate returns an error if the ValidateRequest isn't well-formed.

func (*ValidateRequest) XXX_DiscardUnknown

func (m *ValidateRequest) XXX_DiscardUnknown()

func (*ValidateRequest) XXX_Marshal

func (m *ValidateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidateRequest) XXX_Merge

func (m *ValidateRequest) XXX_Merge(src proto.Message)

func (*ValidateRequest) XXX_Size

func (m *ValidateRequest) XXX_Size() int

func (*ValidateRequest) XXX_Unmarshal

func (m *ValidateRequest) XXX_Unmarshal(b []byte) error

type ValidateRequest_Binding

type ValidateRequest_Binding struct {
	// JSON-encoded object which specifies the endpoint resource to be captured.
	ResourceSpecJson encoding_json.RawMessage `` /* 141-byte string literal not displayed */
	// Collection to be captured.
	Collection           flow.CollectionSpec `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

Bindings of endpoint resources and collections to which they would be captured. Bindings are ordered and unique on the bound collection name.

func (*ValidateRequest_Binding) Descriptor

func (*ValidateRequest_Binding) Descriptor() ([]byte, []int)

func (*ValidateRequest_Binding) Marshal

func (m *ValidateRequest_Binding) Marshal() (dAtA []byte, err error)

func (*ValidateRequest_Binding) MarshalTo

func (m *ValidateRequest_Binding) MarshalTo(dAtA []byte) (int, error)

func (*ValidateRequest_Binding) MarshalToSizedBuffer

func (m *ValidateRequest_Binding) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidateRequest_Binding) ProtoMessage

func (*ValidateRequest_Binding) ProtoMessage()

func (*ValidateRequest_Binding) ProtoSize

func (m *ValidateRequest_Binding) ProtoSize() (n int)

func (*ValidateRequest_Binding) Reset

func (m *ValidateRequest_Binding) Reset()

func (*ValidateRequest_Binding) String

func (m *ValidateRequest_Binding) String() string

func (*ValidateRequest_Binding) Unmarshal

func (m *ValidateRequest_Binding) Unmarshal(dAtA []byte) error

func (*ValidateRequest_Binding) Validate

func (m *ValidateRequest_Binding) Validate() error

Validate returns an error if the ValidateRequest_Binding isn't well-formed.

func (*ValidateRequest_Binding) XXX_DiscardUnknown

func (m *ValidateRequest_Binding) XXX_DiscardUnknown()

func (*ValidateRequest_Binding) XXX_Marshal

func (m *ValidateRequest_Binding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidateRequest_Binding) XXX_Merge

func (m *ValidateRequest_Binding) XXX_Merge(src proto.Message)

func (*ValidateRequest_Binding) XXX_Size

func (m *ValidateRequest_Binding) XXX_Size() int

func (*ValidateRequest_Binding) XXX_Unmarshal

func (m *ValidateRequest_Binding) XXX_Unmarshal(b []byte) error

type ValidateResponse

type ValidateResponse struct {
	Bindings             []*ValidateResponse_Binding `protobuf:"bytes,1,rep,name=bindings,proto3" json:"bindings,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

ValidateResponse is the response type of the Validate RPC.

func (*ValidateResponse) Descriptor

func (*ValidateResponse) Descriptor() ([]byte, []int)

func (*ValidateResponse) Marshal

func (m *ValidateResponse) Marshal() (dAtA []byte, err error)

func (*ValidateResponse) MarshalTo

func (m *ValidateResponse) MarshalTo(dAtA []byte) (int, error)

func (*ValidateResponse) MarshalToSizedBuffer

func (m *ValidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidateResponse) ProtoMessage

func (*ValidateResponse) ProtoMessage()

func (*ValidateResponse) ProtoSize

func (m *ValidateResponse) ProtoSize() (n int)

func (*ValidateResponse) Reset

func (m *ValidateResponse) Reset()

func (*ValidateResponse) String

func (m *ValidateResponse) String() string

func (*ValidateResponse) Unmarshal

func (m *ValidateResponse) Unmarshal(dAtA []byte) error

func (*ValidateResponse) Validate

func (m *ValidateResponse) Validate() error

Validate returns an error if the ValidateResponse isn't well-formed.

func (*ValidateResponse) XXX_DiscardUnknown

func (m *ValidateResponse) XXX_DiscardUnknown()

func (*ValidateResponse) XXX_Marshal

func (m *ValidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidateResponse) XXX_Merge

func (m *ValidateResponse) XXX_Merge(src proto.Message)

func (*ValidateResponse) XXX_Size

func (m *ValidateResponse) XXX_Size() int

func (*ValidateResponse) XXX_Unmarshal

func (m *ValidateResponse) XXX_Unmarshal(b []byte) error

type ValidateResponse_Binding

type ValidateResponse_Binding struct {
	// Components of the resource path which fully qualify the resource
	// identified by this binding.
	// - For an RDBMS, this might be []{dbname, schema, table}.
	// - For Kafka, this might be []{topic}.
	// - For Redis, this might be []{key_prefix}.
	ResourcePath         []string `protobuf:"bytes,1,rep,name=resource_path,json=resourcePath,proto3" json:"resource_path,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Validation responses for each binding of the request, and matching the request ordering. Each Binding must have a unique resource_path.

func (*ValidateResponse_Binding) Descriptor

func (*ValidateResponse_Binding) Descriptor() ([]byte, []int)

func (*ValidateResponse_Binding) Marshal

func (m *ValidateResponse_Binding) Marshal() (dAtA []byte, err error)

func (*ValidateResponse_Binding) MarshalTo

func (m *ValidateResponse_Binding) MarshalTo(dAtA []byte) (int, error)

func (*ValidateResponse_Binding) MarshalToSizedBuffer

func (m *ValidateResponse_Binding) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidateResponse_Binding) ProtoMessage

func (*ValidateResponse_Binding) ProtoMessage()

func (*ValidateResponse_Binding) ProtoSize

func (m *ValidateResponse_Binding) ProtoSize() (n int)

func (*ValidateResponse_Binding) Reset

func (m *ValidateResponse_Binding) Reset()

func (*ValidateResponse_Binding) String

func (m *ValidateResponse_Binding) String() string

func (*ValidateResponse_Binding) Unmarshal

func (m *ValidateResponse_Binding) Unmarshal(dAtA []byte) error

func (*ValidateResponse_Binding) Validate

func (m *ValidateResponse_Binding) Validate() error

Validate returns an error if the ValidateResponse_Binding isn't well-formed.

func (*ValidateResponse_Binding) XXX_DiscardUnknown

func (m *ValidateResponse_Binding) XXX_DiscardUnknown()

func (*ValidateResponse_Binding) XXX_Marshal

func (m *ValidateResponse_Binding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidateResponse_Binding) XXX_Merge

func (m *ValidateResponse_Binding) XXX_Merge(src proto.Message)

func (*ValidateResponse_Binding) XXX_Size

func (m *ValidateResponse_Binding) XXX_Size() int

func (*ValidateResponse_Binding) XXX_Unmarshal

func (m *ValidateResponse_Binding) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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