Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
3bef3a7f
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,发现更多精彩内容 >>
提交
3bef3a7f
编写于
3月 26, 2020
作者:
C
Chesnay Schepler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-16808][e2e] Consolidated logging
上级
e0333a41
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
7 addition
and
25 deletion
+7
-25
flink-end-to-end-tests/flink-end-to-end-tests-common-kafka/src/main/java/org/apache/flink/tests/util/kafka/LocalStandaloneKafkaResourceFactory.java
...tests/util/kafka/LocalStandaloneKafkaResourceFactory.java
+0
-5
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/cache/LolCacheFactory.java
...va/org/apache/flink/tests/util/cache/LolCacheFactory.java
+0
-4
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/cache/PersistingDownloadCacheFactory.java
...link/tests/util/cache/PersistingDownloadCacheFactory.java
+0
-6
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/cache/TravisDownloadCacheFactory.java
...he/flink/tests/util/cache/TravisDownloadCacheFactory.java
+0
-8
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
...tests/util/flink/LocalStandaloneFlinkResourceFactory.java
+0
-2
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/util/FactoryUtils.java
...n/java/org/apache/flink/tests/util/util/FactoryUtils.java
+7
-0
未找到文件。
flink-end-to-end-tests/flink-end-to-end-tests-common-kafka/src/main/java/org/apache/flink/tests/util/kafka/LocalStandaloneKafkaResourceFactory.java
浏览文件 @
3bef3a7f
...
...
@@ -18,18 +18,13 @@
package
org.apache.flink.tests.util.kafka
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* A {@link KafkaResourceFactory} for the {@link LocalStandaloneKafkaResourceFactory}.
*/
public
final
class
LocalStandaloneKafkaResourceFactory
implements
KafkaResourceFactory
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
LocalStandaloneKafkaResourceFactory
.
class
);
@Override
public
KafkaResource
create
(
final
String
kafkaVersion
)
{
LOG
.
info
(
"Created {}."
,
LocalStandaloneKafkaResource
.
class
.
getSimpleName
());
return
new
LocalStandaloneKafkaResource
(
kafkaVersion
);
}
}
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/cache/LolCacheFactory.java
浏览文件 @
3bef3a7f
...
...
@@ -19,8 +19,6 @@
package
org.apache.flink.tests.util.cache
;
import
org.junit.rules.TemporaryFolder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
...
...
@@ -28,13 +26,11 @@ import java.io.IOException;
* A {@link DownloadCacheFactory} for the {@link LolCache}.
*/
public
final
class
LolCacheFactory
implements
DownloadCacheFactory
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
LolCacheFactory
.
class
);
@Override
public
DownloadCache
create
()
throws
IOException
{
final
TemporaryFolder
folder
=
new
TemporaryFolder
();
folder
.
create
();
LOG
.
info
(
"Created {}."
,
LolCache
.
class
.
getSimpleName
());
return
new
LolCache
(
folder
);
}
}
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/cache/PersistingDownloadCacheFactory.java
浏览文件 @
3bef3a7f
...
...
@@ -20,9 +20,6 @@ package org.apache.flink.tests.util.cache;
import
org.apache.flink.tests.util.parameters.ParameterProperty
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.time.Period
;
...
...
@@ -32,7 +29,6 @@ import java.util.Optional;
* A {@link DownloadCacheFactory} for the {@link PersistingDownloadCache}.
*/
public
final
class
PersistingDownloadCacheFactory
implements
DownloadCacheFactory
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
PersistingDownloadCacheFactory
.
class
);
private
static
final
ParameterProperty
<
Path
>
TMP_DIR
=
new
ParameterProperty
<>(
"cache-dir"
,
value
->
Paths
.
get
(
value
));
private
static
final
ParameterProperty
<
Period
>
TIME_TO_LIVE
=
new
ParameterProperty
<>(
"cache-ttl"
,
Period:
:
parse
);
...
...
@@ -44,10 +40,8 @@ public final class PersistingDownloadCacheFactory implements DownloadCacheFactor
final
Optional
<
Path
>
tmpDir
=
TMP_DIR
.
get
();
final
Period
timeToLive
=
TIME_TO_LIVE
.
get
(
TIME_TO_LIVE_DEFAULT
);
if
(!
tmpDir
.
isPresent
())
{
LOG
.
debug
(
"Not loading {} because {} was not set."
,
PersistingDownloadCache
.
class
,
TMP_DIR
.
getPropertyName
());
throw
new
IllegalArgumentException
(
String
.
format
(
"Not loading %s because %s was not set."
,
PersistingDownloadCache
.
class
,
TMP_DIR
.
getPropertyName
()));
}
LOG
.
info
(
"Created {}."
,
PersistingDownloadCache
.
class
.
getSimpleName
());
return
new
PersistingDownloadCache
(
tmpDir
.
get
(),
timeToLive
);
}
}
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/cache/TravisDownloadCacheFactory.java
浏览文件 @
3bef3a7f
...
...
@@ -20,9 +20,6 @@ package org.apache.flink.tests.util.cache;
import
org.apache.flink.tests.util.parameters.ParameterProperty
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.Optional
;
...
...
@@ -31,7 +28,6 @@ import java.util.Optional;
* A {@link DownloadCacheFactory} for the {@link TravisDownloadCache}.
*/
public
final
class
TravisDownloadCacheFactory
implements
DownloadCacheFactory
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TravisDownloadCacheFactory
.
class
);
private
static
final
ParameterProperty
<
Path
>
TMP_DIR
=
new
ParameterProperty
<>(
"cache-dir"
,
value
->
Paths
.
get
(
value
));
private
static
final
ParameterProperty
<
Integer
>
BUILDS_TO_LIVE
=
new
ParameterProperty
<>(
"cache-btl"
,
Integer:
:
parseInt
);
...
...
@@ -43,18 +39,14 @@ public final class TravisDownloadCacheFactory implements DownloadCacheFactory {
final
Optional
<
Integer
>
timeToLive
=
BUILDS_TO_LIVE
.
get
();
final
Optional
<
Integer
>
buildNumber
=
BUILD_NUMBER
.
get
();
if
(!
tmpDir
.
isPresent
())
{
LOG
.
debug
(
"Not loading {} because {} was not set."
,
TravisDownloadCache
.
class
,
TMP_DIR
.
getPropertyName
());
throw
new
IllegalArgumentException
(
String
.
format
(
"Not loading %s because %s was not set."
,
TravisDownloadCache
.
class
,
TMP_DIR
.
getPropertyName
()));
}
if
(!
timeToLive
.
isPresent
())
{
LOG
.
debug
(
"Not loading {} because {} was not set."
,
TravisDownloadCache
.
class
,
BUILDS_TO_LIVE
.
getPropertyName
());
throw
new
IllegalArgumentException
(
String
.
format
(
"Not loading %s because %s was not set."
,
TravisDownloadCache
.
class
,
BUILDS_TO_LIVE
.
getPropertyName
()));
}
if
(!
buildNumber
.
isPresent
())
{
LOG
.
debug
(
"Not loading {} because {} was not set."
,
TravisDownloadCache
.
class
,
BUILD_NUMBER
.
getPropertyName
());
throw
new
IllegalArgumentException
(
String
.
format
(
"Not loading %s because %s was not set."
,
TravisDownloadCache
.
class
,
BUILD_NUMBER
.
getPropertyName
()));
}
LOG
.
info
(
"Created {}."
,
TravisDownloadCache
.
class
.
getSimpleName
());
return
new
TravisDownloadCache
(
tmpDir
.
get
(),
timeToLive
.
get
(),
buildNumber
.
get
());
}
}
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
浏览文件 @
3bef3a7f
...
...
@@ -40,14 +40,12 @@ public final class LocalStandaloneFlinkResourceFactory implements FlinkResourceF
public
FlinkResource
create
(
FlinkResourceSetup
setup
)
{
Optional
<
Path
>
distributionDirectory
=
DISTRIBUTION_DIRECTORY
.
get
();
if
(!
distributionDirectory
.
isPresent
())
{
LOG
.
warn
(
"The distDir property was not set. You can set it when running maven via -DdistDir=<path> ."
);
throw
new
IllegalArgumentException
(
"The distDir property was not set. You can set it when running maven via -DdistDir=<path> ."
);
}
Optional
<
Path
>
logBackupDirectory
=
DISTRIBUTION_LOG_BACKUP_DIRECTORY
.
get
();
if
(!
logBackupDirectory
.
isPresent
())
{
LOG
.
warn
(
"Property {} not set, logs will not be backed up in case of test failures."
,
DISTRIBUTION_LOG_BACKUP_DIRECTORY
.
getPropertyName
());
}
LOG
.
info
(
"Created {}."
,
LocalStandaloneFlinkResource
.
class
.
getSimpleName
());
return
new
LocalStandaloneFlinkResource
(
distributionDirectory
.
get
(),
logBackupDirectory
.
orElse
(
null
),
setup
);
}
}
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/util/FactoryUtils.java
浏览文件 @
3bef3a7f
...
...
@@ -18,6 +18,9 @@
package
org.apache.flink.tests.util.util
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.ServiceLoader
;
...
...
@@ -29,6 +32,8 @@ import java.util.function.Supplier;
public
enum
FactoryUtils
{
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
FactoryUtils
.
class
);
/**
* Loads all factories for the given class using the {@link ServiceLoader} and attempts to create an instance.
*
...
...
@@ -49,7 +54,9 @@ public enum FactoryUtils {
try
{
R
resource
=
factoryInvoker
.
invoke
(
factory
);
instantiatedResources
.
add
(
resource
);
LOG
.
info
(
"Instantiated {}."
,
resource
.
getClass
().
getSimpleName
());
}
catch
(
Exception
e
)
{
LOG
.
debug
(
"Factory {} could not instantiate instance."
,
factory
.
getClass
().
getSimpleName
(),
e
);
errorsDuringInitialization
.
add
(
e
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录