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

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

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

MemcachedClient.append介绍

[英]Append to an existing value in the cache.

Note that the return will be false any time a mutation has not occurred.
[中]

代码示例

代码示例来源:origin: com.google.code.maven-play-plugin.spy/memcached

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * @param cas cas identifier (ignored in the ascii protocol)
  5. * @param key the key to whose value will be appended
  6. * @param val the value to append
  7. * @return a future indicating success
  8. * @throws IllegalStateException in the rare circumstance where queue
  9. * is too full to accept any more requests
  10. */
  11. public Future<Boolean> append(long cas, String key, Object val) {
  12. return append(cas, key, val, transcoder);
  13. }

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

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * <p>
  5. * Note that the return will be false any time a mutation has not occurred.
  6. * </p>
  7. *
  8. * @param cas cas identifier (ignored in the ascii protocol)
  9. * @param key the key to whose value will be appended
  10. * @param val the value to append
  11. * @return a future indicating success, false if there was no change to the
  12. * value
  13. * @throws IllegalStateException in the rare circumstance where queue is too
  14. * full to accept any more requests
  15. */
  16. public OperationFuture<Boolean> append(long cas, String key, Object val) {
  17. return append(cas, key, val, transcoder);
  18. }

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

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * <p>
  5. * Note that the return will be false any time a mutation has not occurred.
  6. * </p>
  7. *
  8. * @param key the key to whose value will be appended
  9. * @param val the value to append
  10. * @return a future indicating success, false if there was no change to the
  11. * value
  12. * @throws IllegalStateException in the rare circumstance where queue is too
  13. * full to accept any more requests
  14. */
  15. @Override
  16. public OperationFuture<Boolean> append(String key, Object val) {
  17. return append(0, key, val, transcoder);
  18. }

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

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * <p>
  5. * Note that the return will be false any time a mutation has not occurred.
  6. * </p>
  7. *
  8. * @param key the key to whose value will be appended
  9. * @param val the value to append
  10. * @return a future indicating success, false if there was no change to the
  11. * value
  12. * @throws IllegalStateException in the rare circumstance where queue is too
  13. * full to accept any more requests
  14. */
  15. @Override
  16. public OperationFuture<Boolean> append(String key, Object val) {
  17. return append(0, key, val, transcoder);
  18. }

代码示例来源:origin: com.google.code.maven-play-plugin.spy/spymemcached

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * <p>Note that the return will be false any time a mutation has not
  5. * occurred.</p>
  6. *
  7. * @param cas cas identifier (ignored in the ascii protocol)
  8. * @param key the key to whose value will be appended
  9. * @param val the value to append
  10. * @return a future indicating success, false if there was no change
  11. * to the value
  12. * @throws IllegalStateException in the rare circumstance where queue
  13. * is too full to accept any more requests
  14. */
  15. public Future<Boolean> append(long cas, String key, Object val) {
  16. return append(cas, key, val, transcoder);
  17. }

代码示例来源:origin: naver/arcus-java-client

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * <p>Note that the return will be false any time a mutation has not
  5. * occurred.</p>
  6. *
  7. * @param cas cas identifier (ignored in the ascii protocol)
  8. * @param key the key to whose value will be appended
  9. * @param val the value to append
  10. * @return a future indicating success, false if there was no change
  11. * to the value
  12. * @throws IllegalStateException in the rare circumstance where queue
  13. * is too full to accept any more requests
  14. */
  15. public Future<Boolean> append(long cas, String key, Object val) {
  16. return append(cas, key, val, transcoder);
  17. }

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

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * If 0 is passed in as the CAS identifier, it will override the value
  5. * on the server without performing the CAS check.
  6. *
  7. * <p>
  8. * Note that the return will be false any time a mutation has not occurred.
  9. * </p>
  10. *
  11. * @param cas cas identifier (ignored in the ascii protocol)
  12. * @param key the key to whose value will be appended
  13. * @param val the value to append
  14. * @return a future indicating success, false if there was no change to the
  15. * value
  16. * @throws IllegalStateException in the rare circumstance where queue is too
  17. * full to accept any more requests
  18. */
  19. @Override
  20. public OperationFuture<Boolean> append(long cas, String key, Object val) {
  21. return append(cas, key, val, transcoder);
  22. }

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

  1. /**
  2. * Append to an existing value in the cache.
  3. *
  4. * If 0 is passed in as the CAS identifier, it will override the value
  5. * on the server without performing the CAS check.
  6. *
  7. * <p>
  8. * Note that the return will be false any time a mutation has not occurred.
  9. * </p>
  10. *
  11. * @param cas cas identifier (ignored in the ascii protocol)
  12. * @param key the key to whose value will be appended
  13. * @param val the value to append
  14. * @return a future indicating success, false if there was no change to the
  15. * value
  16. * @throws IllegalStateException in the rare circumstance where queue is too
  17. * full to accept any more requests
  18. */
  19. @Override
  20. public OperationFuture<Boolean> append(long cas, String key, Object val) {
  21. return append(cas, key, val, transcoder);
  22. }

代码示例来源:origin: io.snappydata/gemfire-junit

  1. public void testAppend() throws Exception {
  2. MemcachedClient client = bootstrapClient();
  3. Future<Boolean> b = client.append(0, "key", "WithAddition");
  4. assertTrue(b.get());
  5. assertEquals("myStringValueWithAddition", client.get("key"));
  6. b = client.append(0, "appendkey", "val");
  7. assertFalse(b.get());
  8. assertNull(client.get("appendkey"));
  9. }

代码示例来源:origin: org.opensaml/opensaml-storage-impl

  1. /**
  2. * Update context key list.
  3. *
  4. * @param suffix the suffix
  5. * @param namespace the namespace
  6. * @param key the storage key
  7. * @return whether the update was a success
  8. * @throws IOException if an error occurs
  9. */
  10. private boolean updateContextKeyList(final String suffix, final String namespace, final String key)
  11. throws IOException {
  12. final String listKey = namespace + suffix;
  13. final String newItem = key + CTX_KEY_LIST_DELIMITER;
  14. final boolean success = handleAsyncResult(memcacheClient.append(listKey, newItem, stringTranscoder));
  15. if (!success) {
  16. // Assume list does not exist and create it
  17. return handleAsyncResult(memcacheClient.add(listKey, 0, newItem, stringTranscoder));
  18. }
  19. return success;
  20. }
  21. }

代码示例来源:origin: ECNU-1X/DataX-Masking

  1. future = client.append(0L, key, value);
  2. break;
  3. case prepend:

相关文章