Skip to content

Commit

Permalink
Merge pull request #940 from gisaia/feat/rollbackCacheFactoryNaming
Browse files Browse the repository at this point in the history
Rollback naming of cache factories
  • Loading branch information
alainbodiguel authored Feb 5, 2024
2 parents b140a32 + 3546cc0 commit f85220e
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

import io.arlas.commons.config.ArlasConfiguration;

public class NoBaseCacheFactory extends CacheFactory {
public class NoCacheFactory extends CacheFactory {
private final BaseCacheManager cacheManager;

public NoBaseCacheFactory(ArlasConfiguration configuration) {
public NoCacheFactory(ArlasConfiguration configuration) {
super(configuration);
this.cacheManager = new NoBaseCacheManager(configuration.arlasCacheTimeout);
this.cacheManager = new NoCacheManager(configuration.arlasCacheTimeout);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/**
* This is a No Cache implementation (does nothing)
*/
public class NoBaseCacheManager implements BaseCacheManager {
public NoBaseCacheManager(int cacheTimeout) {
public class NoCacheManager implements BaseCacheManager {
public NoCacheManager(int cacheTimeout) {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import io.arlas.commons.config.ArlasConfiguration;
import io.arlas.server.core.managers.CacheManager;

public class CollectionLocalCacheFactory extends CacheFactory {
public class HazelcastCacheFactory extends CacheFactory {
private final CacheManager cacheManager;

public CollectionLocalCacheFactory(ArlasConfiguration configuration) {
public HazelcastCacheFactory(ArlasConfiguration configuration) {
super(configuration);
this.cacheManager = new CollectionLocalCacheManager(configuration.arlasCacheTimeout);
this.cacheManager = new HazelcastCacheManager(configuration.arlasCacheTimeout);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
* This cache holds a replicated map (named 'collections') for storing the collection references
* and one replicated map per collection (named '<collection name>') for storing the elastic types.
*/
public class CollectionHazelcastCacheManager extends BaseHazelcastCacheManager implements CacheManager {
Logger LOGGER = LoggerFactory.getLogger(CollectionHazelcastCacheManager.class);
public class HazelcastCacheManager extends BaseHazelcastCacheManager implements CacheManager {
Logger LOGGER = LoggerFactory.getLogger(HazelcastCacheManager.class);

public CollectionHazelcastCacheManager(int cacheTimeout) {
public HazelcastCacheManager(int cacheTimeout) {
super(cacheTimeout);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import io.arlas.commons.config.ArlasConfiguration;
import io.arlas.server.core.managers.CacheManager;

public class CollectionHazelcastCacheFactory extends CacheFactory {
public class LocalCacheFactory extends CacheFactory {
private final CacheManager cacheManager;

public CollectionHazelcastCacheFactory(ArlasConfiguration configuration) {
public LocalCacheFactory(ArlasConfiguration configuration) {
super(configuration);
this.cacheManager = new CollectionHazelcastCacheManager(configuration.arlasCacheTimeout);
this.cacheManager = new LocalCacheManager(configuration.arlasCacheTimeout);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
* This cache holds a map (named 'collections') for storing the collection references
* and one map per collection (named '<collection name>') for storing the elastic types.
*/
public class CollectionLocalCacheManager extends BaseLocalCacheManager implements CacheManager {
Logger LOGGER = LoggerFactory.getLogger(CollectionLocalCacheManager.class);
public class LocalCacheManager extends BaseLocalCacheManager implements CacheManager {
Logger LOGGER = LoggerFactory.getLogger(LocalCacheManager.class);

public CollectionLocalCacheManager(int cacheTimeout) {
public LocalCacheManager(int cacheTimeout) {
super(cacheTimeout);
}

Expand Down
4 changes: 2 additions & 2 deletions conf/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ elastic:
########################################################
# Configuration of the cache
#arlas_cache_factory_class: ${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.NoCacheFactory}
#arlas_cache_factory_class: ${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.CollectionHazelcastCacheFactory}
arlas_cache_factory_class: ${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.CollectionLocalCacheFactory}
#arlas_cache_factory_class: ${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.HazelcastCacheFactory}
arlas_cache_factory_class: ${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.LocalCacheFactory}
arlas-cache-size: ${ARLAS_CACHE_SIZE:-1000}
arlas-cache-timeout: ${ARLAS_CACHE_TIMEOUT:-300}
arlas-rest-cache-timeout: ${ARLAS_REST_CACHE_TIMEOUT:-0}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
- ARLAS_AUTH_PERMISSION_URL="${ARLAS_AUTH_PERMISSION_URL:-http://arlas-iam-server:9990/arlas_iam_server/permissions}"
- ARLAS_CORS_ENABLED="${ARLAS_CORS_ENABLED:-false}"
- ARLAS_AUTH_CERT_URL="${ARLAS_AUTH_CERT_URL}"
- ARLAS_CACHE_FACTORY_CLASS="${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.CollectionLocalCacheFactory}"
- ARLAS_CACHE_FACTORY_CLASS="${ARLAS_CACHE_FACTORY_CLASS:-io.arlas.server.core.impl.cache.LocalCacheFactory}"
- ARLAS_CACHE_TIMEOUT="${ARLAS_CACHE_TIMEOUT:-5}"
- ARLAS_SWAGGER_RESOURCE_PKG="${ARLAS_SWAGGER_RESOURCE_PKG:-io.arlas.server.rest}"
ports:
Expand Down
22 changes: 11 additions & 11 deletions docs/arlas-server-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ Refer to [ARLAS IAM configuration](arlas-iam.md) for a comprehensive configurati

### Collection Cache & Disovery

| Environment variable | ARLAS Server configuration variable | Default | Description |
|----------------------------------------|---------------------------------------------------------|-------------------------------------------------------------|----------------------------------------------------------------------|
| ARLAS_CACHE_FACTORY_CLASS | Cache manager class | io.arlas.server.core.impl.cache.CollectionLocalCacheFactory | Class to be used for the cache manager |
| ARLAS_CACHE_SIZE | arlas-cache-size | 1000 | Size of the cache used for managing the collections |
| ARLAS_CACHE_TIMEOUT | arlas-cache-timeout | 60 | Number of seconds for the cache used for managing the collections |
| ARLAS_REST_CACHE_TIMEOUT | arlas-rest-cache-timeout | 0 | Number of seconds for the cache used for managing the REST responses |
| ARLAS_COLLECTION_AUTODISCOVER_SCHEDULE | collection-auto-discover.schedule | 0 | Number of seconds between two auto discovery tasks |
| N/A | collection-auto-discover.preferred-id-field-name | id,identifier | Name of the id field for auto discovery |
| N/A | collection-auto-discover.preferred-timestamp-field-name | params.startdate | Name of the timestamp field for auto discovery |
| N/A | collection-auto-discover.preferred-centroid-field-name | geo_params.centroid | Name of the centroid field for auto discovery |
| N/A | collection-auto-discover.preferred-geometry-field-name | geo,geo_params.geometry | Name of the geometry field for auto discovery |
| Environment variable | ARLAS Server configuration variable | Default | Description |
|----------------------------------------|---------------------------------------------------------|---------------------------------------------------|----------------------------------------------------------------------|
| ARLAS_CACHE_FACTORY_CLASS | Cache manager class | io.arlas.server.core.impl.cache.LocalCacheFactory | Class to be used for the cache manager |
| ARLAS_CACHE_SIZE | arlas-cache-size | 1000 | Size of the cache used for managing the collections |
| ARLAS_CACHE_TIMEOUT | arlas-cache-timeout | 60 | Number of seconds for the cache used for managing the collections |
| ARLAS_REST_CACHE_TIMEOUT | arlas-rest-cache-timeout | 0 | Number of seconds for the cache used for managing the REST responses |
| ARLAS_COLLECTION_AUTODISCOVER_SCHEDULE | collection-auto-discover.schedule | 0 | Number of seconds between two auto discovery tasks |
| N/A | collection-auto-discover.preferred-id-field-name | id,identifier | Name of the id field for auto discovery |
| N/A | collection-auto-discover.preferred-timestamp-field-name | params.startdate | Name of the timestamp field for auto discovery |
| N/A | collection-auto-discover.preferred-centroid-field-name | geo_params.centroid | Name of the centroid field for auto discovery |
| N/A | collection-auto-discover.preferred-geometry-field-name | geo,geo_params.geometry | Name of the geometry field for auto discovery |


### Server
Expand Down

0 comments on commit f85220e

Please sign in to comment.