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

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

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

MemcachedClient.flush介绍

[英]Flush all caches from all servers immediately.
[中]立即刷新所有服务器上的所有缓存。

代码示例

代码示例来源:origin: ninjaframework/ninja

public void clear() {
  client.flush();
}

代码示例来源:origin: qiujiayu/AutoLoadCache

@Override
public void delete(Set<CacheKeyTO> keys) throws CacheCenterConnectionException {
  if (null == memcachedClient || null == keys || keys.isEmpty()) {
    return;
  }
  String hfield;
  for (CacheKeyTO cacheKeyTO : keys) {
    if (null == cacheKeyTO) {
      continue;
    }
    String cacheKey = cacheKeyTO.getCacheKey();
    if (null == cacheKey || cacheKey.isEmpty()) {
      continue;
    }
    hfield = cacheKeyTO.getHfield();
    if (null != hfield && hfield.length() > 0) {
      throw new RuntimeException("memcached does not support hash cache.");
    }
    try {
      String allKeysPattern = "*";
      if (allKeysPattern.equals(cacheKey)) {
        memcachedClient.flush();
      } else {
        memcachedClient.delete(cacheKey);
      }
    } catch (Exception e) {
      log.error(e.getMessage(), e);
    }
  }
}

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

@Override
public void clear() {
  client.flush();
}

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

/**
 * Flush all caches from all servers immediately.
 *
 * @return whether or not the operation was performed
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
@Override
public OperationFuture<Boolean> flush() {
 return flush(-1);
}

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

/**
 * Flush all caches from all servers immediately.
 *
 * @return whether or not the operation was performed
 * @throws IllegalStateException in the rare circumstance where queue
 *                               is too full to accept any more requests
 */
public Future<Boolean> flush() {
 return flush(-1);
}

代码示例来源:origin: org.osgl/osgl-cache

@Override
public void clear() {
  client.flush();
}

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

/**
 * Flush all caches from all servers immediately.
 *
 * @return whether or not the operation was performed
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
public OperationFuture<Boolean> flush() {
 return flush(-1);
}

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

/**
 * Flush all caches from all servers immediately.
 *
 * @return whether or not the operation was performed
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
@Override
public OperationFuture<Boolean> flush() {
 return flush(-1);
}

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

/**
 * Flush all caches from all servers immediately.
 * @return whether or not the operation was performed
 * @throws IllegalStateException in the rare circumstance where queue
 *         is too full to accept any more requests
 */
public Future<Boolean> flush() {
  return flush(-1);
}

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

/**
 * Flush all caches from all servers immediately.
 * @throws IllegalStateException in the rare circumstance where queue
 *         is too full to accept any more requests
 */
public Future<Boolean> flush() {
  return flush(-1);
}

代码示例来源:origin: org.datanucleus/datanucleus-cache

public void evictAll()
{
  client.flush();
}

代码示例来源:origin: yahoo/fili

@Override
  public void clear() {
    client.flush();
  }
}

代码示例来源:origin: caskdata/coopr

@Override
public void wipe() throws IOException {
 client.flush();
}

代码示例来源:origin: org.datanucleus/datanucleus-cache

public void evictAll()
{
  client.flush();
}

代码示例来源:origin: rpatil26/webutilities

@Override
public void invalidateAll() {
  client.flush();
}

代码示例来源:origin: org.datanucleus/datanucleus-cache

public void close()
{
  if (clearAtClose)
  {
    client.flush();
    client.shutdown();
  }
}

代码示例来源:origin: rpatil26/webutilities

@Override
  public void cleanup() {
    client.flush();
    client.shutdown();
    client = null;
  }
}

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

public void testFlush() throws Exception {
 MemcachedClient client = bootstrapClient();
 Future<Boolean> b = client.flush();
 assertTrue(b.get());
 assertNull(client.get("key"));
 assertNull(client.get("key1"));
}

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

public void testFlushDelay() throws Exception {
 MemcachedClient client = bootstrapClient();
 Future<Boolean> b = client.flush(5);
 assertTrue(b.get());
 assertNotNull(client.get("key"));
 assertNotNull(client.get("key1"));
 Thread.sleep(8*1000);
 assertNull(client.get("key"));
 assertNull(client.get("key1"));
}

代码示例来源:origin: aurorafeint/jruby-memcached

@JRubyMethod
public IRubyObject flush(ThreadContext context) {
  Ruby ruby = context.getRuntime();
  try {
    client.flush().get();
    return context.nil;
  } catch (OperationTimeoutException e) {
    throw Error.newATimeoutOccurred(ruby, e.getLocalizedMessage());
  } catch (ExecutionException e) {
    throw ruby.newRuntimeError(e.getLocalizedMessage());
  } catch (InterruptedException e) {
    throw ruby.newThreadError(e.getLocalizedMessage());
  }
}

相关文章