Skip to content

Commit e0f289b

Browse files
author
dapeng
committed
codeview fix
1 parent 126a295 commit e0f289b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

console/console-sink/src/main/java/com/dtstack/flink/sql/sink/console/table/TablePrintUtil.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public static TablePrintUtil build(String[][] data) {
5858
public static <T> TablePrintUtil build(List<T> data) {
5959
TablePrintUtil self = new TablePrintUtil();
6060
self.data = new ArrayList<>();
61-
if (data.size() <= 0) throw new RuntimeException("数据源至少得有一行吧");
61+
if (data.size() <= 0) {
62+
throw new RuntimeException("数据源至少得有一行吧");
63+
}
6264
Object obj = data.get(0);
6365

6466

@@ -70,7 +72,9 @@ public static <T> TablePrintUtil build(List<T> data) {
7072
int length = ((List) obj).size();
7173
for (Object item : data) {
7274
List<String> col = (List<String>) item;
73-
if (col.size() != length) throw new RuntimeException("数据源每列长度必须一致");
75+
if (col.size() != length) {
76+
throw new RuntimeException("数据源每列长度必须一致");
77+
}
7478
self.data.add(col.toArray(new String[length]));
7579
}
7680
} else {
@@ -163,7 +167,9 @@ private int[] getColLengths() {
163167
if (equilong) {//如果等宽表格
164168
int max = 0;
165169
for (int len : result) {
166-
if (len > max) max = len;
170+
if (len > max) {
171+
max = len;
172+
}
167173
}
168174
for (int i = 0; i < result.length; i++) {
169175
result[i] = max;

launcher/src/main/java/com/dtstack/flink/sql/launcher/ClusterClientFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static ClusterClient createYarnSessionClient(Options launcherOptions) {
8989

9090
if (StringUtils.isNotBlank(yarnConfDir)) {
9191
try {
92-
config.setString(ConfigConstants.PATH_HADOOP_CONFIG, yarnConfDir);
92+
config.setString("fs.hdfs.hadoopconf", yarnConfDir);
9393
FileSystem.initialize(config);
9494

9595
YarnConfiguration yarnConf = YarnConfLoader.getYarnConf(yarnConfDir);
@@ -166,7 +166,7 @@ private static ApplicationId getYarnClusterApplicationId(YarnClient yarnClient)
166166

167167
private static ApplicationId toApplicationId(String appIdStr) {
168168
Iterator<String> it = StringHelper._split(appIdStr).iterator();
169-
if (!(it.next()).equals("application")) {
169+
if (!"application".equals(it.next())) {
170170
throw new IllegalArgumentException("Invalid ApplicationId prefix: " + appIdStr + ". The valid ApplicationId should start with prefix " + "application");
171171
} else {
172172
try {

0 commit comments

Comments
 (0)