Skip to content

Commit

Permalink
PLT-191: minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
n5nk committed Nov 23, 2023
1 parent 68b706c commit aa86e1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
public abstract class AbstractRedisService implements RedisService {

private static final String REDIS_URL_PREFIX = "redis://";
private static final String ATLAS_REDIS = "atlas-redis";
private static final String ATLAS_REDIS_URL = "atlas.redis.url";
private static final String ATLAS_REDIS_SENTINEL_URLS = "atlas.redis.sentinel.urls";
private static final String ATLAS_REDIS_USERNAME = "atlas.redis.username";
Expand Down Expand Up @@ -99,6 +100,7 @@ Config getLocalConfig() throws AtlasException {
Config getProdConfig() throws AtlasException {
Config config = initAtlasConfig();
config.useSentinelServers()
.setClientName(ATLAS_REDIS)
.setReadMode(ReadMode.MASTER_SLAVE)
.setCheckSentinelsList(false)
.setMasterName(atlasConfig.getString(ATLAS_REDIS_MASTER_NAME))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,23 @@ public AtlasObjectId toAtlasObjectId(AtlasVertex entityVertex) throws AtlasBaseE
Map<String, Object> attributes = new HashMap<>();
Set<String> relationAttributes = RequestContext.get().getRelationAttrsForSearch();
if (CollectionUtils.isNotEmpty(relationAttributes)) {
relationAttributes.stream().parallel().forEach(attributeName->{
try {
AtlasAttribute attribute = entityType.getAttribute(attributeName);
if (attribute != null
&& !uniqueAttributes.containsKey(attributeName)) {
Object attrValue = null;

attrValue = getVertexAttribute(entityVertex, attribute);

if (attrValue != null) {
attributes.put(attribute.getName(), attrValue);
}
}
} catch (AtlasBaseException e) {
e.printStackTrace();
}
});
for (String attributeName : relationAttributes) {
AtlasAttribute attribute = entityType.getAttribute(attributeName);
if (attribute != null
Expand Down

0 comments on commit aa86e1e

Please sign in to comment.