File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
modules/scala-api/src/main/scala/org/apache/flinkx/api Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,19 @@ class DataStream[T](stream: JavaStream[T]) {
609609 }
610610 filter(filterFun)
611611 }
612+
613+ /** Creates a new DataStream that contains only the elements not satisfying the given filter predicate.
614+ */
615+ def filterNot (fun : T => Boolean ): DataStream [T ] = {
616+ if (fun == null ) {
617+ throw new NullPointerException (" FilteNot function must not be null." )
618+ }
619+ val cleanFun = clean(fun)
620+ val filterFun = new FilterFunction [T ] {
621+ def filter (in : T ): Boolean = ! cleanFun(in)
622+ }
623+ filter(filterFun)
624+ }
612625
613626 /** Windows this [[DataStream ]] into sliding count windows.
614627 *
Original file line number Diff line number Diff line change @@ -825,6 +825,15 @@ object StreamExecutionEnvironment {
825825 new StreamExecutionEnvironment (JavaEnv .getExecutionEnvironment)
826826 }
827827
828+ /** Creates an execution environment that represents the context in which the program is currently executed.
829+ *
830+ * @param configuration
831+ * Pass a custom configuration into the cluster.
832+ */
833+ def getExecutionEnvironment (configuration : Configuration ): StreamExecutionEnvironment = {
834+ new StreamExecutionEnvironment (JavaEnv .getExecutionEnvironment(configuration))
835+ }
836+
828837 // --------------------------------------------------------------------------
829838 // local environment
830839 // --------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments