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
System
Partition
Commits
9f242b14
Commit
9f242b14
authored
Jan 21, 2022
by
Riabokon Stanislav(EPAM)[GCP]
Browse files
Merge branch 'cache-path_endpoint' into 'master'
Added cache for PATH endpoint (GONRG-4141) See merge request
!139
parents
f9eef68e
d67e8a3c
Pipeline
#91616
canceled with stages
in 7 seconds
Changes
1
Pipelines
9
Hide whitespace changes
Inline
Side-by-side
provider/partition-gcp/src/main/java/org/opengroup/osdu/partition/provider/gcp/service/PartitionServiceImpl.java
View file @
9f242b14
...
...
@@ -71,7 +71,7 @@ public class PartitionServiceImpl implements IPartitionService {
this
.
partitionPropertyEntityRepository
.
saveAll
(
partitionProperties
);
PartitionInfo
pi
=
getPartition
(
partitionId
);
if
(
pi
!=
null
)
{
if
(
Objects
.
nonNull
(
pi
)
)
{
partitionListCache
.
clearAll
();
}
...
...
@@ -118,6 +118,9 @@ public class PartitionServiceImpl implements IPartitionService {
partitionProperties
.
add
(
entity
);
}
this
.
partitionPropertyEntityRepository
.
saveAll
(
partitionProperties
);
if
(
Objects
.
nonNull
(
partitionServiceCache
.
get
(
partitionId
)))
{
partitionServiceCache
.
delete
(
partitionId
);
}
return
getPartition
(
partitionId
);
}
...
...
@@ -126,13 +129,13 @@ public class PartitionServiceImpl implements IPartitionService {
public
PartitionInfo
getPartition
(
String
partitionId
)
{
PartitionInfo
pi
=
partitionServiceCache
.
get
(
partitionId
);
if
(
pi
==
null
)
{
if
(
Objects
.
isNull
(
pi
)
)
{
pi
=
getEncryptedPartition
(
partitionId
);
for
(
Property
property
:
pi
.
getProperties
().
values
())
{
decryptPartitionPropertyIfNeeded
(
property
);
}
if
(
pi
!=
null
)
{
if
(
Objects
.
nonNull
(
pi
)
)
{
partitionServiceCache
.
put
(
partitionId
,
pi
);
}
}
...
...
@@ -181,7 +184,7 @@ public class PartitionServiceImpl implements IPartitionService {
}
this
.
partitionPropertyEntityRepository
.
deleteByPartitionId
(
partitionId
);
if
(
partitionServiceCache
.
get
(
partitionId
)
!=
null
)
{
if
(
Objects
.
nonNull
(
partitionServiceCache
.
get
(
partitionId
)
)
)
{
partitionServiceCache
.
delete
(
partitionId
);
}
partitionListCache
.
clearAll
();
...
...
@@ -192,7 +195,7 @@ public class PartitionServiceImpl implements IPartitionService {
public
List
<
String
>
getAllPartitions
()
{
List
<
String
>
partitions
=
partitionListCache
.
get
(
PARTITION_LIST_KEY
);
if
(
partitions
==
null
)
{
if
(
Objects
.
isNull
(
partitions
)
)
{
List
<
String
>
allPartitions
=
this
.
partitionPropertyEntityRepository
.
getAllPartitions
();
partitions
=
(
allPartitions
.
isEmpty
()
?
Collections
.
emptyList
()
:
allPartitions
);
...
...
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