@ManagedOperation public void put(K key, V val) { put(key, val, caching_time); }
if(num == -1) throw new EOFException(); cache.put(req.key, data, req.caching_time); output.write(STORED); output.flush();
private void migrateData() { for(Map.Entry<K,Cache.Value<V>> entry: l2_cache.entrySet()) { K key=entry.getKey(); Address node=getNode(key); if(!node.equals(local_addr)) { Cache.Value<V> val=entry.getValue(); put(key, val.getValue(), val.getTimeout()); l2_cache.remove(key); if(log.isTraceEnabled()) log.trace("migrated " + key + " from " + local_addr + " to " + node); } } }
String val=readLine("val: "); String caching_time=readLine("ttl: "); map.put(key, val, Long.parseLong(caching_time)); break; case '2':
@ManagedOperation public void put(K key, V val) { put(key, val, caching_time); }
if(num == -1) throw new EOFException(); cache.put(req.key, data, req.caching_time); output.write(STORED); output.flush();
private void migrateData() { for(Map.Entry<K,Cache.Value<V>> entry: l2_cache.entrySet()) { K key=entry.getKey(); Address node=getNode(key); if(!node.equals(local_addr)) { Cache.Value<V> val=entry.getValue(); put(key, val.getValue(), val.getTimeout()); l2_cache.remove(key); if(log.isTraceEnabled()) log.trace("migrated " + key + " from " + local_addr + " to " + node); } } }
String val=readLine("val: "); String caching_time=readLine("ttl: "); map.put(key, val, Long.parseLong(caching_time)); break; case '2':