-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconnector.yaml
230 lines (222 loc) · 8.05 KB
/
connector.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
version: "1.0"
specification:
name: generator
summary: A plugin capable of generating dummy records (in different formats).
description: |-
The generator is capable of generating dummy records (in JSON format). The
connector makes it possible to configure the records' fields, the operation
(whether the record was created, updated or deleted), the rate at which records
are produced, and other properties of the connector.
## Examples
### Bursts
The following configuration generates 100 records in bursts of 10 records each,
with a 1-second sleep time between bursts.
> [!NOTE]
> The generator currently has no concept of resuming work. For instance, below
> we have configured it to generate 100 records, but if we restart the pipeline
> (by stopping and starting the pipeline or by restarting Conduit), then it will
> start generating the 100 records from scratch.
```yaml
version: 2.2
pipelines:
- id: example
status: running
connectors:
- id: example
type: source
plugin: generator
settings:
# global settings
rate: 10
recordCount: 100
burst.generateTime: 1s
burst.sleepTime: 1s
# default collection
format.type: structured
format.options.id: int
format.options.name: string
operations: create
```
### Collections
The following configuration generates records forever with a steady rate of 1000
records per second. Records are generated in the `users` and `orders` collections.
The generated records have a different format, depending on the collection they
belong to.
```yaml
version: 2.2
pipelines:
- id: example
status: running
connectors:
- id: example
type: source
plugin: generator
settings:
# global settings
rate: 1000
# collection "users"
collections.users.format.type: structured
collections.users.format.options.id: int
collections.users.format.options.name: string
collections.users.operations: create
# collection "orders"
collections.orders.format.type: raw
collections.orders.format.options.id: int
collections.orders.format.options.product: string
collections.orders.operations: create,update,delete
```
version: v0.10.0
author: Meroxa, Inc.
source:
parameters:
- name: collections.*.operations
description: |-
Comma separated list of record operations to generate. Allowed values are
"create", "update", "delete", "snapshot".
type: string
default: create
validations:
- type: required
value: ""
- name: operations
description: |-
Comma separated list of record operations to generate. Allowed values are
"create", "update", "delete", "snapshot".
type: string
default: create
validations:
- type: required
value: ""
- name: burst.generateTime
description: |-
The amount of time the generator is generating records in a burst. Has an
effect only if `burst.sleepTime` is set.
type: duration
default: 1s
validations: []
- name: burst.sleepTime
description: The time the generator "sleeps" between bursts.
type: duration
default: ""
validations: []
- name: collections.*.format.options.*
description: |-
The options for the `raw` and `structured` format types. It accepts pairs
of field names and field types, where the type can be one of: `int`, `string`, `time`, `bool`, `duration`.
type: string
default: ""
validations: []
- name: collections.*.format.options.path
description: Path to the input file (only applicable if the format type is `file`).
type: string
default: ""
validations: []
- name: collections.*.format.type
description: The format of the generated payload data (raw, structured, file).
type: string
default: ""
validations:
- type: inclusion
value: raw,structured,file
- name: format.options.*
description: |-
The options for the `raw` and `structured` format types. It accepts pairs
of field names and field types, where the type can be one of: `int`, `string`, `time`, `bool`, `duration`.
type: string
default: ""
validations: []
- name: format.options.path
description: Path to the input file (only applicable if the format type is `file`).
type: string
default: ""
validations: []
- name: format.type
description: The format of the generated payload data (raw, structured, file).
type: string
default: ""
validations:
- type: inclusion
value: raw,structured,file
- name: rate
description: |-
The maximum rate in records per second, at which records are generated (0
means no rate limit).
type: float
default: ""
validations: []
- name: readTime
description: |-
The time it takes to 'read' a record.
Deprecated: use `rate` instead.
type: duration
default: ""
validations: []
- name: recordCount
description: Number of records to be generated (0 means infinite).
type: int
default: ""
validations:
- type: greater-than
value: "-1"
- name: sdk.batch.delay
description: Maximum delay before an incomplete batch is read from the source.
type: duration
default: "0"
validations:
- type: greater-than
value: "-1"
- name: sdk.batch.size
description: Maximum size of batch before it gets read from the source.
type: int
default: "0"
validations:
- type: greater-than
value: "-1"
- name: sdk.schema.context.enabled
description: |-
Specifies whether to use a schema context name. If set to false, no schema context name will
be used, and schemas will be saved with the subject name specified in the connector
(not safe because of name conflicts).
type: bool
default: "true"
validations: []
- name: sdk.schema.context.name
description: |-
Schema context name to be used. Used as a prefix for all schema subject names.
If empty, defaults to the connector ID.
type: string
default: ""
validations: []
- name: sdk.schema.extract.key.enabled
description: Whether to extract and encode the record key with a schema.
type: bool
default: "true"
validations: []
- name: sdk.schema.extract.key.subject
description: |-
The subject of the key schema. If the record metadata contains the field
"opencdc.collection" it is prepended to the subject name and separated
with a dot.
type: string
default: key
validations: []
- name: sdk.schema.extract.payload.enabled
description: Whether to extract and encode the record payload with a schema.
type: bool
default: "true"
validations: []
- name: sdk.schema.extract.payload.subject
description: |-
The subject of the payload schema. If the record metadata contains the
field "opencdc.collection" it is prepended to the subject name and
separated with a dot.
type: string
default: payload
validations: []
- name: sdk.schema.extract.type
description: The type of the payload schema.
type: string
default: avro
validations:
- type: inclusion
value: avro