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

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

本文整理了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

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

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

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

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

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

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

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

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

  1. /**
  2. * Get with a single key and reset its expiration.
  3. *
  4. * @param <T>
  5. * @param key the key to get
  6. * @param exp the new expiration for the key
  7. * @param tc the transcoder to serialize and unserialize value
  8. * @return the result from the cache (null if there is none)
  9. * @throws OperationTimeoutException if the global operation timeout is
  10. * exceeded
  11. * @throws IllegalStateException in the rare circumstance where queue is too
  12. * full to accept any more requests
  13. */
  14. public <T> CASValue<T> getAndTouch(String key, int exp, Transcoder<T> tc) {
  15. try {
  16. return asyncGetAndTouch(key, exp, tc).get(operationTimeout,
  17. TimeUnit.MILLISECONDS);
  18. } catch (InterruptedException e) {
  19. throw new RuntimeException("Interrupted waiting for value", e);
  20. } catch (ExecutionException e) {
  21. throw new RuntimeException("Exception waiting for value", e);
  22. } catch (TimeoutException e) {
  23. throw new OperationTimeoutException("Timeout waiting for value", e);
  24. }
  25. }

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

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

相关文章