Skip to content

Commit

Permalink
Sync proto (#637)
Browse files Browse the repository at this point in the history
* Sync Function.proto with pulsar

* Generate code
  • Loading branch information
jiangpengcheng authored May 15, 2023
1 parent ab8215f commit 3db6632
Show file tree
Hide file tree
Showing 14 changed files with 641 additions and 401 deletions.
26 changes: 20 additions & 6 deletions api/compute/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,12 @@ type OutputConf struct {
}

type ProducerConfig struct {
MaxPendingMessages int32 `json:"maxPendingMessages,omitempty"`
MaxPendingMessagesAcrossPartitions int32 `json:"maxPendingMessagesAcrossPartitions,omitempty"`
UseThreadLocalProducers bool `json:"useThreadLocalProducers,omitempty"`
CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty"`
BatchBuilder string `json:"batchBuilder,omitempty"`
MaxPendingMessages int32 `json:"maxPendingMessages,omitempty"`
MaxPendingMessagesAcrossPartitions int32 `json:"maxPendingMessagesAcrossPartitions,omitempty"`
UseThreadLocalProducers bool `json:"useThreadLocalProducers,omitempty"`
CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty"`
BatchBuilder string `json:"batchBuilder,omitempty"`
CompressionType CompressionType `json:"compressionType,omitempty"`
}

type CryptoConfig struct {
Expand Down Expand Up @@ -334,6 +335,18 @@ const (
Earliest SubscribePosition = "earliest"
)

// CompressionType enum type
// +kubebuilder:validation:Enum=NONE;LZ4;ZLIB;ZSTD;SNAPPY
type CompressionType string

const (
LZ4 CompressionType = "LZ4"
NONE CompressionType = "NONE"
ZLIB CompressionType = "ZLIB"
ZSTD CompressionType = "ZSTD"
SNAPPY CompressionType = "SNAPPY"
)

type Component string

const (
Expand Down Expand Up @@ -377,13 +390,14 @@ const (
)

// ProcessGuarantee enum type
// +kubebuilder:validation:Enum=atleast_once;atmost_once;effectively_once
// +kubebuilder:validation:Enum=atleast_once;atmost_once;effectively_once;manual
type ProcessGuarantee string

const (
AtleastOnce ProcessGuarantee = "atleast_once"
AtmostOnce ProcessGuarantee = "atmost_once"
EffectivelyOnce ProcessGuarantee = "effectively_once"
Manual ProcessGuarantee = "manual"
)

const (
Expand Down
1 change: 1 addition & 0 deletions api/compute/v1alpha1/function_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type FunctionSpec struct {
SubscriptionName string `json:"subscriptionName,omitempty"`
CleanupSubscription bool `json:"cleanupSubscription,omitempty"`
SubscriptionPosition SubscribePosition `json:"subscriptionPosition,omitempty"`
SkipToLatest bool `json:"skipToLatest,omitempty"`

Pod PodPolicy `json:"pod,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -3139,6 +3147,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down Expand Up @@ -3307,6 +3316,8 @@ spec:
type: object
showPreciseParallelism:
type: boolean
skipToLatest:
type: boolean
statefulConfig:
properties:
pulsar:
Expand Down Expand Up @@ -6588,6 +6599,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down Expand Up @@ -6959,6 +6971,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -9841,6 +9861,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -3158,6 +3166,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down Expand Up @@ -3326,6 +3335,8 @@ spec:
type: object
showPreciseParallelism:
type: boolean
skipToLatest:
type: boolean
statefulConfig:
properties:
pulsar:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3085,6 +3085,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -3072,6 +3080,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down
21 changes: 21 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functionmeshes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -3140,6 +3148,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down Expand Up @@ -3308,6 +3317,8 @@ spec:
type: object
showPreciseParallelism:
type: boolean
skipToLatest:
type: boolean
statefulConfig:
properties:
pulsar:
Expand Down Expand Up @@ -6589,6 +6600,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down Expand Up @@ -6960,6 +6972,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -9842,6 +9862,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -3137,6 +3145,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down Expand Up @@ -3305,6 +3314,8 @@ spec:
type: object
showPreciseParallelism:
type: boolean
skipToLatest:
type: boolean
statefulConfig:
properties:
pulsar:
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/compute.functionmesh.io_sinks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3064,6 +3064,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ spec:
properties:
batchBuilder:
type: string
compressionType:
enum:
- NONE
- LZ4
- ZLIB
- ZSTD
- SNAPPY
type: string
cryptoConfig:
properties:
consumerCryptoFailureAction:
Expand Down Expand Up @@ -3051,6 +3059,7 @@ spec:
- atleast_once
- atmost_once
- effectively_once
- manual
type: string
pulsar:
properties:
Expand Down
Loading

0 comments on commit 3db6632

Please sign in to comment.