Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ihooyah-flume
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
黄杰
ihooyah-flume
Commits
5236bcd6
Commit
5236bcd6
authored
Mar 24, 2023
by
txy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切割文件名称
parent
66886203
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
YunnanFileSink.java
src/main/java/com/ihooyah/flume/sink/YunnanFileSink.java
+13
-0
No files found.
src/main/java/com/ihooyah/flume/sink/YunnanFileSink.java
View file @
5236bcd6
...
...
@@ -88,8 +88,21 @@ public class YunnanFileSink extends AbstractSink implements Configurable, BatchS
}
public
void
dealData
(
String
fileName
,
List
<
Event
>
eventList
)
throws
IOException
{
logger
.
info
(
"没有切割之前的fileName的值"
+
fileName
);
if
(
eventList
.
size
()
==
0
)
return
;
String
[]
split
=
fileName
.
split
(
","
);
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++){
String
a
=
split
[
i
];
if
(
"filerecord"
.
equals
(
a
)){
fileName
=
fileName
.
replace
(
"filerecord"
,
"file,record"
);
logger
.
info
(
"filerecord 切割后的值"
+
fileName
);
}
if
(
"filedefault"
.
equals
(
a
)){
fileName
=
fileName
.
replace
(
"filedefault"
,
"file,default"
);
logger
.
info
(
"filedefault 切割后的值"
+
fileName
);
}
}
fileName
=
fileName
.
replaceAll
(
",,"
,
","
).
replaceAll
(
","
,
"\\/"
);
String
uploadDir
=
"/"
+
fileName
;
String
dir
=
uploadDir
.
substring
(
0
,
uploadDir
.
lastIndexOf
(
"/"
));
...
...
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