net.spy.memcached.MemcachedClient.asyncGetAndTouch()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中net.spy.memcached.MemcachedClient.asyncGetAndTouch()方法的一些代码示例,展示了MemcachedClient.asyncGetAndTouch()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MemcachedClient.asyncGetAndTouch()方法的具体详情如下:
包路径:net.spy.memcached.MemcachedClient
类名称:MemcachedClient
方法名:asyncGetAndTouch

MemcachedClient.asyncGetAndTouch介绍

[英]Get the given key to reset its expiration time.
[中]获取给定密钥以重置其过期时间。

代码示例

代码示例来源:origin: com.google.code.simple-spring-memcached/spymemcached

/**
 * Get the given key to reset its expiration time.
 *
 * @param key the key to fetch
 * @param exp the new expiration to set for the given key
 * @return a future that will hold the return value of the fetch
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
public OperationFuture<CASValue<Object>> asyncGetAndTouch(final String key,
  final int exp) {
 return asyncGetAndTouch(key, exp, transcoder);
}

代码示例来源:origin: net.spy/spymemcached

/**
 * Get the given key to reset its expiration time.
 *
 * @param key the key to fetch
 * @param exp the new expiration to set for the given key
 * @return a future that will hold the return value of the fetch
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
@Override
public OperationFuture<CASValue<Object>> asyncGetAndTouch(final String key,
  final int exp) {
 return asyncGetAndTouch(key, exp, transcoder);
}

代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client

/**
 * Get the given key to reset its expiration time.
 *
 * @param key the key to fetch
 * @param exp the new expiration to set for the given key
 * @return a future that will hold the return value of the fetch
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
@Override
public OperationFuture<CASValue<Object>> asyncGetAndTouch(final String key,
  final int exp) {
 return asyncGetAndTouch(key, exp, transcoder);
}

代码示例来源:origin: net.spy/spymemcached

public <T> CASValue<T> getAndTouch(String key, int exp, Transcoder<T> tc) {
 try {
  return asyncGetAndTouch(key, exp, tc).get(operationTimeout,
    TimeUnit.MILLISECONDS);
 } catch (InterruptedException e) {

代码示例来源:origin: com.google.code.simple-spring-memcached/spymemcached

/**
 * Get with a single key and reset its expiration.
 *
 * @param <T>
 * @param key the key to get
 * @param exp the new expiration for the key
 * @param tc the transcoder to serialize and unserialize value
 * @return the result from the cache (null if there is none)
 * @throws OperationTimeoutException if the global operation timeout is
 *           exceeded
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
public <T> CASValue<T> getAndTouch(String key, int exp, Transcoder<T> tc) {
 try {
  return asyncGetAndTouch(key, exp, tc).get(operationTimeout,
    TimeUnit.MILLISECONDS);
 } catch (InterruptedException e) {
  throw new RuntimeException("Interrupted waiting for value", e);
 } catch (ExecutionException e) {
  throw new RuntimeException("Exception waiting for value", e);
 } catch (TimeoutException e) {
  throw new OperationTimeoutException("Timeout waiting for value", e);
 }
}

代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client

public <T> CASValue<T> getAndTouch(String key, int exp, Transcoder<T> tc) {
 try {
  return asyncGetAndTouch(key, exp, tc).get(operationTimeout,
    TimeUnit.MILLISECONDS);
 } catch (InterruptedException e) {

相关文章