org.redisson.api.RScript.ReturnType Java Examples

The following examples show how to use org.redisson.api.RScript.ReturnType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RedisQualityAttribute.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
public int convertData(T data) {
    Integer index = indexCache.get(data);
    if (index == null) {
        Number number = script.evalSha(Mode.READ_WRITE, indexSignature, ReturnType.INTEGER, Arrays.asList(indexKey, sizeKey), data);
        index = number.intValue();
        indexCache.put(data, index);
    }
    return index;
}
 
Example #2
Source File: RedisJobRepositoryImpl.java    From earth-frost with Apache License 2.0 4 votes vote down vote up
@Override
public long currentTime() {
  return redissonClient.getScript()
      .eval(Mode.READ_ONLY, "return redis.call('TIME')[1]*1000", ReturnType.INTEGER);
}
 
Example #3
Source File: RScriptAsync.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @return result object
 */
<R> RFuture<R> evalAsync(Mode mode, String luaScript, ReturnType returnType);
 
Example #4
Source File: RScriptAsync.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param key - used to locate Redis node in Cluster which stores cached Lua script 
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> RFuture<R> evalAsync(String key, Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
 
Example #5
Source File: RScriptAsync.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script 
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> RFuture<R> evalAsync(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
 
Example #6
Source File: RScriptAsync.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @return result object
 */
<R> RFuture<R> evalShaAsync(Mode mode, String shaDigest, ReturnType returnType);
 
Example #7
Source File: RScriptAsync.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param key - used to locate Redis node in Cluster which stores cached Lua script 
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> RFuture<R> evalShaAsync(String key, Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
 
Example #8
Source File: RScriptAsync.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> RFuture<R> evalShaAsync(Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
 
Example #9
Source File: RScriptRx.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param key - used to locate Redis node in Cluster which stores cached Lua script 
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Maybe<R> eval(String key, Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
 
Example #10
Source File: RScriptRx.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @return result object
 */
<R> Maybe<R> eval(Mode mode, String luaScript, ReturnType returnType);
 
Example #11
Source File: RScriptRx.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script 
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Maybe<R> eval(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
 
Example #12
Source File: RScriptRx.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @return result object
 */
<R> Maybe<R> evalSha(Mode mode, String shaDigest, ReturnType returnType);
 
Example #13
Source File: RScriptRx.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param key - used to locate Redis node in Cluster which stores cached Lua script 
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Maybe<R> evalSha(String key, Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
 
Example #14
Source File: RScriptRx.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Maybe<R> evalSha(Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
 
Example #15
Source File: RScriptReactive.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param key - used to locate Redis node in Cluster which stores cached Lua script 
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Mono<R> eval(String key, Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
 
Example #16
Source File: RScriptReactive.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @return result object
 */
<R> Mono<R> eval(Mode mode, String luaScript, ReturnType returnType);
 
Example #17
Source File: RScriptReactive.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param luaScript - lua script
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script 
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Mono<R> eval(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
 
Example #18
Source File: RScriptReactive.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @return result object
 */
<R> Mono<R> evalSha(Mode mode, String shaDigest, ReturnType returnType);
 
Example #19
Source File: RScriptReactive.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param key - used to locate Redis node in Cluster which stores cached Lua script 
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Mono<R> evalSha(String key, Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
 
Example #20
Source File: RScriptReactive.java    From redisson with Apache License 2.0 2 votes vote down vote up
/**
 * Executes Lua script stored in Redis scripts cache by SHA-1 digest
 * 
 * @param <R> - type of result
 * @param mode - execution mode
 * @param shaDigest - SHA-1 digest
 * @param returnType - return type
 * @param keys - keys available through KEYS param in script
 * @param values - values available through VALUES param in script
 * @return result object
 */
<R> Mono<R> evalSha(Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);