throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {
throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {
/** * Set counter's value to expected. * * @param value * @throws MemcachedException * @throws InterruptedException * @throws TimeoutException */ public void set(long value) throws MemcachedException, InterruptedException, TimeoutException { this.memcachedClient.set(this.key, 0, String.valueOf(value)); }
@Override public void save(SessionData sessionData) { try { this.sessions.set(sessionData.getId(), idleTime, sessionData); } catch (TimeoutException | InterruptedException | MemcachedException ex) { log.error("An error occurred when saved SessionData.", ex); } }
@Override public void store(String id, SessionData data) throws Exception { _client.set(id, _expirySec, data); }
/** * Set counter's value to expected. * * @param value * @throws MemcachedException * @throws InterruptedException * @throws TimeoutException */ public void set(long value) throws MemcachedException, InterruptedException, TimeoutException { this.memcachedClient.set(this.key, 0, String.valueOf(value)); }
@Override public boolean set(final String key, final int exp, final Object value) throws TimeoutException, CacheException { try { return memcachedClient.set(key, exp, value); } catch (MemcachedException | InterruptedException e) { throw new CacheException(e); } }
/** * 设置缓存数据字节数组(带有效期) * @param key cache key * @param bytes cache data * @param timeToLiveInSeconds cache ttl */ public void setBytes(String key, byte[] bytes, long timeToLiveInSeconds){ try { client.set(_key(key), (int)timeToLiveInSeconds, bytes); } catch (Exception e) { log.error("Failed to set data to memcached.", e); } }
/** * 批量设置带 TTL 的缓存数据 * @param bytes cache data * @param timeToLiveInSeconds cache ttl */ public void setBytes(Map<String,byte[]> bytes, long timeToLiveInSeconds) { try { for(String key : bytes.keySet()) { String mkey = _key(key); client.set(mkey, (int) timeToLiveInSeconds, bytes.get(key)); } } catch (Exception e) { log.error("Failed to set data to memcached.", e); } }
public List<Object> put(String queryKey, List<Object> results) { if (queryKey == null || results == null) { return null; } try { client.set(keyPrefix + queryKey, expirySeconds, results); } catch (Exception e) { throw new NucleusException("Exception thrown in persistence to xmemcached", e); } return results; } }
@Override public <T> boolean set(final String key, final int exp, final T value, final CacheTranscoder transcoder) throws TimeoutException, CacheException { try { return memcachedClient.set(key, exp, value, getTranscoder(transcoder)); } catch (MemcachedException | InterruptedException e) { throw new CacheException(e); } }
public boolean set(String key, byte[] raw, int exp) throws KeyValueStoreClientException { if (!isAlive()) { throw(new KeyValueStoreClientException(new IllegalStateException("client not established"))); } boolean result = false; try { result = _client.set(key, exp, raw); } catch (Exception error) { throw(new KeyValueStoreClientException(error)); } return result; }
public CachedPC put(Object oid, CachedPC pc) { if (oid == null || pc == null) { return null; } try { client.set(getCacheKeyForId(oid), expireSeconds, pc); } catch (Exception e) { throw new NucleusException("Exception thrown in persistence to xmemcached", e); } return pc; }
@Override public <T> void set(String key, int secondsToExpire, T value) throws IOException { notNullValue("key", key); try { if (hasNoAvailableServer()) { return; } memcached.set(getKeyWithNamespace(key), secondsToExpire, value); } catch (Exception e) { String failedMessage = "Failed to set value on memcached! " + "(key:" + key + ",secondsToExpire:" + secondsToExpire + ",value:" + value + ")"; throw new IOException(failedMessage, e); } }
throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {
throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {
throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {
throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {
throw new IllegalArgumentException("The memcached set method arguments mismatch, must be two arguments. interface: " + type.getName() + ", method: " + invocation.getMethodName() + ", url: " + url); memcachedClient.set(String.valueOf(invocation.getArguments()[0]), expiry, invocation.getArguments()[1]); return new RpcResult(); } else if (delete.equals(invocation.getMethodName())) {