Пример #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;
 }
Пример #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);
  }
Пример #3
0
 @Override
 public Cache<RelationshipImpl> relationship() {
   return provider.newRelationshipCache(logger, config, monitors);
 }
Пример #4
0
 @Override
 public Cache<NodeImpl> node() {
   return provider.newNodeCache(logger, config, monitors);
 }