@SuppressWarnings("unchecked") private Long getExpiration(Fqn fqn) { NodeSPI n = cache.peek(fqn, false); if (n == null) return null; Long expiration = (Long) n.getDirect(config.getExpirationKeyName()); if ( expiration == null ) return -1L; return expiration; }
/** * Returns a parent by checking the TreeMap by name. */ public NodeSPI<K, V> getParent() { if (fqn.isRoot()) { return null; } return cache.peek(fqn.getParent(), true); }
public Object put(Fqn name, Object key, Object value) throws Exception { // DON'T make a remote call if this is a remote call in the first place - leads to deadlocks - JBCACHE-1103 if (!isCacheReady() || !cache.getInvocationContext().isOriginLocal()) return null; lock.acquireLock(name, true); try { NodeSPI n = cache.peek(name, false); if (n == null) { GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(name, key, true); return callRemote(command); } else { // dont bother with a remote call return n.getDirect(key); } } finally { lock.releaseLock(name); } }
/** * Fetches the remove value, does not remove. Replication handles * removal. */ public Object remove(Fqn name, Object key) throws Exception { // DON'T make a remote call if this is a remote call in the first place - leads to deadlocks - JBCACHE-1103 if (!isCacheReady() || !cache.getInvocationContext().isOriginLocal()) return false; lock.acquireLock(name, true); try { NodeSPI n = cache.peek(name, true); if (n == null) { GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(name, key, true); return callRemote(command); } else { // dont bother with a remote call return n.getDirect(key); } } finally { lock.releaseLock(name); } }
subtreeRoot = cache.peek(buddyRoot, false, false); if (subtreeRoot == null)
actualNode = spi.peek(backupNodeFqn, false); ctx.getOptionOverrides().setSkipDataGravitation(false);