You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wayang.apache.org by rp...@apache.org on 2021/09/29 10:12:27 UTC
[incubator-wayang] 01/03: [WAYANG-28] Verification and Completion
of classes and general documentation
This is an automated email from the ASF dual-hosted git repository.
rpardomeza pushed a commit to branch WAYANG-28
in repository https://gitbox.apache.org/repos/asf/incubator-wayang.git
commit 04c8608f357f1b3de7aaacccf45080ca27ff1881
Author: rodrigopardomeza <ro...@gmail.com>
AuthorDate: Tue Sep 28 18:43:41 2021 +0200
[WAYANG-28] Verification and Completion of classes and general documentation
---
.../wayang-hackit-api-defaults.properties | 18 ++++
.../wayang/plugin/hackit/core/action/Action.java | 6 +-
.../plugin/hackit/core/action/ActionGroup.java | 4 +-
.../wayang/plugin/hackit/core/action/HaltJob.java | 4 +-
.../wayang/plugin/hackit/core/action/SendOut.java | 2 +-
.../wayang/plugin/hackit/core/action/Skip.java | 4 +-
.../hackit/core/identifiers/HackitIDGenerator.java | 16 ++--
.../generator/DistributeSequencial.java | 6 +-
.../hackit/core/iterator/ElementPlusIterator.java | 10 +--
.../hackit/core/iterator/FunctionIterator.java | 12 +--
.../hackit/core/iterator/HackitIterator.java | 10 +--
.../hackit/core/iterator/OneElementIterator.java | 22 ++---
.../plugin/hackit/core/sniffer/HackitSniffer.java | 53 ++++++------
.../hackit/core/sniffer/inject/EmptyInjector.java | 2 +-
.../hackit/core/sniffer/shipper/Shipper.java | 28 +++----
.../sniffer/shipper/receiver/BufferReceiver.java | 12 +--
.../core/sniffer/shipper/receiver/Receiver.java | 4 +-
.../hackit/core/sniffer/shipper/sender/Sender.java | 12 +--
.../core/sniffer/sniff/CollectionTagsToSniff.java | 34 +++++---
.../core/sniffer/sniff/SingleTagToSniff.java | 46 +++++++---
.../plugin/hackit/core/sniffer/sniff/Sniff.java | 11 ++-
.../plugin/hackit/core/tagger/HackitTagger.java | 55 ++++++------
.../plugin/hackit/core/tagger/TaggerFunction.java | 8 +-
.../core/tagger/wrapper/FlatmapWrapperHackit.java | 4 +-
.../core/tagger/wrapper/FunctionWrapperHackit.java | 10 +--
.../tagger/wrapper/PredicateWrapperHackit.java | 6 +-
.../wayang/plugin/hackit/core/tags/CrashTag.java | 9 +-
.../wayang/plugin/hackit/core/tags/DebugTag.java | 9 +-
.../wayang/plugin/hackit/core/tags/DisplayTag.java | 9 +-
.../wayang/plugin/hackit/core/tags/HackitTag.java | 12 +--
.../wayang/plugin/hackit/core/tags/LogTag.java | 7 +-
.../wayang/plugin/hackit/core/tags/PauseTag.java | 9 +-
.../wayang/plugin/hackit/core/tags/SkipTag.java | 11 ++-
.../wayang/plugin/hackit/core/tags/TraceTag.java | 9 +-
.../plugin/hackit/core/tuple/HackitTuple.java | 66 +++++++++------
.../plugin/hackit/core/tuple/header/Header.java | 98 ++++++++++++----------
.../hackit/core/tuple/header/HeaderBuilder.java | 23 ++++-
.../hackit/core/tuple/header/HeaderLong.java | 34 +++++---
.../wayang-hackit-core-defaults.properties | 18 ++++
.../wayang-hackit/wayang-hackit-shipper/pom.xml | 4 -
.../wayang-hackit-shipper-kafka/pom.xml | 5 --
41 files changed, 418 insertions(+), 304 deletions(-)
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-api/src/main/resources/wayang-hackit-api-defaults.properties b/wayang-plugins/wayang-hackit/wayang-hackit-api/src/main/resources/wayang-hackit-api-defaults.properties
new file mode 100644
index 0000000..1065b32
--- /dev/null
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-api/src/main/resources/wayang-hackit-api-defaults.properties
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+wayang.hackit.api.var = 0
\ No newline at end of file
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Action.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Action.java
index fc8c6e4..78b2b18 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Action.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Action.java
@@ -18,9 +18,9 @@
package org.apache.wayang.plugin.hackit.core.action;
/**
- * Action defines the possible behaviour that can occur inside of Hackit.
+ * Action defines the possible behaviour that can occur inside Hackit.
*
- * Each Action is independent and not exclusive; this means that the Action's
- * is executed with others Action's in parallel.
+ * Each Action is independent and not exclusive; this means that the Actions
+ * are executed with other Actions in parallel.
*/
public interface Action { }
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/ActionGroup.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/ActionGroup.java
index 7add775..cac1f5a 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/ActionGroup.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/ActionGroup.java
@@ -19,9 +19,9 @@ package org.apache.wayang.plugin.hackit.core.action;
/**
- * ActionGroup is an aggregation of the basic {@link Action}'s that Hackit had as predefined behaviour.
+ * ActionGroup is an aggregation of the basic {@link Action}'s that Hackit has as predefined behaviours.
*
- * The predefined Action's currently are:
+ * The predefined Actions currently are:
* <ul>
* <li>{@link Callback}</li>
* <li>{@link HaltJob}</li>
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/HaltJob.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/HaltJob.java
index bc5b97c..c3422e8 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/HaltJob.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/HaltJob.java
@@ -18,12 +18,12 @@
package org.apache.wayang.plugin.hackit.core.action;
/**
- * HaltJob in an {@link Action} which the behaviour of stopping the job processing partially or complete
+ * HaltJob is an {@link Action} whose behavior stops the job processing partially or completely.
*/
public interface HaltJob extends Action{
/**
- * Said if the element have or not HaltJob {@link Action}
+ * Indicates if the element has or not HaltJob {@link Action}
* @return Boolean
*/
boolean isHaltJob();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/SendOut.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/SendOut.java
index d877447..f4112d2 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/SendOut.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/SendOut.java
@@ -18,7 +18,7 @@
package org.apache.wayang.plugin.hackit.core.action;
/**
- * SendOut is the {@link Action} that will perform the send to the external debugger.
+ * SendOut is the {@link Action} that will perform the shipping to the external debugger.
*/
public interface SendOut extends Action{
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Skip.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Skip.java
index b9dc51c..75a983a 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Skip.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/action/Skip.java
@@ -18,12 +18,12 @@
package org.apache.wayang.plugin.hackit.core.action;
/**
- * Skip is the {@link Action} that helps to filter element either in a typical process or with the external debugger
+ * Skip is the {@link Action} that helps to filter elements either in a typical process or with the external debugger
*/
public interface Skip extends Action{
/**
- * Said if the element have or not a skip {@link Action}
+ * Indicates if the element have or not a skip {@link Action}
* @return Boolean
*/
public boolean isSkip();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/HackitIDGenerator.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/HackitIDGenerator.java
index b41eae2..37a5a06 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/HackitIDGenerator.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/HackitIDGenerator.java
@@ -35,8 +35,8 @@ import java.util.Enumeration;
public abstract class HackitIDGenerator<N, O> {
/**
- * is_address_calculated indicate if the address of the worker it already calculated,
- * because the calculation could be costly in time.
+ * is_address_calculated indicates if the address of the worker is already calculated,
+ * because the calculation can be expensive in time.
*/
private boolean is_address_calculated = false;
@@ -46,8 +46,8 @@ public abstract class HackitIDGenerator<N, O> {
protected InetAddress address_host;
/**
- * This is the identifier of the process, task, or machine, depends of the platform
- * but is use for the generators, normally correspond to an {@link Integer}
+ * This is the identifier of the process, task, or machine; composition depends on the platform
+ * this is used for the generators, normally correspond to an {@link Integer}
* */
protected N identify_process;
@@ -61,7 +61,7 @@ public abstract class HackitIDGenerator<N, O> {
/**
* Constructor with identifier of the process
- * @param identify_process identifier it help on the generation of unique ID
+ * @param identify_process identifier helps on the generation of unique IDs
*/
public HackitIDGenerator(N identify_process) {
this.identify_process = identify_process;
@@ -69,7 +69,7 @@ public abstract class HackitIDGenerator<N, O> {
}
/**
- * Build the address_host from the host information obtained form the context of execution
+ * Build the address_host from the host information obtained from the context of execution
*/
protected void getAddress(){
if( ! this.is_address_calculated ){
@@ -82,9 +82,9 @@ public abstract class HackitIDGenerator<N, O> {
}
/**
- * create the worker id depending on the network context information
+ * Creates the worker id depending on the network context information
*
- * @return unique number that identifier the worker as unique inside of the cluster
+ * @return unique number that identifies the worker as unique among the nodes of the cluster
*/
protected static int createNodeId() {
int nodeId;
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/generator/DistributeSequencial.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/generator/DistributeSequencial.java
index 43865b0..213d220 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/generator/DistributeSequencial.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/identifiers/generator/DistributeSequencial.java
@@ -20,9 +20,9 @@ package org.apache.wayang.plugin.hackit.core.identifiers.generator;
import org.apache.wayang.plugin.hackit.core.identifiers.HackitIDGenerator;
/**
- * DistributeSequencial it instance of {@link HackitIDGenerator}.
+ * DistributeSequencial is an instance of {@link HackitIDGenerator}.
*
- * DistributeSequencial asume not parallel job running, and help in small debugs, or single node work
+ * DistributeSequencial assumes not parallel jobs running, and help in small debugs, or single node work
*/
public class DistributeSequencial extends HackitIDGenerator<Integer, Long> {
@@ -32,7 +32,7 @@ public class DistributeSequencial extends HackitIDGenerator<Integer, Long> {
long current = 0;
/**
- * it add 1 to current and assign the previous number to the ID
+ * Adds 1 to <code>current<code/> and assign the previous number to the ID
*
* @return long that represent the ID, this could have repetition on parallel processing
*/
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/ElementPlusIterator.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/ElementPlusIterator.java
index e385718..b1f7f4c 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/ElementPlusIterator.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/ElementPlusIterator.java
@@ -22,15 +22,15 @@ import java.util.Iterator;
/**
* ElementPlusIterator extends from {@link Iterator}.
*
- * ElementPlusIterator add one unique element to a know {@link Iterator}, this unique element
- * it will be consumed first.
+ * ElementPlusIterator add one unique element to a known {@link Iterator},
+ * this unique element will be consumed first.
*
* @param <T> type of the element of the iterator
*/
public class ElementPlusIterator<T> implements Iterator<T> {
/**
- * Indicate if the first element it was consumed or not yet
+ * Indicates if the first element was consumed or not yet
*/
private boolean element_consumed = false;
@@ -40,13 +40,13 @@ public class ElementPlusIterator<T> implements Iterator<T> {
private T element;
/**
- * The iterator where the element was added
+ * The iterator where the element was included
*/
private Iterator<T> iterator;
/**
- * Construct of ElementPlusIterator
+ * Constructor of ElementPlusIterator
*
* @param element is the object that will be consumed first
* @param iterator iterator that will be consumed after the original element
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/FunctionIterator.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/FunctionIterator.java
index 5cb22d8..ff8eecd 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/FunctionIterator.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/FunctionIterator.java
@@ -23,10 +23,10 @@ import java.util.function.Function;
/**
* FunctionIterator implements {@link Iterator} and {@link Serializable}, because the function could be
- * serializad to be sent to several places at runtime
+ * serialized to be sent to several places at runtime
*
- * FunctionIterator provide the option of convert the data in the iterator using an {@link Function},
- * this will transform the element to the new kind
+ * FunctionIterator provides the option of converting the data in the iterator using an {@link Function},
+ * this will transform the elements to a new kind given by param <O>
*
* @param <I> Type before of the transformation in the iterator
* @param <O> Type after the transformation, this could be the same to <I>
@@ -39,14 +39,14 @@ public class FunctionIterator<I, O> implements Iterator<O>, Serializable {
private Iterator<I> base;
/**
- * function is an {@link Function} that will convert the element inside of <code>base</code>
+ * function is a {@link Function} that will convert the element inside of <code>base</code>
*/
private Function<I, O> function;
/**
- * Construct of FunctionIterator
+ * Constructor of FunctionIterator
*
- * @param base {@link Iterator} that will be transformed at the consumed time
+ * @param base {@link Iterator} that will be transformed at the time of consumption
* @param function {@link Function} that will convert the data inside of <code>base</code>
*/
public FunctionIterator(Iterator<I> base, Function<I, O> function) {
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/HackitIterator.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/HackitIterator.java
index 42166d2..1ef202b 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/HackitIterator.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/HackitIterator.java
@@ -23,8 +23,8 @@ import java.util.Iterator;
import java.util.function.Function;
/**
- * HackitIterator extends {@link FunctionIterator} and provides an signature for the conversion of
- * the tuples into a {@link HackitTuple} during they process.
+ * HackitIterator extends {@link FunctionIterator} and provides a signature for the conversion of
+ * the tuples into a {@link HackitTuple} while they are processed.
*
* @param <K> type of the key on the {@link HackitTuple}
* @param <T> type of the element that it contains the {@link HackitTuple}
@@ -32,9 +32,9 @@ import java.util.function.Function;
public class HackitIterator<K, T> extends FunctionIterator<T, HackitTuple<K, T>>{
/**
- * default construct
- * @param base {@link Iterator} that element will be wrapper inside of a {@link HackitTuple}
- * @param function it a {@link Function} that convert the the {@link HackitTuple}
+ * Default constructor
+ * @param base {@link Iterator} this element will be wrapped inside a {@link HackitTuple}
+ * @param function it is a {@link Function} that converts the {@link HackitTuple}
*/
public HackitIterator(Iterator<T> base, Function<T, HackitTuple<K, T>> function) {
super(base, function);
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/OneElementIterator.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/OneElementIterator.java
index 811413e..ba97291 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/OneElementIterator.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/iterator/OneElementIterator.java
@@ -23,47 +23,47 @@ import java.util.NoSuchElementException;
/**
* OneElementIterator implements {@link Iterator} and {@link Iterable}
*
- * OneElementIterator will contains just one element, but that element need to be treated as
- * Iterator, this class allow handler all the functionality that are related to that.
+ * OneElementIterator will contain just one element, but that element need to be treated as
+ * an Iterator, this class allows handle all the functionalities that are related to that.
*
* @param <T> type of the element
*/
public class OneElementIterator<T> implements Iterator<T>, Iterable<T>{
/**
- * indicate if the element could be removed
+ * Indicates if the element could be removed
*/
private final boolean removeAllowed;
/**
- * Indicate if the process is started or not
+ * Indicates whether the process has started or not
*/
private boolean beforeFirst;
/**
- * allows to follow the process as the object didn't exist
+ * Allows to follow the process as the object didn't exist
*/
private boolean removed;
/**
- * is the element that it will "process" at the iteration time
+ * It is the element that will be processed at iteration time
*/
private T object;
/**
- * Default Construct
+ * Default Constructor
*
- * @param object element that will be process
+ * @param object element that will be processed
*/
public OneElementIterator(T object) {
this(object, true);
}
/**
- * Construct that allows indicate the option of remove the object
+ * Constructor that allows indicating the option to remove the object
*
- * @param object element that will be process
- * @param removeAllowed indicate if the element could be removed
+ * @param object element that will be processed
+ * @param removeAllowed indicates if the element could be removed
*/
public OneElementIterator(T object, boolean removeAllowed) {
this.beforeFirst = true;
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/HackitSniffer.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/HackitSniffer.java
index 58e0366..cfad59c 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/HackitSniffer.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/HackitSniffer.java
@@ -31,12 +31,12 @@ import java.util.Iterator;
import java.util.function.Function;
/**
- * {@link HackitSniffer} is the one of the main function on Hackit, this function have the resposability of execute the
- * logic of sniff the tuples and apply the logic of {@link #apply(HackitTuple)}
+ * {@link HackitSniffer} is one of the main functions of Hackit, this function has the responsibility of executing the
+ * logic of sniffing tuples and applying the logic of {@link #apply(HackitTuple)}
*
* @param <K> type of key that it handle the {@link org.apache.wayang.plugin.hackit.core.tuple.header.Header}
- * @param <T> type that wrapped by {@link HackitTuple}
- * @param <SentType> Type of the element that it will be send out by {@link Sender}
+ * @param <T> type of element that is wrapped by {@link HackitTuple}
+ * @param <SentType> Type of the element that will be sent out by {@link Sender}
* @param <SenderObj> Object class of the implementation of {@link Sender}
* @param <ReceiverObj>Object class of the implementation of {@link Receiver}
*/
@@ -56,43 +56,43 @@ public class
Serializable {
/**
- * Indicate if the first execution or not, because some function will need that information
+ * Indicates if it is the first execution or not, because some function will need that information
* to get instantiated
*/
private transient boolean not_first = false;
/**
- * {@link Injector} instance that will be use by {@link HackitSniffer} as component
+ * {@link Injector} instance that will be used by {@link HackitSniffer} as component
*/
private Injector<HackitTuple<K, T>> hackItInjector;
/**
- * {@link Actor} instance that will be use by {@link HackitSniffer} as component
+ * {@link Actor} instance that will be used by {@link HackitSniffer} as component
*/
private Actor<HackitTuple<K, T>> actorFunction;
/**
- * {@link Shipper} instance that will be use by {@link HackitSniffer} as component
+ * {@link Shipper} instance that will be used by {@link HackitSniffer} as component
*/
private Shipper<HackitTuple<K, T>, SentType, SenderObj, ReceiverObj> shipper;
/**
- * {@link Sniff} instance that will be use by {@link HackitSniffer} as component
+ * {@link Sniff} instance that will be used by {@link HackitSniffer} as component
*/
private Sniff<HackitTuple<K, T>> hackItSniff;
/**
- * {@link Cloner} instance that will be use by {@link HackitSniffer} as component
+ * {@link Cloner} instance that will be used by {@link HackitSniffer} as component
*/
private Cloner<HackitTuple<K, T>, SentType> hackItCloner;
/**
* Construct with the components as parameters
- * @param hackItInjector {@link Injector} instance that will be use by {@link HackitSniffer} as component
- * @param actorFunction {@link Actor} instance that will be use by {@link HackitSniffer} as component
- * @param shipper {@link Shipper} instance that will be use by {@link HackitSniffer} as component
- * @param hackItSniff {@link Sniff} instance that will be use by {@link HackitSniffer} as component
- * @param hackItCloner {@link Cloner} instance that will be use by {@link HackitSniffer} as component
+ * @param hackItInjector {@link Injector} instance that will be used by {@link HackitSniffer} as component
+ * @param actorFunction {@link Actor} instance that will be used by {@link HackitSniffer} as component
+ * @param shipper {@link Shipper} instance that will be used by {@link HackitSniffer} as component
+ * @param hackItSniff {@link Sniff} instance that will be used by {@link HackitSniffer} as component
+ * @param hackItCloner {@link Cloner} instance that will be used by {@link HackitSniffer} as component
*/
//TODO: it may private, because need to be executed just at the creation moment
public HackitSniffer(
@@ -119,7 +119,7 @@ public class
}
/**
- * apply contains the logic that need to be executed at each tuple that is process by the main pipeline,
+ * Apply contains the logic that need to be executed at each tuple that is process by the main pipeline,
* <ol>
* <li>If is the first exection the function perform the connection between the sidecar and the main pipeline</li>
* <li>Validate if the tuple need to be sniffed</li>
@@ -157,7 +157,7 @@ public class
}
/**
- * set {@link Injector} instance that will be use by {@link HackitSniffer} as component
+ * Set {@link Injector} instance that will be used by {@link HackitSniffer} as component
*
* @param hackItInjector {@link Injector} instance
* @return self instance of the {@link HackitSniffer}
@@ -168,7 +168,7 @@ public class
}
/**
- * set {@link Actor} instance that will be use by {@link HackitSniffer} as component
+ * Set {@link Actor} instance that will be used by {@link HackitSniffer} as component
*
* @param actorFunction {@link Actor} instance
* @return self instance of the {@link HackitSniffer}
@@ -179,7 +179,7 @@ public class
}
/**
- * set {@link Shipper} instance that will be use by {@link HackitSniffer} as component
+ * Set {@link Shipper} instance that will be used by {@link HackitSniffer} as component
*
* @param shipper {@link Shipper} instance
* @return self instance of the {@link HackitSniffer}
@@ -190,7 +190,7 @@ public class
}
/**
- * set {@link Sniff} instance that will be use by {@link HackitSniffer} as component
+ * Set {@link Sniff} instance that will be used by {@link HackitSniffer} as component
*
* @param hackItSniff {@link Sniff} instance
* @return self instance of the {@link HackitSniffer}
@@ -201,7 +201,7 @@ public class
}
/**
- * set {@link Cloner} instance that will be use by {@link HackitSniffer} as component
+ * Set {@link Cloner} instance that will be used by {@link HackitSniffer} as component
*
* @param hackItCloner {@link Cloner} instance
* @return self instance of the {@link HackitSniffer}
@@ -213,13 +213,8 @@ public class
@Override
public String toString() {
- return "HackItSniffer{" +
- "\nfirst=" + not_first +
- ",\n hackItInjector=" + hackItInjector +
- ",\n actorFunction=" + actorFunction +
- ",\n shipper=" + shipper +
- ",\n hackItSniff=" + hackItSniff +
- ",\n hackItCloner=" + hackItCloner +
- "\n}";
+ return String.format("HackItSniffer{\n first=%s, \n hackItInjector=%s, \n actorFunction=%s, " +
+ "\n shipper=%s, \n hackItSniff=%s, \n hackItCloner=%s\n}"
+ , not_first, hackItInjector, actorFunction, shipper, hackItSniff, hackItCloner);
}
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/inject/EmptyInjector.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/inject/EmptyInjector.java
index ece3404..484b650 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/inject/EmptyInjector.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/inject/EmptyInjector.java
@@ -25,7 +25,7 @@ import java.util.Spliterators;
import java.util.stream.StreamSupport;
/**
- * EmptyInjector is a dummy implementation of the {@link Injector} to show how it need to looks and Inyector implementation
+ * EmptyInjector is a dummy implementation of the {@link Injector} to show how it needs to look an Inyector implementation
*
* @param <T> type of the element processed.
*/
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/Shipper.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/Shipper.java
index ad01d32..9ca558c 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/Shipper.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/Shipper.java
@@ -24,11 +24,11 @@ import java.io.Serializable;
import java.util.Iterator;
/**
- * Shipper is the component that it handle the reception and emision of the message from the main pipeline and sidecar
- * pipeline to enable a smoothly connection between them.
+ * Shipper is the component that it handle the reception and emission of messages from the main pipeline and sidecar
+ * pipeline to enable a smooth connection between them.
*
- * @param <T_IN> type of the tuple that it come from the sidecar to the main pipeline
- * @param <T_OUT> type of the tuple that it go from the main to sidecar pipeline
+ * @param <T_IN> type of the tuple that came from the sidecar to the main pipeline
+ * @param <T_OUT> type of the tuple that goes from the main pipeline to sidecar pipeline
* @param <SenderObj> type of {@link Sender} that the shipper will use
* @param <ReceiverObj> type of {@link Receiver} that the shipper will use
*/
@@ -45,27 +45,27 @@ public abstract class Shipper<T_IN, T_OUT, SenderObj extends Sender<T_OUT>, Rece
protected Receiver receiver_instance;
/**
- * Generate an instance of the {@link Sender}, it could be take it by configurations
+ * Generate an instance of the {@link Sender}, it could be taken from configurations
*
* @return {@link Sender} instance
*/
protected abstract Sender createSenderInstance();
/**
- * Generate an instance of the {@link Receiver}, it could be take it by configurations
+ * Generate an instance of the {@link Receiver}, it could be taken from configurations
*
* @return {@link Receiver} instance
*/
protected abstract Receiver createReceiverInstance();
/**
- * Connect with the a Message queue service and send the message
+ * Connect with a Message queue service and send a message
*
- * @param value is the element that it will be send out form the main pipeline
+ * @param value is the element that it will be sent out from the main pipeline
*/
public void publish(T_OUT value){
if(this.sender_instance == null){
- throw new RuntimeException("The Sender of the Shipper is not instanciated");
+ throw new RuntimeException("The Sender of the Shipper is not instantiated");
}
this.sender_instance.send(value);
}
@@ -80,7 +80,7 @@ public abstract class Shipper<T_IN, T_OUT, SenderObj extends Sender<T_OUT>, Rece
/**
* @see #subscribeAsProducer()
- * @param topic list of topic where the messages need to be seeded
+ * @param topic list of topic where the messages need to be sent
*/
public void subscribeAsProducer(String... topic){
this.subscribeAsProducer("default", topic);
@@ -88,7 +88,7 @@ public abstract class Shipper<T_IN, T_OUT, SenderObj extends Sender<T_OUT>, Rece
/**
* @see #subscribeAsProducer(String...)
- * @param metatopic If the metatopic is different to the Default, need to be provided here
+ * @param metatopic If the metatopic is different to the Default one, need to be provided here
*/
public void subscribeAsProducer(String metatopic, String... topic){
this.subscribeAsProducer();
@@ -99,7 +99,7 @@ public abstract class Shipper<T_IN, T_OUT, SenderObj extends Sender<T_OUT>, Rece
}
/**
- * Close connection and send the remaind elements
+ * Close connection and send the remaining elements
*/
public void unsubscribeAsProducer(){
if( this.sender_instance == null) return;
@@ -118,7 +118,7 @@ public abstract class Shipper<T_IN, T_OUT, SenderObj extends Sender<T_OUT>, Rece
/**
* @see #subscribeAsConsumer()
- * @param topic list of topic where the consumer it will be consuming
+ * @param topic list of topic where the consumer will be consuming
*/
public void subscribeAsConsumer(String... topic){
this.subscribeAsProducer("default", topic);
@@ -126,7 +126,7 @@ public abstract class Shipper<T_IN, T_OUT, SenderObj extends Sender<T_OUT>, Rece
/**
* @see #subscribeAsProducer(String...)
- * @param metatopic If the metatopic is different to the Default, need to be provided here
+ * @param metatopic If the metatopic is different to the Defaults, need to be provided here
*/
public void subscribeAsConsumer(String metatopic, String... topic){
this.subscribeAsConsumer();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/BufferReceiver.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/BufferReceiver.java
index 5e38a35..41187ac 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/BufferReceiver.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/BufferReceiver.java
@@ -22,30 +22,30 @@ import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
/**
- * BufferReceiver is component where the element getted by the {@link Receiver} are stored waiting for be consumed
+ * BufferReceiver is component where the elements get by the {@link Receiver} are stored waiting to be consumed
*
- * @param <T> type of the element that it will receive
+ * @param <T> type of the elements that will be received
*/
//TODO: Implement this class well
public class BufferReceiver<T> implements Serializable {
- //TODO implement the doble buffering
+ //TODO implement the double buffering
/**
- * queue is a {@link Queue} where the element are storage waiting to be consumed
+ * Queue is a {@link Queue} where the element are stored waiting to be consumed
*/
private transient Queue<T> queue;
/**
- * Start the Buffer to be enable to get new {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * Start the Buffer to be able to get new {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*
* @return True if the Buffer start without problem, False in other cases
*/
//TODO implement the server to receive the messages
public boolean start(){
+
return true;
}
-
//TODO registrer on the rest of the worker; validate if is need
public boolean register(){
return true;
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/Receiver.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/Receiver.java
index a529161..b81df04 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/Receiver.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/receiver/Receiver.java
@@ -21,7 +21,7 @@ import java.io.Serializable;
import java.util.Iterator;
/**
- * Receiver is the component that handle the connection with the side car, and get
+ * Receiver is the component that handle the connection with the sidecar, and get
* external elements, this can be instructions to perform or new {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*
* @param <T> Type of received elements
@@ -34,7 +34,7 @@ public abstract class Receiver<T> implements Serializable {
private transient BufferReceiver<T> bufferReceiver;
/**
- * Start the the Receiver service that will be waiting the new elements.
+ * Start the Receiver service that will be waiting for new elements.
*/
public abstract void init();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/Sender.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/Sender.java
index 2e6ad41..f672146 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/Sender.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/shipper/sender/Sender.java
@@ -23,26 +23,26 @@ import java.io.Serializable;
* Sender is the component that send the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} out from
* the main pipeline
*
- * @param <T> type of the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} that will be send out
+ * @param <T> type of the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} that will be sent out
*/
public interface Sender<T> extends Serializable {
/**
* Start the service or connect to the server where the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
- * need to be sended it
+ * need to be sent
*/
void init();
/**
- * Place in a buffer or send inmediatly the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} this will
- * depends on the configuration
+ * Place in a buffer or send immediately the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} this will
+ * depend on the configuration
*
- * @param value to be send out
+ * @param value to be sent out
*/
void send(T value);
/**
- * Terminate the connection and clean the buffers if is need
+ * Terminate the connection and clean the buffers if is needed
*/
void close();
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/CollectionTagsToSniff.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/CollectionTagsToSniff.java
index 6e49b3a..6f643e3 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/CollectionTagsToSniff.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/CollectionTagsToSniff.java
@@ -19,46 +19,60 @@
package org.apache.wayang.plugin.hackit.core.sniffer.sniff;
import org.apache.wayang.plugin.hackit.core.tags.HackitTag;
+import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
/**
- * TODO validate if is correct implementation
+ * Sniffing {@link Sniff} use case when a Set of {@link HackitTag}s is required to evaluate HackitTuples
*/
public class CollectionTagsToSniff implements Sniff {
/**
- *
+ * Contains the Set {@link HackitTag}s to be evaluated
*/
public Set<HackitTag> tags2sniff;
/**
- * Default Construct
+ * Default Constructor
*/
public CollectionTagsToSniff(){
this.tags2sniff = new HashSet<>();
}
/**
- *
- * @param tag
- * @return
+ * Constructor that assigns a Set of HackitTags to Sniff tuples
*/
- public boolean sniff(HackitTag tag){
- return this.tags2sniff.contains(tag);
+ public CollectionTagsToSniff(Set<HackitTag> tags2sniff){
+ this.tags2sniff = tags2sniff;
}
/**
*
- * @param tag
+ * @param tag to be Added in this Sniffer {@link Sniff}
*/
public void addTag2sniff(HackitTag tag) {
this.tags2sniff.add(tag);
}
+ /**
+ * Review that at least a single preset {@link HackitTag} is present
+ * on received {@link HackitTuple}
+ *
+ * @param input element to evaluate if is sniffable
+ * @return {@link Boolean} Indicates if the Sniffer has found at least a single Tag {@link HackitTag}
+ */
@Override
- public boolean sniff(Object input) {
+ public boolean sniff(HackitTuple input) {
+ Iterator<HackitTag> iterator = input.getTags();
+ while (iterator.hasNext()){
+ HackitTag tag = iterator.next();
+ if(this.tags2sniff.contains(tag)){
+ return true;
+ }
+ }
return false;
}
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/SingleTagToSniff.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/SingleTagToSniff.java
index 9fcf1b7..2eee7c9 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/SingleTagToSniff.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/SingleTagToSniff.java
@@ -19,39 +19,61 @@
package org.apache.wayang.plugin.hackit.core.sniffer.sniff;
import org.apache.wayang.plugin.hackit.core.tags.HackitTag;
+import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
+
+import java.util.Iterator;
/**
- * TODO validate if is correct implementation
+ * Sniffing {@link Sniff} use case when a single {@link HackitTag} is required to evaluate HackitTuples
*/
public class SingleTagToSniff implements Sniff {
/**
- *
+ * Contains the single {@link HackitTag} to be evaluated
*/
- public HackitTag tags2sniff;
+ public HackitTag tag2sniff;
/**
- *
- * @param tag
- * @return
+ * Default constructor
*/
- public boolean sniff(HackitTag tag){
- return this.tags2sniff.equals(tag);
+ public SingleTagToSniff(){
+ this.tag2sniff = null;
+ }
+
+ /**
+ * Constructor that sets the Tag
+ */
+ public SingleTagToSniff(HackitTag tag){
+ this.tag2sniff = tag;
}
/**
*
- * @param tag
+ * @param tag to be Added in this Sniffer {@link Sniff}
*/
public void addTag2sniff(HackitTag tag) {
- if(this.tags2sniff != null){
+ if(this.tag2sniff != null){
throw new RuntimeException("The SingleTagToSniff already got the tag, if you need more of one tag use CollectionTagsToSniff class");
}
- this.tags2sniff = tag;
+ this.tag2sniff = tag;
}
+ /**
+ * Returns whether the received {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * contains the preset tag in this Sniffer {@link Sniff}
+ *
+ * @param input {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} analyzed to match its tags with the Sniffer preset tag
+ * @return {@link Boolean} Indicates if the Sniffer has found the Tag {@link HackitTag}
+ */
@Override
- public boolean sniff(Object input) {
+ public boolean sniff(HackitTuple input) {
+ Iterator<HackitTag> iterator = input.getTags();
+ while (iterator.hasNext()){
+ HackitTag tag = iterator.next();
+ if(tag.equals(this.tag2sniff)){
+ return true;
+ }
+ }
return false;
}
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/Sniff.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/Sniff.java
index cd4461b..89dfaf5 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/Sniff.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/sniffer/sniff/Sniff.java
@@ -17,18 +17,21 @@
*/
package org.apache.wayang.plugin.hackit.core.sniffer.sniff;
+import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
+
import java.io.Serializable;
/**
- * Sniff is the component that evaluate if some {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} need to
- * be treated on some way
+ * Sniff is the component that evaluate whether some {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} need to
+ * be treated in some way
*
* @param <I> type of the element that will be evaluated
*/
-public interface Sniff<I> extends Serializable {
+public interface Sniff<I extends HackitTuple> extends Serializable {
/**
- * sniff evaluate if the <code>input</code> need to be treated on some way or contains some {@link org.apache.wayang.plugin.hackit.core.tags.HackitTag}
+ * Sniff evaluate if the <code>input</code> needs to be treated in some way
+ * or contains some {@link org.apache.wayang.plugin.hackit.core.tags.HackitTag}
* to enable the sniff
*
* @param input element to evaluate if is sniffable
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/HackitTagger.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/HackitTagger.java
index e172903..89f9128 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/HackitTagger.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/HackitTagger.java
@@ -30,22 +30,19 @@ import java.util.List;
import java.util.Set;
/**
- * HackitTagger is class where is allocated all the logic that need to be perform during the
- * tagging step in Hackit, this logic have and pre and post processing and they are acting like
- * template that follow same behaivor in every tagger
+ * HackitTagger is a class in which all the logic that needs to be performed during the tagging step in Hackit is assigned,
+ * this logic has pre and post processing, both acting as a template that follows the same behavior on each tagger
*/
//TODO add the option of add a custom function
public class HackitTagger implements Serializable {
/**
- * {@link List} of {@link HackitTag} that are added previous of the execution of the
- * original function
+ * {@link List} of {@link HackitTag} that are added before the original function execution
*/
protected Set<HackitTag> pre_tags;
/**
- * {@link List} of {@link HackitTag} that are added after of the execution of the
- * original function
+ * {@link List} of {@link HackitTag} that are added after the original function execution
*/
protected Set<HackitTag> post_tags;
@@ -58,7 +55,7 @@ public class HackitTagger implements Serializable {
* Add a {@link HackitTag} to {@link List} of <code>pre_tags</code>
*
* @param tag is a {@link HackitTag} added to change the future behavior
- * @return {@link HackitTagger} as it self reference
+ * @return {@link HackitTagger} as a self reference
*/
public HackitTagger addPreTag(HackitTag tag){
if(this.pre_tags == null){
@@ -72,7 +69,7 @@ public class HackitTagger implements Serializable {
* Add a {@link HackitTag} to {@link List} of <code>post_tags</code>
*
* @param tag is a {@link HackitTag} added to change the future behavior
- * @return {@link HackitTagger} as it self reference
+ * @return {@link HackitTagger} as a self reference
*/
public HackitTagger addPostTag(HackitTag tag){
if(this.post_tags == null){
@@ -83,9 +80,9 @@ public class HackitTagger implements Serializable {
}
/**
- * add to the {@link HackitTuple} all the {@link HackitTag}'s add pre-tagging phase are available at that moment
+ * Add to the {@link HackitTuple} all the {@link HackitTag}'s that are available at the moment. Add to pre-tagging phase
*
- * @param tuple is a {@link HackitTuple} where that {@link HackitTag} will be added
+ * @param tuple is a {@link HackitTuple} where {@link HackitTag}s will be added
*/
public void preTaggingTuple(HackitTuple tuple){
if(this.pre_tags != null)
@@ -93,9 +90,9 @@ public class HackitTagger implements Serializable {
}
/**
- * add to the {@link HackitTuple} all the {@link HackitTag}'s add post-tagging phase are available at that moment
+ * Add to the {@link HackitTuple} all the {@link HackitTag}s that are available at the moment. Add to post-tagging phase
*
- * @param tuple is a {@link HackitTuple} where that {@link HackitTag} will be added
+ * @param tuple is a {@link HackitTuple} where {@link HackitTag}s will be added
*/
public void postTaggingTuple(HackitTuple tuple){
if(this.post_tags != null)
@@ -103,10 +100,10 @@ public class HackitTagger implements Serializable {
}
/**
- * add all the {@link HackitTag}'s available on the {@link List} to the {@link HackitTuple}
+ * Add all the {@link HackitTag}s available on the {@link List} to the {@link HackitTuple}
*
* @param tuple is {@link HackitTuple} where the tags will be added
- * @param tags {@link List} of {@link HackitTag}'s that will add to {@link HackitTuple}
+ * @param tags {@link List} of {@link HackitTag}s to be added to {@link HackitTuple}
*/
public void taggingTuple(HackitTuple tuple, Set<HackitTag> tags){
//TODO: change this code for an efficient one
@@ -114,18 +111,19 @@ public class HackitTagger implements Serializable {
}
/**
- * It take the original {@link HackitTuple} and extract the {@link Header} and start creating the children
- * from that {@link Header} this enable to follow the lineage of the after a several elements come out from
- * one {@link HackitTuple}. This generation is possible by inserting a new step at the iterator using {@link HackitIterator}
- * that allow append a new instruction in the process that will be perform on the original {@link Iterator}
*
- * @param origin Original {@link HackitTuple} that it was transformed
- * @param result is the transformation output inside of an {@link Iterator}
+ * It takes the original {@link HackitTuple}, extracts the {@link Header} and start creating children
+ * from that {@link Header}. This allows the lineage to be tracked after multiple items come out of a
+ * {@link HackitTuple}. This generation is possible by inserting a new step at the iterator using {@link HackitIterator}
+ * that allows appending a new instruction in the process that will be performed on the original {@link Iterator}
+ *
+ * @param origin Original {@link HackitTuple} that was transformed
+ * @param result is the transformation output inside an {@link Iterator}
* @param <K> type of the identifier of {@link HackitTuple}
- * @param <I> type of the original element inside of {@link HackitTuple} that it was transformed
+ * @param <I> type of the original element inside of {@link HackitTuple} that was transformed
* @param <O> type of the output in the transformation
*
- * @return {@link Iterator} that is wrapper of the original with the add instruction using {@link HackitIterator}
+ * @return {@link Iterator} wrapper of the original with an added instruction using {@link HackitIterator}
*/
public <K, I, O> Iterator<HackitTuple<K,O>> postTaggingTuple(HackitTuple<K, I> origin, Iterator<O>result){
Header<K> header = origin.getHeader();
@@ -144,15 +142,14 @@ public class HackitTagger implements Serializable {
}
/**
- * It take the original {@link HackitTuple} and extract the {@link Header} to be enable to follow the lineage of the
- * same value transformed, then is generate a new {@link HackitTuple} with the <code>result</code> as the wrapped
- * element, it also add the new {@link HackitTag}'s to the {@link Header}
- *
+ * It takes the original {@link HackitTuple} and extract the {@link Header} to allow the lineage to be tracked regarding the
+ * same value transformed. Then, it is generated a new {@link HackitTuple} with the <code>result</code> as the wrapped
+ * element, it also adds the new {@link HackitTag}'s to the {@link Header}
*
- * @param origin Original {@link HackitTuple} that it was transformed
+ * @param origin Original {@link HackitTuple} that was transformed
* @param result is the transformation output
* @param <K> type of the identifier of {@link HackitTuple}
- * @param <I> type of the original element inside of {@link HackitTuple} that it was transformed
+ * @param <I> type of the original element inside of {@link HackitTuple} that was transformed
* @param <O> type of the output in the transformation
*
* @return {@link HackitTuple} with the new {@link HackitTag}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/TaggerFunction.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/TaggerFunction.java
index eb26a4b..6435150 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/TaggerFunction.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tagger/TaggerFunction.java
@@ -18,20 +18,22 @@
package org.apache.wayang.plugin.hackit.core.tagger;
/**
- * TaggerFunction is the template for the function that will be use inside of {@link HackitTagger}
+ * TaggerFunction is the template for the function that will be used inside of {@link HackitTagger}
*
* @param <T> output type of the execution
+ * @deprecated Do not use, if you found a place using it remove ut and use the Wrapper hackit :D
*/
+@Deprecated
public interface TaggerFunction<T> {
/**
- * It execute the function of tagger, and generate and output
+ * It executes the function of tagger, and generates an output
*
* @return result of the execution
*/
T execute();
/**
- * Get the name of the function, this is use a identifier
+ * Get the name of the function, this is used as an identifier
*
* @return {@link String} that contains the name of the {@link TaggerFunction}
*/
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 5d020a2..c0e612d 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
@@ -24,8 +24,8 @@ import java.util.Iterator;
import java.util.function.Function;
/**
- * FlatmapWrapperHackit is an implementation of {@link HackitTagger} where Hackit manage the logic
- * before and after of tagging process, also it perform the unwrap of the tuple to be handle by the
+ * FlatmapWrapperHackit is an implementation of {@link HackitTagger} where Hackit manages the logic
+ * before and after of tagging process. Additionally, it performs unwrap of the tuple to be handled by the
* original function
*
* @param <IDType> Type of {@link org.apache.wayang.plugin.hackit.core.tuple.header.Header} key of the {@link HackitTuple}
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 4c97b28..beae3b5 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
@@ -23,13 +23,13 @@ import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
import java.util.function.Function;
/**
- * FunctionWrapperHackit is an implementation of {@link HackitTagger} 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
+ * FunctionWrapperHackit is an implementation of {@link HackitTagger} where Hackit manages the logic
+ * before and after of tagging process. Additionally, it performs unwrap of the tuple to be handled by the
+ * original function.
*
* @param <IDType> Type of {@link org.apache.wayang.plugin.hackit.core.tuple.header.Header} key of the {@link HackitTuple}
* @param <I> Input Type of the original Tuple
- * @param <O> Output Type after the perform the Function
+ * @param <O> Output Type after performing the Function
*/
public class FunctionWrapperHackit<IDType, I, O>
extends HackitTagger
@@ -41,7 +41,7 @@ public class FunctionWrapperHackit<IDType, I, O>
private Function<I, O> function;
/**
- * Default Construct
+ * Default Constructor
*
* @param function is the function that will be Wrapped by the {@link FunctionWrapperHackit}
*/
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 945cbfb..c7d0728 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
@@ -23,9 +23,9 @@ import org.apache.wayang.plugin.hackit.core.tuple.HackitTuple;
import java.util.function.Predicate;
/**
- * PredicateWrapperHackit is an implementation of {@link HackitTagger} 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 Predicate} function because return a {@link Boolean}
+ * PredicateWrapperHackit is an implementation of {@link HackitTagger} where Hackit manages the logic
+ * before and after of tagging process. Additionally, it performs unwrap of the tuple to be handled by the
+ * original function. This original function is a {@link Predicate} function and therefore returns a {@link Boolean}
*
* @param <IDType> Type of {@link org.apache.wayang.plugin.hackit.core.tuple.header.Header} key of the {@link HackitTuple}
* @param <I> Input Type of the original Tuple to be evaluated
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/CrashTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/CrashTag.java
index dca602a..3d7505a 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/CrashTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/CrashTag.java
@@ -18,19 +18,18 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * CrashTag is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} that
- * produce and exception that goes from UDF context and could make that the process stop.
+ * CrashTag is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} that
+ * produces an exception that goes from UDF context and could make the process stop.
*/
public class CrashTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static CrashTag seed = null;
/**
- * default construct
+ * Default constructor
*/
private CrashTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DebugTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DebugTag.java
index 7c7a834..5dc699f 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DebugTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DebugTag.java
@@ -18,19 +18,18 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * DebugTag is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
- * as an element that need to capture the timestamp and send it out to analyse the values
+ * DebugTag is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * as an element that needs to be captured with its timestamp, and send it out for further analysis
*/
public class DebugTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static DebugTag seed = null;
/**
- * default construct
+ * Default constructor
*/
private DebugTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DisplayTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DisplayTag.java
index d584159..400e7c9 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DisplayTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/DisplayTag.java
@@ -18,19 +18,18 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * Display is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
- * as an element that need to be sent it out to just print the values
+ * Display is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * as an element that needs to be sent out to just print its values
*/
public class DisplayTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static DisplayTag seed = null;
/**
- * default construct
+ * Default constructor
*/
private DisplayTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/HackitTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/HackitTag.java
index 9d4c813..e37134b 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/HackitTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/HackitTag.java
@@ -27,12 +27,12 @@ import java.util.List;
import java.util.Map;
/**
- * HackitTag extend from {@link ActionGroup} becuase is the element that allows to create
- * an element that contains the flags for the {@link org.apache.wayang.plugin.hackit.core.tagger.HackitTagger}
- * and {@link org.apache.wayang.plugin.hackit.core.sniffer.HackitSniffer} could perform the right logic
- * to {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} that have the tag
+ * HackitTag extends from {@link ActionGroup} because is the element that allows to create
+ * an element that contains the flags for the {@link org.apache.wayang.plugin.hackit.core.tagger.HackitTagger}.
+ * Then, {@link org.apache.wayang.plugin.hackit.core.sniffer.HackitSniffer} can perform the right logic
+ * to {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}s that have the tag
*
- * HachitTag implements {@link Serializable} because the element could be send it out.
+ * HachitTag implements {@link Serializable} because the element could be sent out.
*/
public abstract class HackitTag implements Serializable, ActionGroup {
@@ -47,7 +47,7 @@ public abstract class HackitTag implements Serializable, ActionGroup {
private Map<String, Object> callback_results;
/**
- * Default Construct
+ * Default Constructor
*/
protected HackitTag(){
//TODO: validate is is not better to go by delay option
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/LogTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/LogTag.java
index d00805e..1e7a05f 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/LogTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/LogTag.java
@@ -18,19 +18,18 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * LogTag is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * LogTag is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
* as part of logging status, this will produce to send out just the metadata
*/
public class LogTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static LogTag seed = null;
/**
- * default construct
+ * Default constructor
*/
public LogTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/PauseTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/PauseTag.java
index 31e9515..c347f21 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/PauseTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/PauseTag.java
@@ -18,19 +18,18 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * PauseTag is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
- * where is need to pause all the process and wait for a signal that tell what to do, either kill the process or continues
+ * PauseTag is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * where is needed to pause all the process and wait for a signal that tells what to do, either kill the process or continues
*/
public class PauseTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static PauseTag seed = null;
/**
- * default construct
+ * Default constructor
*/
private PauseTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/SkipTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/SkipTag.java
index b8523f9..9a1dbef 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/SkipTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/SkipTag.java
@@ -18,20 +18,19 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * SkipTag is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
- * that not need to be process by the {@link org.apache.wayang.plugin.hackit.core.sniffer.HackitSniffer} and
- * also need to be removed and not continues with the process.
+ * SkipTag is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * that is not needed to be processed by the {@link org.apache.wayang.plugin.hackit.core.sniffer.HackitSniffer} and
+ * therefore needs to be removed from the tuples to be processed.
*/
public class SkipTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static SkipTag seed = null;
/**
- * default construct
+ * Default constructor
*/
private SkipTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/TraceTag.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/TraceTag.java
index 47c1108..cf80d2e 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/TraceTag.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tags/TraceTag.java
@@ -18,19 +18,18 @@
package org.apache.wayang.plugin.hackit.core.tags;
/**
- * DebugTag is the {@link HackitTag} that identify the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
- * as an element which will be identifier and also add the timestamp to be enable to follow it
+ * DebugTag is the {@link HackitTag} that identifies the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * as an element to be tracked, adds a timestamp to be able to follow it
*/
public class TraceTag extends HackitTag {
/**
- * seed is the element that allow to have small overhead in memory, is like use
- * singleton.
+ * Seed is the element that allows to have small overhead in memory, it is like using singleton.
*/
private static TraceTag seed = null;
/**
- * default construct
+ * Default constructor
*/
private TraceTag(){
super();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/HackitTuple.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/HackitTuple.java
index 7e36fa0..8518ca1 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/HackitTuple.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/HackitTuple.java
@@ -31,24 +31,24 @@ import java.util.Set;
* to enable the execution of the logic in the internal pipeline of hackit
*
* HackitTuple implements {@link Serializable} because the HackitTuple and the <code>T</code> will sent
- * out or part of the suffle process
+ * out as part of the shuffle process
*
* HackitTuple implements {@link ActionGroup} because it could have any {@link org.apache.wayang.plugin.hackit.core.action.Action}
- * to perform, and is easy to validate at runtime what are the operation that need to be performed
+ * to perform, and it is easy to validate at runtime which operations need to be performed
*
- * @param <K> type of the key that will use as indentifier on the HackitTuple
- * @param <T> type of the element that it will be wrapper inside of the HackitTuple
+ * @param <K> type of the key that will be used as an identifier on the HackitTuple
+ * @param <T> type of the element that it will be wrapped inside the HackitTuple
*/
public class HackitTuple<K, T> implements Serializable, ActionGroup {
/**
- * BUILDER is the {@link HeaderBuilder} that produce the identifier on the process
- * of construction the new {@link Header}
+ * BUILDER is the {@link HeaderBuilder} that produces the identifier on the process
+ * of construction of the new {@link Header}
*/
private static HeaderBuilder BUILDER;
/**
- * header is an {@link Header}, this help to save relevant meta data of the tuple
+ * header is a {@link Header}, this helps to save relevant metadata of the tuple. E.g. added Tags.
*/
private Header<K> header;
@@ -58,8 +58,8 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
private T value;
/**
- * this static create the {@link HeaderBuilder} that will be use during the process
- * of geneating the {@link Header}
+ * this static creates the {@link HeaderBuilder} that will be used during the process
+ * of generating the {@link Header}
*/
static {
//TODO: the generation of the HeaderBuilder need to be done by configuration and using maybe a Dependency Inyection
@@ -67,9 +67,9 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * Default Construct, internally it generate the tuple
+ * Default Constructor, internally it generates the tuple
*
- * @param value that it will wrapper by the {@link HackitTuple}
+ * @param value that will be wrapped by current {@link HackitTuple}
*/
public HackitTuple(T value){
this.header = BUILDER.generateHeader();
@@ -77,10 +77,10 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * Construct where the header could be provided an not use the default {@link HeaderBuilder}
+ * Constructor where the header can be provided, instead of using the default {@link HeaderBuilder}
*
- * @param header {@link Header} that will be save the relevant metadata
- * @param value that it will wrapper by the {@link HackitTuple}
+ * @param header {@link Header} that will save the relevant metadata
+ * @param value that will be wrapped by the {@link HackitTuple}
*/
public HackitTuple(Header<K> header, T value){
this.header = header;
@@ -88,7 +88,7 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * obtain the header of the tuple
+ * Obtain the header of the tuple
*
* @return {@link Header} that contains the relevant metadata
*/
@@ -97,7 +97,7 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * obtains the identifier allocated inside of the {@link Header}
+ * Obtains the identifier allocated inside the {@link Header}
*
* @return identifier of the tuple
*/
@@ -106,7 +106,7 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * obtain the wrapped element inside of the {@link HackitTuple}
+ * Obtains the wrapped element inside the {@link HackitTuple}
*
* @return original value that was wrapped
*/
@@ -115,7 +115,7 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * add an {@link HackitTag} to the {@link Header}
+ * Adds a {@link HackitTag} to the {@link Header}
*
* @param tag {@link HackitTag} that it will need at some point on the process
*/
@@ -124,16 +124,17 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
}
/**
- * add a {@link Set} of {@lin HackitTag} on the {@link Header}
+ * Adds a {@link Set} of {@lin HackitTag}s on the {@link Header}
*
- * @param tags {@link HackitTag} that it will need at some point on the process
+ * @param tags {@link HackitTag} that will be needed at some point of the process
*/
public void addTag(Set<HackitTag> tags){
this.header.addTag(tags);
}
/**
- * get a {@link Iterator} of the currents {@link HackitTag} that are inside of the {@link Header}
+ * Gets an {@link Iterator} of the current {@link HackitTag}s that are inside the {@link Header}
+ *
* @return {@link Iterator} of tags
*/
public Iterator<HackitTag> getTags(){
@@ -142,29 +143,40 @@ public class HackitTuple<K, T> implements Serializable, ActionGroup {
@Override
public String toString() {
- //TODO: change to String.format
- return "HackItTuple{" +
- "header=" + header +
- ", value=" + value +
- '}';
+ return String.format("HackItTuple{header=%s, value=%s}", header, value);
}
-
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Callback action}
+ */
@Override
public boolean hasCallback() {
return this.getHeader().hasCallback();
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Halt job action}
+ */
@Override
public boolean isHaltJob() {
return this.getHeader().isHaltJob();
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Send out action}
+ */
@Override
public boolean isSendOut() {
return this.getHeader().isSendOut();
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Skip action}
+ */
@Override
public boolean isSkip() {
return this.getHeader().isSkip();
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/Header.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/Header.java
index c08a2f0..d93bc21 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/Header.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/Header.java
@@ -29,7 +29,7 @@ import java.util.List;
import java.util.Set;
/**
- * Header is the container of the metadata asociated to one {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
+ * Header is the container of the metadata associated to one {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*
* @param <K> type of the identifier of the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*/
@@ -41,44 +41,44 @@ public abstract class Header<K> implements Serializable, ActionGroup {
private K id;
/**
- * child indicate the number of the child that the current header is from the
- * original {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple} and they share the
- * same identifier <code>id</code>
+ * Child indicates the number of the child corresponding to the current header, regarding the
+ * original (parent) {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}.
+ * Current child and Original (parent) have the same identifier <code>id</code>
*/
protected int child = 0;
/**
- * tags added to the header, this describe some action that need to be apply to the
+ * Tags added to the header, each tag describes some action that needs to be applied to the
* {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*/
private Set<HackitTag> tags;
/**
- * during the process of adding news {@link HackitTag} could add a new {@link org.apache.wayang.plugin.hackit.core.action.Action} at the header, and this
- * change the status of <code>has_callback_tag</code>
+ * During the process of adding new {@link HackitTag}s could be added new {@link org.apache.wayang.plugin.hackit.core.action.Action}s
+ * at the header. This change the status of <code>has_callback_tag</code>
*/
private boolean has_callback_tag = false;
/**
- * during the process of adding news {@link HackitTag} could add a new {@link org.apache.wayang.plugin.hackit.core.action.Action} at the header, and this
- * change the status of <code>has_skip_tag</code>
+ * During the process of adding new {@link HackitTag}s could be added new {@link org.apache.wayang.plugin.hackit.core.action.Action}s
+ * at the header. This change the status of <code>has_skip_tag</code>
*/
private boolean has_skip_tag = false;
/**
- * during the process of adding news {@link HackitTag} could add a new {@link org.apache.wayang.plugin.hackit.core.action.Action} at the header, and this
- * change the status of <code>has_sendout_tag</code>
+ * During the process of adding new {@link HackitTag}s could be added new {@link org.apache.wayang.plugin.hackit.core.action.Action}s
+ * at the header. This change the status of <code>has_sendout_tag</code>
*/
private boolean has_sendout_tag = false;
/**
- * during the process of adding news {@link HackitTag} could add a new {@link org.apache.wayang.plugin.hackit.core.action.Action} at the header, and this
- * change the status of <code>has_haltjob_tag</code>
+ * During the process of adding new {@link HackitTag}s could be added new {@link org.apache.wayang.plugin.hackit.core.action.Action}s
+ * at the header. This change the status of <code>has_haltjob_tag</code>
*/
private boolean has_haltjob_tag = false;
/**
- * Default Construct, this will call {@link #generateID()} and produce the new identifier
+ * Default Constructor, this will call {@link #generateID()} and produce the new identifier
*/
public Header() {
this.id = generateID();
@@ -94,7 +94,7 @@ public abstract class Header<K> implements Serializable, ActionGroup {
}
/**
- * Construct with the identifier and child identifier as parameter
+ * Constructor with identifier and child identifier as parameter
*
* @param id is the identifier of the Header
* @param child is the child identifier assigned
@@ -105,7 +105,7 @@ public abstract class Header<K> implements Serializable, ActionGroup {
}
/**
- * retrieve the identifier of the Header
+ * Retrieve the identifier of the Header and subsequently the identifier of the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*
* @return current identifier of type <code>K</code>
*/
@@ -115,24 +115,26 @@ public abstract class Header<K> implements Serializable, ActionGroup {
/**
* Add a {@link HackitTag} that could provide a new {@link org.apache.wayang.plugin.hackit.core.action.Action} to be
- * perfomed by Hackit to the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}, also update all the
- * possible action calling the method {@link #updateActionVector(HackitTag)}
+ * performed by Hackit to the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}, also update all the
+ * possible actions calling the method {@link #updateActionVector(HackitTag)}
*
* @param tag {@link HackitTag}
*/
public void addTag(HackitTag tag){
- //TODO: could be better to use an Set because it just saving uniques elements
+
if(this.tags == null){
this.tags = new HashSet<>();
}
- this.tags.add(tag);
+
//update all the possible actions on the {@link ActionGroup}
- //TODO: just execute this action when the element is inserted the first time
- updateActionVector(tag);
+ if(this.tags.add(tag)){
+ updateActionVector(tag);
+ }
+ ;
}
/**
- * do exactly the same of {@link #addTag(HackitTag)} but adding all the element at the same time
+ * Does exactly the same as {@link #addTag(HackitTag)}, but adding all the elements of the Set at the same time
*
* @param tags {@link Set} of {@link HackitTag} that will be added
*/
@@ -149,7 +151,7 @@ public abstract class Header<K> implements Serializable, ActionGroup {
}
/**
- * remove all the tags from the header, and set all the possible options as false
+ * Remove all {@link org.apache.wayang.plugin.hackit.core.tuple.header.Header}'s tags and set all possible options to false
*/
public void clearTags(){
this.tags.clear();
@@ -160,32 +162,32 @@ public abstract class Header<K> implements Serializable, ActionGroup {
}
/**
- * iterate provide an {@link Iterator} that contains all the {@link HackitTag} that were
- * add on the {@link #tags}
+ * Iterate provides an {@link Iterator} that contains all the {@link HackitTag}s that currently exists in {@link #tags}
*
- * If the {@link #tags} is null or empty it will return an {@link Collections#emptyIterator()}
+ * If {@link #tags} is null or empty, it will return an {@link Collections#emptyIterator()}
*
- * @return {@link Iterator} with the current {@link HackitTag}'s
+ * @return {@link Iterator} with the current {@link HackitTag}s
*/
public Iterator<HackitTag> iterate(){
- //TODO: maybe is need to add the option of empty
- if(this.tags == null){
+
+ if(this.tags == null || this.tags.isEmpty()){
return Collections.emptyIterator();
}
return this.tags.iterator();
}
/**
- * Generate a new header that it related on some way with the father header,
- * depending on the logic of the extender it will be way of generate the child
+ * Generates a new header {@link Header} that will be related to the father's header
+ * of this tuple {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}.
+ * Depending on the logic of the extender of this class, it will define a way to generate this child header {@link Header}
*
*
- * @return new {@link Header} that correspond to the child
+ * @return new {@link Header} that corresponds to the child
*/
public abstract Header<K> createChild();
/**
- * Generate a new identifier of type <code>K</code> that it will use inside of {@link #Header()}
+ * Generates a new identifier of type <code>K</code> that will be used inside of {@link #Header()}
*
* @return new identifier of type <code>K</code>
*/
@@ -193,19 +195,15 @@ public abstract class Header<K> implements Serializable, ActionGroup {
@Override
public String toString() {
- //TODO: maybe is better to change to String.format
- return "HackItTupleHeader{" +
- "id=" + id +
- ", child=" + child +
- '}';
+ return String.format("HackItTupleHeader{id=%s, child=%s}", id, child);
}
/**
- * Update the possible {@link org.apache.wayang.plugin.hackit.core.action.Action} that could be perfomed
- * over the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}, this is depending of the new
+ * Updates the possible {@link org.apache.wayang.plugin.hackit.core.action.Action} that could be performed
+ * over the {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}, this depends on the new
* {@link HackitTag}
*
- * @param tag {@link HackitTag} that could have new {@link org.apache.wayang.plugin.hackit.core.action.Action}'s
+ * @param tag {@link HackitTag} that could require new {@link org.apache.wayang.plugin.hackit.core.action.Action}s
*/
private void updateActionVector(HackitTag tag){
this.has_callback_tag = tag.hasCallback() || this.has_callback_tag;
@@ -214,21 +212,37 @@ public abstract class Header<K> implements Serializable, ActionGroup {
this.has_skip_tag = tag.isSkip() || this.has_skip_tag;
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Callback action}
+ */
@Override
public boolean hasCallback() {
return this.has_callback_tag;
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Halt job action}
+ */
@Override
public boolean isHaltJob() {
return this.has_haltjob_tag;
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Send out action}
+ */
@Override
public boolean isSendOut() {
return this.has_sendout_tag;
}
+ /**
+ *
+ * @return {@link Boolean that specifies if current tuple requires Skip action}
+ */
@Override
public boolean isSkip() {
return this.has_skip_tag;
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderBuilder.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderBuilder.java
index 98ae453..9a94bf2 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderBuilder.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderBuilder.java
@@ -17,16 +17,22 @@
*/
package org.apache.wayang.plugin.hackit.core.tuple.header;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* HeaderBuilder it the generator of {@link Header} to one kind of {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}
*/
public class HeaderBuilder {
+ //TODO: Use Wayang Configuration
+ Map<String, String> configuration;
/**
* Default Construct
*/
public HeaderBuilder(){
+ configuration = new HashMap<>();
//TODO: take from the configuration
}
@@ -38,7 +44,22 @@ public class HeaderBuilder {
*/
public <T> Header<T> generateHeader(){
//TODO: take and works from the configuration provided either on a file or by parameters at runtime
- return (Header<T>) new HeaderLong();
+ return (Header<T>) new HeaderLong(this.configuration);
+ }
+
+ public Map<String, String> getConfiguration() {
+ return configuration;
+ }
+
+ public String getConfiguration(String key) {
+ return configuration.get(key);
+ }
+
+ public void setConfiguration(Map<String, String> configuration) {
+ this.configuration = configuration;
}
+ public void setConfiguration(String key, String value){
+ this.configuration.put(key, value);
+ }
}
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderLong.java b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderLong.java
index 2bb6983..05ef482 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderLong.java
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/java/org/apache/wayang/plugin/hackit/core/tuple/header/HeaderLong.java
@@ -17,8 +17,10 @@
*/
package org.apache.wayang.plugin.hackit.core.tuple.header;
+import java.util.Map;
+
/**
- * HeaderLong extend {@link Header} just a simple implementation of correlative number
+ * HeaderLong extend {@link Header}. It is just a simple implementation with correlative numbers
*/
public class HeaderLong extends Header<Long> {
@@ -27,44 +29,56 @@ public class HeaderLong extends Header<Long> {
*/
static long base;
- /*
- TODO: maybe it need to be remove or change to be load form configurations
- */
static{
- base = 0;//(new Random()).nextLong();
+
+ base = 0;
+ //HeaderLong.getConfiguration().getLongProperty("wayang.hackit.core.headerlong.correlative.base");//0 or (new Random()).nextLong();
}
/**
* Default Construct
*/
- public HeaderLong() {
+ public HeaderLong(Map<String, String> configuration) {
super();
+ base = Long.parseLong(configuration.get("correlative.base"));
}
/**
- * Construct where is possible to define the identifier
+ * Constructor where it is possible to define the identifier
*
- * @param id is the identifier that it will be used by the {@link Header}
+ * @param id is the identifier that the {@link Header} will use
*/
public HeaderLong(Long id){
super(id);
}
/**
- * Construct where is possible to define the identifier and child number
+ * Constructor where it is possible to define the identifier and the child number
+ * This constructor assigns an identifier for the tuple relative to its parent
*
- * @param id is the identifier that it will be used by the {@link Header}
+ * @param id is the identifier that the {@link Header} will use
* @param child is the identifier as child of the original element giving by <code>id</code>
*/
public HeaderLong(Long id, int child) {
super(id, child);
}
+ /**
+ * Generates a new header {@link HeaderLong} that will be related to the father's header
+ * of this tuple {@link org.apache.wayang.plugin.hackit.core.tuple.HackitTuple}.
+ * Regarding the logic of this class, children will be differentiated by a correlative long
+ *
+ * @return a {@link HeaderLong} that corresponds to the current child
+ */
@Override
public HeaderLong createChild() {
return new HeaderLong(this.getId(), this.child++);
}
+ /**
+ *
+ * @return {@link Long} as an ID for the current Child
+ */
@Override
protected Long generateID() {
return base++;
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/resources/wayang-hackit-core-defaults.properties b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/resources/wayang-hackit-core-defaults.properties
new file mode 100644
index 0000000..2683d8c
--- /dev/null
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-core/src/main/resources/wayang-hackit-core-defaults.properties
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+wayang.hackit.core.headerlong.correlative.base = 0
\ No newline at end of file
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-shipper/pom.xml b/wayang-plugins/wayang-hackit/wayang-hackit-shipper/pom.xml
index c1e128f..d9ac095 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-shipper/pom.xml
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-shipper/pom.xml
@@ -33,9 +33,5 @@
<module>wayang-hackit-shipper-kafka</module>
</modules>
- <properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
- </properties>
</project>
diff --git a/wayang-plugins/wayang-hackit/wayang-hackit-shipper/wayang-hackit-shipper-kafka/pom.xml b/wayang-plugins/wayang-hackit/wayang-hackit-shipper/wayang-hackit-shipper-kafka/pom.xml
index 83fe74d..16c4d24 100644
--- a/wayang-plugins/wayang-hackit/wayang-hackit-shipper/wayang-hackit-shipper-kafka/pom.xml
+++ b/wayang-plugins/wayang-hackit/wayang-hackit-shipper/wayang-hackit-shipper-kafka/pom.xml
@@ -29,9 +29,4 @@
<artifactId>wayang-hackit-shipper-kafka</artifactId>
- <properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
- </properties>
-
</project>