/*
* 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.streaming.api.environment;
import org.apache.flink.annotation.Internal;
import org.apache.flink.annotation.Public;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.common.InvalidProgramException;
import org.apache.flink.api.common.JobExecutionResult;
import org.apache.flink.api.common.cache.DistributedCache;
import org.apache.flink.api.common.functions.InvalidTypesException;
import org.apache.flink.api.common.functions.StoppableFunction;
import org.apache.flink.api.common.io.FileInputFormat;
import org.apache.flink.api.common.io.FilePathFilter;
import org.apache.flink.api.common.io.InputFormat;
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import org.apache.flink.api.common.time.Time;
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.ClosureCleaner;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.io.TextInputFormat;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.typeutils.MissingTypeInfo;
import org.apache.flink.api.java.typeutils.PojoTypeInfo;
import org.apache.flink.api.java.typeutils.ResultTypeQueryable;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.client.program.ContextEnvironment;
import org.apache.flink.client.program.OptimizerPlanEnvironment;
import org.apache.flink.client.program.PreviewPlanEnvironment;
import org.apache.flink.configuration.ConfigConstants;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.RestOptions;
import org.apache.flink.core.fs.Path;
import org.apache.flink.runtime.state.AbstractStateBackend;
import org.apache.flink.runtime.state.KeyGroupRangeAssignment;
import org.apache.flink.runtime.state.StateBackend;
import org.apache.flink.streaming.api.CheckpointingMode;
import org.apache.flink.streaming.api.TimeCharacteristic;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.functions.source.*;
import org.apache.flink.streaming.api.graph.StreamGraph;
import org.apache.flink.streaming.api.graph.StreamGraphGenerator;
import org.apache.flink.streaming.api.operators.StoppableStreamSource;
import org.apache.flink.streaming.api.operators.StreamSource;
import org.apache.flink.streaming.api.transformations.StreamTransformation;
import org.apache.flink.util.Preconditions;
import org.apache.flink.util.SplittableIterator;
import org.apache.flink.util.StringUtils;
import com.esotericsoftware.kryo.Serializer;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import static org.apache.flink.util.Preconditions.checkNotNull;
/**
* The StreamExecutionEnvironment is the context in which a streaming program is executed. A
* {@link LocalStreamEnvironment} will cause execution in the current JVM, a
* {@link RemoteStreamEnvironment} will cause execution on a remote setup.
*
* <p>The environment provides methods to control the job execution (such as setting the parallelism
* or the fault tolerance/checkpointing parameters) and to interact with the outside world (data access).
*
* @see org.apache.flink.streaming.api.environment.LocalStreamEnvironment
* @see org.apache.flink.streaming.api.environment.RemoteStreamEnvironment
*/
@Public
public abstract class StreamExecutionEnvironment {
/** The default name to use for a streaming job if no other name has been specified. */
public static final String DEFAULT_JOB_NAME = "Flink Streaming Job";
/** The time characteristic that is used if none other is set. */
private static final TimeCharacteristic DEFAULT_TIME_CHARACTERISTIC = TimeCharacteristic.ProcessingTime;
/** The default buffer timeout (max delay of records in the network stack). */
private static final long DEFAULT_NETWORK_BUFFER_TIMEOUT = 100L;
/**
* The environment of the context (local by default, cluster if invoked through command line).
*/
private static ThreadLocal<StreamExecutionEnvironmentFactory> contextEnvironmentFactory = new ThreadLocal<>();
/** The default parallelism used when creating a local environment. */
private static int defaultLocalParallelism = Runtime.getRuntime().availableProcessors();
// ------------------------------------------------------------------------
/** The execution configuration for this environment. */
private final ExecutionConfig config = new ExecutionConfig();
/** Settings that control the checkpointing behavior. */
private final CheckpointConfig checkpointCfg = new CheckpointConfig();
protected final List<StreamTransformation<?>> transformations = new ArrayList<>();
private long bufferTimeout = DEFAULT_NETWORK_BUFFER_TIMEOUT;
protected boolean isChainingEnabled = true;
/** The state backend used for storing k/v state and state snapshots. */
private StateBackend defaultStateBackend;
/** The time characteristic used by the data streams. */
private TimeCharacteristic timeCharacteristic = DEFAULT_TIME_CHARACTERISTIC;
protected final List<Tuple2<String, DistributedCache.DistributedCacheEntry>> cacheFile = new ArrayList<>();
// --------------------------------------------------------------------------------------------
// Constructor and Properties
// --------------------------------------------------------------------------------------------
/**
* Gets the config object.
*/
public ExecutionConfig getConfig() {
return config;
}
/**
* Get the list of cached files that were registered for distribution among the task managers.
*/
public List<Tuple2<String, DistributedCache.DistributedCacheEntry>> getCachedFiles() {
return cacheFile;
}
/**
* Sets the parallelism for operations executed through this environment.
* Setting a parallelism of x here will cause all operators (such as map,
* batchReduce) to run with x parallel instances. This method overrides the
* default parallelism for this environment. The
* {@link LocalStreamEnvironment} uses by default a value equal to the
* number of hardware contexts (CPU cores / threads). When executing the
* program via the command line client from a JAR file, the default degree
* of parallelism is the one configured for that setup.
*
* @param parallelism The parallelism
*/
public StreamExecutionEnvironment setParallelism(int parallelism) {
config.setParallelism(parallelism);
return this;
}
/**
* Sets the maximum degree of parallelism defined for the program. The upper limit (inclusive)
* is Short.MAX_VALUE.
*
* <p>The maximum degree of
没有合适的资源?快使用搜索试试~ 我知道了~
FlinkX是在是袋鼠云内部广泛使用的基于flink的分布式离线数据同步框架,实现了多种异构数据源之间高效的数据迁移
共551个文件
java:349个
xml:93个
json:43个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 36 浏览量
2024-03-15
12:00:16
上传
评论
收藏 9.21MB ZIP 举报
温馨提示
FlinkX是在是袋鼠云内部广泛使用的基于flink的分布式离线数据同步框架,实现了多种异构数据源之间高效的数据迁移。不同的数据源头被抽象成不同的Reader插件,不同的数据目标被抽象成不同的Writer插件。理论上,FlinkX框架可以支持任意数据源类型的数据同步工作。作为一套生态系统,每接入一套新数据源该新加入的数据源即可实现和现有的数据源互通。
资源推荐
资源详情
资源评论
收起资源包目录
FlinkX是在是袋鼠云内部广泛使用的基于flink的分布式离线数据同步框架,实现了多种异构数据源之间高效的数据迁移 (551个子文件)
flinkx 1KB
.gitignore 144B
.gitignore 133B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 105B
.gitignore 73B
java.header 801B
ojdbc8-12.2.0.1.jar 3.82MB
db2jcc-3.72.44.jar 3.64MB
gbase-8.3.81.53.jar 787KB
StreamExecutionEnvironment.java 83KB
ExecutionEnvironment.java 60KB
HiveConnection.java 52KB
JdbcInputFormat.java 28KB
HbaseOutputFormat.java 21KB
OdpsUtil.java 19KB
RichOutputFormat.java 18KB
DBUtil.java 16KB
HdfsParquetOutputFormat.java 15KB
CarbonDictionaryUtil.java 14KB
DBUtil.java 14KB
HbaseInputFormat.java 14KB
HiveUtil.java 14KB
LocalTest.java 13KB
SFtpHandler.java 13KB
JdbcOutputFormat.java 13KB
HdfsParquetInputFormat.java 13KB
AbstractPrometheusReporter.java 12KB
DateTimeUtils.java 12KB
FtpHandler.java 12KB
CarbonTypeConverter.java 12KB
FileOutputFormat.java 11KB
HiveOutputFormat.java 11KB
FtpOutputFormat.java 10KB
HdfsOrcOutputFormat.java 10KB
HdfsOutputFormat.java 10KB
RetryUtil.java 10KB
CarbonOutputFormat.java 10KB
RetryUtil.java 10KB
DistributedJdbcInputFormat.java 10KB
HdfsOrcInputFormat.java 10KB
DateUtil.java 10KB
KuduUtil.java 10KB
BinlogInputFormat.java 9KB
AbstractRecordWriter.java 9KB
HbaseHelper.java 9KB
RichInputFormat.java 9KB
DateUtil.java 9KB
CarbondataInputFormat.java 9KB
HdfsTextOutputFormat.java 8KB
HivePartitionRecordWriter.java 8KB
DtInputFormatSourceFunction.java 8KB
RangeSplitUtil.java 8KB
HiveWriter.java 8KB
Launcher.java 8KB
AccumulatorCollector.java 8KB
MongodbUtil.java 8KB
KerberosUtil.java 7KB
HdfsTextInputFormat.java 7KB
Main.java 7KB
JdbcDataReader.java 7KB
QuerySqlBuilder.java 7KB
HdfsUtil.java 7KB
EsUtil.java 7KB
StringUtil.java 7KB
OdpsInputFormat.java 7KB
BaseDatabaseMeta.java 7KB
ClusterClientFactory.java 6KB
OdpsOutputFormat.java 6KB
DictionaryLoadModel.java 6KB
CarbonPartitionRecordWriter.java 6KB
DtOutputFormatSinkFunction.java 6KB
EsInputFormat.java 6KB
KuduConfig.java 6KB
FunctionParser.java 6KB
MyLocalStreamEnvironment.java 6KB
DataWriter.java 6KB
AbstractConfig.java 6KB
RedisOutputFormat.java 6KB
MongodbInputFormat.java 6KB
FtpInputFormat.java 6KB
ExampleGenerator.java 6KB
KuduInputFormat.java 6KB
FileSystemUtil.java 6KB
共 551 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6735
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功