Skip to content

Commit

Permalink
feat: add blackhole sink. Closes #329 (#330)
Browse files Browse the repository at this point in the history
Signed-off-by: Vigith Maurice <vigith@gmail.com>
  • Loading branch information
vigith authored and whynowy committed Nov 18, 2022
1 parent 4590547 commit 3d936a5
Show file tree
Hide file tree
Showing 19 changed files with 971 additions and 381 deletions.
7 changes: 7 additions & 0 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17420,6 +17420,10 @@
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.Blackhole": {
"description": "Blackhole is a sink to emulate /dev/null",
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.Buffer": {
"properties": {
"Name": {
Expand Down Expand Up @@ -18725,6 +18729,9 @@
},
"io.numaproj.numaflow.v1alpha1.Sink": {
"properties": {
"blackhole": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.Blackhole"
},
"kafka": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.KafkaSink"
},
Expand Down
7 changes: 7 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -17424,6 +17424,10 @@
}
}
},
"io.numaproj.numaflow.v1alpha1.Blackhole": {
"description": "Blackhole is a sink to emulate /dev/null",
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.Buffer": {
"type": "object",
"required": [
Expand Down Expand Up @@ -18712,6 +18716,9 @@
"io.numaproj.numaflow.v1alpha1.Sink": {
"type": "object",
"properties": {
"blackhole": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.Blackhole"
},
"kafka": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.KafkaSink"
},
Expand Down
2 changes: 2 additions & 0 deletions config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3466,6 +3466,8 @@ spec:
type: array
sink:
properties:
blackhole:
type: object
kafka:
properties:
brokers:
Expand Down
2 changes: 2 additions & 0 deletions config/base/crds/full/numaflow.numaproj.io_vertices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,8 @@ spec:
type: array
sink:
properties:
blackhole:
type: object
kafka:
properties:
brokers:
Expand Down
4 changes: 4 additions & 0 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5687,6 +5687,8 @@ spec:
type: array
sink:
properties:
blackhole:
type: object
kafka:
properties:
brokers:
Expand Down Expand Up @@ -8942,6 +8944,8 @@ spec:
type: array
sink:
properties:
blackhole:
type: object
kafka:
properties:
brokers:
Expand Down
4 changes: 4 additions & 0 deletions config/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5687,6 +5687,8 @@ spec:
type: array
sink:
properties:
blackhole:
type: object
kafka:
properties:
brokers:
Expand Down Expand Up @@ -8942,6 +8944,8 @@ spec:
type: array
sink:
properties:
blackhole:
type: object
kafka:
properties:
brokers:
Expand Down
20 changes: 20 additions & 0 deletions docs/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,18 @@ needs to add “Authorization: Bearer <token>” in the header
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.Blackhole">
Blackhole
</h3>
<p>
(<em>Appears on:</em>
<a href="#numaflow.numaproj.io/v1alpha1.Sink">Sink</a>)
</p>
<p>
<p>
Blackhole is a sink to emulate /dev/null
</p>
</p>
<h3 id="numaflow.numaproj.io/v1alpha1.Buffer">
Buffer
</h3>
Expand Down Expand Up @@ -3326,6 +3338,14 @@ Log </a> </em>
</tr>
<tr>
<td>
<code>blackhole</code></br> <em>
<a href="#numaflow.numaproj.io/v1alpha1.Blackhole"> Blackhole </a> </em>
</td>
<td>
</td>
</tr>
<tr>
<td>
<code>udsink</code></br> <em>
<a href="#numaflow.numaproj.io/v1alpha1.UDSink"> UDSink </a> </em>
</td>
Expand Down
11 changes: 11 additions & 0 deletions docs/sinks/blackhole.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Blackhole Sink

A `Blackhole` sink is where the output is drained without writing to any sink, it is to emulate `/dev/null`.

```yaml
spec:
vertices:
- name: output
sink:
blackhole: {}
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ nav:
- Sinks:
- sinks/kafka.md
- sinks/log.md
- sinks/blackhole.md
- User Defined Sinks: "sinks/user-defined-sinks.md"
- User Defined Functions:
- Overview: "user-defined-functions.md"
Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/numaflow/v1alpha1/blackhole_sink.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright 2022 The Numaproj Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

// Blackhole is a sink to emulate /dev/null
type Blackhole struct {
}
Loading

0 comments on commit 3d936a5

Please sign in to comment.