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

(GONRG-9014)Register multi partitioning, unhardcode namespace\PG Schema

parent 3f5caced
No related branches found
No related tags found
1 merge request!440(GONRG-9014)Register multi partitioning, unhardcode namespace\PG Schema
......@@ -59,12 +59,14 @@ public class OsmActionRepo implements IActionRepo {
private final TenantInfo tenantInfo;
ReentrantLock actionDeleteLock = new ReentrantLock();
private static final Namespace NAMESPACE = new Namespace("DE");
private static final Kind KIND = new Kind("ACTION");
//queries addressed to tenant specific GCP project and namespace and to a certain kind.
private Destination getDestination() {
return Destination.builder().partitionId(tenantInfo.getDataPartitionId()).namespace(NAMESPACE).kind(KIND).build();
return Destination.builder()
.partitionId(tenantInfo.getDataPartitionId())
.namespace(new Namespace(tenantInfo.getName()))
.kind(KIND)
.build();
}
@Override
......
......@@ -54,12 +54,15 @@ public class OsmDdmsRepository implements IDdmsRepository {
private final TenantInfo tenantInfo;
ReentrantLock ddmsDeleteLock = new ReentrantLock();
private static final Namespace NAMESPACE = new Namespace("DE");
private static final Kind KIND = new Kind("DDMS");
//queries addressed to tenant specific GCP project and namespace and to a certain kind.
private Destination getDestination() {
return Destination.builder().partitionId(tenantInfo.getDataPartitionId()).namespace(NAMESPACE).kind(KIND).build();
return Destination.builder()
.partitionId(tenantInfo.getDataPartitionId())
.namespace(new Namespace(tenantInfo.getName()))
.kind(KIND)
.build();
}
@Override
......
......@@ -69,15 +69,17 @@ public class OsmAccess implements IDatastoreAccess {
private static final String CONFLICT_REASON = "Conflict";
private static final String ABORTED_DUE_TO_CONFLICT_MSG = "ABORTED due to conflict";
private static final Namespace NAMESPACE = new Namespace("DE");
private static final Kind KIND = new Kind("SUBSCRIPTION");
private static final String SUBSCRIPTION_CREATED = "Subscription Created";
private static final String SUBSCRIPTION_UPDATED = "Subscription Updated";
private static final String SUBSCRIPTION_DELETED = "Subscription Deleted";
//queries addressed to tenant specific GCP project and namespace and to a certain kind.
private Destination getDestination() {
return Destination.builder().partitionId(tenantInfo.getDataPartitionId()).namespace(NAMESPACE).kind(KIND).build();
return Destination.builder()
.partitionId(tenantInfo.getDataPartitionId())
.namespace(new Namespace(tenantInfo.getName()))
.kind(KIND)
.build();
}
@PostConstruct
......@@ -101,7 +103,6 @@ public class OsmAccess implements IDatastoreAccess {
return getSubscriptionByDto(existingSubscription);
}
// TODO: Remove this api when switch notification to use cache
@Override
public List<Subscription> query(String notificationId) {
GetQuery<SubscriptionDto> q = new GetQuery<>(SubscriptionDto.class, getDestination(), eq("notificationId", notificationId));
......
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