Skip to content
Snippets Groups Projects
Commit 4ff78238 authored by Rustam Lotsmanenko (EPAM)'s avatar Rustam Lotsmanenko (EPAM) Committed by Riabokon Stanislav(EPAM)[GCP]
Browse files

update core-lib, work with nullables from datastore

parent c8ad6ab4
No related branches found
No related tags found
2 merge requests!744Upgraded packages to mitigated vulns in netty, guava, snakeyaml,!630update core-lib, work with nullables from datastore
......@@ -101,9 +101,8 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-gcp</artifactId>
<version>0.19.0-rc5</version>
<version>0.20.0-rc1</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
......
......@@ -19,7 +19,6 @@ package org.opengroup.osdu.storage.provider.gcp.messaging.jobs;
import static java.util.Collections.singletonList;
import com.google.cloud.datastore.Cursor;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.List;
......@@ -70,8 +69,7 @@ public class LegalComplianceChangeServiceGcpImpl implements ILegalComplianceChan
if (complianceChangeInfo == null) {
continue;
}
AbstractMap.SimpleEntry<Cursor, List<RecordMetadata>> results = this.recordsRepo
AbstractMap.SimpleEntry<String, List<RecordMetadata>> results = this.recordsRepo
.queryByLegal(lt.getChangedTagName(), complianceChangeInfo.getCurrent(), 500);
while (results.getValue() != null && !results.getValue().isEmpty()) {
......
......@@ -31,11 +31,13 @@ import org.springframework.context.annotation.Configuration;
@RequiredArgsConstructor
public class CacheConfig {
private final RedisCacheBuilder<String, Groups> groupsRedisCacheBuilder;
private final RedisCacheBuilder<String, String> legalRedisCacheBuilder;
private final RedisCacheBuilder<String, Schema> schemaRedisCacheBuilder;
@Bean
public ICache<String, Groups> groupCache(GcpAppServiceConfig gcpAppServiceConfig) {
RedisCacheBuilder<String, Groups> cacheBuilder = new RedisCacheBuilder<>();
return cacheBuilder.buildRedisCache(
return groupsRedisCacheBuilder.buildRedisCache(
gcpAppServiceConfig.getRedisGroupHost(),
gcpAppServiceConfig.getRedisGroupPort(),
gcpAppServiceConfig.getRedisGroupPassword(),
......@@ -48,8 +50,7 @@ public class CacheConfig {
@Bean("LegalTagCache")
public ICache<String, String> legalTagCache(GcpAppServiceConfig gcpAppServiceConfig) {
RedisCacheBuilder<String, String> cacheBuilder = new RedisCacheBuilder<>();
RedisCache<String, String> storageCache = cacheBuilder.buildRedisCache(
RedisCache<String, String> storageCache = legalRedisCacheBuilder.buildRedisCache(
gcpAppServiceConfig.getRedisStorageHost(),
gcpAppServiceConfig.getRedisStoragePort(),
gcpAppServiceConfig.getRedisStoragePassword(),
......@@ -63,8 +64,7 @@ public class CacheConfig {
@Bean
public ICache<String, Schema> schemaCache(GcpAppServiceConfig gcpAppServiceConfig) {
RedisCacheBuilder<String, Schema> cacheBuilder = new RedisCacheBuilder<>();
return cacheBuilder.buildRedisCache(
return schemaRedisCacheBuilder.buildRedisCache(
gcpAppServiceConfig.getRedisStorageHost(),
gcpAppServiceConfig.getRedisStoragePort(),
gcpAppServiceConfig.getRedisStoragePassword(),
......
......@@ -25,6 +25,7 @@ import java.util.AbstractMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.java.Log;
......@@ -85,7 +86,10 @@ public class OsmRecordsMetadataRepository implements IRecordsMetadataRepository<
@Override
public RecordMetadata get(String id, Optional<CollaborationContext> collaborationContext) {
GetQuery<RecordMetadata> osmQuery = new GetQuery<>(RecordMetadata.class, getDestination(), eq("id", id));
return context.getResultsAsList(osmQuery).stream().findFirst().orElse(null);
return context.getResultsAsList(osmQuery).stream()
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment