Skip to content

Commit

Permalink
some more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
phil3k committed Oct 22, 2017
1 parent 4def369 commit 73c71ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/main/java/at/datasciencelabs/EsperSelectFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@
* @param <OUT> Type of the output DataStream
*/
public interface EsperSelectFunction<OUT> extends Function, Serializable {

/**
* Select by transforming an {@link EventBean} to an instance of the OUT type.
* @param eventBean Result event of an esper pattern
* @return The transformed instance
* @throws Exception If there is an error in the transformation.
*/
OUT select(EventBean eventBean) throws Exception;
}
2 changes: 1 addition & 1 deletion src/main/java/at/datasciencelabs/EsperStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public <R> SingleOutputStreamOperator<R> select(EsperSelectFunction<R> esperSele

SingleOutputStreamOperator<R> patternStream;

// TODO until the typeextractor is capable of extracing non-generic parameters, the return type has to be passed in manually
// TODO until the type extractor is capable of extracting non-generic parameters, the return type has to be passed in manually

final boolean isProcessingTime = inputStream.getExecutionEnvironment().getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime;
patternStream = inputStream.keyBy(keySelector).transform("SelectEsperOperator", dataStreamReturnType, new SelectEsperStreamOperator<Byte, IN, R>(inputStream.getType(), esperSelectFunction, isProcessingTime, esperQuery));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public class SelectEsperStreamOperator<KEY, IN, OUT> extends AbstractUdfStreamOp
/**
* Constructs a new operator. Requires the type of the input DataStream to register its Event Type at Esper.
* Currently only processing time evaluation is supported.
* @param inputStreamType
* @param esperSelectFunction
* @param isProcessingTime
* @param esperQuery
* @param inputStreamType type of the input DataStream
* @param esperSelectFunction function to select from Esper's output
* @param isProcessingTime Flag indicating how time is interpreted (processing time vs event time)
* @param esperQuery The esper query
*/
public SelectEsperStreamOperator(TypeInformation<IN> inputStreamType, EsperSelectFunction<OUT> esperSelectFunction, boolean isProcessingTime, String esperQuery) {
super(esperSelectFunction);
Expand Down

0 comments on commit 73c71ae

Please sign in to comment.