Removes the current {@link #activeMigrationInfo} if the {@code partitionId} is the same and returns {@code true} if
removed.
Acquires the partition service lock.
194282
private boolean removeActiveMigration(int partitionId) {
        partitionServiceLock.lock();
        try {
            if (activeMigrationInfo != null) {
                if (activeMigrationInfo.getPartitionId() == partitionId) {
                    activeMigrationInfo = null;
                    return true;
                }
                if (logger.isFineEnabled()) {
                    logger.fine("Active migration is not removed, because it has different partitionId! "
                            + "partitionId=" + partitionId + ", active migration=" + activeMigrationInfo);
                }
            }
        } finally {
            partitionServiceLock.unlock();
        }
        return false;
    }
541728
boolean remove(BlockInfo blockInfo, RaidCodec codec) {
    if(queues.get(codec).remove(blockInfo)) {
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug(
                                      "BLOCK* NameSystem.RaidMissingBlocks.remove:"
                                      + blockInfo
                                      + " file "+ blockInfo.getINode()
                                      + " codec " + codec.id);
      }
      return true;
    }
    return false;
  }
1202220
public boolean remove() {
		try {
			if(!isBinary)return getJedisCommands(groupName).del(key) == 1;
			if(isCluster(groupName)){
				return getBinaryJedisClusterCommands(groupName).del(keyBytes) == 1;
			}
			return getBinaryJedisCommands(groupName).del(keyBytes) == 1;
		} finally {
			getJedisProvider(groupName).release();
		}
	}
1011323
private boolean doTryDeleteNoLock(S storable) {
        return mMap.remove(new Key<S>(storable, mFullComparator)) != null;
    }
885113
public void deregisterDeferredService() {
        Object obj = serviceReg.get();
        if (obj == null) {
            // already deregistered so there is nothing to be done
            return;
        }
        if (obj instanceof CountDownLatch) {
            // If someone else has the latch, then let them do whatever they are doing and we pretend
            // we've already done the deregister.
            return;
        } else if (obj instanceof ServiceRegistration<?>) {
            CountDownLatch latch = new CountDownLatch(1);
            if (serviceReg.compareAndSet(obj, latch)) {
                // This thread won the right to deregister the service
                try {
                    ((ServiceRegistration<?>) obj).unregister();
                    // successfully deregistered - nothing more to do
                    return;
                } finally {
                    // if the serviceReg was not updated for any reason, we need to restore the previous value
                    serviceReg.compareAndSet(latch, obj);
                    // in any case we need to allow any blocked threads to proceed
                    latch.countDown();
                }
            }
        }

    }
154833
public synchronized boolean removeLock(Object bookmark, SessionInfo sessionInfo)
    {
        Utility.getLogger().info("Unlock: " + bookmark + ", Session: " + sessionInfo.m_iSessionID + " success: " + sessionInfo.equals(this.get(bookmark)));
        if (!sessionInfo.equals(this.get(bookmark)))
            return false;   // Not my session - error.
        if (this.getWaitlist(bookmark, false) != null)
        	if (this.getWaitlist(bookmark, false).size() > 0)
        {   // Notify this person that the wait is over
    		SessionInfo sessionInfoToUnlock = this.getWaitlist(bookmark, true).get(0);
            if (sessionInfoToUnlock == null)
            	return false;	// Never
            synchronized (sessionInfoToUnlock)
            {
        		if (sessionInfoToUnlock != this.popWaitlistSession(bookmark))
                	return false;	// Never since the only remove is this (synchronized line)
                boolean bSuccess = sessionInfo.equals(this.remove(bookmark));
                if (bSuccess)	// Always
                	sessionInfoToUnlock.notify();	// Tell locked session to continue
            	return bSuccess;
            }
        }
        return sessionInfo.equals(this.remove(bookmark));
    }
992402
private void commitServices() {
        PartitionMigrationEvent event = getPartitionMigrationEvent();
        for (MigrationAwareService service : getMigrationAwareServices()) {
            try {
                service.commitMigration(event);
            } catch (Throwable e) {
                logger.warning("While promoting " + getPartitionMigrationEvent(), e);
            }
        }
    }
64518
private boolean checkIfActiveOidExisting(String oid) {
        try {
            JPAObject obj = dao.getJPAObject(oid);
            if (!obj.isDeleted()) {
                return true;
            }
        } catch (EDBException e) {
            // nothing to do here
        }
        return false;
    }
