@Override public boolean equals(final Object o) { if (o instanceof Node) { final Node other = (Node) o; return this.id.equals(other.id); } return false; }
@Override protected boolean basicEquals(LogicalManagedObjectState o) { QueueManagedObjectState mo = (QueueManagedObjectState) o; return ((takeLockField == mo.takeLockField) || (takeLockField != null && takeLockField.equals(mo.takeLockField))) && ((putLockField == mo.putLockField) || (putLockField != null && putLockField.equals(mo.putLockField))) && ((capacityField == mo.capacityField) || (capacityField != null && capacityField.equals(mo.capacityField))) && references.equals(mo.references); }
/** * TODO: make sure this is always called within a lock */ private boolean isRemoteRemovePossible(ObjectID objectId) { if (ObjectID.NULL_ID.equals(objectId)) { return false; } if (oidsForWhichTxnAreInProgress.containsKey(objectId)) { removedObjectIDs.putIfAbsent(objectId, NULL_VALUE); return false; } else { return true; } }
/** * TODO: make sure this is always called within a lock */ private boolean isRemoteRemovePossible(ObjectID objectId) { if (ObjectID.NULL_ID.equals(objectId)) { return false; } if (oidsForWhichTxnAreInProgress.containsKey(objectId)) { removedObjectIDs.putIfAbsent(objectId, NULL_VALUE); return false; } else { return true; } }
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final CDSMValue cdsmValue = (CDSMValue)o; if (creationTime != cdsmValue.creationTime) return false; if (lastAccessedTime != cdsmValue.lastAccessedTime) return false; if (timeToIdle != cdsmValue.timeToIdle) return false; if (timeToLive != cdsmValue.timeToLive) return false; if (version != cdsmValue.version) return false; if (!objectID.equals(cdsmValue.objectID)) return false; return true; }
/** * TODO: make sure this is always called within a lock */ private boolean isRemoteRemovePossible(ObjectID objectId) { if (ObjectID.NULL_ID.equals(objectId)) { return false; } if (oidsForWhichTxnAreInProgress.containsKey(objectId) || checkedOutObjects.containsKey(objectId)) { removedObjectIDs.putIfAbsent(objectId, NULL_VALUE); return false; } else { return true; } }
public void setResult(final ObjectID mapID, final Map<Object, Object> rv) { if (!this.oid.equals(mapID)) { throw new AssertionError("Wrong request to response : this map id : " + this.oid + " response is for : " + mapID + " type : " + getRequestType()); } this.result = rv; }
public void setResult(final ObjectID mapID, final Map<Object, Object> rv) { if (!this.oid.equals(mapID)) { throw new AssertionError("Wrong request to response : this map id : " + this.oid + " response is for : " + mapID + " type : " + getRequestType()); } this.result = rv; }
public void setResult(final ObjectID mapID, final Map<Object, Object> rv) { if (!this.oid.equals(mapID)) { throw new AssertionError("Wrong request to response : this map id : " + this.oid + " response is for : " + mapID + " type : " + getRequestType()); } this.result = rv; }
public boolean isLiteral() { return this.value != null && getValueObjectId().equals(ObjectID.NULL_ID); }
public boolean isLiteral() { return this.value != null && getValueObjectId().equals(ObjectID.NULL_ID); }
private void objectIDMappingEvicted(ObjectID oid, Object key) { ReentrantReadWriteLock lock = getLock(key); lock.writeLock().lock(); try { AbstractLocalCacheStoreValue value = (AbstractLocalCacheStoreValue) localStore.get(key); if (value != null && value.getValueObjectId().equals(oid)) { AbstractLocalCacheStoreValue removed = (AbstractLocalCacheStoreValue) localStore.remove(key); handleKeyValueMappingRemoved(key, removed, true); } } finally { lock.writeLock().unlock(); } }
private void objectIDMappingEvicted(ObjectID oid, Object key) { ReentrantReadWriteLock lock = getLock(key); lock.writeLock().lock(); try { AbstractLocalCacheStoreValue value = (AbstractLocalCacheStoreValue) localStore.get(key); if (value != null && value.getValueObjectId().equals(oid)) { AbstractLocalCacheStoreValue removed = (AbstractLocalCacheStoreValue) localStore.remove(key); handleKeyValueMappingRemoved(key, removed, true); } } finally { lock.writeLock().unlock(); } }
@Override public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof AbstractServerMapRequestContext)) { return false; } final AbstractServerMapRequestContext other = (AbstractServerMapRequestContext) o; return (this.requestID.equals(other.requestID) && this.requestType.equals(other.requestType) && this.oid.equals(other.oid) && this.groupID.equals(other.groupID)); }
public synchronized void replaceRootIDIfNecessary(final String rootName, final GroupID gid, final ObjectID newRootID) { waitUntilRunning(); final ObjectID oldRootID = this.rootsHolder.getRootIDForName(rootName, gid); if (oldRootID == null || oldRootID.equals(newRootID)) { return; } this.rootsHolder.addRoot(rootName, newRootID); }
public synchronized void replaceRootIDIfNecessary(final String rootName, final GroupID gid, final ObjectID newRootID) { waitUntilRunning(); final ObjectID oldRootID = this.rootsHolder.getRootIDForName(rootName, gid); if (oldRootID == null || oldRootID.equals(newRootID)) { return; } this.rootsHolder.addRoot(rootName, newRootID); }
@Override public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof AbstractServerMapRequestContext)) { return false; } final AbstractServerMapRequestContext other = (AbstractServerMapRequestContext) o; return (this.requestID.equals(other.requestID) && this.requestType.equals(other.requestType) && this.oid.equals(other.oid) && this.groupID.equals(other.groupID)); }
public synchronized void replaceRootIDIfNecessary(final String rootName, final GroupID gid, final ObjectID newRootID) { waitUntilRunning(); final ObjectID oldRootID = this.rootsHolder.getRootIDForName(rootName, gid); if (oldRootID == null || oldRootID.equals(newRootID)) { return; } this.rootsHolder.addRoot(rootName, newRootID); }
@Override public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof AbstractServerMapRequestContext)) { return false; } final AbstractServerMapRequestContext other = (AbstractServerMapRequestContext) o; return (this.requestID.equals(other.requestID) && this.requestType.equals(other.requestType) && this.oid.equals(other.oid) && this.groupID.equals(other.groupID)); }
private void applyReplaceIfEqualWithExpiry(ApplyTransactionInfo applyInfo, Object[] params) { Object key = params[0]; Object currentValue = params[1]; Object newValue = params[2]; CDSMValue old = getValueForKey(key); if (old != null && old.getObjectID().equals(currentValue)) { if (params.length == 7) { applyPut(applyInfo, new Object[] { key, newValue, params[3], params[4], params[5], params[6]}); } else { applyPut(applyInfo, new Object[]{ key, newValue }); } } else { removedReferences(applyInfo, newValue); } }