Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
4945cb71
Unverified
Commit
4945cb71
authored
Oct 09, 2022
by
Zzih
Committed by
GitHub
Oct 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix [*] Replace System.out.println with logger.info (#1069)
* Replace System.out.println with logger.info * Delete System.out.println * update import;
parent
0765de2c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
17 deletions
+43
-17
Submiter.java
...p-base/src/main/java/com/dlink/app/flinksql/Submiter.java
+1
-2
CustomTableResultImpl.java
...c/main/java/com/dlink/executor/CustomTableResultImpl.java
+5
-1
CustomTableResultImpl.java
...c/main/java/com/dlink/executor/CustomTableResultImpl.java
+5
-1
CustomTableResultImpl.java
...c/main/java/com/dlink/executor/CustomTableResultImpl.java
+5
-1
CustomTableResultImpl.java
...c/main/java/com/dlink/executor/CustomTableResultImpl.java
+5
-1
LineageBuilder.java
...n/java/com/dlink/explainer/sqllineage/LineageBuilder.java
+6
-2
LineageUtils.java
...ain/java/com/dlink/explainer/sqllineage/LineageUtils.java
+5
-1
UDFUtil.java
dlink-core/src/main/java/com/dlink/utils/UDFUtil.java
+11
-8
No files found.
dlink-app/dlink-app-base/src/main/java/com/dlink/app/flinksql/Submiter.java
View file @
4945cb71
...
@@ -184,7 +184,6 @@ public class Submiter {
...
@@ -184,7 +184,6 @@ public class Submiter {
logger
.
error
(
"执行失败, {}"
,
e
.
getMessage
(),
e
);
logger
.
error
(
"执行失败, {}"
,
e
.
getMessage
(),
e
);
}
}
}
}
logger
.
info
(
LocalDateTime
.
now
()
+
"任务提交成功"
);
logger
.
info
(
"{}任务提交成功"
,
LocalDateTime
.
now
());
System
.
out
.
println
(
LocalDateTime
.
now
()
+
"任务提交成功"
);
}
}
}
}
dlink-client/dlink-client-1.11/src/main/java/com/dlink/executor/CustomTableResultImpl.java
View file @
4945cb71
...
@@ -39,6 +39,9 @@ import java.util.Optional;
...
@@ -39,6 +39,9 @@ import java.util.Optional;
import
javax.annotation.Nullable
;
import
javax.annotation.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
/**
* 定制TableResultImpl
* 定制TableResultImpl
*
*
...
@@ -47,6 +50,7 @@ import javax.annotation.Nullable;
...
@@ -47,6 +50,7 @@ import javax.annotation.Nullable;
**/
**/
@Internal
@Internal
class
CustomTableResultImpl
implements
TableResult
{
class
CustomTableResultImpl
implements
TableResult
{
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CustomTableResultImpl
.
class
);
public
static
final
TableResult
TABLE_RESULT_OK
=
public
static
final
TableResult
TABLE_RESULT_OK
=
CustomTableResultImpl
.
builder
()
CustomTableResultImpl
.
builder
()
.
resultKind
(
ResultKind
.
SUCCESS
)
.
resultKind
(
ResultKind
.
SUCCESS
)
...
@@ -123,7 +127,7 @@ class CustomTableResultImpl implements TableResult {
...
@@ -123,7 +127,7 @@ class CustomTableResultImpl implements TableResult {
deriveColumnWidthByType
);
deriveColumnWidthByType
);
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
System
.
out
.
println
(
String
.
join
(
","
,
PrintUtils
.
rowToString
(
it
.
next
())));
logger
.
info
(
String
.
join
(
","
,
PrintUtils
.
rowToString
(
it
.
next
())));
}
}
}
else
{
}
else
{
throw
new
TableException
(
"Unsupported print style: "
+
printStyle
);
throw
new
TableException
(
"Unsupported print style: "
+
printStyle
);
...
...
dlink-client/dlink-client-1.12/src/main/java/com/dlink/executor/CustomTableResultImpl.java
View file @
4945cb71
...
@@ -45,6 +45,9 @@ import java.util.concurrent.TimeoutException;
...
@@ -45,6 +45,9 @@ import java.util.concurrent.TimeoutException;
import
javax.annotation.Nullable
;
import
javax.annotation.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
/**
* 定制CustomTableResultImpl
* 定制CustomTableResultImpl
*
*
...
@@ -53,6 +56,7 @@ import javax.annotation.Nullable;
...
@@ -53,6 +56,7 @@ import javax.annotation.Nullable;
**/
**/
@Internal
@Internal
class
CustomTableResultImpl
implements
TableResult
{
class
CustomTableResultImpl
implements
TableResult
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CustomTableResultImpl
.
class
);
public
static
final
TableResult
TABLE_RESULT_OK
=
public
static
final
TableResult
TABLE_RESULT_OK
=
CustomTableResultImpl
.
builder
()
CustomTableResultImpl
.
builder
()
.
resultKind
(
ResultKind
.
SUCCESS
)
.
resultKind
(
ResultKind
.
SUCCESS
)
...
@@ -179,7 +183,7 @@ class CustomTableResultImpl implements TableResult {
...
@@ -179,7 +183,7 @@ class CustomTableResultImpl implements TableResult {
printRowKind
);
printRowKind
);
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
System
.
out
.
println
(
String
.
join
(
","
,
PrintUtils
.
rowToString
(
it
.
next
())));
logger
.
info
(
String
.
join
(
","
,
PrintUtils
.
rowToString
(
it
.
next
())));
}
}
}
else
{
}
else
{
throw
new
TableException
(
"Unsupported print style: "
+
printStyle
);
throw
new
TableException
(
"Unsupported print style: "
+
printStyle
);
...
...
dlink-client/dlink-client-1.13/src/main/java/com/dlink/executor/CustomTableResultImpl.java
View file @
4945cb71
...
@@ -49,6 +49,9 @@ import java.util.concurrent.TimeoutException;
...
@@ -49,6 +49,9 @@ import java.util.concurrent.TimeoutException;
import
javax.annotation.Nullable
;
import
javax.annotation.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
/**
* 定制CustomTableResultImpl
* 定制CustomTableResultImpl
*
*
...
@@ -57,6 +60,7 @@ import javax.annotation.Nullable;
...
@@ -57,6 +60,7 @@ import javax.annotation.Nullable;
**/
**/
@Internal
@Internal
public
class
CustomTableResultImpl
implements
TableResult
{
public
class
CustomTableResultImpl
implements
TableResult
{
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CustomTableResultImpl
.
class
);
public
static
final
TableResult
TABLE_RESULT_OK
=
public
static
final
TableResult
TABLE_RESULT_OK
=
CustomTableResultImpl
.
builder
()
CustomTableResultImpl
.
builder
()
.
resultKind
(
ResultKind
.
SUCCESS
)
.
resultKind
(
ResultKind
.
SUCCESS
)
...
@@ -190,7 +194,7 @@ public class CustomTableResultImpl implements TableResult {
...
@@ -190,7 +194,7 @@ public class CustomTableResultImpl implements TableResult {
sessionTimeZone
);
sessionTimeZone
);
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
System
.
out
.
println
(
logger
.
info
(
String
.
join
(
String
.
join
(
","
,
","
,
PrintUtils
.
rowToString
(
PrintUtils
.
rowToString
(
...
...
dlink-client/dlink-client-1.14/src/main/java/com/dlink/executor/CustomTableResultImpl.java
View file @
4945cb71
...
@@ -49,6 +49,9 @@ import java.util.concurrent.TimeoutException;
...
@@ -49,6 +49,9 @@ import java.util.concurrent.TimeoutException;
import
javax.annotation.Nullable
;
import
javax.annotation.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
/**
* 定制TableResultImpl
* 定制TableResultImpl
*
*
...
@@ -57,6 +60,7 @@ import javax.annotation.Nullable;
...
@@ -57,6 +60,7 @@ import javax.annotation.Nullable;
**/
**/
@Internal
@Internal
public
class
CustomTableResultImpl
implements
TableResult
{
public
class
CustomTableResultImpl
implements
TableResult
{
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CustomTableResultImpl
.
class
);
public
static
final
TableResult
TABLE_RESULT_OK
=
public
static
final
TableResult
TABLE_RESULT_OK
=
CustomTableResultImpl
.
builder
()
CustomTableResultImpl
.
builder
()
.
resultKind
(
ResultKind
.
SUCCESS
)
.
resultKind
(
ResultKind
.
SUCCESS
)
...
@@ -190,7 +194,7 @@ public class CustomTableResultImpl implements TableResult {
...
@@ -190,7 +194,7 @@ public class CustomTableResultImpl implements TableResult {
sessionTimeZone
);
sessionTimeZone
);
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
}
else
if
(
printStyle
instanceof
RawContentStyle
)
{
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
System
.
out
.
println
(
logger
.
info
(
String
.
join
(
String
.
join
(
","
,
","
,
PrintUtils
.
rowToString
(
PrintUtils
.
rowToString
(
...
...
dlink-core/src/main/java/com/dlink/explainer/sqllineage/LineageBuilder.java
View file @
4945cb71
...
@@ -34,6 +34,9 @@ import java.util.List;
...
@@ -34,6 +34,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.alibaba.druid.sql.SQLUtils
;
import
com.alibaba.druid.sql.SQLUtils
;
import
com.alibaba.druid.sql.ast.SQLExpr
;
import
com.alibaba.druid.sql.ast.SQLExpr
;
import
com.alibaba.druid.sql.ast.SQLStatement
;
import
com.alibaba.druid.sql.ast.SQLStatement
;
...
@@ -43,6 +46,7 @@ import com.alibaba.druid.sql.ast.statement.SQLInsertStatement;
...
@@ -43,6 +46,7 @@ import com.alibaba.druid.sql.ast.statement.SQLInsertStatement;
import
com.alibaba.druid.stat.TableStat
;
import
com.alibaba.druid.stat.TableStat
;
public
class
LineageBuilder
{
public
class
LineageBuilder
{
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LineageBuilder
.
class
);
public
static
LineageResult
getSqlLineageByOne
(
String
statement
,
String
type
)
{
public
static
LineageResult
getSqlLineageByOne
(
String
statement
,
String
type
)
{
List
<
LineageTable
>
tables
=
new
ArrayList
<>();
List
<
LineageTable
>
tables
=
new
ArrayList
<>();
List
<
LineageRelation
>
relations
=
new
ArrayList
<>();
List
<
LineageRelation
>
relations
=
new
ArrayList
<>();
...
@@ -115,7 +119,7 @@ public class LineageBuilder {
...
@@ -115,7 +119,7 @@ public class LineageBuilder {
int
tSize
=
tgtList
.
size
();
int
tSize
=
tgtList
.
size
();
int
sSize
=
srcLists
.
size
();
int
sSize
=
srcLists
.
size
();
if
(
tSize
!=
sSize
&&
tSize
*
2
!=
sSize
)
{
if
(
tSize
!=
sSize
&&
tSize
*
2
!=
sSize
)
{
System
.
out
.
println
(
"出现字段位数不相等错误"
);
logger
.
info
(
"出现字段位数不相等错误"
);
return
null
;
return
null
;
}
}
for
(
int
i
=
0
;
i
<
tSize
;
i
++)
{
for
(
int
i
=
0
;
i
<
tSize
;
i
++)
{
...
@@ -249,7 +253,7 @@ public class LineageBuilder {
...
@@ -249,7 +253,7 @@ public class LineageBuilder {
int
tSize
=
tgtList
.
size
();
int
tSize
=
tgtList
.
size
();
int
sSize
=
srcLists
.
size
();
int
sSize
=
srcLists
.
size
();
if
(
tSize
!=
sSize
&&
tSize
*
2
!=
sSize
)
{
if
(
tSize
!=
sSize
&&
tSize
*
2
!=
sSize
)
{
System
.
out
.
println
(
"出现字段位数不相等错误"
);
logger
.
info
(
"出现字段位数不相等错误"
);
return
null
;
return
null
;
}
}
for
(
int
i
=
0
;
i
<
tSize
;
i
++)
{
for
(
int
i
=
0
;
i
<
tSize
;
i
++)
{
...
...
dlink-core/src/main/java/com/dlink/explainer/sqllineage/LineageUtils.java
View file @
4945cb71
...
@@ -25,6 +25,9 @@ import java.util.ArrayList;
...
@@ -25,6 +25,9 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.alibaba.druid.sql.SQLUtils
;
import
com.alibaba.druid.sql.SQLUtils
;
import
com.alibaba.druid.sql.ast.SQLExpr
;
import
com.alibaba.druid.sql.ast.SQLExpr
;
import
com.alibaba.druid.sql.ast.SQLStatement
;
import
com.alibaba.druid.sql.ast.SQLStatement
;
...
@@ -49,6 +52,7 @@ import com.alibaba.druid.sql.ast.statement.SQLUnionQuery;
...
@@ -49,6 +52,7 @@ import com.alibaba.druid.sql.ast.statement.SQLUnionQuery;
import
com.alibaba.druid.sql.ast.statement.SQLUnionQueryTableSource
;
import
com.alibaba.druid.sql.ast.statement.SQLUnionQueryTableSource
;
public
class
LineageUtils
{
public
class
LineageUtils
{
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LineageUtils
.
class
);
public
static
void
columnLineageAnalyzer
(
String
sql
,
String
type
,
TreeNode
<
LineageColumn
>
node
)
{
public
static
void
columnLineageAnalyzer
(
String
sql
,
String
type
,
TreeNode
<
LineageColumn
>
node
)
{
if
(
Asserts
.
isNullString
(
sql
))
{
if
(
Asserts
.
isNullString
(
sql
))
{
...
@@ -62,7 +66,7 @@ public class LineageUtils {
...
@@ -62,7 +66,7 @@ public class LineageUtils {
try
{
try
{
statements
=
SQLUtils
.
parseStatements
(
sql
,
type
);
statements
=
SQLUtils
.
parseStatements
(
sql
,
type
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"can't parser by druid "
+
type
+
e
);
logger
.
info
(
"can't parser by druid {}"
,
type
,
e
);
}
}
// 只考虑一条语句
// 只考虑一条语句
...
...
dlink-core/src/main/java/com/dlink/utils/UDFUtil.java
View file @
4945cb71
...
@@ -29,6 +29,8 @@ import java.util.List;
...
@@ -29,6 +29,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
org.codehaus.groovy.control.CompilerConfiguration
;
import
org.codehaus.groovy.control.CompilerConfiguration
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.map.MapUtil
;
...
@@ -43,6 +45,7 @@ import groovy.lang.GroovyClassLoader;
...
@@ -43,6 +45,7 @@ import groovy.lang.GroovyClassLoader;
* @since 2021/12/27 23:25
* @since 2021/12/27 23:25
*/
*/
public
class
UDFUtil
{
public
class
UDFUtil
{
protected
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UDFUtil
.
class
);
public
static
void
buildClass
(
String
code
)
{
public
static
void
buildClass
(
String
code
)
{
CustomStringJavaCompiler
compiler
=
new
CustomStringJavaCompiler
(
code
);
CustomStringJavaCompiler
compiler
=
new
CustomStringJavaCompiler
(
code
);
...
@@ -51,12 +54,12 @@ public class UDFUtil {
...
@@ -51,12 +54,12 @@ public class UDFUtil {
String
className
=
compiler
.
getFullClassName
();
String
className
=
compiler
.
getFullClassName
();
byte
[]
compiledBytes
=
compiler
.
getJavaFileObjectMap
(
className
).
getCompiledBytes
();
byte
[]
compiledBytes
=
compiler
.
getJavaFileObjectMap
(
className
).
getCompiledBytes
();
ClassPool
.
push
(
new
ClassEntity
(
className
,
code
,
compiledBytes
));
ClassPool
.
push
(
new
ClassEntity
(
className
,
code
,
compiledBytes
));
System
.
out
.
println
(
"编译成功"
);
logger
.
info
(
"编译成功"
);
System
.
out
.
println
(
"compilerTakeTime:"
+
compiler
.
getCompilerTakeTime
());
logger
.
info
(
"compilerTakeTime:{}"
,
compiler
.
getCompilerTakeTime
());
initClassLoader
(
className
);
initClassLoader
(
className
);
}
else
{
}
else
{
System
.
out
.
println
(
"编译失败"
);
logger
.
info
(
"编译失败"
);
System
.
out
.
println
(
compiler
.
getCompilerMessage
());
logger
.
info
(
compiler
.
getCompilerMessage
());
}
}
}
}
...
@@ -84,12 +87,12 @@ public class UDFUtil {
...
@@ -84,12 +87,12 @@ public class UDFUtil {
boolean
res
=
compiler
.
compilerToTmpPath
(
tmpPath
);
boolean
res
=
compiler
.
compilerToTmpPath
(
tmpPath
);
String
className
=
compiler
.
getFullClassName
();
String
className
=
compiler
.
getFullClassName
();
if
(
res
)
{
if
(
res
)
{
System
.
out
.
println
(
"编译成功"
);
logger
.
info
(
"编译成功"
);
System
.
out
.
println
(
"compilerTakeTime:"
+
compiler
.
getCompilerTakeTime
());
logger
.
info
(
"compilerTakeTime:{}"
,
compiler
.
getCompilerTakeTime
());
successList
.
add
(
className
);
successList
.
add
(
className
);
}
else
{
}
else
{
System
.
out
.
println
(
"编译失败"
);
logger
.
info
(
"编译失败"
);
System
.
out
.
println
(
compiler
.
getCompilerMessage
());
logger
.
info
(
compiler
.
getCompilerMessage
());
failedList
.
add
(
className
);
failedList
.
add
(
className
);
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment