Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
Overview
Overview
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
data-hook
gic-cloud
Commits
f22d725e
Commit
f22d725e
authored
Apr 24, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-2023-04' into 'master'
Fix 2023 04 See merge request
!97
parents
e7679764
84c71daf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
HDFSUtil.java
...c/main/java/com/gic/cloud/data/hook/service/HDFSUtil.java
+3
-1
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+7
-1
ExceTest2.java
...ud-data-hook-service/src/test/java/com/gic/ExceTest2.java
+0
-0
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/HDFSUtil.java
View file @
f22d725e
...
...
@@ -47,7 +47,9 @@ public class HDFSUtil {
*/
public
boolean
downloadFile
(
String
srcPath
,
String
toPath
)
{
try
{
fileSystem
.
copyToLocalFile
(
true
,
new
Path
(
srcPath
),
new
Path
(
toPath
));
Config
appConfig
=
ConfigService
.
getAppConfig
();
Integer
delFlag
=
appConfig
.
getIntProperty
(
"del.hive.flag"
,
1
);
fileSystem
.
copyToLocalFile
(
delFlag
.
intValue
()==
1
?
true
:
false
,
new
Path
(
srcPath
),
new
Path
(
toPath
));
return
true
;
}
catch
(
IOException
e
)
{
logger
.
info
(
"下载失败:{}"
,
e
);
...
...
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
f22d725e
...
...
@@ -934,6 +934,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
logger
.
info
(
"下载耗时:{}"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
List
<
String
>
xlsxFiles
=
new
ArrayList
<>();
AtomicInteger
totalCount
=
new
AtomicInteger
(
0
);
AtomicInteger
count
=
new
AtomicInteger
(
0
);
AtomicReference
<
XlsxFileInfo
>
currentFile
=
new
AtomicReference
<>();
readCsvFile
(
condition
,
dirName
,(
cells
,
titles
,
firstFlag
)->{
...
...
@@ -946,9 +947,12 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
saveXlsSplitNew
(
currentFile
.
get
().
filepath
,
cells
,
titles
,
currentFile
.
get
(),
count
,
false
,
queryDataType
);
});
//结束
Integer
limitSize
=
FileUtil
.
getLimitSize
();
Integer
total
=
(
xlsxFiles
.
size
()-
1
)*
limitSize
+
count
.
get
();
saveXlsSplitNew
(
currentFile
.
get
().
filepath
,
null
,
null
,
currentFile
.
get
(),
count
,
true
,
queryDataType
);
stopWatch
.
stop
();
logger
.
info
(
"写入本地excel耗时:{}
"
,
stopWatch
.
getLastTaskTimeMillis
()
);
logger
.
info
(
"写入本地excel耗时:{}
, 数量: {}-》{}"
,
stopWatch
.
getLastTaskTimeMillis
(),
task
.
getAmount
(),
total
);
stopWatch
.
start
();
//是否压缩
boolean
zipFlag
=
(
xlsxFiles
.
size
()
>
1
)
?
true
:
false
;
...
...
@@ -975,6 +979,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
task
.
setFilePath
(
cloudFileUrl
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常:{}"
,
e
);
task
.
setStatus
(
DownloadTaskStatus
.
ERROR
);
...
...
@@ -1060,6 +1065,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
csvReader
.
close
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"读取异常:{}"
,
e
);
throw
new
RuntimeException
(
e
);
}
}
}
...
...
gic-cloud-data-hook-service/src/test/java/com/gic/ExceTest2.java
View file @
f22d725e
This diff is collapsed.
Click to expand it.
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