Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
c25f8586
Commit
c25f8586
authored
4 years ago
by
Aman Verma
Browse files
Options
Downloads
Patches
Plain Diff
removing arrey list
parent
3423f8e6
No related branches found
No related tags found
1 merge request
!112
Moving the while loop to iterate over storage records in azure code
Pipeline
#30190
passed
4 years ago
Stage: build
Stage: scan
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java
+5
-16
5 additions, 16 deletions
...osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java
with
5 additions
and
16 deletions
provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java
+
5
−
16
View file @
c25f8586
...
...
@@ -91,16 +91,8 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder {
RecordReindexRequest
recordReindexRequest
=
gson
.
fromJson
(
payload
,
RecordReindexRequest
.
class
);
final
String
recordKind
=
recordReindexRequest
.
getKind
();
RecordQueryResponse
recordQueryResponse
=
null
;
List
<
RecordInfo
>
recordsAll
=
new
ArrayList
<>();
Map
<
String
,
String
>
attributes
=
new
HashMap
<>();
int
docCount
=
0
;
try
{
attributes
.
put
(
DpsHeaders
.
ACCOUNT_ID
,
dataPartitionId
);
attributes
.
put
(
DpsHeaders
.
DATA_PARTITION_ID
,
dataPartitionId
);
attributes
.
put
(
DpsHeaders
.
CORRELATION_ID
,
correlationId
);
do
{
if
(
recordQueryResponse
!=
null
)
{
recordReindexRequest
=
RecordReindexRequest
.
builder
().
cursor
(
recordQueryResponse
.
getCursor
()).
kind
(
recordKind
).
build
();
...
...
@@ -111,20 +103,17 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder {
List
<
RecordInfo
>
records
=
recordQueryResponse
.
getResults
().
stream
()
.
map
(
record
->
RecordInfo
.
builder
().
id
(
record
).
kind
(
recordKind
).
op
(
OperationType
.
create
.
name
()).
build
()).
collect
(
Collectors
.
toList
());
records
.
parallelStream
()
.
collect
(
Collectors
.
toCollection
(()
->
recordsAll
)
);
docCount
=
docCount
+
records
.
size
(
);
Map
<
String
,
String
>
attributes
=
new
HashMap
<>
()
;
attributes
.
put
(
DpsHeaders
.
ACCOUNT_ID
,
dataPartitionId
);
attributes
.
put
(
DpsHeaders
.
DATA_PARTITION_ID
,
dataPartitionId
);
attributes
.
put
(
DpsHeaders
.
CORRELATION_ID
,
correlationId
);
logger
.
info
(
String
.
format
(
"Current doc count is %d "
,
docCount
));
RecordChangedMessages
recordChangedMessages
=
RecordChangedMessages
.
builder
().
data
(
gson
.
toJson
(
records
)).
attributes
(
attributes
).
build
();
String
recordChangedMessagePayload
=
gson
.
toJson
(
recordChangedMessages
);
createTask
(
recordChangedMessagePayload
,
dataPartitionId
,
correlationId
);
}
}
while
(!
Strings
.
isNullOrEmpty
(
recordQueryResponse
.
getCursor
())
&&
recordQueryResponse
.
getResults
().
size
()
==
configurationProperties
.
getStorageRecordsBatchSize
());
logger
.
info
(
String
.
format
(
"FINAL doc count is %d "
,
docCount
));
}
catch
(
AppException
e
)
{
throw
e
;
}
catch
(
Exception
e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment