Interface PersistentStore

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  PersistentStore.Handle
      Represents a handle to the underlying space of key-value pairs.
    • Method Detail

      • get

        Optional<com.google.protobuf.ByteString> get​(PersistentStore.Handle handle,
                                                     @Nonnull
                                                     com.google.protobuf.ByteString key)
        Gets the value associated with the entry specified by key.
        Parameters:
        handle - of the store space from which we want to retrieve the value
        key - entry key for which we want to retrieve the value
        Returns:
        the Optional containing the value or empty if there is no associated value
        Throws:
        com.palantir.logsafe.exceptions.SafeIllegalArgumentException - when referencing a non existing store space
      • get

        Map<com.google.protobuf.ByteString,​com.google.protobuf.ByteString> get​(PersistentStore.Handle handle,
                                                                                     List<com.google.protobuf.ByteString> keys)
        Gets the values associated with the entries specified by keys. Keys which are not present in the store will not be included in the returned map.
        Parameters:
        handle - of the store space
        keys - representing keys for which we want to retrieve the values
        Returns:
        a map from keys to values
      • put

        void put​(PersistentStore.Handle handle,
                 @Nonnull
                 com.google.protobuf.ByteString key,
                 @Nonnull
                 com.google.protobuf.ByteString value)
        Stores the value for the associated key while overwriting the existing value in the specified store space.
        Parameters:
        handle - of the store to which we should store the entry
        key - entry key
        value - entry value
        Throws:
        com.palantir.logsafe.exceptions.SafeIllegalArgumentException - when referencing a non existing store space
      • put

        void put​(PersistentStore.Handle handle,
                 Map<com.google.protobuf.ByteString,​com.google.protobuf.ByteString> toWrite)
        Stores the entry pairs given in toWrite, overwriting the existing values.
        Parameters:
        handle - of the store space to which we should store the entry
        toWrite - entry pairs to write
        Throws:
        com.palantir.logsafe.exceptions.SafeIllegalArgumentException - when referencing a non existing store space
      • createSpace

        PersistentStore.Handle createSpace()
        Creates a store space to be used to store key-value pairs. Each call creates a new store space.
        Returns:
        handle to the created store space
      • dropStoreSpace

        void dropStoreSpace​(PersistentStore.Handle handle)
        Drops the store space specified by the supplied handle. Dropping of a store space may fail if there are concurrent calls on the same store space or if the store space has already been dropped.
        Parameters:
        handle - of the store space
        Throws:
        com.palantir.logsafe.exceptions.SafeIllegalArgumentException - if the handle points to a non-existing store space