1046932
public boolean remove(SegmentIndexBuffer sib) {
        if(sib == null) {
            return false;
        }
        
        _sibLookup.remove(sib.getSegmentId());
        return true;
    }
1021804
@Override
	public void removeByC_A(long commerceCountryId, boolean active) {
		for (CommerceRegion commerceRegion : findByC_A(commerceCountryId,
				active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceRegion);
		}
	}
89227
void retainCompletedMigrations(Collection<MigrationInfo> migrations) {
        partitionServiceLock.lock();
        try {
            completedMigrations.retainAll(migrations);
        } finally {
            partitionServiceLock.unlock();
        }
    }
958428
boolean migrationRequired() throws RepositoryException
   {
      Session session = service.getStorageSession();

      try
      {
         if (session.itemExists(storagePathOld))
         {
            return true;
         }

         try
         {
            Node node = (Node)session.getItem(service.getStoragePath());
            return node.isNodeType(JOS_ORGANIZATION_NODETYPE_OLD);
         }
         catch (PathNotFoundException e)
         {
            return false;
         }
      }
      finally
      {
         session.logout();
      }
   }
1300199
protected Boolean removeExistingEntity(String localId) {
		if (StringUtils.isEmpty(localId))
			return false;
		Team team = teamRepo.findByTeamId(localId);
		if (team == null)
			return false;
		if (!localId.equalsIgnoreCase(team.getTeamId()))
			return false;

		this.setOldTeamId(team.getId());
		this.setOldTeamEnabledState(team.isEnabled());
		teamRepo.delete(team.getId());
		return true;

	}
1113818
public boolean releaseLock() {
        LockInfo info = (LockInfo)mLockInfoRef.get();
        int type = info.mType;
        int count = info.mCount;
        if (count > 0) {
            count--;
        }
        else {
            info.mType = type = NONE;
            count = 0;
        }

        if ((info.mCount = count) == 0) {
            switch (type) {
            case NONE: default:
                return false;

            case READ:
                synchronized (this) {
                    mReadLocks--;
                    notifyAll();
                }
                break;

            case UPGRADABLE:
                synchronized (this) {
                    mUpgradableLockHeld = null;
                    notifyAll();
                }
                break;

            case WRITE:
                synchronized (this) {
                    mWriteLockHeld = null;
                    notifyAll();
                }
                break;
            }

            info.mType = NONE;
        }
        else if (type == WRITE && info.mUpgradeCount == count) {
            // Convert write lock back into an upgradable lock.
            info.mType = UPGRADABLE;
            info.mUpgradeCount = 0;
            synchronized (this) {
                mWriteLockHeld = null;
                notifyAll();
            }
        }

        return true;
    }
1143971
@DELETE
    @Path("/clusters/{clusterid: ([A-Z,a-z,0-9,_,\\-]+)}")
    public Response migrateCluster(@PathParam("clusterid") final String clusterId) {

        // as this is a long running task, this has to be asynchronous
        migrationService.startClusterMigration(clusterId);

        return Response.status(202 /* Accepted */).build();
    }
1056383
static boolean uninstall() {
    boolean uninstalled = false;
    synchronized (lock) {
      if (locationCollectionClient != null) {
        locationCollectionClient.locationEngineController.onDestroy();
        locationCollectionClient.settingsChangeHandlerThread.quit();
        locationCollectionClient.sharedPreferences.unregisterOnSharedPreferenceChangeListener(locationCollectionClient);
        locationCollectionClient = null;
        uninstalled = true;
      }
    }
    return uninstalled;
  }
786685
void setActiveMigration() {
        InternalPartitionServiceImpl partitionService = getService();
        MigrationManager migrationManager = partitionService.getMigrationManager();
        MigrationInfo currentActiveMigration = migrationManager.setActiveMigration(migrationInfo);
        if (currentActiveMigration != null) {
            if (migrationInfo.equals(currentActiveMigration)) {
                migrationInfo = currentActiveMigration;
                return;
            }

            throw new RetryableHazelcastException("Cannot set active migration to " + migrationInfo
                    + ". Current active migration is " + currentActiveMigration);
        }
        PartitionStateManager partitionStateManager = partitionService.getPartitionStateManager();
        if (!partitionStateManager.trySetMigratingFlag(migrationInfo.getPartitionId())) {
            throw new RetryableHazelcastException("Cannot set migrating flag, "
                    + "probably previous migration's finalization is not completed yet.");
        }
    }