Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
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
shenjunjie
brandkbs2
Commits
87f14b36
Commit
87f14b36
authored
Dec 13, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
修复非channelRecord批量操作bug2 See merge request
!436
parents
8d32c848
6a3e68fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/main/java/com/zhiwei/brandkbs2/es/ChannelEsDao.java
+6
-4
No files found.
src/main/java/com/zhiwei/brandkbs2/es/ChannelEsDao.java
View file @
87f14b36
...
@@ -76,13 +76,13 @@ public class ChannelEsDao extends EsClientDao {
...
@@ -76,13 +76,13 @@ public class ChannelEsDao extends EsClientDao {
public
void
upsertChannelRecord
(
List
<
ChannelRecord
>
channelRecords
)
{
public
void
upsertChannelRecord
(
List
<
ChannelRecord
>
channelRecords
)
{
String
index
=
getChannelRecordIndexes
().
get
(
0
);
String
index
=
getChannelRecordIndexes
().
get
(
0
);
// 打印统计时间
AtomicLong
startTime
=
new
AtomicLong
(-
1
);
AtomicLong
endTime
=
new
AtomicLong
(-
1
);
for
(
List
<
ChannelRecord
>
records
:
ListUtils
.
partition
(
channelRecords
,
100
))
{
for
(
List
<
ChannelRecord
>
records
:
ListUtils
.
partition
(
channelRecords
,
100
))
{
// 打印统计时间
AtomicLong
atomicStartTime
=
new
AtomicLong
(-
1
);
AtomicLong
atomicEndTime
=
new
AtomicLong
(-
1
);
BulkRequest
bulkRequest
=
new
BulkRequest
();
BulkRequest
bulkRequest
=
new
BulkRequest
();
for
(
ChannelRecord
record
:
records
)
{
for
(
ChannelRecord
record
:
records
)
{
bulkRequest
.
add
(
createChannelRecordIndexRequest
(
record
,
index
,
startTime
,
e
ndTime
));
bulkRequest
.
add
(
createChannelRecordIndexRequest
(
record
,
index
,
atomicStartTime
,
atomicE
ndTime
));
}
}
BulkResponse
bulkResponse
;
BulkResponse
bulkResponse
;
try
{
try
{
...
@@ -98,6 +98,8 @@ public class ChannelEsDao extends EsClientDao {
...
@@ -98,6 +98,8 @@ public class ChannelEsDao extends EsClientDao {
// 重试三次后失败拆分channelRecords
// 重试三次后失败拆分channelRecords
bulkResponse
=
upsertChannelRecordLimit
(
records
,
index
,
10
);
bulkResponse
=
upsertChannelRecordLimit
(
records
,
index
,
10
);
}
}
Long
startTime
=
atomicStartTime
.
get
();
Long
endTime
=
atomicEndTime
.
get
();
if
(
null
==
bulkResponse
)
{
if
(
null
==
bulkResponse
)
{
log
.
error
(
"upsertRecord批量操作重试后失败,index:{},rangeTime:{}"
,
index
,
startTime
+
"-"
+
endTime
);
log
.
error
(
"upsertRecord批量操作重试后失败,index:{},rangeTime:{}"
,
index
,
startTime
+
"-"
+
endTime
);
}
else
if
(
bulkResponse
.
hasFailures
())
{
}
else
if
(
bulkResponse
.
hasFailures
())
{
...
...
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