Interface DistributedMetaStorage
-
- All Superinterfaces:
ReadableDistributedMetaStorage
- All Known Implementing Classes:
DistributedMetaStorageImpl
public interface DistributedMetaStorage extends ReadableDistributedMetaStorage
API for distributed data storage with the ability to write into it.- See Also:
ReadableDistributedMetaStorage
-
-
Field Summary
Fields Modifier and Type Field Description static StringIGNITE_INTERNAL_KEY_PREFIXPrefix for keys in metastorage used by Ignite internally.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancompareAndRemove(@NotNull String key, @NotNull Serializable expVal)Remove value from distributed metastorage but only if current value matches the expected one.booleancompareAndSet(@NotNull String key, @Nullable Serializable expVal, @NotNull Serializable newVal)Write value into distributed metastorage but only if current value matches the expected one.GridFutureAdapter<Boolean>compareAndSetAsync(@NotNull String key, @Nullable Serializable expVal, @NotNull Serializable newVal)Write value into distributed metastorage asynchronously but only if current value matches the expected one.voidremove(@NotNull String key)Remove value from distributed metastorage.GridFutureAdapter<?>removeAsync(@NotNull String key)Remove value from distributed metastorage asynchronously.voidwrite(@NotNull String key, @NotNull Serializable val)Write value into distributed metastorage.GridFutureAdapter<?>writeAsync(@NotNull String key, @NotNull Serializable val)Write value into distributed metastorage asynchronously.-
Methods inherited from interface org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage
getUpdatesCount, iterate, listen, read
-
-
-
-
Field Detail
-
IGNITE_INTERNAL_KEY_PREFIX
static final String IGNITE_INTERNAL_KEY_PREFIX
Prefix for keys in metastorage used by Ignite internally. No user keys should start with this prefix.- See Also:
- Constant Field Values
-
-
Method Detail
-
write
void write(@NotNull @NotNull String key, @NotNull @NotNull Serializable val) throws IgniteCheckedExceptionWrite value into distributed metastorage.- Parameters:
key- The key.val- Value to write. Must not be null.- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
writeAsync
GridFutureAdapter<?> writeAsync(@NotNull @NotNull String key, @NotNull @NotNull Serializable val) throws IgniteCheckedException
Write value into distributed metastorage asynchronously.- Parameters:
key- The key.val- Value to write. Must not be null.- Returns:
- Future with the operation result.
- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
removeAsync
GridFutureAdapter<?> removeAsync(@NotNull @NotNull String key) throws IgniteCheckedException
Remove value from distributed metastorage asynchronously.- Parameters:
key- The key.- Returns:
- Future with the operation result.
- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
remove
void remove(@NotNull @NotNull String key) throws IgniteCheckedExceptionRemove value from distributed metastorage.- Parameters:
key- The key.- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
compareAndSet
boolean compareAndSet(@NotNull @NotNull String key, @Nullable @Nullable Serializable expVal, @NotNull @NotNull Serializable newVal) throws IgniteCheckedExceptionWrite value into distributed metastorage but only if current value matches the expected one.- Parameters:
key- The key.expVal- Expected value. Might be null.newVal- Value to write. Must not be null.- Returns:
Trueif expected value matched the actual one and write was completed successfully.Falseotherwise.- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
compareAndSetAsync
GridFutureAdapter<Boolean> compareAndSetAsync(@NotNull @NotNull String key, @Nullable @Nullable Serializable expVal, @NotNull @NotNull Serializable newVal) throws IgniteCheckedException
Write value into distributed metastorage asynchronously but only if current value matches the expected one.- Parameters:
key- The key.expVal- Expected value. Might be null.newVal- Value to write. Must not be null.- Returns:
Trueif expected value matched the actual one and write was completed successfully.Falseotherwise.- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
compareAndRemove
boolean compareAndRemove(@NotNull @NotNull String key, @NotNull @NotNull Serializable expVal) throws IgniteCheckedExceptionRemove value from distributed metastorage but only if current value matches the expected one.- Parameters:
key- The key.expVal- Expected value. Must not be null.- Returns:
Trueif expected value matched the actual one and remove was completed successfully.Falseotherwise.- Throws:
IgniteCheckedException- In case of marshalling error or some other unexpected exception.
-
-