You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wayang.apache.org by be...@apache.org on 2022/05/23 13:20:10 UTC

[incubator-wayang] 21/38: [WAYANG-28] add empty implementation on Shipper components

This is an automated email from the ASF dual-hosted git repository.

bertty pushed a commit to branch WAYANG-28-update
in repository https://gitbox.apache.org/repos/asf/incubator-wayang.git

commit 6a12f49bd68aab1f07a84b730d7770796e27d56f
Author: Bertty Contreras-Rojas <be...@scalytics.io>
AuthorDate: Tue Apr 6 13:25:13 2021 -0400

    [WAYANG-28] add empty implementation on Shipper components
---
 .../sniffer/shipper/receiver/EmptyReceiver.java    | 38 ++++++++++++++++++++++
 .../core/sniffer/shipper/sender/EmptySender.java   | 35 ++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/EmptyReceiver.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/EmptyReceiver.java
new file mode 100644
index 00000000..2bd42a77
--- /dev/null
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/EmptyReceiver.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.wayang.plugin.hackit.core.sniffer.shipper.receiver;
+
+import java.util.Collections;
+import java.util.Iterator;
+
+public class EmptyReceiver<T> extends Receiver<T> {
+
+    @Override
+    public void init() {}
+
+    @Override
+    public Iterator<T> getElements() {
+        return (Iterator<T>) Collections.emptyIterator();
+    }
+
+    @Override
+    public void close() {
+
+    }
+}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/EmptySender.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/EmptySender.java
new file mode 100644
index 00000000..6ac08179
--- /dev/null
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/EmptySender.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.wayang.plugin.hackit.core.sniffer.shipper.sender;
+
+public class EmptySender<T> implements Sender<T> {
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void send(T value) {}
+
+    @Override
+    public void close() {
+
+    }
+}