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
e723d0c1
Commit
e723d0c1
authored
Jan 08, 2021
by
ethiraj krishnamanaidu
Browse files
Merge branch 'fix_list_cache' into 'master'
Fix list cache See merge request
!32
parents
05a9a67a
5036eceb
Pipeline
#21086
passed with stages
in 18 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/di/RedisConfig.java
View file @
e723d0c1
...
...
@@ -10,6 +10,7 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
javax.inject.Named
;
import
java.util.List
;
@Configuration
public
class
RedisConfig
{
...
...
@@ -44,6 +45,11 @@ public class RedisConfig {
return
new
RedisCache
<>(
host
,
port
,
password
,
expiration
,
database
,
String
.
class
,
PartitionInfo
.
class
);
}
@Bean
public
RedisCache
<
String
,
List
<
String
>>
partitionListCache
(
@Named
(
"REDIS_HOST"
)
String
host
,
@Named
(
"REDIS_PASSWORD"
)
String
password
)
{
return
new
RedisCache
(
host
,
port
,
password
,
expiration
,
database
,
String
.
class
,
List
.
class
);
}
}
@Configuration
...
...
@@ -64,5 +70,10 @@ public class RedisConfig {
return
new
RedisCache
<>(
host
,
port
,
expiration
,
database
,
String
.
class
,
PartitionInfo
.
class
);
}
@Bean
public
RedisCache
<
String
,
List
<
String
>>
partitionListCache
(
@Named
(
"REDIS_HOST"
)
String
host
)
{
return
new
RedisCache
(
host
,
port
,
expiration
,
database
,
String
.
class
,
List
.
class
);
}
}
}
provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/di/VmConfig.java
View file @
e723d0c1
package
org.opengroup.osdu.partition.provider.azure.di
;
import
org.opengroup.osdu.core.common.cache.VmCache
;
import
org.opengroup.osdu.partition.model.PartitionInfo
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -12,6 +13,7 @@ import java.util.List;
public
class
VmConfig
{
@Bean
@ConditionalOnProperty
(
value
=
"cache.provider"
,
havingValue
=
"vm"
,
matchIfMissing
=
true
)
public
VmCache
<
String
,
List
<
String
>>
partitionListCache
(
@Value
(
"${cache.expiration}"
)
final
int
expiration
,
@Value
(
"${cache.maxSize}"
)
final
int
maxSize
)
{
return
new
VmCache
<>(
expiration
*
60
,
maxSize
);
...
...
@@ -19,8 +21,8 @@ public class VmConfig {
@Bean
@ConditionalOnProperty
(
value
=
"cache.provider"
,
havingValue
=
"vm"
,
matchIfMissing
=
true
)
public
VmCache
<
String
,
List
<
String
>
>
partitionServiceCache
(
@Value
(
"${cache.expiration}"
)
final
int
expiration
,
@Value
(
"${cache.maxSize}"
)
final
int
maxSize
)
{
public
VmCache
<
String
,
PartitionInfo
>
partitionServiceCache
(
@Value
(
"${cache.expiration}"
)
final
int
expiration
,
@Value
(
"${cache.maxSize}"
)
final
int
maxSize
)
{
return
new
VmCache
<>(
expiration
*
60
,
maxSize
);
}
}
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