Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
302c6741
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
302c6741
编写于
5月 18, 2017
作者:
Z
zjureel
提交者:
zentol
5月 22, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-6495] Migrate Akka configuration options
This closes #3935.
上级
9a9e193a
变更
43
隐藏空白更改
内联
并排
Showing
43 changed file
with
324 addition
and
157 deletion
+324
-157
flink-clients/src/test/java/org/apache/flink/client/program/ClientConnectionTest.java
...org/apache/flink/client/program/ClientConnectionTest.java
+3
-2
flink-clients/src/test/java/org/apache/flink/client/program/ClientTest.java
...test/java/org/apache/flink/client/program/ClientTest.java
+2
-1
flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkClient.java
...src/main/java/org/apache/flink/storm/api/FlinkClient.java
+3
-2
flink-core/src/main/java/org/apache/flink/configuration/AkkaOptions.java
...main/java/org/apache/flink/configuration/AkkaOptions.java
+93
-9
flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
.../java/org/apache/flink/configuration/ConfigConstants.java
+92
-0
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosTaskManagerRunner.java
...esos/runtime/clusterframework/MesosTaskManagerRunner.java
+2
-1
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/metrics/MetricFetcher.java
...pache/flink/runtime/webmonitor/metrics/MetricFetcher.java
+2
-2
flink-runtime/src/main/java/org/apache/flink/runtime/client/JobAttachmentClientActor.java
...apache/flink/runtime/client/JobAttachmentClientActor.java
+2
-2
flink-runtime/src/main/java/org/apache/flink/runtime/client/JobSubmissionClientActor.java
...apache/flink/runtime/client/JobSubmissionClientActor.java
+2
-2
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/FlinkResourceManager.java
.../flink/runtime/clusterframework/FlinkResourceManager.java
+2
-2
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FailureRateRestartStrategy.java
...me/executiongraph/restart/FailureRateRestartStrategy.java
+2
-1
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
...ime/executiongraph/restart/FixedDelayRestartStrategy.java
+3
-3
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
...untime/executiongraph/restart/RestartStrategyFactory.java
+3
-3
flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateClient.java
.../org/apache/flink/runtime/query/QueryableStateClient.java
+3
-5
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerConfiguration.java
...runtime/resourcemanager/ResourceManagerConfiguration.java
+4
-4
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java
...resourcemanager/slotmanager/SlotManagerConfiguration.java
+3
-9
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java
...rg/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java
+2
-4
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerConfiguration.java
.../flink/runtime/taskexecutor/TaskManagerConfiguration.java
+2
-1
flink-runtime/src/main/scala/org/apache/flink/runtime/akka/AkkaUtils.scala
.../main/scala/org/apache/flink/runtime/akka/AkkaUtils.scala
+22
-43
flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
...g/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
+4
-4
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/ResourceManagerTest.java
...e/flink/runtime/clusterframework/ResourceManagerTest.java
+3
-3
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PartialConsumePipelinedResultTest.java
.../network/partition/PartialConsumePipelinedResultTest.java
+2
-1
flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerTest.java
...a/org/apache/flink/runtime/jobmanager/JobManagerTest.java
+2
-1
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerComponentsStartupShutdownTest.java
...taskmanager/TaskManagerComponentsStartupShutdownTest.java
+4
-3
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
...link/runtime/taskmanager/TaskManagerRegistrationTest.java
+5
-4
flink-runtime/src/test/java/org/apache/flink/runtime/testutils/ZooKeeperTestUtils.java
...rg/apache/flink/runtime/testutils/ZooKeeperTestUtils.java
+5
-4
flink-runtime/src/test/scala/org/apache/flink/runtime/akka/AkkaSslITCase.scala
...t/scala/org/apache/flink/runtime/akka/AkkaSslITCase.scala
+3
-3
flink-runtime/src/test/scala/org/apache/flink/runtime/jobmanager/JobManagerConnectionTest.scala
...e/flink/runtime/jobmanager/JobManagerConnectionTest.scala
+2
-2
flink-runtime/src/test/scala/org/apache/flink/runtime/jobmanager/RecoveryITCase.scala
.../org/apache/flink/runtime/jobmanager/RecoveryITCase.scala
+2
-2
flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingUtils.scala
.../org/apache/flink/runtime/testingUtils/TestingUtils.scala
+2
-2
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
...c/main/java/org/apache/flink/test/util/TestBaseUtils.java
+6
-5
flink-tests/src/test/java/org/apache/flink/test/accumulators/AccumulatorLiveITCase.java
...apache/flink/test/accumulators/AccumulatorLiveITCase.java
+2
-1
flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java
...a/org/apache/flink/test/cancelling/CancelingTestBase.java
+2
-1
flink-tests/src/test/java/org/apache/flink/test/checkpointing/EventTimeAllWindowCheckpointingITCase.java
.../checkpointing/EventTimeAllWindowCheckpointingITCase.java
+3
-2
flink-tests/src/test/java/org/apache/flink/test/classloading/jar/StreamingCustomInputSplitProgram.java
...st/classloading/jar/StreamingCustomInputSplitProgram.java
+2
-2
flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/RemoteEnvironmentITCase.java
.../flink/test/javaApiOperators/RemoteEnvironmentITCase.java
+3
-2
flink-tests/src/test/java/org/apache/flink/test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java
...covery/AbstractTaskManagerProcessFailureRecoveryTest.java
+6
-5
flink-tests/src/test/java/org/apache/flink/test/recovery/ChaosMonkeyITCase.java
...ava/org/apache/flink/test/recovery/ChaosMonkeyITCase.java
+4
-3
flink-tests/src/test/java/org/apache/flink/test/recovery/ProcessFailureCancelingITCase.java
...he/flink/test/recovery/ProcessFailureCancelingITCase.java
+5
-5
flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerFailureRecoveryITCase.java
...flink/test/recovery/TaskManagerFailureRecoveryITCase.java
+4
-3
flink-tests/src/test/java/org/apache/flink/test/runtime/leaderelection/ZooKeeperLeaderElectionITCase.java
...runtime/leaderelection/ZooKeeperLeaderElectionITCase.java
+2
-1
flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskExecutorRunner.java
...in/java/org/apache/flink/yarn/YarnTaskExecutorRunner.java
+2
-1
flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskManagerRunner.java
...ain/java/org/apache/flink/yarn/YarnTaskManagerRunner.java
+2
-1
未找到文件。
flink-clients/src/test/java/org/apache/flink/client/program/ClientConnectionTest.java
浏览文件 @
302c6741
...
@@ -21,6 +21,7 @@ package org.apache.flink.client.program;
...
@@ -21,6 +21,7 @@ package org.apache.flink.client.program;
import
akka.actor.ActorRef
;
import
akka.actor.ActorRef
;
import
akka.actor.ActorSystem
;
import
akka.actor.ActorSystem
;
import
akka.actor.Props
;
import
akka.actor.Props
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.core.testutils.CommonTestUtils
;
import
org.apache.flink.core.testutils.CommonTestUtils
;
...
@@ -92,8 +93,8 @@ public class ClientConnectionTest extends TestLogger {
...
@@ -92,8 +93,8 @@ public class ClientConnectionTest extends TestLogger {
private
static
void
testFailureBehavior
(
final
InetSocketAddress
unreachableEndpoint
)
throws
Exception
{
private
static
void
testFailureBehavior
(
final
InetSocketAddress
unreachableEndpoint
)
throws
Exception
{
final
Configuration
config
=
new
Configuration
();
final
Configuration
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_ASK_TIMEOUT
,
(
ASK_STARTUP_TIMEOUT
)
+
" ms"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
ASK_STARTUP_TIMEOUT
+
" ms"
);
config
.
setString
(
ConfigConstants
.
AKKA_LOOKUP_TIMEOUT
,
(
CONNECT_TIMEOUT
)
+
" ms"
);
config
.
setString
(
AkkaOptions
.
LOOKUP_TIMEOUT
,
CONNECT_TIMEOUT
+
" ms"
);
config
.
setString
(
ConfigConstants
.
JOB_MANAGER_IPC_ADDRESS_KEY
,
unreachableEndpoint
.
getHostName
());
config
.
setString
(
ConfigConstants
.
JOB_MANAGER_IPC_ADDRESS_KEY
,
unreachableEndpoint
.
getHostName
());
config
.
setInteger
(
ConfigConstants
.
JOB_MANAGER_IPC_PORT_KEY
,
unreachableEndpoint
.
getPort
());
config
.
setInteger
(
ConfigConstants
.
JOB_MANAGER_IPC_PORT_KEY
,
unreachableEndpoint
.
getPort
());
...
...
flink-clients/src/test/java/org/apache/flink/client/program/ClientTest.java
浏览文件 @
302c6741
...
@@ -32,6 +32,7 @@ import org.apache.flink.api.java.ExecutionEnvironment;
...
@@ -32,6 +32,7 @@ import org.apache.flink.api.java.ExecutionEnvironment;
import
org.apache.flink.api.java.io.DiscardingOutputFormat
;
import
org.apache.flink.api.java.io.DiscardingOutputFormat
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.client.program.DetachedEnvironment.DetachedJobExecutionResult
;
import
org.apache.flink.client.program.DetachedEnvironment.DetachedJobExecutionResult
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.optimizer.DataStatistics
;
import
org.apache.flink.optimizer.DataStatistics
;
...
@@ -97,7 +98,7 @@ public class ClientTest extends TestLogger {
...
@@ -97,7 +98,7 @@ public class ClientTest extends TestLogger {
config
=
new
Configuration
();
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
JOB_MANAGER_IPC_ADDRESS_KEY
,
"localhost"
);
config
.
setString
(
ConfigConstants
.
JOB_MANAGER_IPC_ADDRESS_KEY
,
"localhost"
);
config
.
setInteger
(
ConfigConstants
.
JOB_MANAGER_IPC_PORT_KEY
,
freePort
);
config
.
setInteger
(
ConfigConstants
.
JOB_MANAGER_IPC_PORT_KEY
,
freePort
);
config
.
setString
(
ConfigConstants
.
AKKA_ASK_TIMEOUT
,
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
AkkaOptions
.
ASK_TIMEOUT
.
defaultValue
()
);
try
{
try
{
scala
.
Tuple2
<
String
,
Object
>
address
=
new
scala
.
Tuple2
<
String
,
Object
>(
"localhost"
,
freePort
);
scala
.
Tuple2
<
String
,
Object
>
address
=
new
scala
.
Tuple2
<
String
,
Object
>(
"localhost"
,
freePort
);
...
...
flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkClient.java
浏览文件 @
302c6741
...
@@ -39,6 +39,7 @@ import org.apache.flink.client.program.ClusterClient;
...
@@ -39,6 +39,7 @@ import org.apache.flink.client.program.ClusterClient;
import
org.apache.flink.client.program.JobWithJars
;
import
org.apache.flink.client.program.JobWithJars
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.client.program.StandaloneClusterClient
;
import
org.apache.flink.client.program.StandaloneClusterClient
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
...
@@ -269,7 +270,7 @@ public class FlinkClient {
...
@@ -269,7 +270,7 @@ public class FlinkClient {
JobID
getTopologyJobId
(
final
String
id
)
{
JobID
getTopologyJobId
(
final
String
id
)
{
final
Configuration
configuration
=
GlobalConfiguration
.
loadConfiguration
();
final
Configuration
configuration
=
GlobalConfiguration
.
loadConfiguration
();
if
(
this
.
timeout
!=
null
)
{
if
(
this
.
timeout
!=
null
)
{
configuration
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
this
.
timeout
);
configuration
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
this
.
timeout
);
}
}
try
{
try
{
...
@@ -309,7 +310,7 @@ public class FlinkClient {
...
@@ -309,7 +310,7 @@ public class FlinkClient {
private
FiniteDuration
getTimeout
()
{
private
FiniteDuration
getTimeout
()
{
final
Configuration
configuration
=
GlobalConfiguration
.
loadConfiguration
();
final
Configuration
configuration
=
GlobalConfiguration
.
loadConfiguration
();
if
(
this
.
timeout
!=
null
)
{
if
(
this
.
timeout
!=
null
)
{
configuration
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
this
.
timeout
);
configuration
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
this
.
timeout
);
}
}
return
AkkaUtils
.
getClientTimeout
(
configuration
);
return
AkkaUtils
.
getClientTimeout
(
configuration
);
...
...
flink-core/src/main/java/org/apache/flink/configuration/AkkaOptions.java
浏览文件 @
302c6741
...
@@ -29,30 +29,114 @@ import org.apache.flink.annotation.PublicEvolving;
...
@@ -29,30 +29,114 @@ import org.apache.flink.annotation.PublicEvolving;
public
class
AkkaOptions
{
public
class
AkkaOptions
{
/**
/**
* Timeout for akka ask calls
* Timeout for akka ask calls
.
*/
*/
public
static
final
ConfigOption
<
String
>
A
KKA_A
SK_TIMEOUT
=
ConfigOptions
public
static
final
ConfigOption
<
String
>
ASK_TIMEOUT
=
ConfigOptions
.
key
(
"akka.ask.timeout"
)
.
key
(
"akka.ask.timeout"
)
.
defaultValue
(
"10 s"
);
.
defaultValue
(
"10 s"
);
/**
* The Akka death watch heartbeat interval.
*/
public
static
final
ConfigOption
<
String
>
WATCH_HEARTBEAT_INTERVAL
=
ConfigOptions
.
key
(
"akka.watch.heartbeat.interval"
)
.
defaultValue
(
ASK_TIMEOUT
.
defaultValue
());
/**
* The maximum acceptable Akka death watch heartbeat pause.
*/
public
static
final
ConfigOption
<
String
>
WATCH_HEARTBEAT_PAUSE
=
ConfigOptions
.
key
(
"akka.watch.heartbeat.pause"
)
.
defaultValue
(
ASK_TIMEOUT
.
defaultValue
());
/**
/**
* The Akka tcp connection timeout.
* The Akka tcp connection timeout.
*/
*/
public
static
final
ConfigOption
<
String
>
AKKA_
TCP_TIMEOUT
=
ConfigOptions
public
static
final
ConfigOption
<
String
>
TCP_TIMEOUT
=
ConfigOptions
.
key
(
"akka.tcp.timeout"
)
.
key
(
"akka.tcp.timeout"
)
.
defaultValue
(
"20 s"
);
.
defaultValue
(
"20 s"
);
/**
/**
* T
he Akka death watch heartbeat interval
.
* T
imeout for the startup of the actor system
.
*/
*/
public
static
final
ConfigOption
<
String
>
AKKA_WATCH_HEARTBEAT_INTERVAL
=
ConfigOptions
public
static
final
ConfigOption
<
String
>
STARTUP_TIMEOUT
=
ConfigOptions
.
key
(
"akka.watch.heartbeat.interval"
)
.
key
(
"akka.startup-timeout"
)
.
noDefaultValue
();
/**
* Heartbeat interval of the transport failure detector.
*/
public
static
final
ConfigOption
<
String
>
TRANSPORT_HEARTBEAT_INTERVAL
=
ConfigOptions
.
key
(
"akka.transport.heartbeat.interval"
)
.
defaultValue
(
"1000 s"
);
/**
* Allowed heartbeat pause for the transport failure detector.
*/
public
static
final
ConfigOption
<
String
>
TRANSPORT_HEARTBEAT_PAUSE
=
ConfigOptions
.
key
(
"akka.transport.heartbeat.pause"
)
.
defaultValue
(
"6000 s"
);
/**
* Detection threshold of transport failure detector.
*/
public
static
final
ConfigOption
<
Double
>
TRANSPORT_THRESHOLD
=
ConfigOptions
.
key
(
"akka.transport.threshold"
)
.
defaultValue
(
300.0
);
/**
* Detection threshold for the phi accrual watch failure detector.
*/
public
static
final
ConfigOption
<
Integer
>
WATCH_THRESHOLD
=
ConfigOptions
.
key
(
"akka.watch.threshold"
)
.
defaultValue
(
12
);
/**
* Override SSL support for the Akka transport.
*/
public
static
final
ConfigOption
<
Boolean
>
SSL_ENABLED
=
ConfigOptions
.
key
(
"akka.ssl.enabled"
)
.
defaultValue
(
true
);
/**
* Maximum framesize of akka messages.
*/
public
static
final
ConfigOption
<
String
>
FRAMESIZE
=
ConfigOptions
.
key
(
"akka.framesize"
)
.
defaultValue
(
"10485760b"
);
/**
* Maximum number of messages until another actor is executed by the same thread.
*/
public
static
final
ConfigOption
<
Integer
>
DISPATCHER_THROUGHPUT
=
ConfigOptions
.
key
(
"akka.throughput"
)
.
defaultValue
(
15
);
/**
* Log lifecycle events.
*/
public
static
final
ConfigOption
<
Boolean
>
LOG_LIFECYCLE_EVENTS
=
ConfigOptions
.
key
(
"akka.log.lifecycle.events"
)
.
defaultValue
(
false
);
/**
* Timeout for all blocking calls that look up remote actors.
*/
public
static
final
ConfigOption
<
String
>
LOOKUP_TIMEOUT
=
ConfigOptions
.
key
(
"akka.lookup.timeout"
)
.
defaultValue
(
"10 s"
);
.
defaultValue
(
"10 s"
);
/**
/**
* T
he maximum acceptable Akka death watch heartbeat paus
e.
* T
imeout for all blocking calls on the client sid
e.
*/
*/
public
static
final
ConfigOption
<
String
>
AKKA_WATCH_HEARTBEAT_PAUSE
=
ConfigOptions
public
static
final
ConfigOption
<
String
>
CLIENT_TIMEOUT
=
ConfigOptions
.
key
(
"akka.
watch.heartbeat.pause
"
)
.
key
(
"akka.
client.timeout
"
)
.
defaultValue
(
"60 s"
);
.
defaultValue
(
"60 s"
);
/**
* Exit JVM on fatal Akka errors.
*/
public
static
final
ConfigOption
<
Boolean
>
JVM_EXIT_ON_FATAL_ERROR
=
ConfigOptions
.
key
(
"akka.jvm-exit-on-fatal-error"
)
.
defaultValue
(
true
);
}
}
flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
浏览文件 @
302c6741
...
@@ -708,82 +708,130 @@ public final class ConfigConstants {
...
@@ -708,82 +708,130 @@ public final class ConfigConstants {
/**
/**
* Timeout for the startup of the actor system
* Timeout for the startup of the actor system
*
* @deprecated Use {@link AkkaOptions#STARTUP_TIMEOUT} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_STARTUP_TIMEOUT
=
"akka.startup-timeout"
;
public
static
final
String
AKKA_STARTUP_TIMEOUT
=
"akka.startup-timeout"
;
/**
/**
* Heartbeat interval of the transport failure detector
* Heartbeat interval of the transport failure detector
*
* @deprecated Use {@link AkkaOptions#TRANSPORT_HEARTBEAT_INTERVAL} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_TRANSPORT_HEARTBEAT_INTERVAL
=
"akka.transport.heartbeat.interval"
;
public
static
final
String
AKKA_TRANSPORT_HEARTBEAT_INTERVAL
=
"akka.transport.heartbeat.interval"
;
/**
/**
* Allowed heartbeat pause for the transport failure detector
* Allowed heartbeat pause for the transport failure detector
*
* @deprecated Use {@link AkkaOptions#TRANSPORT_HEARTBEAT_PAUSE} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_TRANSPORT_HEARTBEAT_PAUSE
=
"akka.transport.heartbeat.pause"
;
public
static
final
String
AKKA_TRANSPORT_HEARTBEAT_PAUSE
=
"akka.transport.heartbeat.pause"
;
/**
/**
* Detection threshold of transport failure detector
* Detection threshold of transport failure detector
*
* @deprecated Use {@link AkkaOptions#TRANSPORT_THRESHOLD} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_TRANSPORT_THRESHOLD
=
"akka.transport.threshold"
;
public
static
final
String
AKKA_TRANSPORT_THRESHOLD
=
"akka.transport.threshold"
;
/**
/**
* Heartbeat interval of watch failure detector
* Heartbeat interval of watch failure detector
*
* @deprecated Use {@link AkkaOptions#WATCH_HEARTBEAT_INTERVAL} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_WATCH_HEARTBEAT_INTERVAL
=
"akka.watch.heartbeat.interval"
;
public
static
final
String
AKKA_WATCH_HEARTBEAT_INTERVAL
=
"akka.watch.heartbeat.interval"
;
/**
/**
* Allowed heartbeat pause for the watch failure detector
* Allowed heartbeat pause for the watch failure detector
*
* @deprecated Use {@link AkkaOptions#WATCH_HEARTBEAT_PAUSE} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_WATCH_HEARTBEAT_PAUSE
=
"akka.watch.heartbeat.pause"
;
public
static
final
String
AKKA_WATCH_HEARTBEAT_PAUSE
=
"akka.watch.heartbeat.pause"
;
/**
/**
* Detection threshold for the phi accrual watch failure detector
* Detection threshold for the phi accrual watch failure detector
*
* @deprecated Use {@link AkkaOptions#WATCH_THRESHOLD} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_WATCH_THRESHOLD
=
"akka.watch.threshold"
;
public
static
final
String
AKKA_WATCH_THRESHOLD
=
"akka.watch.threshold"
;
/**
/**
* Akka TCP timeout
* Akka TCP timeout
*
* @deprecated Use {@link AkkaOptions#TCP_TIMEOUT} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_TCP_TIMEOUT
=
"akka.tcp.timeout"
;
public
static
final
String
AKKA_TCP_TIMEOUT
=
"akka.tcp.timeout"
;
/**
/**
* Override SSL support for the Akka transport
* Override SSL support for the Akka transport
*
* @deprecated Use {@link AkkaOptions#SSL_ENABLED} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_SSL_ENABLED
=
"akka.ssl.enabled"
;
public
static
final
String
AKKA_SSL_ENABLED
=
"akka.ssl.enabled"
;
/**
/**
* Maximum framesize of akka messages
* Maximum framesize of akka messages
*
* @deprecated Use {@link AkkaOptions#FRAMESIZE} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_FRAMESIZE
=
"akka.framesize"
;
public
static
final
String
AKKA_FRAMESIZE
=
"akka.framesize"
;
/**
/**
* Maximum number of messages until another actor is executed by the same thread
* Maximum number of messages until another actor is executed by the same thread
*
* @deprecated Use {@link AkkaOptions#DISPATCHER_THROUGHPUT} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_DISPATCHER_THROUGHPUT
=
"akka.throughput"
;
public
static
final
String
AKKA_DISPATCHER_THROUGHPUT
=
"akka.throughput"
;
/**
/**
* Log lifecycle events
* Log lifecycle events
*
* @deprecated Use {@link AkkaOptions#LOG_LIFECYCLE_EVENTS} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_LOG_LIFECYCLE_EVENTS
=
"akka.log.lifecycle.events"
;
public
static
final
String
AKKA_LOG_LIFECYCLE_EVENTS
=
"akka.log.lifecycle.events"
;
/**
/**
* Timeout for all blocking calls on the cluster side
* Timeout for all blocking calls on the cluster side
*
* @deprecated Use {@link AkkaOptions#ASK_TIMEOUT} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_ASK_TIMEOUT
=
"akka.ask.timeout"
;
public
static
final
String
AKKA_ASK_TIMEOUT
=
"akka.ask.timeout"
;
/**
/**
* Timeout for all blocking calls that look up remote actors
* Timeout for all blocking calls that look up remote actors
*
* @deprecated Use {@link AkkaOptions#LOOKUP_TIMEOUT} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_LOOKUP_TIMEOUT
=
"akka.lookup.timeout"
;
public
static
final
String
AKKA_LOOKUP_TIMEOUT
=
"akka.lookup.timeout"
;
/**
/**
* Timeout for all blocking calls on the client side
* Timeout for all blocking calls on the client side
*
* @deprecated Use {@link AkkaOptions#CLIENT_TIMEOUT} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_CLIENT_TIMEOUT
=
"akka.client.timeout"
;
public
static
final
String
AKKA_CLIENT_TIMEOUT
=
"akka.client.timeout"
;
/**
/**
* Exit JVM on fatal Akka errors
* Exit JVM on fatal Akka errors
*
* @deprecated Use {@link AkkaOptions#JVM_EXIT_ON_FATAL_ERROR} instead.
*/
*/
@Deprecated
public
static
final
String
AKKA_JVM_EXIT_ON_FATAL_ERROR
=
"akka.jvm-exit-on-fatal-error"
;
public
static
final
String
AKKA_JVM_EXIT_ON_FATAL_ERROR
=
"akka.jvm-exit-on-fatal-error"
;
// ----------------------------- Transport SSL Settings--------------------
// ----------------------------- Transport SSL Settings--------------------
...
@@ -1425,26 +1473,70 @@ public final class ConfigConstants {
...
@@ -1425,26 +1473,70 @@ public final class ConfigConstants {
// ------------------------------ Akka Values ------------------------------
// ------------------------------ Akka Values ------------------------------
/**
* @deprecated Use {@link AkkaOptions#TRANSPORT_HEARTBEAT_INTERVAL} instead.
*/
@Deprecated
public
static
String
DEFAULT_AKKA_TRANSPORT_HEARTBEAT_INTERVAL
=
"1000 s"
;
public
static
String
DEFAULT_AKKA_TRANSPORT_HEARTBEAT_INTERVAL
=
"1000 s"
;
/**
* @deprecated Use {@link AkkaOptions#TRANSPORT_HEARTBEAT_PAUSE} instead.
*/
@Deprecated
public
static
String
DEFAULT_AKKA_TRANSPORT_HEARTBEAT_PAUSE
=
"6000 s"
;
public
static
String
DEFAULT_AKKA_TRANSPORT_HEARTBEAT_PAUSE
=
"6000 s"
;
/**
* @deprecated Use {@link AkkaOptions#TRANSPORT_THRESHOLD} instead.
*/
@Deprecated
public
static
double
DEFAULT_AKKA_TRANSPORT_THRESHOLD
=
300.0
;
public
static
double
DEFAULT_AKKA_TRANSPORT_THRESHOLD
=
300.0
;
/**
* @deprecated Use {@link AkkaOptions#WATCH_THRESHOLD} instead.
*/
@Deprecated
public
static
double
DEFAULT_AKKA_WATCH_THRESHOLD
=
12
;
public
static
double
DEFAULT_AKKA_WATCH_THRESHOLD
=
12
;
/**
* @deprecated Use {@link AkkaOptions#DISPATCHER_THROUGHPUT} instead.
*/
@Deprecated
public
static
int
DEFAULT_AKKA_DISPATCHER_THROUGHPUT
=
15
;
public
static
int
DEFAULT_AKKA_DISPATCHER_THROUGHPUT
=
15
;
/**
* @deprecated Use {@link AkkaOptions#LOG_LIFECYCLE_EVENTS} instead.
*/
@Deprecated
public
static
boolean
DEFAULT_AKKA_LOG_LIFECYCLE_EVENTS
=
false
;
public
static
boolean
DEFAULT_AKKA_LOG_LIFECYCLE_EVENTS
=
false
;
/**
* @deprecated Use {@link AkkaOptions#FRAMESIZE} instead.
*/
@Deprecated
public
static
String
DEFAULT_AKKA_FRAMESIZE
=
"10485760b"
;
public
static
String
DEFAULT_AKKA_FRAMESIZE
=
"10485760b"
;
/**
* @deprecated Use {@link AkkaOptions#ASK_TIMEOUT} instead.
*/
@Deprecated
public
static
String
DEFAULT_AKKA_ASK_TIMEOUT
=
"10 s"
;
public
static
String
DEFAULT_AKKA_ASK_TIMEOUT
=
"10 s"
;
/**
* @deprecated Use {@link AkkaOptions#LOOKUP_TIMEOUT} instead.
*/
@Deprecated
public
static
String
DEFAULT_AKKA_LOOKUP_TIMEOUT
=
"10 s"
;
public
static
String
DEFAULT_AKKA_LOOKUP_TIMEOUT
=
"10 s"
;
/**
* @deprecated Use {@link AkkaOptions#CLIENT_TIMEOUT} instead.
*/
@Deprecated
public
static
String
DEFAULT_AKKA_CLIENT_TIMEOUT
=
"60 s"
;
public
static
String
DEFAULT_AKKA_CLIENT_TIMEOUT
=
"60 s"
;
/**
* @deprecated Use {@link AkkaOptions#SSL_ENABLED} instead.
*/
@Deprecated
public
static
boolean
DEFAULT_AKKA_SSL_ENABLED
=
true
;
public
static
boolean
DEFAULT_AKKA_SSL_ENABLED
=
true
;
// ----------------------------- SSL Values --------------------------------
// ----------------------------- SSL Values --------------------------------
...
...
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosTaskManagerRunner.java
浏览文件 @
302c6741
...
@@ -26,6 +26,7 @@ import org.apache.commons.cli.CommandLine;
...
@@ -26,6 +26,7 @@ import org.apache.commons.cli.CommandLine;
import
org.apache.commons.cli.CommandLineParser
;
import
org.apache.commons.cli.CommandLineParser
;
import
org.apache.commons.cli.Options
;
import
org.apache.commons.cli.Options
;
import
org.apache.commons.cli.PosixParser
;
import
org.apache.commons.cli.PosixParser
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
...
@@ -108,7 +109,7 @@ public class MesosTaskManagerRunner {
...
@@ -108,7 +109,7 @@ public class MesosTaskManagerRunner {
}
}
// tell akka to die in case of an error
// tell akka to die in case of an error
configuration
.
setBoolean
(
ConfigConstants
.
AKKA_
JVM_EXIT_ON_FATAL_ERROR
,
true
);
configuration
.
setBoolean
(
AkkaOptions
.
JVM_EXIT_ON_FATAL_ERROR
,
true
);
// Infer the resource identifier from the environment variable
// Infer the resource identifier from the environment variable
String
containerID
=
Preconditions
.
checkNotNull
(
envs
.
get
(
MesosConfigKeys
.
ENV_FLINK_CONTAINER_ID
));
String
containerID
=
Preconditions
.
checkNotNull
(
envs
.
get
(
MesosConfigKeys
.
ENV_FLINK_CONTAINER_ID
));
...
...
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/metrics/MetricFetcher.java
浏览文件 @
302c6741
...
@@ -23,7 +23,7 @@ import akka.dispatch.OnFailure;
...
@@ -23,7 +23,7 @@ import akka.dispatch.OnFailure;
import
akka.dispatch.OnSuccess
;
import
akka.dispatch.OnSuccess
;
import
akka.pattern.Patterns
;
import
akka.pattern.Patterns
;
import
akka.util.Timeout
;
import
akka.util.Timeout
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.runtime.instance.ActorGateway
;
import
org.apache.flink.runtime.instance.ActorGateway
;
import
org.apache.flink.runtime.instance.Instance
;
import
org.apache.flink.runtime.instance.Instance
;
import
org.apache.flink.runtime.messages.JobManagerMessages
;
import
org.apache.flink.runtime.messages.JobManagerMessages
;
...
@@ -61,7 +61,7 @@ public class MetricFetcher {
...
@@ -61,7 +61,7 @@ public class MetricFetcher {
private
final
ActorSystem
actorSystem
;
private
final
ActorSystem
actorSystem
;
private
final
JobManagerRetriever
retriever
;
private
final
JobManagerRetriever
retriever
;
private
final
ExecutionContext
ctx
;
private
final
ExecutionContext
ctx
;
private
final
FiniteDuration
timeout
=
new
FiniteDuration
(
Duration
.
create
(
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
).
toMillis
(),
TimeUnit
.
MILLISECONDS
);
private
final
FiniteDuration
timeout
=
new
FiniteDuration
(
Duration
.
create
(
AkkaOptions
.
ASK_TIMEOUT
.
defaultValue
()
).
toMillis
(),
TimeUnit
.
MILLISECONDS
);
private
MetricStore
metrics
=
new
MetricStore
();
private
MetricStore
metrics
=
new
MetricStore
();
private
MetricDumpDeserializer
deserializer
=
new
MetricDumpDeserializer
();
private
MetricDumpDeserializer
deserializer
=
new
MetricDumpDeserializer
();
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/client/JobAttachmentClientActor.java
浏览文件 @
302c6741
...
@@ -23,7 +23,7 @@ import akka.actor.Props;
...
@@ -23,7 +23,7 @@ import akka.actor.Props;
import
akka.actor.Status
;
import
akka.actor.Status
;
import
akka.dispatch.Futures
;
import
akka.dispatch.Futures
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.runtime.akka.ListeningBehaviour
;
import
org.apache.flink.runtime.akka.ListeningBehaviour
;
import
org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService
;
import
org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService
;
import
org.apache.flink.runtime.messages.JobClientMessages
;
import
org.apache.flink.runtime.messages.JobClientMessages
;
...
@@ -114,7 +114,7 @@ public class JobAttachmentClientActor extends JobClientActor {
...
@@ -114,7 +114,7 @@ public class JobAttachmentClientActor extends JobClientActor {
client
.
tell
(
client
.
tell
(
decorateMessage
(
new
Status
.
Failure
(
decorateMessage
(
new
Status
.
Failure
(
new
JobClientActorRegistrationTimeoutException
(
"Registration for Job at the JobManager "
+
new
JobClientActorRegistrationTimeoutException
(
"Registration for Job at the JobManager "
+
"timed out. "
+
"You may increase '"
+
ConfigConstants
.
AKKA_CLIENT_TIMEOUT
+
"timed out. "
+
"You may increase '"
+
AkkaOptions
.
CLIENT_TIMEOUT
.
key
()
+
"' in case the JobManager needs more time to confirm the job client registration."
))),
"' in case the JobManager needs more time to confirm the job client registration."
))),
getSelf
());
getSelf
());
}
}
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/client/JobSubmissionClientActor.java
浏览文件 @
302c6741
...
@@ -22,7 +22,7 @@ import akka.actor.ActorRef;
...
@@ -22,7 +22,7 @@ import akka.actor.ActorRef;
import
akka.actor.Props
;
import
akka.actor.Props
;
import
akka.actor.Status
;
import
akka.actor.Status
;
import
akka.dispatch.Futures
;
import
akka.dispatch.Futures
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.akka.ListeningBehaviour
;
import
org.apache.flink.runtime.akka.ListeningBehaviour
;
import
org.apache.flink.runtime.instance.ActorGateway
;
import
org.apache.flink.runtime.instance.ActorGateway
;
...
@@ -119,7 +119,7 @@ public class JobSubmissionClientActor extends JobClientActor {
...
@@ -119,7 +119,7 @@ public class JobSubmissionClientActor extends JobClientActor {
client
.
tell
(
client
.
tell
(
decorateMessage
(
new
Status
.
Failure
(
decorateMessage
(
new
Status
.
Failure
(
new
JobClientActorSubmissionTimeoutException
(
"Job submission to the JobManager timed out. "
+
new
JobClientActorSubmissionTimeoutException
(
"Job submission to the JobManager timed out. "
+
"You may increase '"
+
ConfigConstants
.
AKKA_CLIENT_TIMEOUT
+
"' in case the JobManager "
+
"You may increase '"
+
AkkaOptions
.
CLIENT_TIMEOUT
.
key
()
+
"' in case the JobManager "
+
"needs more time to configure and confirm the job submission."
))),
"needs more time to configure and confirm the job submission."
))),
getSelf
());
getSelf
());
}
}
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/FlinkResourceManager.java
浏览文件 @
302c6741
...
@@ -26,7 +26,7 @@ import akka.dispatch.OnComplete;
...
@@ -26,7 +26,7 @@ import akka.dispatch.OnComplete;
import
akka.pattern.Patterns
;
import
akka.pattern.Patterns
;
import
akka.util.Timeout
;
import
akka.util.Timeout
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.FlinkUntypedActor
;
import
org.apache.flink.runtime.akka.FlinkUntypedActor
;
...
@@ -148,7 +148,7 @@ public abstract class FlinkResourceManager<WorkerType extends ResourceIDRetrieva
...
@@ -148,7 +148,7 @@ public abstract class FlinkResourceManager<WorkerType extends ResourceIDRetrieva
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
lt
=
new
FiniteDuration
(
lt
=
new
FiniteDuration
(
Duration
.
apply
(
ConfigConstants
.
DEFAULT_AKKA_LOOKUP_TIMEOUT
).
toMillis
(),
Duration
.
apply
(
AkkaOptions
.
LOOKUP_TIMEOUT
.
defaultValue
()
).
toMillis
(),
TimeUnit
.
MILLISECONDS
);
TimeUnit
.
MILLISECONDS
);
}
}
this
.
messageTimeout
=
lt
;
this
.
messageTimeout
=
lt
;
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FailureRateRestartStrategy.java
浏览文件 @
302c6741
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
package
org.apache.flink.runtime.executiongraph.restart
;
package
org.apache.flink.runtime.executiongraph.restart
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.concurrent.impl.FlinkFuture
;
import
org.apache.flink.runtime.concurrent.impl.FlinkFuture
;
...
@@ -92,7 +93,7 @@ public class FailureRateRestartStrategy implements RestartStrategy {
...
@@ -92,7 +93,7 @@ public class FailureRateRestartStrategy implements RestartStrategy {
String
failuresIntervalString
=
configuration
.
getString
(
String
failuresIntervalString
=
configuration
.
getString
(
ConfigConstants
.
RESTART_STRATEGY_FAILURE_RATE_FAILURE_RATE_INTERVAL
,
Duration
.
apply
(
1
,
TimeUnit
.
MINUTES
).
toString
()
ConfigConstants
.
RESTART_STRATEGY_FAILURE_RATE_FAILURE_RATE_INTERVAL
,
Duration
.
apply
(
1
,
TimeUnit
.
MINUTES
).
toString
()
);
);
String
timeoutString
=
configuration
.
getString
(
ConfigConstants
.
AKKA_WATCH_HEARTBEAT_INTERVAL
,
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
);
String
timeoutString
=
configuration
.
getString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
);
String
delayString
=
configuration
.
getString
(
ConfigConstants
.
RESTART_STRATEGY_FAILURE_RATE_DELAY
,
timeoutString
);
String
delayString
=
configuration
.
getString
(
ConfigConstants
.
RESTART_STRATEGY_FAILURE_RATE_DELAY
,
timeoutString
);
Duration
failuresInterval
=
Duration
.
apply
(
failuresIntervalString
);
Duration
failuresInterval
=
Duration
.
apply
(
failuresIntervalString
);
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
浏览文件 @
302c6741
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
package
org.apache.flink.runtime.executiongraph.restart
;
package
org.apache.flink.runtime.executiongraph.restart
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.concurrent.impl.FlinkFuture
;
import
org.apache.flink.runtime.concurrent.impl.FlinkFuture
;
...
@@ -72,8 +73,7 @@ public class FixedDelayRestartStrategy implements RestartStrategy {
...
@@ -72,8 +73,7 @@ public class FixedDelayRestartStrategy implements RestartStrategy {
int
maxAttempts
=
configuration
.
getInteger
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS
,
1
);
int
maxAttempts
=
configuration
.
getInteger
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS
,
1
);
String
timeoutString
=
configuration
.
getString
(
String
timeoutString
=
configuration
.
getString
(
ConfigConstants
.
AKKA_WATCH_HEARTBEAT_INTERVAL
,
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
);
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
);
String
delayString
=
configuration
.
getString
(
String
delayString
=
configuration
.
getString
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_DELAY
,
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_DELAY
,
...
@@ -87,7 +87,7 @@ public class FixedDelayRestartStrategy implements RestartStrategy {
...
@@ -87,7 +87,7 @@ public class FixedDelayRestartStrategy implements RestartStrategy {
}
catch
(
NumberFormatException
nfe
)
{
}
catch
(
NumberFormatException
nfe
)
{
if
(
delayString
.
equals
(
timeoutString
))
{
if
(
delayString
.
equals
(
timeoutString
))
{
throw
new
Exception
(
"Invalid config value for "
+
throw
new
Exception
(
"Invalid config value for "
+
ConfigConstants
.
AKKA_WATCH_HEARTBEAT_PAUSE
+
": "
+
timeoutString
+
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
.
key
()
+
": "
+
timeoutString
+
". Value must be a valid duration (such as '10 s' or '1 min')"
);
". Value must be a valid duration (such as '10 s' or '1 min')"
);
}
else
{
}
else
{
throw
new
Exception
(
"Invalid config value for "
+
throw
new
Exception
(
"Invalid config value for "
+
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
浏览文件 @
302c6741
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
package
org.apache.flink.runtime.executiongraph.restart
;
package
org.apache.flink.runtime.executiongraph.restart
;
import
org.apache.flink.api.common.restartstrategy.RestartStrategies
;
import
org.apache.flink.api.common.restartstrategy.RestartStrategies
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -88,8 +89,7 @@ public abstract class RestartStrategyFactory implements Serializable {
...
@@ -88,8 +89,7 @@ public abstract class RestartStrategyFactory implements Serializable {
// support deprecated ConfigConstants values
// support deprecated ConfigConstants values
final
int
numberExecutionRetries
=
configuration
.
getInteger
(
ConfigConstants
.
EXECUTION_RETRIES_KEY
,
final
int
numberExecutionRetries
=
configuration
.
getInteger
(
ConfigConstants
.
EXECUTION_RETRIES_KEY
,
ConfigConstants
.
DEFAULT_EXECUTION_RETRIES
);
ConfigConstants
.
DEFAULT_EXECUTION_RETRIES
);
String
pauseString
=
configuration
.
getString
(
ConfigConstants
.
AKKA_WATCH_HEARTBEAT_PAUSE
,
String
pauseString
=
configuration
.
getString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
);
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
);
String
delayString
=
configuration
.
getString
(
ConfigConstants
.
EXECUTION_RETRY_DELAY_KEY
,
String
delayString
=
configuration
.
getString
(
ConfigConstants
.
EXECUTION_RETRY_DELAY_KEY
,
pauseString
);
pauseString
);
...
@@ -100,7 +100,7 @@ public abstract class RestartStrategyFactory implements Serializable {
...
@@ -100,7 +100,7 @@ public abstract class RestartStrategyFactory implements Serializable {
}
catch
(
NumberFormatException
nfe
)
{
}
catch
(
NumberFormatException
nfe
)
{
if
(
delayString
.
equals
(
pauseString
))
{
if
(
delayString
.
equals
(
pauseString
))
{
throw
new
Exception
(
"Invalid config value for "
+
throw
new
Exception
(
"Invalid config value for "
+
ConfigConstants
.
AKKA_WATCH_HEARTBEAT_PAUSE
+
": "
+
pauseString
+
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
.
key
()
+
": "
+
pauseString
+
". Value must be a valid duration (such as '10 s' or '1 min')"
);
". Value must be a valid duration (such as '10 s' or '1 min')"
);
}
else
{
}
else
{
throw
new
Exception
(
"Invalid config value for "
+
throw
new
Exception
(
"Invalid config value for "
+
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateClient.java
浏览文件 @
302c6741
...
@@ -24,7 +24,7 @@ import akka.dispatch.Mapper;
...
@@ -24,7 +24,7 @@ import akka.dispatch.Mapper;
import
akka.dispatch.Recover
;
import
akka.dispatch.Recover
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.state.StateDescriptor
;
import
org.apache.flink.api.common.state.StateDescriptor
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.IllegalConfigurationException
;
import
org.apache.flink.configuration.IllegalConfigurationException
;
import
org.apache.flink.configuration.QueryableStateOptions
;
import
org.apache.flink.configuration.QueryableStateOptions
;
...
@@ -114,13 +114,11 @@ public class QueryableStateClient {
...
@@ -114,13 +114,11 @@ public class QueryableStateClient {
LeaderRetrievalService
leaderRetrievalService
=
highAvailabilityServices
.
getJobManagerLeaderRetriever
(
HighAvailabilityServices
.
DEFAULT_JOB_ID
);
LeaderRetrievalService
leaderRetrievalService
=
highAvailabilityServices
.
getJobManagerLeaderRetriever
(
HighAvailabilityServices
.
DEFAULT_JOB_ID
);
// Get the ask timeout
// Get the ask timeout
String
askTimeoutString
=
config
.
getString
(
String
askTimeoutString
=
config
.
getString
(
AkkaOptions
.
ASK_TIMEOUT
);
ConfigConstants
.
AKKA_ASK_TIMEOUT
,
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
);
Duration
timeout
=
FiniteDuration
.
apply
(
askTimeoutString
);
Duration
timeout
=
FiniteDuration
.
apply
(
askTimeoutString
);
if
(!
timeout
.
isFinite
())
{
if
(!
timeout
.
isFinite
())
{
throw
new
IllegalConfigurationException
(
ConfigConstants
.
AKKA_ASK_TIMEOUT
throw
new
IllegalConfigurationException
(
AkkaOptions
.
ASK_TIMEOUT
.
key
()
+
" is not a finite timeout ('"
+
askTimeoutString
+
"')"
);
+
" is not a finite timeout ('"
+
askTimeoutString
+
"')"
);
}
}
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerConfiguration.java
浏览文件 @
302c6741
...
@@ -53,24 +53,24 @@ public class ResourceManagerConfiguration {
...
@@ -53,24 +53,24 @@ public class ResourceManagerConfiguration {
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
public
static
ResourceManagerConfiguration
fromConfiguration
(
Configuration
configuration
)
throws
ConfigurationException
{
public
static
ResourceManagerConfiguration
fromConfiguration
(
Configuration
configuration
)
throws
ConfigurationException
{
final
String
strTimeout
=
configuration
.
getString
(
AkkaOptions
.
A
KKA_A
SK_TIMEOUT
);
final
String
strTimeout
=
configuration
.
getString
(
AkkaOptions
.
ASK_TIMEOUT
);
final
Time
timeout
;
final
Time
timeout
;
try
{
try
{
timeout
=
Time
.
milliseconds
(
Duration
.
apply
(
strTimeout
).
toMillis
());
timeout
=
Time
.
milliseconds
(
Duration
.
apply
(
strTimeout
).
toMillis
());
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
throw
new
ConfigurationException
(
"Could not parse the resource manager's timeout "
+
throw
new
ConfigurationException
(
"Could not parse the resource manager's timeout "
+
"value "
+
AkkaOptions
.
A
KKA_A
SK_TIMEOUT
+
'.'
,
e
);
"value "
+
AkkaOptions
.
ASK_TIMEOUT
+
'.'
,
e
);
}
}
final
String
strHeartbeatInterval
=
configuration
.
getString
(
AkkaOptions
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
);
final
String
strHeartbeatInterval
=
configuration
.
getString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
);
final
Time
heartbeatInterval
;
final
Time
heartbeatInterval
;
try
{
try
{
heartbeatInterval
=
Time
.
milliseconds
(
Duration
.
apply
(
strHeartbeatInterval
).
toMillis
());
heartbeatInterval
=
Time
.
milliseconds
(
Duration
.
apply
(
strHeartbeatInterval
).
toMillis
());
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
throw
new
ConfigurationException
(
"Could not parse the resource manager's heartbeat interval "
+
throw
new
ConfigurationException
(
"Could not parse the resource manager's heartbeat interval "
+
"value "
+
AkkaOptions
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
+
'.'
,
e
);
"value "
+
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
+
'.'
,
e
);
}
}
return
new
ResourceManagerConfiguration
(
timeout
,
heartbeatInterval
);
return
new
ResourceManagerConfiguration
(
timeout
,
heartbeatInterval
);
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java
浏览文件 @
302c6741
...
@@ -19,9 +19,7 @@
...
@@ -19,9 +19,7 @@
package
org.apache.flink.runtime.resourcemanager.slotmanager
;
package
org.apache.flink.runtime.resourcemanager.slotmanager
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigOption
;
import
org.apache.flink.configuration.ConfigOptions
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.util.ConfigurationException
;
import
org.apache.flink.util.ConfigurationException
;
import
org.apache.flink.util.Preconditions
;
import
org.apache.flink.util.Preconditions
;
...
@@ -55,18 +53,14 @@ public class SlotManagerConfiguration {
...
@@ -55,18 +53,14 @@ public class SlotManagerConfiguration {
}
}
public
static
SlotManagerConfiguration
fromConfiguration
(
Configuration
configuration
)
throws
ConfigurationException
{
public
static
SlotManagerConfiguration
fromConfiguration
(
Configuration
configuration
)
throws
ConfigurationException
{
ConfigOption
<
String
>
timeoutOption
=
ConfigOptions
final
String
strTimeout
=
configuration
.
getString
(
AkkaOptions
.
ASK_TIMEOUT
);
.
key
(
ConfigConstants
.
AKKA_ASK_TIMEOUT
)
.
defaultValue
(
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
);
final
String
strTimeout
=
configuration
.
getString
(
timeoutOption
);
final
Time
timeout
;
final
Time
timeout
;
try
{
try
{
timeout
=
Time
.
milliseconds
(
Duration
.
apply
(
strTimeout
).
toMillis
());
timeout
=
Time
.
milliseconds
(
Duration
.
apply
(
strTimeout
).
toMillis
());
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
throw
new
ConfigurationException
(
"Could not parse the resource manager's timeout "
+
throw
new
ConfigurationException
(
"Could not parse the resource manager's timeout "
+
"value "
+
timeoutOption
+
'.'
,
e
);
"value "
+
AkkaOptions
.
ASK_TIMEOUT
+
'.'
,
e
);
}
}
return
new
SlotManagerConfiguration
(
timeout
,
timeout
,
timeout
);
return
new
SlotManagerConfiguration
(
timeout
,
timeout
,
timeout
);
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java
浏览文件 @
302c6741
...
@@ -21,7 +21,7 @@ package org.apache.flink.runtime.rpc.akka;
...
@@ -21,7 +21,7 @@ package org.apache.flink.runtime.rpc.akka;
import
akka.actor.ActorSystem
;
import
akka.actor.ActorSystem
;
import
com.typesafe.config.Config
;
import
com.typesafe.config.Config
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils
;
import
org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils
;
...
@@ -130,9 +130,7 @@ public class AkkaRpcServiceUtils {
...
@@ -130,9 +130,7 @@ public class AkkaRpcServiceUtils {
checkNotNull
(
config
,
"config is null"
);
checkNotNull
(
config
,
"config is null"
);
final
boolean
sslEnabled
=
config
.
getBoolean
(
final
boolean
sslEnabled
=
config
.
getBoolean
(
AkkaOptions
.
SSL_ENABLED
)
&&
ConfigConstants
.
AKKA_SSL_ENABLED
,
ConfigConstants
.
DEFAULT_AKKA_SSL_ENABLED
)
&&
SSLUtils
.
getSSLEnabled
(
config
);
SSLUtils
.
getSSLEnabled
(
config
);
return
getRpcUrl
(
return
getRpcUrl
(
...
...
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerConfiguration.java
浏览文件 @
302c6741
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
package
org.apache.flink.runtime.taskexecutor
;
package
org.apache.flink.runtime.taskexecutor
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.TaskManagerOptions
;
import
org.apache.flink.configuration.TaskManagerOptions
;
...
@@ -146,7 +147,7 @@ public class TaskManagerConfiguration implements TaskManagerRuntimeInfo {
...
@@ -146,7 +147,7 @@ public class TaskManagerConfiguration implements TaskManagerRuntimeInfo {
timeout
=
Time
.
milliseconds
(
AkkaUtils
.
getTimeout
(
configuration
).
toMillis
());
timeout
=
Time
.
milliseconds
(
AkkaUtils
.
getTimeout
(
configuration
).
toMillis
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
IllegalArgumentException
(
throw
new
IllegalArgumentException
(
"Invalid format for '"
+
ConfigConstants
.
AKKA_ASK_TIMEOUT
+
"Invalid format for '"
+
AkkaOptions
.
ASK_TIMEOUT
.
key
()
+
"'.Use formats like '50 s' or '1 min' to specify the timeout."
);
"'.Use formats like '50 s' or '1 min' to specify the timeout."
);
}
}
...
...
flink-runtime/src/main/scala/org/apache/flink/runtime/akka/AkkaUtils.scala
浏览文件 @
302c6741
...
@@ -184,13 +184,11 @@ object AkkaUtils {
...
@@ -184,13 +184,11 @@ object AkkaUtils {
* @return Flink's basic Akka config
* @return Flink's basic Akka config
*/
*/
private
def
getBasicAkkaConfig
(
configuration
:
Configuration
)
:
Config
=
{
private
def
getBasicAkkaConfig
(
configuration
:
Configuration
)
:
Config
=
{
val
akkaThroughput
=
configuration
.
getInteger
(
ConfigConstants
.
AKKA_DISPATCHER_THROUGHPUT
,
val
akkaThroughput
=
configuration
.
getInteger
(
AkkaOptions
.
DISPATCHER_THROUGHPUT
)
ConfigConstants
.
DEFAULT_AKKA_DISPATCHER_THROUGHPUT
)
val
lifecycleEvents
=
configuration
.
getBoolean
(
AkkaOptions
.
LOG_LIFECYCLE_EVENTS
)
val
lifecycleEvents
=
configuration
.
getBoolean
(
ConfigConstants
.
AKKA_LOG_LIFECYCLE_EVENTS
,
ConfigConstants
.
DEFAULT_AKKA_LOG_LIFECYCLE_EVENTS
)
val
jvmExitOnFatalError
=
if
(
val
jvmExitOnFatalError
=
if
(
configuration
.
getBoolean
(
ConfigConstants
.
AKKA_JVM_EXIT_ON_FATAL_ERROR
,
true
)){
configuration
.
getBoolean
(
AkkaOptions
.
JVM_EXIT_ON_FATAL_ERROR
)){
"on"
"on"
}
else
{
}
else
{
"off"
"off"
...
@@ -269,48 +267,36 @@ object AkkaUtils {
...
@@ -269,48 +267,36 @@ object AkkaUtils {
bindAddress
:
String
,
port
:
Int
,
bindAddress
:
String
,
port
:
Int
,
externalHostname
:
String
,
externalPort
:
Int
)
:
Config
=
{
externalHostname
:
String
,
externalPort
:
Int
)
:
Config
=
{
val
akkaAskTimeout
=
Duration
(
configuration
.
getString
(
val
akkaAskTimeout
=
Duration
(
configuration
.
getString
(
AkkaOptions
.
ASK_TIMEOUT
))
ConfigConstants
.
AKKA_ASK_TIMEOUT
,
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
))
val
startupTimeout
=
configuration
.
getString
(
val
startupTimeout
=
configuration
.
getString
(
ConfigConstants
.
AKKA_
STARTUP_TIMEOUT
,
AkkaOptions
.
STARTUP_TIMEOUT
,
(
akkaAskTimeout
*
10
).
toString
)
(
akkaAskTimeout
*
10
).
toString
)
val
transportHeartbeatInterval
=
configuration
.
getString
(
val
transportHeartbeatInterval
=
configuration
.
getString
(
ConfigConstants
.
AKKA_TRANSPORT_HEARTBEAT_INTERVAL
,
AkkaOptions
.
TRANSPORT_HEARTBEAT_INTERVAL
)
ConfigConstants
.
DEFAULT_AKKA_TRANSPORT_HEARTBEAT_INTERVAL
)
val
transportHeartbeatPause
=
configuration
.
getString
(
val
transportHeartbeatPause
=
configuration
.
getString
(
ConfigConstants
.
AKKA_TRANSPORT_HEARTBEAT_PAUSE
,
AkkaOptions
.
TRANSPORT_HEARTBEAT_PAUSE
)
ConfigConstants
.
DEFAULT_AKKA_TRANSPORT_HEARTBEAT_PAUSE
)
val
transportThreshold
=
configuration
.
getDouble
(
val
transportThreshold
=
configuration
.
getDouble
(
AkkaOptions
.
TRANSPORT_THRESHOLD
)
ConfigConstants
.
AKKA_TRANSPORT_THRESHOLD
,
ConfigConstants
.
DEFAULT_AKKA_TRANSPORT_THRESHOLD
)
val
watchHeartbeatInterval
=
configuration
.
getString
(
AkkaOptions
.
AKKA_WATCH_HEARTBEAT_INTERVAL
);
val
watchHeartbeatInterval
=
configuration
.
getString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
)
val
watchHeartbeatPause
=
configuration
.
getString
(
AkkaOptions
.
AKKA_WATCH_HEARTBEAT_PAUSE
);
val
watchHeartbeatPause
=
configuration
.
getString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
)
val
watchThreshold
=
configuration
.
getDouble
(
val
watchThreshold
=
configuration
.
getInteger
(
AkkaOptions
.
WATCH_THRESHOLD
)
ConfigConstants
.
AKKA_WATCH_THRESHOLD
,
ConfigConstants
.
DEFAULT_AKKA_WATCH_THRESHOLD
)
val
akkaTCPTimeout
=
configuration
.
getString
(
AkkaOptions
.
AKKA_TCP_TIMEOUT
);
val
akkaTCPTimeout
=
configuration
.
getString
(
AkkaOptions
.
TCP_TIMEOUT
)
val
akkaFramesize
=
configuration
.
getString
(
val
akkaFramesize
=
configuration
.
getString
(
AkkaOptions
.
FRAMESIZE
)
ConfigConstants
.
AKKA_FRAMESIZE
,
ConfigConstants
.
DEFAULT_AKKA_FRAMESIZE
)
val
lifecycleEvents
=
configuration
.
getBoolean
(
val
lifecycleEvents
=
configuration
.
getBoolean
(
AkkaOptions
.
LOG_LIFECYCLE_EVENTS
)
ConfigConstants
.
AKKA_LOG_LIFECYCLE_EVENTS
,
ConfigConstants
.
DEFAULT_AKKA_LOG_LIFECYCLE_EVENTS
)
val
logLifecycleEvents
=
if
(
lifecycleEvents
)
"on"
else
"off"
val
logLifecycleEvents
=
if
(
lifecycleEvents
)
"on"
else
"off"
val
akkaEnableSSLConfig
=
configuration
.
getBoolean
(
ConfigConstants
.
AKKA_SSL_ENABLED
,
val
akkaEnableSSLConfig
=
configuration
.
getBoolean
(
AkkaOptions
.
SSL_ENABLED
)
&&
ConfigConstants
.
DEFAULT_AKKA_SSL_ENABLED
)
&&
SSLUtils
.
getSSLEnabled
(
configuration
)
SSLUtils
.
getSSLEnabled
(
configuration
)
val
akkaEnableSSL
=
if
(
akkaEnableSSLConfig
)
"on"
else
"off"
val
akkaEnableSSL
=
if
(
akkaEnableSSLConfig
)
"on"
else
"off"
...
@@ -588,14 +574,13 @@ object AkkaUtils {
...
@@ -588,14 +574,13 @@ object AkkaUtils {
}
}
def
getTimeout
(
config
:
Configuration
)
:
FiniteDuration
=
{
def
getTimeout
(
config
:
Configuration
)
:
FiniteDuration
=
{
val
duration
=
Duration
(
config
.
getString
(
ConfigConstants
.
AKKA_ASK_TIMEOUT
,
val
duration
=
Duration
(
config
.
getString
(
AkkaOptions
.
ASK_TIMEOUT
))
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
))
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
}
}
def
getDefaultTimeout
:
Time
=
{
def
getDefaultTimeout
:
Time
=
{
val
duration
=
Duration
(
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
)
val
duration
=
Duration
(
AkkaOptions
.
ASK_TIMEOUT
.
defaultValue
()
)
Time
.
milliseconds
(
duration
.
toMillis
)
Time
.
milliseconds
(
duration
.
toMillis
)
}
}
...
@@ -607,30 +592,24 @@ object AkkaUtils {
...
@@ -607,30 +592,24 @@ object AkkaUtils {
}
}
def
getLookupTimeout
(
config
:
Configuration
)
:
FiniteDuration
=
{
def
getLookupTimeout
(
config
:
Configuration
)
:
FiniteDuration
=
{
val
duration
=
Duration
(
config
.
getString
(
val
duration
=
Duration
(
config
.
getString
(
AkkaOptions
.
LOOKUP_TIMEOUT
))
ConfigConstants
.
AKKA_LOOKUP_TIMEOUT
,
ConfigConstants
.
DEFAULT_AKKA_LOOKUP_TIMEOUT
))
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
}
}
def
getDefaultLookupTimeout
:
FiniteDuration
=
{
def
getDefaultLookupTimeout
:
FiniteDuration
=
{
val
duration
=
Duration
(
ConfigConstants
.
DEFAULT_AKKA_LOOKUP_TIMEOUT
)
val
duration
=
Duration
(
AkkaOptions
.
LOOKUP_TIMEOUT
.
defaultValue
()
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
}
}
def
getClientTimeout
(
config
:
Configuration
)
:
FiniteDuration
=
{
def
getClientTimeout
(
config
:
Configuration
)
:
FiniteDuration
=
{
val
duration
=
Duration
(
val
duration
=
Duration
(
config
.
getString
(
AkkaOptions
.
CLIENT_TIMEOUT
))
config
.
getString
(
ConfigConstants
.
AKKA_CLIENT_TIMEOUT
,
ConfigConstants
.
DEFAULT_AKKA_CLIENT_TIMEOUT
))
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
}
}
def
getDefaultClientTimeout
:
FiniteDuration
=
{
def
getDefaultClientTimeout
:
FiniteDuration
=
{
val
duration
=
Duration
(
ConfigConstants
.
DEFAULT_AKKA_CLIENT_TIMEOUT
)
val
duration
=
Duration
(
AkkaOptions
.
CLIENT_TIMEOUT
.
defaultValue
()
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
new
FiniteDuration
(
duration
.
toMillis
,
TimeUnit
.
MILLISECONDS
)
}
}
...
...
flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
浏览文件 @
302c6741
...
@@ -27,7 +27,7 @@ import akka.pattern.ask
...
@@ -27,7 +27,7 @@ import akka.pattern.ask
import
akka.actor.
{
ActorRef
,
ActorSystem
}
import
akka.actor.
{
ActorRef
,
ActorSystem
}
import
com.typesafe.config.Config
import
com.typesafe.config.Config
import
org.apache.flink.api.common.
{
JobExecutionResult
,
JobID
,
JobSubmissionResult
}
import
org.apache.flink.api.common.
{
JobExecutionResult
,
JobID
,
JobSubmissionResult
}
import
org.apache.flink.configuration.
{
ConfigConstants
,
Configuration
}
import
org.apache.flink.configuration.
{
AkkaOptions
,
ConfigConstants
,
Configuration
}
import
org.apache.flink.core.fs.Path
import
org.apache.flink.core.fs.Path
import
org.apache.flink.runtime.akka.AkkaUtils
import
org.apache.flink.runtime.akka.AkkaUtils
import
org.apache.flink.runtime.client.
{
JobClient
,
JobExecutionException
}
import
org.apache.flink.runtime.client.
{
JobClient
,
JobExecutionException
}
...
@@ -265,9 +265,9 @@ abstract class FlinkMiniCluster(
...
@@ -265,9 +265,9 @@ abstract class FlinkMiniCluster(
// https://docs.travis-ci.com/user/environment-variables#Default-Environment-Variables
// https://docs.travis-ci.com/user/environment-variables#Default-Environment-Variables
if
(
sys
.
env
.
contains
(
"CI"
))
{
if
(
sys
.
env
.
contains
(
"CI"
))
{
// Only set if nothing specified in config
// Only set if nothing specified in config
if
(
config
.
getString
(
ConfigConstants
.
AKKA_ASK_TIMEOUT
,
null
)
==
null
)
{
if
(
!
config
.
contains
(
AkkaOptions
.
ASK_TIMEOUT
)
)
{
val
duration
=
Duration
(
ConfigConstants
.
DEFAULT_AKKA_ASK_TIMEOUT
)
*
10
val
duration
=
Duration
(
AkkaOptions
.
ASK_TIMEOUT
.
defaultValue
()
)
*
10
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
s
"${duration.toSeconds}s"
)
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
s
"${duration.toSeconds}s"
)
LOG
.
info
(
s
"Akka ask timeout set to ${duration.toSeconds}s"
)
LOG
.
info
(
s
"Akka ask timeout set to ${duration.toSeconds}s"
)
}
}
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/ResourceManagerTest.java
浏览文件 @
302c6741
...
@@ -22,7 +22,7 @@ import akka.actor.ActorSystem;
...
@@ -22,7 +22,7 @@ import akka.actor.ActorSystem;
import
akka.testkit.JavaTestKit
;
import
akka.testkit.JavaTestKit
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.clusterframework.messages.NotifyResourceStarted
;
import
org.apache.flink.runtime.clusterframework.messages.NotifyResourceStarted
;
...
@@ -192,7 +192,7 @@ public class ResourceManagerTest extends TestLogger {
...
@@ -192,7 +192,7 @@ public class ResourceManagerTest extends TestLogger {
// set a short timeout for lookups
// set a short timeout for lookups
Configuration
shortTimeoutConfig
=
config
.
clone
();
Configuration
shortTimeoutConfig
=
config
.
clone
();
shortTimeoutConfig
.
setString
(
ConfigConstants
.
AKKA_
LOOKUP_TIMEOUT
,
"1 s"
);
shortTimeoutConfig
.
setString
(
AkkaOptions
.
LOOKUP_TIMEOUT
,
"1 s"
);
fakeJobManager
=
TestingUtils
.
createForwardingActor
(
fakeJobManager
=
TestingUtils
.
createForwardingActor
(
system
,
system
,
...
@@ -234,7 +234,7 @@ public class ResourceManagerTest extends TestLogger {
...
@@ -234,7 +234,7 @@ public class ResourceManagerTest extends TestLogger {
// set a long timeout for lookups such that the test fails in case of timeouts
// set a long timeout for lookups such that the test fails in case of timeouts
Configuration
shortTimeoutConfig
=
config
.
clone
();
Configuration
shortTimeoutConfig
=
config
.
clone
();
shortTimeoutConfig
.
setString
(
ConfigConstants
.
AKKA_
LOOKUP_TIMEOUT
,
"99999 s"
);
shortTimeoutConfig
.
setString
(
AkkaOptions
.
LOOKUP_TIMEOUT
,
"99999 s"
);
fakeJobManager
=
TestingUtils
.
createForwardingActor
(
fakeJobManager
=
TestingUtils
.
createForwardingActor
(
system
,
system
,
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PartialConsumePipelinedResultTest.java
浏览文件 @
302c6741
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
package
org.apache.flink.runtime.io.network.partition
;
package
org.apache.flink.runtime.io.network.partition
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.TaskManagerOptions
;
import
org.apache.flink.configuration.TaskManagerOptions
;
...
@@ -51,7 +52,7 @@ public class PartialConsumePipelinedResultTest {
...
@@ -51,7 +52,7 @@ public class PartialConsumePipelinedResultTest {
final
Configuration
config
=
new
Configuration
();
final
Configuration
config
=
new
Configuration
();
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
NUMBER_OF_TMS
);
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
NUMBER_OF_TMS
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
NUMBER_OF_SLOTS_PER_TM
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
NUMBER_OF_SLOTS_PER_TM
);
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
TestingUtils
.
DEFAULT_AKKA_ASK_TIMEOUT
());
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
TestingUtils
.
DEFAULT_AKKA_ASK_TIMEOUT
());
config
.
setInteger
(
TaskManagerOptions
.
NETWORK_NUM_BUFFERS
,
NUMBER_OF_NETWORK_BUFFERS
);
config
.
setInteger
(
TaskManagerOptions
.
NETWORK_NUM_BUFFERS
,
NUMBER_OF_NETWORK_BUFFERS
);
flink
=
new
TestingCluster
(
config
,
true
);
flink
=
new
TestingCluster
(
config
,
true
);
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerTest.java
浏览文件 @
302c6741
...
@@ -26,6 +26,7 @@ import akka.testkit.JavaTestKit;
...
@@ -26,6 +26,7 @@ import akka.testkit.JavaTestKit;
import
akka.testkit.TestProbe
;
import
akka.testkit.TestProbe
;
import
com.typesafe.config.Config
;
import
com.typesafe.config.Config
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.JobManagerOptions
;
import
org.apache.flink.configuration.JobManagerOptions
;
...
@@ -601,7 +602,7 @@ public class JobManagerTest extends TestLogger {
...
@@ -601,7 +602,7 @@ public class JobManagerTest extends TestLogger {
Deadline
deadline
=
new
FiniteDuration
(
100
,
TimeUnit
.
SECONDS
).
fromNow
();
Deadline
deadline
=
new
FiniteDuration
(
100
,
TimeUnit
.
SECONDS
).
fromNow
();
Configuration
config
=
new
Configuration
();
Configuration
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"100ms"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"100ms"
);
ActorRef
jobManagerActor
=
JobManager
.
startJobManagerActors
(
ActorRef
jobManagerActor
=
JobManager
.
startJobManagerActors
(
config
,
config
,
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerComponentsStartupShutdownTest.java
浏览文件 @
302c6741
...
@@ -27,6 +27,7 @@ import akka.actor.Props;
...
@@ -27,6 +27,7 @@ import akka.actor.Props;
import
akka.testkit.JavaTestKit
;
import
akka.testkit.JavaTestKit
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.api.common.time.Time
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.core.memory.MemoryType
;
import
org.apache.flink.core.memory.MemoryType
;
...
@@ -77,9 +78,9 @@ public class TaskManagerComponentsStartupShutdownTest extends TestLogger {
...
@@ -77,9 +78,9 @@ public class TaskManagerComponentsStartupShutdownTest extends TestLogger {
final
int
BUFFER_SIZE
=
32
*
1024
;
final
int
BUFFER_SIZE
=
32
*
1024
;
Configuration
config
=
new
Configuration
();
Configuration
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"200 ms"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"200 ms"
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"1 s"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"1 s"
);
config
.
setInteger
(
ConfigConstants
.
AKKA_
WATCH_THRESHOLD
,
1
);
config
.
setInteger
(
AkkaOptions
.
WATCH_THRESHOLD
,
1
);
ActorSystem
actorSystem
=
null
;
ActorSystem
actorSystem
=
null
;
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
浏览文件 @
302c6741
...
@@ -23,6 +23,7 @@ import akka.actor.ActorSystem;
...
@@ -23,6 +23,7 @@ import akka.actor.ActorSystem;
import
akka.actor.InvalidActorNameException
;
import
akka.actor.InvalidActorNameException
;
import
akka.actor.Terminated
;
import
akka.actor.Terminated
;
import
akka.testkit.JavaTestKit
;
import
akka.testkit.JavaTestKit
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
...
@@ -90,10 +91,10 @@ public class TaskManagerRegistrationTest extends TestLogger {
...
@@ -90,10 +91,10 @@ public class TaskManagerRegistrationTest extends TestLogger {
@BeforeClass
@BeforeClass
public
static
void
startActorSystem
()
{
public
static
void
startActorSystem
()
{
config
=
new
Configuration
();
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"5 s"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"5 s"
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"200 ms"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"200 ms"
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"2 s"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"2 s"
);
config
.
set
Double
(
ConfigConstants
.
AKKA_WATCH_THRESHOLD
,
2.0
);
config
.
set
Integer
(
AkkaOptions
.
WATCH_THRESHOLD
,
2
);
actorSystem
=
AkkaUtils
.
createLocalActorSystem
(
config
);
actorSystem
=
AkkaUtils
.
createLocalActorSystem
(
config
);
}
}
...
...
flink-runtime/src/test/java/org/apache/flink/runtime/testutils/ZooKeeperTestUtils.java
浏览文件 @
302c6741
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
package
org.apache.flink.runtime.testutils
;
package
org.apache.flink.runtime.testutils
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.CoreOptions
;
import
org.apache.flink.configuration.CoreOptions
;
...
@@ -86,10 +87,10 @@ public class ZooKeeperTestUtils {
...
@@ -86,10 +87,10 @@ public class ZooKeeperTestUtils {
config
.
setString
(
HighAvailabilityOptions
.
HA_STORAGE_PATH
,
fsStateHandlePath
+
"/recovery"
);
config
.
setString
(
HighAvailabilityOptions
.
HA_STORAGE_PATH
,
fsStateHandlePath
+
"/recovery"
);
// Akka failure detection and execution retries
// Akka failure detection and execution retries
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"1000 ms"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"1000 ms"
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"6 s"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"6 s"
);
config
.
setInteger
(
ConfigConstants
.
AKKA_
WATCH_THRESHOLD
,
9
);
config
.
setInteger
(
AkkaOptions
.
WATCH_THRESHOLD
,
9
);
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"100 s"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"100 s"
);
config
.
setString
(
HighAvailabilityOptions
.
HA_JOB_DELAY
,
"10 s"
);
config
.
setString
(
HighAvailabilityOptions
.
HA_JOB_DELAY
,
"10 s"
);
return
config
;
return
config
;
...
...
flink-runtime/src/test/scala/org/apache/flink/runtime/akka/AkkaSslITCase.scala
浏览文件 @
302c6741
...
@@ -20,7 +20,7 @@ package org.apache.flink.runtime.akka
...
@@ -20,7 +20,7 @@ package org.apache.flink.runtime.akka
import
akka.actor.ActorSystem
import
akka.actor.ActorSystem
import
akka.testkit.
{
ImplicitSender
,
TestKit
}
import
akka.testkit.
{
ImplicitSender
,
TestKit
}
import
org.apache.flink.configuration.
{
ConfigConstants
,
Configuration
}
import
org.apache.flink.configuration.
{
AkkaOptions
,
ConfigConstants
,
Configuration
}
import
org.apache.flink.runtime.testingUtils.
{
TestingCluster
,
TestingUtils
,
ScalaTestingUtils
}
import
org.apache.flink.runtime.testingUtils.
{
TestingCluster
,
TestingUtils
,
ScalaTestingUtils
}
import
org.junit.runner.RunWith
import
org.junit.runner.RunWith
import
org.scalatest.
{
BeforeAndAfterAll
,
Matchers
,
WordSpecLike
}
import
org.scalatest.
{
BeforeAndAfterAll
,
Matchers
,
WordSpecLike
}
...
@@ -119,7 +119,7 @@ class AkkaSslITCase(_system: ActorSystem)
...
@@ -119,7 +119,7 @@ class AkkaSslITCase(_system: ActorSystem)
val
config
=
new
Configuration
()
val
config
=
new
Configuration
()
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
1
)
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
1
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
1
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
1
)
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"2 s"
)
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"2 s"
)
config
.
setBoolean
(
ConfigConstants
.
SECURITY_SSL_ENABLED
,
true
)
config
.
setBoolean
(
ConfigConstants
.
SECURITY_SSL_ENABLED
,
true
)
config
.
setString
(
ConfigConstants
.
SECURITY_SSL_KEYSTORE
,
"invalid.keystore"
)
config
.
setString
(
ConfigConstants
.
SECURITY_SSL_KEYSTORE
,
"invalid.keystore"
)
...
@@ -141,7 +141,7 @@ class AkkaSslITCase(_system: ActorSystem)
...
@@ -141,7 +141,7 @@ class AkkaSslITCase(_system: ActorSystem)
val
config
=
new
Configuration
()
val
config
=
new
Configuration
()
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
1
)
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
1
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
1
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
1
)
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"2 s"
)
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"2 s"
)
config
.
setBoolean
(
ConfigConstants
.
SECURITY_SSL_ENABLED
,
true
)
config
.
setBoolean
(
ConfigConstants
.
SECURITY_SSL_ENABLED
,
true
)
...
...
flink-runtime/src/test/scala/org/apache/flink/runtime/jobmanager/JobManagerConnectionTest.scala
浏览文件 @
302c6741
...
@@ -23,7 +23,7 @@ import java.net.{InetAddress, InetSocketAddress}
...
@@ -23,7 +23,7 @@ import java.net.{InetAddress, InetSocketAddress}
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.atomic.
{
AtomicBoolean
,
AtomicReference
}
import
java.util.concurrent.atomic.
{
AtomicBoolean
,
AtomicReference
}
import
org.apache.flink.configuration.
{
ConfigConstants
,
Configuration
}
import
org.apache.flink.configuration.
{
AkkaOptions
,
ConfigConstants
,
Configuration
}
import
org.apache.flink.runtime.akka.AkkaUtils
import
org.apache.flink.runtime.akka.AkkaUtils
import
org.apache.flink.util.NetUtils
import
org.apache.flink.util.NetUtils
import
org.junit.Assert._
import
org.junit.Assert._
...
@@ -122,7 +122,7 @@ class JobManagerConnectionTest {
...
@@ -122,7 +122,7 @@ class JobManagerConnectionTest {
private
def
createConfigWithLowTimeout
()
:
Configuration
=
{
private
def
createConfigWithLowTimeout
()
:
Configuration
=
{
val
config
=
new
Configuration
()
val
config
=
new
Configuration
()
config
.
setString
(
ConfigConstants
.
AKKA_
LOOKUP_TIMEOUT
,
config
.
setString
(
AkkaOptions
.
LOOKUP_TIMEOUT
,
Duration
(
timeout
,
TimeUnit
.
MILLISECONDS
).
toSeconds
+
" s"
)
Duration
(
timeout
,
TimeUnit
.
MILLISECONDS
).
toSeconds
+
" s"
)
config
config
}
}
...
...
flink-runtime/src/test/scala/org/apache/flink/runtime/jobmanager/RecoveryITCase.scala
浏览文件 @
302c6741
...
@@ -21,7 +21,7 @@ package org.apache.flink.runtime.jobmanager
...
@@ -21,7 +21,7 @@ package org.apache.flink.runtime.jobmanager
import
akka.actor.
{
ActorSystem
,
PoisonPill
}
import
akka.actor.
{
ActorSystem
,
PoisonPill
}
import
akka.testkit.
{
ImplicitSender
,
TestKit
}
import
akka.testkit.
{
ImplicitSender
,
TestKit
}
import
org.apache.flink.api.common.ExecutionConfig
import
org.apache.flink.api.common.ExecutionConfig
import
org.apache.flink.configuration.
{
ConfigConstants
,
Configuration
}
import
org.apache.flink.configuration.
{
AkkaOptions
,
ConfigConstants
,
Configuration
}
import
org.apache.flink.runtime.akka.ListeningBehaviour
import
org.apache.flink.runtime.akka.ListeningBehaviour
import
org.apache.flink.runtime.io.network.partition.ResultPartitionType
import
org.apache.flink.runtime.io.network.partition.ResultPartitionType
import
org.apache.flink.runtime.jobgraph.
{
DistributionPattern
,
JobGraph
,
JobStatus
,
JobVertex
}
import
org.apache.flink.runtime.jobgraph.
{
DistributionPattern
,
JobGraph
,
JobStatus
,
JobVertex
}
...
@@ -60,7 +60,7 @@ class RecoveryITCase(_system: ActorSystem)
...
@@ -60,7 +60,7 @@ class RecoveryITCase(_system: ActorSystem)
val
config
=
new
Configuration
()
val
config
=
new
Configuration
()
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
numSlots
)
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
numSlots
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
numTaskManagers
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
numTaskManagers
)
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
heartbeatTimeout
)
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
heartbeatTimeout
)
config
.
setString
(
ConfigConstants
.
RESTART_STRATEGY
,
"fixeddelay"
)
config
.
setString
(
ConfigConstants
.
RESTART_STRATEGY
,
"fixeddelay"
)
config
.
setInteger
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS
,
1
)
config
.
setInteger
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS
,
1
)
config
.
setString
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_DELAY
,
heartbeatTimeout
)
config
.
setString
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_DELAY
,
heartbeatTimeout
)
...
...
flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingUtils.scala
浏览文件 @
302c6741
...
@@ -28,7 +28,7 @@ import com.google.common.util.concurrent.MoreExecutors
...
@@ -28,7 +28,7 @@ import com.google.common.util.concurrent.MoreExecutors
import
com.typesafe.config.ConfigFactory
import
com.typesafe.config.ConfigFactory
import
grizzled.slf4j.Logger
import
grizzled.slf4j.Logger
import
org.apache.flink.api.common.time.Time
import
org.apache.flink.api.common.time.Time
import
org.apache.flink.configuration.
{
ConfigConstants
,
Configuration
,
HighAvailabilityOptions
,
TaskManagerOptions
}
import
org.apache.flink.configuration.
_
import
org.apache.flink.runtime.akka.AkkaUtils
import
org.apache.flink.runtime.akka.AkkaUtils
import
org.apache.flink.runtime.clusterframework.FlinkResourceManager
import
org.apache.flink.runtime.clusterframework.FlinkResourceManager
import
org.apache.flink.runtime.clusterframework.types.ResourceID
import
org.apache.flink.runtime.clusterframework.types.ResourceID
...
@@ -89,7 +89,7 @@ object TestingUtils {
...
@@ -89,7 +89,7 @@ object TestingUtils {
val
config
=
new
Configuration
()
val
config
=
new
Configuration
()
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
numSlots
)
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
numSlots
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
numTMs
)
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
numTMs
)
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
timeout
)
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
timeout
)
val
cluster
=
new
TestingCluster
(
config
)
val
cluster
=
new
TestingCluster
(
config
)
...
...
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
浏览文件 @
302c6741
...
@@ -27,6 +27,7 @@ import org.apache.commons.io.FileUtils;
...
@@ -27,6 +27,7 @@ import org.apache.commons.io.FileUtils;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.flink.api.java.tuple.Tuple
;
import
org.apache.flink.api.java.tuple.Tuple
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.HighAvailabilityOptions
;
import
org.apache.flink.configuration.HighAvailabilityOptions
;
...
@@ -146,8 +147,8 @@ public class TestBaseUtils extends TestLogger {
...
@@ -146,8 +147,8 @@ public class TestBaseUtils extends TestLogger {
config
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
TASK_MANAGER_MEMORY_SIZE
);
config
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
TASK_MANAGER_MEMORY_SIZE
);
config
.
setBoolean
(
ConfigConstants
.
FILESYSTEM_DEFAULT_OVERWRITE_KEY
,
true
);
config
.
setBoolean
(
ConfigConstants
.
FILESYSTEM_DEFAULT_OVERWRITE_KEY
,
true
);
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
DEFAULT_AKKA_ASK_TIMEOUT
+
"s"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
DEFAULT_AKKA_ASK_TIMEOUT
+
"s"
);
config
.
setString
(
ConfigConstants
.
AKKA_
STARTUP_TIMEOUT
,
DEFAULT_AKKA_STARTUP_TIMEOUT
);
config
.
setString
(
AkkaOptions
.
STARTUP_TIMEOUT
,
DEFAULT_AKKA_STARTUP_TIMEOUT
);
config
.
setInteger
(
JobManagerOptions
.
WEB_PORT
,
8081
);
config
.
setInteger
(
JobManagerOptions
.
WEB_PORT
,
8081
);
config
.
setString
(
JobManagerOptions
.
WEB_LOG_PATH
,
logFile
.
toString
());
config
.
setString
(
JobManagerOptions
.
WEB_LOG_PATH
,
logFile
.
toString
());
...
@@ -287,7 +288,7 @@ public class TestBaseUtils extends TestLogger {
...
@@ -287,7 +288,7 @@ public class TestBaseUtils extends TestLogger {
String
resultPath
,
String
resultPath
,
String
[]
excludePrefixes
,
String
[]
excludePrefixes
,
boolean
inOrderOfFiles
)
throws
IOException
{
boolean
inOrderOfFiles
)
throws
IOException
{
checkArgument
(
resultPath
!=
null
,
"resultPath cannot be be null"
);
checkArgument
(
resultPath
!=
null
,
"resultPath cannot be be null"
);
final
BufferedReader
[]
readers
=
getResultReader
(
resultPath
,
excludePrefixes
,
inOrderOfFiles
);
final
BufferedReader
[]
readers
=
getResultReader
(
resultPath
,
excludePrefixes
,
inOrderOfFiles
);
...
@@ -328,8 +329,8 @@ public class TestBaseUtils extends TestLogger {
...
@@ -328,8 +329,8 @@ public class TestBaseUtils extends TestLogger {
String
msg
=
String
.
format
(
String
msg
=
String
.
format
(
"Different elements in arrays: expected %d elements and received %d\n"
+
"Different elements in arrays: expected %d elements and received %d\n"
+
"files: %s\n expected: %s\n received: %s"
,
"files: %s\n expected: %s\n received: %s"
,
expected
.
length
,
result
.
length
,
expected
.
length
,
result
.
length
,
Arrays
.
toString
(
getAllInvolvedFiles
(
resultPath
,
excludePrefixes
)),
Arrays
.
toString
(
getAllInvolvedFiles
(
resultPath
,
excludePrefixes
)),
Arrays
.
toString
(
expected
),
Arrays
.
toString
(
result
));
Arrays
.
toString
(
expected
),
Arrays
.
toString
(
result
));
fail
(
msg
);
fail
(
msg
);
}
}
...
...
flink-tests/src/test/java/org/apache/flink/test/accumulators/AccumulatorLiveITCase.java
浏览文件 @
302c6741
...
@@ -34,6 +34,7 @@ import org.apache.flink.api.common.io.OutputFormat;
...
@@ -34,6 +34,7 @@ import org.apache.flink.api.common.io.OutputFormat;
import
org.apache.flink.api.java.DataSet
;
import
org.apache.flink.api.java.DataSet
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.LocalEnvironment
;
import
org.apache.flink.api.java.LocalEnvironment
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.optimizer.DataStatistics
;
import
org.apache.flink.optimizer.DataStatistics
;
...
@@ -120,7 +121,7 @@ public class AccumulatorLiveITCase extends TestLogger {
...
@@ -120,7 +121,7 @@ public class AccumulatorLiveITCase extends TestLogger {
Configuration
config
=
new
Configuration
();
Configuration
config
=
new
Configuration
();
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
1
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
1
);
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
1
);
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
1
);
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
TestingUtils
.
DEFAULT_AKKA_ASK_TIMEOUT
());
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
TestingUtils
.
DEFAULT_AKKA_ASK_TIMEOUT
());
TestingCluster
testingCluster
=
new
TestingCluster
(
config
,
false
,
true
);
TestingCluster
testingCluster
=
new
TestingCluster
(
config
,
false
,
true
);
testingCluster
.
start
();
testingCluster
.
start
();
...
...
flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java
浏览文件 @
302c6741
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
package
org.apache.flink.test.cancelling
;
package
org.apache.flink.test.cancelling
;
import
org.apache.flink.api.common.Plan
;
import
org.apache.flink.api.common.Plan
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.TaskManagerOptions
;
import
org.apache.flink.configuration.TaskManagerOptions
;
...
@@ -88,7 +89,7 @@ public abstract class CancelingTestBase extends TestLogger {
...
@@ -88,7 +89,7 @@ public abstract class CancelingTestBase extends TestLogger {
config
.
setBoolean
(
ConfigConstants
.
FILESYSTEM_DEFAULT_OVERWRITE_KEY
,
true
);
config
.
setBoolean
(
ConfigConstants
.
FILESYSTEM_DEFAULT_OVERWRITE_KEY
,
true
);
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
2
);
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
2
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
4
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
4
);
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
TestingUtils
.
DEFAULT_AKKA_ASK_TIMEOUT
());
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
TestingUtils
.
DEFAULT_AKKA_ASK_TIMEOUT
());
config
.
setInteger
(
TaskManagerOptions
.
MEMORY_SEGMENT_SIZE
,
4096
);
config
.
setInteger
(
TaskManagerOptions
.
MEMORY_SEGMENT_SIZE
,
4096
);
config
.
setInteger
(
TaskManagerOptions
.
NETWORK_NUM_BUFFERS
,
2048
);
config
.
setInteger
(
TaskManagerOptions
.
NETWORK_NUM_BUFFERS
,
2048
);
...
...
flink-tests/src/test/java/org/apache/flink/test/checkpointing/EventTimeAllWindowCheckpointingITCase.java
浏览文件 @
302c6741
...
@@ -23,6 +23,7 @@ import org.apache.flink.api.common.functions.ReduceFunction;
...
@@ -23,6 +23,7 @@ import org.apache.flink.api.common.functions.ReduceFunction;
import
org.apache.flink.api.common.restartstrategy.RestartStrategies
;
import
org.apache.flink.api.common.restartstrategy.RestartStrategies
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.api.java.tuple.Tuple4
;
import
org.apache.flink.api.java.tuple.Tuple4
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.TaskManagerOptions
;
import
org.apache.flink.configuration.TaskManagerOptions
;
...
@@ -74,8 +75,8 @@ public class EventTimeAllWindowCheckpointingITCase extends TestLogger {
...
@@ -74,8 +75,8 @@ public class EventTimeAllWindowCheckpointingITCase extends TestLogger {
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
2
);
config
.
setInteger
(
ConfigConstants
.
LOCAL_NUMBER_TASK_MANAGER
,
2
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
PARALLELISM
/
2
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
PARALLELISM
/
2
);
config
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
48L
);
config
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
48L
);
config
.
setString
(
ConfigConstants
.
DEFAULT_AKKA_
LOOKUP_TIMEOUT
,
"60 s"
);
config
.
setString
(
AkkaOptions
.
LOOKUP_TIMEOUT
,
"60 s"
);
config
.
setString
(
ConfigConstants
.
DEFAULT_AKKA_
ASK_TIMEOUT
,
"60 s"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"60 s"
);
cluster
=
new
LocalFlinkMiniCluster
(
config
,
false
);
cluster
=
new
LocalFlinkMiniCluster
(
config
,
false
);
cluster
.
start
();
cluster
.
start
();
...
...
flink-tests/src/test/java/org/apache/flink/test/classloading/jar/StreamingCustomInputSplitProgram.java
浏览文件 @
302c6741
...
@@ -25,7 +25,7 @@ import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
...
@@ -25,7 +25,7 @@ import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import
org.apache.flink.api.common.typeinfo.TypeInformation
;
import
org.apache.flink.api.common.typeinfo.TypeInformation
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.api.java.typeutils.ResultTypeQueryable
;
import
org.apache.flink.api.java.typeutils.ResultTypeQueryable
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.core.io.InputSplit
;
import
org.apache.flink.core.io.InputSplit
;
import
org.apache.flink.core.io.InputSplitAssigner
;
import
org.apache.flink.core.io.InputSplitAssigner
;
...
@@ -44,7 +44,7 @@ public class StreamingCustomInputSplitProgram {
...
@@ -44,7 +44,7 @@ public class StreamingCustomInputSplitProgram {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Configuration
config
=
new
Configuration
();
Configuration
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"5 s"
);
config
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"5 s"
);
StreamExecutionEnvironment
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
();
StreamExecutionEnvironment
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
();
...
...
flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/RemoteEnvironmentITCase.java
浏览文件 @
302c6741
...
@@ -24,6 +24,7 @@ import org.apache.flink.api.java.DataSet;
...
@@ -24,6 +24,7 @@ import org.apache.flink.api.java.DataSet;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.io.LocalCollectionOutputFormat
;
import
org.apache.flink.api.java.io.LocalCollectionOutputFormat
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.core.io.GenericInputSplit
;
import
org.apache.flink.core.io.GenericInputSplit
;
...
@@ -78,7 +79,7 @@ public class RemoteEnvironmentITCase extends TestLogger {
...
@@ -78,7 +79,7 @@ public class RemoteEnvironmentITCase extends TestLogger {
@Test
(
expected
=
FlinkException
.
class
)
@Test
(
expected
=
FlinkException
.
class
)
public
void
testInvalidAkkaConfiguration
()
throws
Throwable
{
public
void
testInvalidAkkaConfiguration
()
throws
Throwable
{
Configuration
config
=
new
Configuration
();
Configuration
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_
STARTUP_TIMEOUT
,
INVALID_STARTUP_TIMEOUT
);
config
.
setString
(
AkkaOptions
.
STARTUP_TIMEOUT
,
INVALID_STARTUP_TIMEOUT
);
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
createRemoteEnvironment
(
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
createRemoteEnvironment
(
cluster
.
getHostname
(),
cluster
.
getHostname
(),
...
@@ -103,7 +104,7 @@ public class RemoteEnvironmentITCase extends TestLogger {
...
@@ -103,7 +104,7 @@ public class RemoteEnvironmentITCase extends TestLogger {
@Test
@Test
public
void
testUserSpecificParallelism
()
throws
Exception
{
public
void
testUserSpecificParallelism
()
throws
Exception
{
Configuration
config
=
new
Configuration
();
Configuration
config
=
new
Configuration
();
config
.
setString
(
ConfigConstants
.
AKKA_
STARTUP_TIMEOUT
,
VALID_STARTUP_TIMEOUT
);
config
.
setString
(
AkkaOptions
.
STARTUP_TIMEOUT
,
VALID_STARTUP_TIMEOUT
);
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
createRemoteEnvironment
(
final
ExecutionEnvironment
env
=
ExecutionEnvironment
.
createRemoteEnvironment
(
cluster
.
getHostname
(),
cluster
.
getHostname
(),
...
...
flink-tests/src/test/java/org/apache/flink/test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java
浏览文件 @
302c6741
...
@@ -24,6 +24,7 @@ import akka.pattern.Patterns;
...
@@ -24,6 +24,7 @@ import akka.pattern.Patterns;
import
akka.util.Timeout
;
import
akka.util.Timeout
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.JobManagerOptions
;
import
org.apache.flink.configuration.JobManagerOptions
;
...
@@ -127,11 +128,11 @@ public abstract class AbstractTaskManagerProcessFailureRecoveryTest extends Test
...
@@ -127,11 +128,11 @@ public abstract class AbstractTaskManagerProcessFailureRecoveryTest extends Test
Tuple2
<
String
,
Object
>
localAddress
=
new
Tuple2
<
String
,
Object
>(
"localhost"
,
jobManagerPort
);
Tuple2
<
String
,
Object
>
localAddress
=
new
Tuple2
<
String
,
Object
>(
"localhost"
,
jobManagerPort
);
Configuration
jmConfig
=
new
Configuration
();
Configuration
jmConfig
=
new
Configuration
();
jmConfig
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"1000 ms"
);
jmConfig
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"1000 ms"
);
jmConfig
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"6 s"
);
jmConfig
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"6 s"
);
jmConfig
.
setInteger
(
ConfigConstants
.
AKKA_
WATCH_THRESHOLD
,
9
);
jmConfig
.
setInteger
(
AkkaOptions
.
WATCH_THRESHOLD
,
9
);
jmConfig
.
setString
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_DELAY
,
"10 s"
);
jmConfig
.
setString
(
ConfigConstants
.
RESTART_STRATEGY_FIXED_DELAY_DELAY
,
"10 s"
);
jmConfig
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"100 s"
);
jmConfig
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"100 s"
);
jmConfig
.
setString
(
JobManagerOptions
.
ADDRESS
,
localAddress
.
_1
());
jmConfig
.
setString
(
JobManagerOptions
.
ADDRESS
,
localAddress
.
_1
());
jmConfig
.
setInteger
(
JobManagerOptions
.
PORT
,
jobManagerPort
);
jmConfig
.
setInteger
(
JobManagerOptions
.
PORT
,
jobManagerPort
);
...
@@ -409,7 +410,7 @@ public abstract class AbstractTaskManagerProcessFailureRecoveryTest extends Test
...
@@ -409,7 +410,7 @@ public abstract class AbstractTaskManagerProcessFailureRecoveryTest extends Test
cfg
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
4L
);
cfg
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
4L
);
cfg
.
setInteger
(
TaskManagerOptions
.
NETWORK_NUM_BUFFERS
,
100
);
cfg
.
setInteger
(
TaskManagerOptions
.
NETWORK_NUM_BUFFERS
,
100
);
cfg
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
2
);
cfg
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
2
);
cfg
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"100 s"
);
cfg
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"100 s"
);
TaskManager
.
selectNetworkInterfaceAndRunTaskManager
(
cfg
,
TaskManager
.
selectNetworkInterfaceAndRunTaskManager
(
cfg
,
ResourceID
.
generate
(),
TaskManager
.
class
);
ResourceID
.
generate
(),
TaskManager
.
class
);
...
...
flink-tests/src/test/java/org/apache/flink/test/recovery/ChaosMonkeyITCase.java
浏览文件 @
302c6741
...
@@ -22,6 +22,7 @@ import akka.actor.ActorRef;
...
@@ -22,6 +22,7 @@ import akka.actor.ActorRef;
import
akka.actor.ActorSystem
;
import
akka.actor.ActorSystem
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.HighAvailabilityOptions
;
import
org.apache.flink.configuration.HighAvailabilityOptions
;
...
@@ -156,9 +157,9 @@ public class ChaosMonkeyITCase extends TestLogger {
...
@@ -156,9 +157,9 @@ public class ChaosMonkeyITCase extends TestLogger {
ZooKeeper
.
getConnectString
(),
FileStateBackendBasePath
.
toURI
().
toString
());
ZooKeeper
.
getConnectString
(),
FileStateBackendBasePath
.
toURI
().
toString
());
// Akka and restart timeouts
// Akka and restart timeouts
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"1000 ms"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"1000 ms"
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"6 s"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"6 s"
);
config
.
setInteger
(
ConfigConstants
.
AKKA_
WATCH_THRESHOLD
,
9
);
config
.
setInteger
(
AkkaOptions
.
WATCH_THRESHOLD
,
9
);
if
(
checkpointingIntervalMs
>=
killEvery
.
toMillis
())
{
if
(
checkpointingIntervalMs
>=
killEvery
.
toMillis
())
{
throw
new
IllegalArgumentException
(
"Relax! You want to kill processes every "
+
throw
new
IllegalArgumentException
(
"Relax! You want to kill processes every "
+
...
...
flink-tests/src/test/java/org/apache/flink/test/recovery/ProcessFailureCancelingITCase.java
浏览文件 @
302c6741
...
@@ -29,7 +29,7 @@ import org.apache.flink.api.common.restartstrategy.RestartStrategies;
...
@@ -29,7 +29,7 @@ import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.io.DiscardingOutputFormat
;
import
org.apache.flink.api.java.io.DiscardingOutputFormat
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.configuration.
ConfigConstant
s
;
import
org.apache.flink.configuration.
AkkaOption
s
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.JobManagerOptions
;
import
org.apache.flink.configuration.JobManagerOptions
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
...
@@ -101,10 +101,10 @@ public class ProcessFailureCancelingITCase extends TestLogger {
...
@@ -101,10 +101,10 @@ public class ProcessFailureCancelingITCase extends TestLogger {
Tuple2
<
String
,
Object
>
localAddress
=
new
Tuple2
<
String
,
Object
>(
"localhost"
,
jobManagerPort
);
Tuple2
<
String
,
Object
>
localAddress
=
new
Tuple2
<
String
,
Object
>(
"localhost"
,
jobManagerPort
);
Configuration
jmConfig
=
new
Configuration
();
Configuration
jmConfig
=
new
Configuration
();
jmConfig
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"5 s"
);
jmConfig
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"5 s"
);
jmConfig
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"2000 s"
);
jmConfig
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"2000 s"
);
jmConfig
.
setInteger
(
ConfigConstants
.
AKKA_
WATCH_THRESHOLD
,
10
);
jmConfig
.
setInteger
(
AkkaOptions
.
WATCH_THRESHOLD
,
10
);
jmConfig
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
"100 s"
);
jmConfig
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
"100 s"
);
jmConfig
.
setString
(
JobManagerOptions
.
ADDRESS
,
localAddress
.
_1
());
jmConfig
.
setString
(
JobManagerOptions
.
ADDRESS
,
localAddress
.
_1
());
jmConfig
.
setInteger
(
JobManagerOptions
.
PORT
,
jobManagerPort
);
jmConfig
.
setInteger
(
JobManagerOptions
.
PORT
,
jobManagerPort
);
...
...
flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerFailureRecoveryITCase.java
浏览文件 @
302c6741
...
@@ -27,6 +27,7 @@ import org.apache.flink.api.common.functions.RichMapFunction;
...
@@ -27,6 +27,7 @@ import org.apache.flink.api.common.functions.RichMapFunction;
import
org.apache.flink.api.common.restartstrategy.RestartStrategies
;
import
org.apache.flink.api.common.restartstrategy.RestartStrategies
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.api.java.io.LocalCollectionOutputFormat
;
import
org.apache.flink.api.java.io.LocalCollectionOutputFormat
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.TaskManagerOptions
;
import
org.apache.flink.configuration.TaskManagerOptions
;
...
@@ -77,9 +78,9 @@ public class TaskManagerFailureRecoveryITCase extends TestLogger {
...
@@ -77,9 +78,9 @@ public class TaskManagerFailureRecoveryITCase extends TestLogger {
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
PARALLELISM
);
config
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_NUM_TASK_SLOTS
,
PARALLELISM
);
config
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
16L
);
config
.
setLong
(
TaskManagerOptions
.
MANAGED_MEMORY_SIZE
,
16L
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_INTERVAL
,
"500 ms"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_INTERVAL
,
"500 ms"
);
config
.
setString
(
ConfigConstants
.
AKKA_
WATCH_HEARTBEAT_PAUSE
,
"20 s"
);
config
.
setString
(
AkkaOptions
.
WATCH_HEARTBEAT_PAUSE
,
"20 s"
);
config
.
setInteger
(
ConfigConstants
.
AKKA_
WATCH_THRESHOLD
,
20
);
config
.
setInteger
(
AkkaOptions
.
WATCH_THRESHOLD
,
20
);
cluster
=
new
LocalFlinkMiniCluster
(
config
,
false
);
cluster
=
new
LocalFlinkMiniCluster
(
config
,
false
);
...
...
flink-tests/src/test/java/org/apache/flink/test/runtime/leaderelection/ZooKeeperLeaderElectionITCase.java
浏览文件 @
302c6741
...
@@ -23,6 +23,7 @@ import akka.actor.Kill;
...
@@ -23,6 +23,7 @@ import akka.actor.Kill;
import
akka.actor.PoisonPill
;
import
akka.actor.PoisonPill
;
import
org.apache.curator.test.TestingServer
;
import
org.apache.curator.test.TestingServer
;
import
org.apache.flink.api.common.JobExecutionResult
;
import
org.apache.flink.api.common.JobExecutionResult
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
import
org.apache.flink.runtime.akka.AkkaUtils
;
...
@@ -151,7 +152,7 @@ public class ZooKeeperLeaderElectionITCase extends TestLogger {
...
@@ -151,7 +152,7 @@ public class ZooKeeperLeaderElectionITCase extends TestLogger {
// we "effectively" disable the automatic RecoverAllJobs message and sent it manually to make
// we "effectively" disable the automatic RecoverAllJobs message and sent it manually to make
// sure that all TMs have registered to the JM prior to issueing the RecoverAllJobs message
// sure that all TMs have registered to the JM prior to issueing the RecoverAllJobs message
configuration
.
setString
(
ConfigConstants
.
AKKA_
ASK_TIMEOUT
,
AkkaUtils
.
INF_TIMEOUT
().
toString
());
configuration
.
setString
(
AkkaOptions
.
ASK_TIMEOUT
,
AkkaUtils
.
INF_TIMEOUT
().
toString
());
Tasks
.
BlockingOnceReceiver
$
.
MODULE
$
.
blocking_
$eq
(
true
);
Tasks
.
BlockingOnceReceiver
$
.
MODULE
$
.
blocking_
$eq
(
true
);
...
...
flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskExecutorRunner.java
浏览文件 @
302c6741
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
package
org.apache.flink.yarn
;
package
org.apache.flink.yarn
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
import
org.apache.flink.configuration.GlobalConfiguration
;
...
@@ -127,7 +128,7 @@ public class YarnTaskExecutorRunner {
...
@@ -127,7 +128,7 @@ public class YarnTaskExecutorRunner {
}
}
// tell akka to die in case of an error
// tell akka to die in case of an error
configuration
.
setBoolean
(
ConfigConstants
.
AKKA_
JVM_EXIT_ON_FATAL_ERROR
,
true
);
configuration
.
setBoolean
(
AkkaOptions
.
JVM_EXIT_ON_FATAL_ERROR
,
true
);
String
keytabPath
=
null
;
String
keytabPath
=
null
;
if
(
remoteKeytabPath
!=
null
)
{
if
(
remoteKeytabPath
!=
null
)
{
...
...
flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskManagerRunner.java
浏览文件 @
302c6741
...
@@ -23,6 +23,7 @@ import java.io.IOException;
...
@@ -23,6 +23,7 @@ import java.io.IOException;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
org.apache.flink.configuration.AkkaOptions
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.ConfigConstants
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.SecurityOptions
;
import
org.apache.flink.configuration.SecurityOptions
;
...
@@ -91,7 +92,7 @@ public class YarnTaskManagerRunner {
...
@@ -91,7 +92,7 @@ public class YarnTaskManagerRunner {
}
}
// tell akka to die in case of an error
// tell akka to die in case of an error
configuration
.
setBoolean
(
ConfigConstants
.
AKKA_
JVM_EXIT_ON_FATAL_ERROR
,
true
);
configuration
.
setBoolean
(
AkkaOptions
.
JVM_EXIT_ON_FATAL_ERROR
,
true
);
String
localKeytabPath
=
null
;
String
localKeytabPath
=
null
;
if
(
remoteKeytabPath
!=
null
)
{
if
(
remoteKeytabPath
!=
null
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录