Package org.redisson

Class RedissonFuction

java.lang.Object
org.redisson.RedissonFuction
All Implemented Interfaces:
RFunction, RFunctionAsync

public class RedissonFuction extends Object implements RFunction
Author:
Nikita Koksharov
  • Constructor Details

  • Method Details

    • delete

      public void delete(String libraryName)
      Description copied from interface: RFunction
      Deletes library. Error is thrown if library doesn't exist.
      Specified by:
      delete in interface RFunction
      Parameters:
      libraryName - library name
    • deleteAsync

      public RFuture<Void> deleteAsync(String libraryName)
      Description copied from interface: RFunctionAsync
      Deletes library. Error is thrown if library doesn't exist.
      Specified by:
      deleteAsync in interface RFunctionAsync
      Parameters:
      libraryName - library name
    • dump

      public byte[] dump()
      Description copied from interface: RFunction
      Returns serialized state of all libraries.
      Specified by:
      dump in interface RFunction
      Returns:
      serialized state
    • dumpAsync

      public RFuture<byte[]> dumpAsync()
      Description copied from interface: RFunctionAsync
      Returns serialized state of all libraries.
      Specified by:
      dumpAsync in interface RFunctionAsync
      Returns:
      serialized state
    • flush

      public void flush()
      Description copied from interface: RFunction
      Deletes all libraries.
      Specified by:
      flush in interface RFunction
    • flushAsync

      public RFuture<Void> flushAsync()
      Description copied from interface: RFunctionAsync
      Deletes all libraries.
      Specified by:
      flushAsync in interface RFunctionAsync
    • kill

      public void kill()
      Description copied from interface: RFunction
      Kills currently executed functions. Applied only to functions which don't modify data.
      Specified by:
      kill in interface RFunction
    • killAsync

      public RFuture<Void> killAsync()
      Description copied from interface: RFunctionAsync
      Kills currently executed functions. Applied only to functions which don't modify data.
      Specified by:
      killAsync in interface RFunctionAsync
    • list

      public List<FunctionLibrary> list()
      Description copied from interface: RFunction
      Returns information about libraries and functions per each.
      Specified by:
      list in interface RFunction
      Returns:
      list of libraries
    • listAsync

      public RFuture<List<FunctionLibrary>> listAsync()
      Description copied from interface: RFunctionAsync
      Returns information about libraries and functions per each.
      Specified by:
      listAsync in interface RFunctionAsync
      Returns:
      list of libraries
    • list

      public List<FunctionLibrary> list(String namePattern)
      Description copied from interface: RFunction
      Returns information about libraries and functions per each by name pattern.

      Supported glob-style patterns: h?llo matches hello, hallo and hxllo h*llo matches hllo and heeeello h[ae]llo matches hello and hallo, but not hillo

      Specified by:
      list in interface RFunction
      Parameters:
      namePattern - name pattern
      Returns:
      list of libraries
    • listAsync

      public RFuture<List<FunctionLibrary>> listAsync(String namePattern)
      Description copied from interface: RFunctionAsync
      Returns information about libraries and functions per each by name pattern.

      Supported glob-style patterns: h?llo matches hello, hallo and hxllo h*llo matches hllo and heeeello h[ae]llo matches hello and hallo, but not hillo

      Specified by:
      listAsync in interface RFunctionAsync
      Parameters:
      namePattern - name pattern
      Returns:
      list of libraries
    • load

      public void load(String libraryName, String code)
      Description copied from interface: RFunction
      Loads a library. Error is thrown if library already exists.
      Specified by:
      load in interface RFunction
      Parameters:
      libraryName - library name
      code - function code
    • loadAsync

      public RFuture<Void> loadAsync(String libraryName, String code)
      Description copied from interface: RFunctionAsync
      Loads a library. Error is thrown if library already exists.
      Specified by:
      loadAsync in interface RFunctionAsync
      Parameters:
      libraryName - library name
      code - function code
    • loadAndReplace

      public void loadAndReplace(String libraryName, String code)
      Description copied from interface: RFunction
      Loads a library and overwrites existing library.
      Specified by:
      loadAndReplace in interface RFunction
      Parameters:
      libraryName - library name
      code - function code
    • loadAndReplaceAsync

      public RFuture<Void> loadAndReplaceAsync(String libraryName, String code)
      Description copied from interface: RFunctionAsync
      Loads a library and overwrites existing library.
      Specified by:
      loadAndReplaceAsync in interface RFunctionAsync
      Parameters:
      libraryName - library name
      code - function code
    • restore

      public void restore(byte[] payload)
      Description copied from interface: RFunction
      Restores libraries using their state returned by RFunction.dump() method. Restored libraries are appended to the existing libraries and throws error in case of collision.
      Specified by:
      restore in interface RFunction
      Parameters:
      payload - serialized state
    • restoreAsync

      public RFuture<Void> restoreAsync(byte[] payload)
      Description copied from interface: RFunctionAsync
      Restores libraries using their state returned by RFunctionAsync.dumpAsync() method. Restored libraries are appended to the existing libraries and throws error in case of collision.
      Specified by:
      restoreAsync in interface RFunctionAsync
      Parameters:
      payload - serialized state
    • restoreAndReplace

      public void restoreAndReplace(byte[] payload)
      Description copied from interface: RFunction
      Restores libraries using their state returned by RFunction.dump() method. Restored libraries are appended to the existing libraries.
      Specified by:
      restoreAndReplace in interface RFunction
      Parameters:
      payload - serialized state
    • restoreAndReplaceAsync

      public RFuture<Void> restoreAndReplaceAsync(byte[] payload)
      Description copied from interface: RFunctionAsync
      Restores libraries using their state returned by RFunctionAsync.dumpAsync() method. Restored libraries are appended to the existing libraries.
      Specified by:
      restoreAndReplaceAsync in interface RFunctionAsync
      Parameters:
      payload - serialized state
    • restoreAfterFlush

      public void restoreAfterFlush(byte[] payload)
      Description copied from interface: RFunction
      Restores libraries using their state returned by RFunction.dump() method. Deletes all existing libraries before restoring.
      Specified by:
      restoreAfterFlush in interface RFunction
      Parameters:
      payload - serialized state
    • restoreAfterFlushAsync

      public RFuture<Void> restoreAfterFlushAsync(byte[] payload)
      Description copied from interface: RFunctionAsync
      Restores libraries using their state returned by RFunctionAsync.dumpAsync() method. Deletes all existing libraries before restoring.
      Specified by:
      restoreAfterFlushAsync in interface RFunctionAsync
      Parameters:
      payload - serialized state
    • call

      public <R> R call(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
      Description copied from interface: RFunction
      Executes function
      Specified by:
      call in interface RFunction
      Type Parameters:
      R - - type of result
      Parameters:
      key - - used to locate Redis node in Cluster
      mode - - execution mode
      name - - function name
      returnType - - return type
      keys - - keys available through KEYS param in script
      values - - values available through VALUES param in script
      Returns:
      result object
    • call

      public <R> R call(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
      Description copied from interface: RFunction
      Executes function
      Specified by:
      call in interface RFunction
      Type Parameters:
      R - - type of result
      Parameters:
      mode - - execution mode
      name - - function name
      returnType - - return type
      keys - - keys available through KEYS param in script
      values - - values available through VALUES param in script
      Returns:
      result object
    • call

      public <R> R call(FunctionMode mode, String name, FunctionResult returnType)
      Description copied from interface: RFunction
      Executes function
      Specified by:
      call in interface RFunction
      Type Parameters:
      R - - type of result
      Parameters:
      mode - - execution mode
      name - - function name
      returnType - - return type
      Returns:
      result object
    • stats

      public FunctionStats stats()
      Description copied from interface: RFunction
      Returns information about currently running Redis function and available execution engines.
      Specified by:
      stats in interface RFunction
      Returns:
      function information
    • statsAsync

      public RFuture<FunctionStats> statsAsync()
      Description copied from interface: RFunctionAsync
      Returns information about currently running Redis function and available execution engines.
      Specified by:
      statsAsync in interface RFunctionAsync
      Returns:
      function information
    • callAsync

      public <R> RFuture<R> callAsync(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
      Description copied from interface: RFunctionAsync
      Executes function
      Specified by:
      callAsync in interface RFunctionAsync
      Type Parameters:
      R - - type of result
      Parameters:
      key - - used to locate Redis node in Cluster which stores cached Lua script
      mode - - execution mode
      name - - function name
      returnType - - return type
      keys - - keys available through KEYS param in script
      values - - values available through VALUES param in script
      Returns:
      result object
    • callAsync

      public <R> RFuture<R> callAsync(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
      Description copied from interface: RFunctionAsync
      Executes function
      Specified by:
      callAsync in interface RFunctionAsync
      Type Parameters:
      R - - type of result
      Parameters:
      mode - - execution mode
      name - - function name
      returnType - - return type
      keys - - keys available through KEYS param in script
      values - - values available through VALUES param in script
      Returns:
      result object
    • callAsync

      public <R> RFuture<R> callAsync(FunctionMode mode, String name, FunctionResult returnType)
      Description copied from interface: RFunctionAsync
      Executes function
      Specified by:
      callAsync in interface RFunctionAsync
      Type Parameters:
      R - - type of result
      Parameters:
      mode - - execution mode
      name - - function name
      returnType - - return type
      Returns:
      result object