Skip to content

Commit

Permalink
feat: parameterize the fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sumandas0 committed Nov 8, 2024
1 parent 06322d3 commit aafc251
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.apache.atlas.service.redis;

import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasConfiguration;
import org.apache.atlas.AtlasException;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.ArrayUtils;
Expand Down Expand Up @@ -133,10 +134,10 @@ Config getProdConfig() throws AtlasException {
.setReadMode(ReadMode.MASTER_SLAVE)
.setCheckSentinelsList(false)
.setKeepAlive(true)
.setMasterConnectionMinimumIdleSize(2)
.setMasterConnectionPoolSize(5)
.setSlaveConnectionMinimumIdleSize(2)
.setSlaveConnectionPoolSize(5)
.setMasterConnectionMinimumIdleSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MIN.getInt())
.setMasterConnectionPoolSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MAX.getInt())
.setSlaveConnectionMinimumIdleSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MIN.getInt())
.setSlaveConnectionPoolSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MAX.getInt())
.setMasterName(atlasConfig.getString(ATLAS_REDIS_MASTER_NAME))
.addSentinelAddress(formatUrls(atlasConfig.getStringArray(ATLAS_REDIS_SENTINEL_URLS)))
.setUsername(atlasConfig.getString(ATLAS_REDIS_USERNAME))
Expand All @@ -151,10 +152,10 @@ Config getCacheImplConfig() {
.setReadMode(ReadMode.MASTER_SLAVE)
.setCheckSentinelsList(false)
.setKeepAlive(true)
.setMasterConnectionMinimumIdleSize(10)
.setMasterConnectionPoolSize(2)
.setSlaveConnectionMinimumIdleSize(10)
.setSlaveConnectionPoolSize(2)
.setMasterConnectionMinimumIdleSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MIN.getInt())
.setMasterConnectionPoolSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MAX.getInt())
.setSlaveConnectionMinimumIdleSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MIN.getInt())
.setSlaveConnectionPoolSize(AtlasConfiguration.ATLAS_REDIS_POOL_CONNECTION_MAX.getInt())
.setMasterName(atlasConfig.getString(ATLAS_REDIS_MASTER_NAME))
.addSentinelAddress(formatUrls(atlasConfig.getStringArray(ATLAS_REDIS_SENTINEL_URLS)))
.setUsername(atlasConfig.getString(ATLAS_REDIS_USERNAME))
Expand Down
4 changes: 3 additions & 1 deletion intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ public enum AtlasConfiguration {

ATLAS_MAINTENANCE_MODE("atlas.maintenance.mode", false),

ATLAS_UD_RELATIONSHIPS_MAX_COUNT("atlas.ud.relationship.max.count", 100);
ATLAS_UD_RELATIONSHIPS_MAX_COUNT("atlas.ud.relationship.max.count", 100),
ATLAS_REDIS_POOL_CONNECTION_MAX("atlas.redis.connection.max", 5),
ATLAS_REDIS_POOL_CONNECTION_MIN("atlas.redis.connection.min", 2);


private static final Configuration APPLICATION_PROPERTIES;
Expand Down

0 comments on commit aafc251

Please sign in to comment.