forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
flink-core-api/src/main/java/org/apache/flink/api/connector/v2/Source.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.api.connector.v2; | ||
|
||
/** | ||
* Source interface for DataStream api v2. Note that this is a temporary approach, will be removed | ||
* in the future. | ||
*/ | ||
public interface Source<T> {} |
30 changes: 30 additions & 0 deletions
30
flink-core/src/main/java/org/apache/flink/api/connector/v2/SourceUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.api.connector.v2; | ||
|
||
import org.apache.flink.annotation.Experimental; | ||
|
||
/** Utils to convert a FLIP-27 based source to a DataStream V2 Source. */ | ||
@Experimental | ||
public final class SourceUtils { | ||
public static <T> Source<T> wrapSource( | ||
org.apache.flink.api.connector.source.Source<T, ?, ?> source) { | ||
return new WrappedSource<>(source); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
flink-core/src/main/java/org/apache/flink/api/connector/v2/WrappedSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.api.connector.v2; | ||
|
||
import org.apache.flink.annotation.Internal; | ||
|
||
/** A simple {@link Source} implementation that wrap a FLIP-27 source. */ | ||
@Internal | ||
public class WrappedSource<T> implements Source<T> { | ||
org.apache.flink.api.connector.source.Source<T, ?, ?> wrappedSource; | ||
|
||
public WrappedSource(org.apache.flink.api.connector.source.Source<T, ?, ?> wrappedSource) { | ||
this.wrappedSource = wrappedSource; | ||
} | ||
|
||
public org.apache.flink.api.connector.source.Source<T, ?, ?> getWrappedSource() { | ||
return wrappedSource; | ||
} | ||
} |