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 2021/09/22 15:21:53 UTC
[incubator-wayang] 12/15: [WAYANG-28] update the structure of class
in the Tagger function wrappers
This is an automated email from the ASF dual-hosted git repository.
bertty pushed a commit to branch WAYANG-28
in repository https://gitbox.apache.org/repos/asf/incubator-wayang.git
commit ad7f4510c8cedb22e6d3bffaebbe7229f5f9d244
Author: Bertty Contreras-Rojas <be...@scalytics.io>
AuthorDate: Mon May 17 12:40:25 2021 -0400
[WAYANG-28] update the structure of class in the Tagger function wrappers
---
.../core/tagger/wrapper/FlatmapWrapperHackit.java | 10 +++---
.../core/tagger/wrapper/FunctionWrapperHackit.java | 13 ++++---
.../tagger/wrapper/PredicateWrapperHackit.java | 12 +++----
.../tagger/wrapper/template/FlatMapTemplate.java | 40 ---------------------
.../template/TaggerWrapperFlatMapTemplate.java | 41 ++++++++++++++++++++++
...ate.java => TaggerWrapperFunctionTemplate.java} | 4 +--
6 files changed, 60 insertions(+), 60 deletions(-)
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FlatmapWrapperHackit.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FlatmapWrapperHackit.java
index 9100c99..5190f26 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FlatmapWrapperHackit.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FlatmapWrapperHackit.java
@@ -18,13 +18,13 @@
package org.apache.wayang.plugin.hackit.core.tagger.wrapper;
import org.apache.wayang.plugin.hackit.core.tagger.HackitTagger;
-import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.FlatMapTemplate;
+import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.TaggerWrapperFlatMapTemplate;
import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
import java.util.Iterator;
/**
- * FlatmapWrapperHackit is an implementation of {@link FlatMapTemplate} where Hackit manage the logic
+ * FlatmapWrapperHackit is an implementation of {@link TaggerWrapperFlatMapTemplate} where Hackit manage the logic
* before and after of tagging process, also it perform the unwrap of the tuple to be handle by the
* original function
*
@@ -34,19 +34,19 @@ import java.util.Iterator;
*/
public class FlatmapWrapperHackit<IDType, I, O>
extends HackitTagger
- implements FlatMapTemplate<HackitTuple<IDType, I>, HackitTuple<IDType, O>> {
+ implements TaggerWrapperFlatMapTemplate<HackitTuple<IDType, I>, HackitTuple<IDType, O>> {
/**
* Original function that will transform the data
*/
- private FlatMapTemplate<I, O> function;
+ private TaggerWrapperFlatMapTemplate<I, O> function;
/**
* Default Construct
*
* @param function is the function that will be Wrapped by the {@link FlatmapWrapperHackit}
*/
- public FlatmapWrapperHackit( FlatMapTemplate<I, O> function ) {
+ public FlatmapWrapperHackit(TaggerWrapperFlatMapTemplate<I, O> function ) {
this.function = function;
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FunctionWrapperHackit.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FunctionWrapperHackit.java
index 99e4b37..982b838 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FunctionWrapperHackit.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/FunctionWrapperHackit.java
@@ -18,12 +18,11 @@
package org.apache.wayang.plugin.hackit.core.tagger.wrapper;
import org.apache.wayang.plugin.hackit.core.tagger.HackitTagger;
-import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.FlatMapTemplate;
-import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.FunctionTemplate;
+import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.TaggerWrapperFunctionTemplate;
import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
/**
- * FunctionWrapperHackit is an implementation of {@link FunctionTemplate} where Hackit manage the logic
+ * FunctionWrapperHackit is an implementation of {@link TaggerWrapperFunctionTemplate} where Hackit manage the logic
* before and after of tagging process, also it perform the unwrap of the tuple to be handle by the
* original function
*
@@ -31,21 +30,21 @@ import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
* @param <I> Input Type of the original Tuple
* @param <O> Output Type after the perform the Function
*/
-public class FunctionWrapperHackit <IDType, I, O>
+public class FunctionWrapperHackit<IDType, I, O>
extends HackitTagger
- implements FunctionTemplate<HackitTuple<IDType, I>, HackitTuple<IDType, O>> {
+ implements TaggerWrapperFunctionTemplate<HackitTuple<IDType, I>, HackitTuple<IDType, O>> {
/**
* Original function that will transform the data
*/
- private FunctionTemplate<I, O> function;
+ private TaggerWrapperFunctionTemplate<I, O> function;
/**
* Default Construct
*
* @param function is the function that will be Wrapped by the {@link FunctionWrapperHackit}
*/
- public FunctionWrapperHackit(FunctionTemplate<I, O> function) {
+ public FunctionWrapperHackit(TaggerWrapperFunctionTemplate<I, O> function) {
this.function = function;
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/PredicateWrapperHackit.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/PredicateWrapperHackit.java
index 7249fdf..f9d47cd 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/PredicateWrapperHackit.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/PredicateWrapperHackit.java
@@ -18,13 +18,13 @@
package org.apache.wayang.plugin.hackit.core.tagger.wrapper;
import org.apache.wayang.plugin.hackit.core.tagger.HackitTagger;
-import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.FunctionTemplate;
+import org.apache.wayang.plugin.hackit.core.tagger.wrapper.template.TaggerWrapperFunctionTemplate;
import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
/**
- * PredicateWrapperHackit is an implementation of {@link FunctionTemplate} where Hackit manage the logic
+ * PredicateWrapperHackit is an implementation of {@link TaggerWrapperFunctionTemplate} where Hackit manage the logic
* before and after of tagging process, also it perform the unwrap of the tuple to be handle by the
- * original function. The original {@link FunctionTemplate} it an predicate function because return a
+ * original function. The original {@link TaggerWrapperFunctionTemplate} it an predicate function because return a
* {@link Boolean}
*
* @param <IDType> Type of {@link org.apache.wayang.plugin.hackit.core.tuple.header.Header} key of the {@link HackitTuple}
@@ -32,19 +32,19 @@ import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
*/
public class PredicateWrapperHackit<IDType, I>
extends HackitTagger
- implements FunctionTemplate<HackitTuple<IDType, I>, Boolean> {
+ implements TaggerWrapperFunctionTemplate<HackitTuple<IDType, I>, Boolean> {
/**
* Original predicate that will evaluate the data to give a True or False value
*/
- private FunctionTemplate<I, Boolean> function;
+ private TaggerWrapperFunctionTemplate<I, Boolean> function;
/**
* Default Construct
*
* @param function is the predicate that will be Wrapped by the {@link PredicateWrapperHackit}
*/
- public PredicateWrapperHackit(FunctionTemplate<I, Boolean> function) {
+ public PredicateWrapperHackit(TaggerWrapperFunctionTemplate<I, Boolean> function) {
this.function = function;
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/FlatMapTemplate.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/FlatMapTemplate.java
deleted file mode 100644
index 6c68f0c..0000000
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/FlatMapTemplate.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.tagger.wrapper.template;
-
-import java.util.Iterator;
-
-/**
- * FlatMapTemplate is the template that provide the abstraction to work with Flatmap operations and also
- * allows to wrap some function made by the user.
- *
- * FlatMapTemplate generate as output a {@link Iterator} this could be an extension of {@link org.apache.wayang.plugin.hackit.core.iterator.HackitIterator}
- *
- * @param <I> Input type of the original Function
- * @param <O> Output type of the original function
- */
-public interface FlatMapTemplate<I, O> {
-
- /**
- * Execute the logic over one element and generate as output a {@link Iterator}
- *
- * @param input element to transform
- * @return {@link Iterator} that contains the output's
- */
- public Iterator<O> execute(I input);
-}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/TaggerWrapperFlatMapTemplate.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/TaggerWrapperFlatMapTemplate.java
new file mode 100644
index 0000000..bb05c3a
--- /dev/null
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/TaggerWrapperFlatMapTemplate.java
@@ -0,0 +1,41 @@
+/*
+ * 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.tagger.wrapper.template;
+
+import java.util.Iterator;
+
+/**
+ * TaggerWrapperFlatMapTemplate is the template that provide the abstraction to work with Flatmap operations and also
+ * allows to wrap some function made by the user.
+ *
+ * TaggerWrapperFlatMapTemplate generate as output a {@link Iterator} this could be an extension of {@link org.apache.wayang.plugin.hackit.core.iterator.HackitIterator}
+ *
+ * @param <I> Input type of the original Function
+ * @param <O> Output type of the original function
+ */
+public interface TaggerWrapperFlatMapTemplate<I, O> extends TaggerWrapperFunctionTemplate<I, Iterator<O>> {
+
+ /**
+ * Execute the logic over one element and generate as output a {@link Iterator}
+ *
+ * @param input element to transform
+ * @return {@link Iterator} that contains the output's
+ */
+ Iterator<O> execute(I input);
+}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/FunctionTemplate.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/TaggerWrapperFunctionTemplate.java
similarity index 87%
rename from wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/FunctionTemplate.java
rename to wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/TaggerWrapperFunctionTemplate.java
index e33ad77..1033d4f 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/FunctionTemplate.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/wrapper/template/TaggerWrapperFunctionTemplate.java
@@ -18,13 +18,13 @@
package org.apache.wayang.plugin.hackit.core.tagger.wrapper.template;
/**
- * FunctionTemplate is the template that provide the abstraction to work with Transformation operations and also
+ * TaggerWrapperFunctionTemplate is the template that provide the abstraction to work with Transformation operations and also
* allows to wrap some function made by the user.
*
* @param <I> Input type of the original Function
* @param <O> Output type of the original function
*/
-public interface FunctionTemplate<I, O> {
+public interface TaggerWrapperFunctionTemplate<I, O> {
/**
* Execute the logic over one element and generate as output <code>T</code>