Skip to content

Commit

Permalink
[INLONG-4169][Sort] Add comments before classes (apache#4176)
Browse files Browse the repository at this point in the history
  • Loading branch information
EMsnap authored May 12, 2022
1 parent 8804a30 commit 76b9c64
Show file tree
Hide file tree
Showing 91 changed files with 313 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import java.util.HashMap;
import java.util.Map;

/**
* generator for flume config
*/
public class FlumeConfigGenerator {

public static final String KEY_TASK_NAME = "taskName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class ZkTools {

private static final Logger LOG = LoggerFactory.getLogger(ZkTools.class);

/**
* add a dataFlow to sort cluster by creating a zk node
*/
public static void addDataFlowToCluster(
String cluster,
long dataFlowId,
Expand All @@ -59,6 +62,9 @@ public static void addDataFlowToCluster(
LOG.info("Add dataFlow with id {} to cluster {} successfully", dataFlowId, cluster);
}

/**
* remove a dataFlow from sort cluster
*/
public static void removeDataFlowFromCluster(
String cluster,
long dataFlowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

import static org.apache.inlong.sort.configuration.ConfigOptions.key;

/**
* Constants used in sort
*/
public class Constants {

public static final long UNKNOWN_DATAFLOW_ID = -1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class FallbackKey {
// -------------------------
// Factory methods
// -------------------------

static FallbackKey createFallbackKey(String key) {
return new FallbackKey(key, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;

/**
* defines where to get the data flow info from
* only supports zookeeper now
*/
public class DataFlowStorageInfo implements Serializable {

private static final long serialVersionUID = -2785142086976967367L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

package org.apache.inlong.sort.protocol.deserialization;

/**
* Avro deserialization info
*/
public class AvroDeserializationInfo implements DeserializationInfo {

private static final long serialVersionUID = -5344203248610337314L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

import java.util.Objects;

/**
* Canal deserialization info
*/
public class CanalDeserializationInfo implements DeserializationInfo {

private static final long serialVersionUID = -5344203248610337314L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;

/**
* .
* Csv deserialization info
*/
public class CsvDeserializationInfo implements DeserializationInfo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;

/**
* Debezium deserialization info
*/
public class DebeziumDeserializationInfo implements DeserializationInfo {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

package org.apache.inlong.sort.protocol.deserialization;

/**
* Json deserialization info
*/
public class JsonDeserializationInfo implements DeserializationInfo {

private static final long serialVersionUID = -5344203248610337314L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;

/**
* .
* Kv deserialization info
*/
public class KvDeserializationInfo implements DeserializationInfo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
import java.util.List;
import java.util.Map;

/**
* extract node extracts data from external system
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
import java.util.List;
import java.util.Map;

/**
* node for inserting data to external system
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
import java.util.Map;
import java.util.TreeMap;

/**
* Base class for extract node \ load node \ transform node
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
import org.apache.inlong.sort.protocol.node.ExtractNode;
import org.apache.inlong.sort.protocol.transformation.WatermarkField;

/**
* Mysql extract node using debezium engine
*/
@EqualsAndHashCode(callSuper = true)
@JsonTypeName("mysqlExtract")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import java.util.HashMap;
import java.util.Map;


/**
* Interface class for data format
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
import java.util.List;
import java.util.Map;

/**
* hive load node with flink connectors
*/
@EqualsAndHashCode(callSuper = true)
@JsonTypeName("hiveLoad")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
import java.util.List;
import java.util.Map;

/**
* Kafka load node using kafka connectors provided by flink
*/
@EqualsAndHashCode(callSuper = true)
@JsonTypeName("kafkaLoad")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
import java.util.List;
import java.util.Map;

/**
* Base class for transform node, such as a distinct node
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package org.apache.inlong.sort.protocol.serialization;

/**
* basic info for avro serialization
*/
public class AvroSerializationInfo implements SerializationInfo {

private static final long serialVersionUID = 8446721117598285868L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package org.apache.inlong.sort.protocol.serialization;

/**
* basic info for canal serialization
*/
public class CanalSerializationInfo implements SerializationInfo {

private static final long serialVersionUID = 479443152335788151L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

import java.io.Serializable;

/**
* interface for serialization infos
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import org.apache.inlong.sort.protocol.transformation.operator.NotEqualOperator;
import org.apache.inlong.sort.protocol.transformation.operator.NotInOperator;

/**
* interface for all compare operators
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.inlong.sort.protocol.FieldInfo;

/**
* defines the mapping rules for data fields
*/
public class FieldMappingRule implements TransformationRule, Serializable {

private static final long serialVersionUID = -3285027125865704371L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeName;
import org.apache.inlong.sort.protocol.FieldInfo;


/**
* defines the relationship between fields
* from input to output field
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import org.apache.inlong.sort.protocol.transformation.function.MultiValueFilterFunction;
import org.apache.inlong.sort.protocol.transformation.function.SingleValueFilterFunction;

/**
* interface for filter functions
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
import org.apache.inlong.sort.protocol.transformation.function.SessionFunction;
import org.apache.inlong.sort.protocol.transformation.function.TumbleFunction;

/**
* top-level interface for window function in flink
* such as hop\session\tumble functions
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package org.apache.inlong.sort.protocol.transformation;

/**
* order direction used in a flink sql
*/
public enum OrderDirection {
/**
* Asc for order direction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import org.apache.inlong.sort.protocol.transformation.function.TumbleFunction;
import org.apache.inlong.sort.protocol.transformation.function.TumbleStartFunction;

/**
* interface for all the window functions appeared in flink
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import java.util.Arrays;
import java.util.List;

/**
* defines the field for generating watermarks
*/
@JsonTypeName("watermark")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import java.util.Arrays;
import java.util.List;

/**
* return hop end of a time window function
*/
@JsonTypeName("hopEnd")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
import java.util.Arrays;
import java.util.List;

/**
* The HOP function assigns elements to windows of fixed length.
* Like a TUMBLE windowing function, the size of the windows is configured by the window size
* parameter. An additional window slide parameter controls how frequently a hopping
* window is started. Hence, hopping windows can be overlapping if the slide is smaller
* than the window size. In this case, elements are assigned to multiple windows.
* Hopping windows are also known as “sliding windows”.
*/
@JsonTypeName("hop")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import java.util.Arrays;
import java.util.List;

/**
* hop start of a window function
*/
@JsonTypeName("hopStart")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
import java.util.List;
import java.util.stream.Collectors;


/**
* filter for filtering out data with multi-values
*/
@JsonTypeName("multiValueFilter")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import java.util.Arrays;
import java.util.List;

/**
* identifier for the end of a session window
*/
@JsonTypeName("sessionEnd")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
import java.util.Arrays;
import java.util.List;

/**
* The sliding windows assigner assigns elements to windows of fixed length.
* Similar to a tumbling windows assigner, the size of the windows is configured
* by the window size parameter. An additional window slide parameter
* controls how frequently a sliding window is started. Hence,
* sliding windows can be overlapping if the slide is smaller than the window size.
* In this case elements are assigned to multiple windows.
*/
@JsonTypeName("session")
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import java.util.Arrays;
import java.util.List;

/**
* session start for a session window function
*/
@JsonTypeName("sessionStart")
@Data
@NoArgsConstructor
Expand Down
Loading

0 comments on commit 76b9c64

Please sign in to comment.