Example #1
0
 @Override
 public void configure(CacheProvider newType, Config config) {
   if (!cacheConfigSame(newType, config)) {
     node = newType.newNodeCache(logger, config, monitors);
     relationship = newType.newRelationshipCache(logger, config, monitors);
   } else {
     node.clear();
     relationship.clear();
   }
   this.type = newType;
   this.config = config;
 }
Example #2
0
  private boolean cacheConfigSame(CacheProvider type, Config config) {
    return this.type != null
        && this.type.getName().equals(type.getName())
        &&

        // Only reuse array caches, since the other ones are cheap to recreate
        HighPerformanceCacheProvider.NAME.equals(this.type.getName())
        && mySettingIsSameAs(config, node_cache_array_fraction)
        && mySettingIsSameAs(config, relationship_cache_array_fraction)
        && mySettingIsSameAs(config, node_cache_size)
        && mySettingIsSameAs(config, relationship_cache_size);
  }
Example #3
0
 @Override
 public Cache<RelationshipImpl> relationship() {
   return provider.newRelationshipCache(logger, config, monitors);
 }
Example #4
0
 @Override
 public Cache<NodeImpl> node() {
   return provider.newNodeCache(logger, config, monitors);
 }