Skip to content

Commit

Permalink
ISPN-6748: Deprecate Singleton Mode for Persistent Stores.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed Jun 7, 2016
1 parent 3318cd3 commit 76a3617
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 3 deletions.
Expand Up @@ -13,8 +13,10 @@
* implementation. It always delegates reads to the real CacheStore.
*
* @author pmuir
*
* @deprecated Singleton writers will be removed in 9.1. If it is desirable that all nodes don't write to the underlying store
* then a shared store should be used instead, as this only performs store writes at a key's primary owner.
*/
@Deprecated
public class SingletonStoreConfiguration {
public final static AttributeDefinition<Boolean> ENABLED = AttributeDefinition.builder("enabled", false).immutable().build();
public final static AttributeDefinition<Long> PUSH_STATE_TIMEOUT = AttributeDefinition.builder("push-state-timeout", TimeUnit.SECONDS.toMillis(10)).immutable().build();
Expand Down
Expand Up @@ -11,6 +11,11 @@
import org.infinispan.commons.configuration.attributes.AttributeSet;
import org.infinispan.configuration.global.GlobalConfiguration;

/**
* @deprecated Singleton writers will be removed in 9.1. If it is desirable that all nodes don't write to the underlying store
* then a shared store should be used instead, as this only performs store writes at a key's primary owner.
*/
@Deprecated
public class SingletonStoreConfigurationBuilder<S> extends AbstractStoreConfigurationChildBuilder<S> implements Builder<SingletonStoreConfiguration> {
private final AttributeSet attributes;

Expand Down
Expand Up @@ -22,7 +22,11 @@ public interface StoreConfiguration {
* cluster should interact with the underlying store. The coordinator of the cluster will be
* responsible for the underlying CacheStore. SingletonStore is a simply facade to a real
* CacheStore implementation. It always delegates reads to the real CacheStore.
*
* @deprecated Singleton writers will be removed in 9.1. If it is desirable that all nodes don't write to the underlying store
* then a shared store should be used instead, as this only performs store writes at a key's primary owner.
*/
@Deprecated
SingletonStoreConfiguration singletonStore();

/**
Expand Down
Expand Up @@ -15,7 +15,11 @@ public interface StoreConfigurationChildBuilder<S> extends ConfigurationChildBui
* cluster should interact with the underlying store. The coordinator of the cluster will be
* responsible for the underlying CacheStore. SingletonStore is a simply facade to a real
* CacheStore implementation. It always delegates reads to the real CacheStore.
*
* @deprecated Singleton writers will be removed in 9.1. If it is desirable that all nodes don't write to the underlying store
* then a shared store should be used instead, as this only performs store writes at a key's primary owner.
*/
@Deprecated
SingletonStoreConfigurationBuilder<S> singleton();

/**
Expand Down
Expand Up @@ -114,6 +114,7 @@ public enum Attribute {
@Deprecated
SHUTDOWN_TIMEOUT("shutdown-timeout"),
SIMPLE_CACHE("simple-cache"),
@Deprecated
SINGLETON("singleton"),
SITE("site"),
SIZE("size"),
Expand Down
Expand Up @@ -72,6 +72,7 @@ public enum Element {
SECURITY("security"),
SERIALIZATION("serialization"),
SHUTDOWN("shutdown"),
@Deprecated
SINGLETON_STORE("singleton"),
SITE("site"),
SITES("sites"),
Expand Down
Expand Up @@ -9,7 +9,10 @@
/**
* @author Mircea Markus
* @since 6.0
* @deprecated this writer will be removed in 9.1. If it is desirable that all nodes don't write to the underlying store
* then a shared store should be used instead, as this only performs store writes at a key's primary owner.
*/
@Deprecated
public class AdvancedSingletonCacheWriter extends SingletonCacheWriter implements AdvancedCacheWriter {

public AdvancedSingletonCacheWriter(CacheWriter actual, SingletonStoreConfiguration singletonConfiguration) {
Expand Down
Expand Up @@ -47,7 +47,10 @@
*
* @author Mircea Markus
* @since 6.0
* @deprecated this writer will be removed in 9.1. If it is desirable that all nodes don't write to the underlying store
* then a shared store should be used instead, as this only performs store writes at a key's primary owner.
*/
@Deprecated
public class SingletonCacheWriter extends DelegatingCacheWriter {

private static final Log log = LogFactory.getLog(SingletonCacheWriter.class);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/schema/infinispan-config-9.0.xsd
Expand Up @@ -1316,7 +1316,7 @@
</xs:attribute>
<xs:attribute name="singleton" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>If true, the singleton store cache store is enabled. SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store.</xs:documentation>
<xs:documentation>If true, the singleton store cache store is enabled. SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store. Deprecated: A shared store should be used instead, as this limits store writes to the primary owner of a key</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="read-only" type="xs:boolean" default="false">
Expand Down
Expand Up @@ -143,6 +143,7 @@ public enum Attribute {
SHARED(ModelKeys.SHARED),
SHUTDOWN_TIMEOUT(ModelKeys.SHUTDOWN_TIMEOUT),
SIMPLE_CACHE(ModelKeys.SIMPLE_CACHE),
@Deprecated
SINGLETON(ModelKeys.SINGLETON),
SITE(ModelKeys.SITE),
SIZE(ModelKeys.SIZE),
Expand Down
Expand Up @@ -23,6 +23,7 @@

import org.infinispan.commons.util.Util;
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.ModelVersion;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.SimpleAttributeDefinition;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
Expand Down Expand Up @@ -74,6 +75,7 @@ public class BaseStoreConfigurationResource extends BaseLoaderConfigurationResou
.setAllowExpression(true)
.setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES)
.setDefaultValue(new ModelNode().set(false))
.setDeprecated(ModelVersion.create(9))
.build();

static final AttributeDefinition[] BASE_STORE_ATTRIBUTES = {PASSIVATION, FETCH_STATE, PURGE, READ_ONLY, SINGLETON};
Expand Down
Expand Up @@ -210,6 +210,8 @@ public class ModelKeys {
static final String SHARED = "shared";
static final String SHUTDOWN_TIMEOUT = "shutdown-timeout";
static final String SIMPLE_CACHE = "simple-cache";

@Deprecated
static final String SINGLETON = "singleton";
static final String SITE = "site";
static final String SIZE = "size";
Expand Down
Expand Up @@ -858,7 +858,7 @@
</xs:attribute>
<xs:attribute name="singleton" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>If true, the singleton store cache store is enabled. SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store.</xs:documentation>
<xs:documentation>If true, the singleton store cache store is enabled. SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store. Deprecated: A shared store should be used instead, as this limits store writes to the primary owner of a key</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="read-only" type="xs:boolean" default="false">
Expand Down

0 comments on commit 76a3617

Please sign in to comment.