public class SimpleDistributedProperty<T extends Serializable> extends Object implements DistributedChangeableProperty<T>
| Constructor and Description |
|---|
SimpleDistributedProperty(String name,
Function<String,T> parser) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(DistributePropertyListener<? super T> listener) |
T |
get() |
String |
getName() |
T |
getOrDefault(T dfltVal) |
void |
localUpdate(Serializable newVal)
Update only local value without updating remote cluster.
|
void |
onAttached()
This property have been attached to processor.
|
void |
onReadyForUpdate(@NotNull PropertyUpdateClosure updater)
On this property ready to be update on cluster wide.
|
T |
parse(String str) |
static Integer |
parseNonNegativeInteger(String val) |
static Long |
parseNonNegativeLong(String val) |
static HashSet<String> |
parseStringSet(String val) |
boolean |
propagate(T newVal)
Change value across whole cluster.
|
GridFutureAdapter<?> |
propagateAsync(T newVal)
Change value across whole cluster.
|
GridFutureAdapter<?> |
propagateAsync(T expectedVal,
T newVal)
Change value across whole cluster.
|
String |
toString() |
protected volatile T extends Serializable val
public boolean propagate(T newVal) throws IgniteCheckedException
propagate in interface DistributedProperty<T extends Serializable>newVal - Value which this property should be changed on.true if value was successfully updated and false if cluster wide update was failed,
perhaps some concurrent operation was changed this value in same moment.DetachedPropertyException - If this property have not been attached to processor yet, please call DistributedConfigurationProcessor.registerProperty(DistributedChangeableProperty) before this method.NotWritablePropertyException - If this property don't ready to cluster wide update yet, perhaps cluster is
not active yet.IgniteCheckedException - If failed during cluster wide update.public GridFutureAdapter<?> propagateAsync(T newVal) throws IgniteCheckedException
propagateAsync in interface DistributedProperty<T extends Serializable>newVal - Value which this property should be changed on.DetachedPropertyException - If this property have not been attached to processor yet, please call DistributedConfigurationProcessor.registerProperty(DistributedChangeableProperty) before this method.NotWritablePropertyException - If this property don't ready to cluster wide update yet, perhaps cluster is
not active yet.IgniteCheckedException - If failed during cluster wide update.public GridFutureAdapter<?> propagateAsync(T expectedVal, T newVal) throws IgniteCheckedException
propagateAsync in interface DistributedProperty<T extends Serializable>expectedVal - Value from which this property should be changed.newVal - Value which this property should be changed on.DetachedPropertyException - If this property have not been attached to processor yet, please call DistributedConfigurationProcessor.registerProperty(DistributedChangeableProperty) before this method.NotWritablePropertyException - If this property don't ready to cluster wide update yet, perhaps cluster is
not active yet.IgniteCheckedException - If failed during cluster wide update.public T get()
get in interface DistributedProperty<T extends Serializable>public T getOrDefault(T dfltVal)
getOrDefault in interface DistributedProperty<T extends Serializable>dfltVal - Default value when current value is null.public String getName()
getName in interface DistributedProperty<T extends Serializable>public void addListener(DistributePropertyListener<? super T> listener)
addListener in interface DistributedProperty<T extends Serializable>listener - Update listener.public void onAttached()
onAttached in interface DistributedChangeableProperty<T extends Serializable>public void onReadyForUpdate(@NotNull
@NotNull PropertyUpdateClosure updater)
onReadyForUpdate in interface DistributedChangeableProperty<T extends Serializable>updater - Consumer for update value across cluster.public void localUpdate(Serializable newVal)
localUpdate in interface DistributedChangeableProperty<T extends Serializable>newVal - New value.public T parse(String str)
parse in interface DistributedChangeableProperty<T extends Serializable>str - String representation of the property value.public static Integer parseNonNegativeInteger(String val)
val - String to parse.public static Long parseNonNegativeLong(String val)
val - String to parse.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021