Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Enrichment
wks
Commits
f4b90818
Commit
f4b90818
authored
Jan 17, 2021
by
harshit aggarwal
Browse files
undo stray changes
parent
6deb8f96
Pipeline
#21842
failed with stages
in 2 minutes and 14 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
provider/wks-azure/src/main/java/org/opengroup/osdu/wks/provider/azure/pubsub/MessageHandler.java
View file @
f4b90818
...
...
@@ -22,7 +22,6 @@ public class MessageHandler implements IMessageHandler {
@Override
public
CompletableFuture
<
Void
>
onMessageAsync
(
IMessage
message
)
{
LOGGER
.
info
(
"Pulled a Service Bus message"
);
this
.
processWKSTransform
.
initiateWksTransformation
(
message
);
return
this
.
receiveClient
.
completeAsync
(
message
.
getLockToken
());
}
...
...
wks-core/src/main/java/org/opengroup/osdu/wks/service/WKSServiceImpl.java
View file @
f4b90818
...
...
@@ -82,6 +82,8 @@ public class WKSServiceImpl implements WKSService {
if
(
rawRecordsDetailsForTransformation
.
length
>
0
)
{
Map
<
String
,
List
<
MappingsModel
>>
mappingsMap
=
retrieveMappingsMap
(
rawRecordsDetailsForTransformation
);
// Updating mappings with latest minor and patch versions
updateMappingsWithLatestMinorAndPatchVersions
(
mappingsMap
);
transformRecords
(
rawRecordsDetailsForTransformation
,
mappingsMap
,
dataPartitionId
,
correlationId
);
}
}
finally
{
...
...
@@ -124,11 +126,10 @@ public class WKSServiceImpl implements WKSService {
for
(
RawRecordDetails
rawRecord
:
rawRecordsDetails
)
{
try
{
List
<
MappingsModel
>
mappingsList
=
retrieveMappings
(
mappingsMap
,
rawRecord
);
List
<
MappingsModel
>
mappingsWithLatestMinorAndPatchVersions
=
updateMappingsWithLatestMinorAndPatchVersions
(
mappingsList
);
Tree
rawRecordTree
=
retrieveRawRecordTree
(
rawRecord
);
for
(
MappingsModel
mappings:
mappings
WithLatestMinorAndPatchVersions
)
{
for
(
MappingsModel
mappings:
mappings
List
)
{
try
{
TransformRequest
transformRequest
=
new
TransformRequest
(
rawRecordTree
,
mappings
);
...
...
@@ -165,14 +166,18 @@ public class WKSServiceImpl implements WKSService {
LOGGER
.
info
(
Constants
.
TRANFORMATION_PROCESS_COMPLETED
);
}
private
List
<
MappingsModel
>
updateMappingsWithLatestMinorAndPatchVersions
(
List
<
MappingsModel
>
mappingsList
)
throws
ApplicationException
{
for
(
MappingsModel
mappingsModel
:
mappingsList
)
{
private
void
updateMappingsWithLatestMinorAndPatchVersions
(
Map
<
String
,
List
<
MappingsModel
>>
mappingsMap
)
throws
ApplicationException
{
List
<
String
>
schemaKindsWithLatestMinorAndPatchVersions
=
schemaService
.
getSchemas
(
mappingsModel
.
getTargetSchemaKind
());
mappingsModel
.
setTargetSchemaKind
(
schemaKindsWithLatestMinorAndPatchVersions
.
get
(
0
));
for
(
Map
.
Entry
<
String
,
List
<
MappingsModel
>>
entry
:
mappingsMap
.
entrySet
())
{
List
<
MappingsModel
>
mappingsModelList
=
new
ArrayList
<>();
for
(
MappingsModel
mappingsModel
:
entry
.
getValue
())
{
List
<
String
>
schemaKindsWithLatestMinorAndPatchVersions
=
schemaService
.
getSchemas
(
mappingsModel
.
getTargetSchemaKind
());
mappingsModel
.
setTargetSchemaKind
(
schemaKindsWithLatestMinorAndPatchVersions
.
get
(
0
));
mappingsModelList
.
add
(
mappingsModel
);
}
entry
.
setValue
(
mappingsModelList
);
}
LOGGER
.
info
(
"Schemas for WKS fetched with latest minor and patch versions"
);
return
mappingsList
;
}
private
void
initializeMessageContext
(
String
dataPartitionId
,
String
correlationId
)
{
...
...
wks-core/src/main/java/org/opengroup/osdu/wks/util/RestClient.java
View file @
f4b90818
...
...
@@ -50,10 +50,6 @@ public class RestClient {
*/
public
RestResponse
processRequest
(
RequestParameters
requestParameters
)
{
LOGGER
.
info
(
"Printing rest client parameters"
);
LOGGER
.
info
(
requestParameters
.
getCorrelationId
());
LOGGER
.
info
(
requestParameters
.
getUrl
());
HttpHeaders
headers
=
setHeaders
(
requestParameters
.
getContent
(),
requestParameters
.
getAuthKey
(),
requestParameters
.
getDataPartitionId
(),
requestParameters
.
getCorrelationId
(),
requestParameters
.
getOnBehalfOf
(),
requestParameters
.
getAppKey
());
...
...
@@ -108,7 +104,6 @@ public class RestClient {
if
(
appKey
!=
null
)
{
headers
.
set
(
Constants
.
APP_KEY
,
appKey
);
}
LOGGER
.
info
(
String
.
valueOf
(
headers
.
get
(
Constants
.
CORRELATION_ID
)));
return
headers
;
}
...
...
Write
Preview
Supports
Markdown
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