Interface DistributedMetaStorage

    • 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 IgniteCheckedException
        Write 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 IgniteCheckedException
        Remove 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 IgniteCheckedException
        Write 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:
        True if expected value matched the actual one and write was completed successfully. False otherwise.
        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:
        True if expected value matched the actual one and write was completed successfully. False otherwise.
        Throws:
        IgniteCheckedException - In case of marshalling error or some other unexpected exception.
      • compareAndRemove

        boolean compareAndRemove​(@NotNull
                                 @NotNull String key,
                                 @NotNull
                                 @NotNull Serializable expVal)
                          throws IgniteCheckedException
        Remove 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:
        True if expected value matched the actual one and remove was completed successfully. False otherwise.
        Throws:
        IgniteCheckedException - In case of marshalling error or some other unexpected exception.