if(configuration.isClustered()) { log.warn("clustering not supported by Guava in-memory caching backend; please use Infinispan or Hazelcast instead!");
if(configuration.isClustered()) { log.warn("clustering not supported by Guava in-memory caching backend; please use Infinispan or Hazelcast instead!");
/** * Mark the triple passed as argument as not deleted, setting the "deleted" flag to false and * clearing the timestamp value of "deletedAt". * <p/> * Note that this operation should only be called if the triple was deleted before in the same * transaction! * * @param triple the KiWiTriple to restore */ public void undeleteTriple(KiWiTriple triple) throws SQLException { if(triple.getId() < 0) { log.warn("attempting to undelete non-persistent triple: {}",triple); return; } requireJDBCConnection(); // make sure the triple is not marked as deleted in case some service still holds a reference triple.setDeleted(false); triple.setDeletedAt(null); synchronized (triple) { if(!triple.isDeleted()) { log.warn("attempting to undelete triple that was not deleted: {}",triple); } PreparedStatement undeleteTriple = getPreparedStatement("undelete.triple"); undeleteTriple.setLong(1, triple.getId()); undeleteTriple.executeUpdate(); if(!persistence.getConfiguration().isClustered()) { cacheTriple(triple); } } }
/** * Mark the triple passed as argument as not deleted, setting the "deleted" flag to false and * clearing the timestamp value of "deletedAt". * <p/> * Note that this operation should only be called if the triple was deleted before in the same * transaction! * * @param triple the KiWiTriple to restore */ public void undeleteTriple(KiWiTriple triple) throws SQLException { if(triple.getId() < 0) { log.warn("attempting to undelete non-persistent triple: {}",triple); return; } requireJDBCConnection(); // make sure the triple is not marked as deleted in case some service still holds a reference triple.setDeleted(false); triple.setDeletedAt(null); synchronized (triple) { if(!triple.isDeleted()) { log.warn("attempting to undelete triple that was not deleted: {}",triple); } PreparedStatement undeleteTriple = getPreparedStatement("undelete.triple"); undeleteTriple.setLong(1, triple.getId()); undeleteTriple.executeUpdate(); if(!persistence.getConfiguration().isClustered()) { cacheTriple(triple); } } }
public HazelcastCacheManager(KiWiConfiguration configuration) { this.configuration = configuration; hcConfiguration = new Config(); if(configuration.isClustered()) { hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true); hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setMulticastPort(configuration.getClusterPort()); hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setMulticastGroup(configuration.getClusterAddress()); } else { hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); } hcConfiguration.getGroupConfig().setName(configuration.getClusterName()); hcConfiguration.setClassLoader(HazelcastCacheManager.class.getClassLoader()); hcConfiguration.setProperty("hazelcast.logging.type", "slf4j"); setupSerializers(); setupCaches(); hazelcast = Hazelcast.newHazelcastInstance(hcConfiguration); if(!configuration.isClustered()) { log.info("initialised Hazelcast local cache manager"); } else { log.info("initialised Hazelcast distributed cache manager (cluster name: {})", configuration.getClusterName()); if(configuration.getCacheMode() != CacheMode.DISTRIBUTED) { log.warn("Hazelcast only supports distributed cache mode (mode configuration was {})", configuration.getCacheMode()); } } }
public HazelcastCacheManager(KiWiConfiguration configuration) { this.configuration = configuration; hcConfiguration = new Config(); if(configuration.isClustered()) { hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true); hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setMulticastPort(configuration.getClusterPort()); hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setMulticastGroup(configuration.getClusterAddress()); } else { hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); } hcConfiguration.getGroupConfig().setName(configuration.getClusterName()); hcConfiguration.setClassLoader(HazelcastCacheManager.class.getClassLoader()); hcConfiguration.setProperty("hazelcast.logging.type", "slf4j"); setupSerializers(); setupCaches(); hazelcast = Hazelcast.newHazelcastInstance(hcConfiguration); if(!configuration.isClustered()) { log.info("initialised Hazelcast local cache manager"); } else { log.info("initialised Hazelcast distributed cache manager (cluster name: {})", configuration.getClusterName()); if(configuration.getCacheMode() != CacheMode.DISTRIBUTED) { log.warn("Hazelcast only supports distributed cache mode (mode configuration was {})", configuration.getCacheMode()); } } }
configuration.setCacheMode(CacheMode.valueOf(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_MODE,"LOCAL"))); if(configuration.isClustered()) { configuration.setRegistryStrategy(RegistryStrategy.CACHE); } else {
configuration.setCacheMode(CacheMode.valueOf(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_MODE,"LOCAL"))); if(configuration.isClustered()) { configuration.setRegistryStrategy(RegistryStrategy.CACHE); } else {