When enabled, reserve requests to this ObjectStore will throw ObjectStoreFullException.

@param isFull true subsequent reservations throw ObjectStoreFullException. if false subsequent reservations may
succeed.
@throws ObjectManagerException
428608
public void simulateFull(boolean isFull)
                    throws ObjectManagerException {
        final String methodName = "simulateFull";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { new Boolean(isFull) });

        if (isFull) {
            // Clear as much space as we can.
            objectManagerState.waitForCheckpoint(true);
            // Reserve all of the available space.
            synchronized (this) {
                long available = storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize - reservedSize.get();
                long newReservedSize = reservedSize.addAndGet((int) available);
                simulateFullReservedSize = simulateFullReservedSize + available;
                if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                    trace.debug(this, cclass, methodName, new Object[] { "isFull:834",
                                                                        new Long(available),
                                                                        new Long(newReservedSize),
                                                                        new Long(simulateFullReservedSize) });

            } // synchronized (this).

        } else {
            synchronized (this) {
                reservedSize.addAndGet((int) -simulateFullReservedSize);
                simulateFullReservedSize = 0;
            } // synchronized (this).
            objectManagerState.waitForCheckpoint(true);
        } // if (isFull).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName, new Object[] { new Long(simulateFullReservedSize) });
    }
434505
@Override
	public boolean containsAll(Collection<?> collection) {
		if (booleanTerms == null) {
			return false;
		}
		return booleanTerms.containsAll(collection);
	}
1320024
protected void setAllocationAllowed()
                    throws ObjectManagerException {
        final String methodName = "setAllocationAllowed";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { new Long(storeFileSizeAllocated),
                                                                new Long(storeFileSizeUsed) });

        // Users of the store should have reserved space in the store for Objects that are allocated before
        // they finally add them to the store. We have already reserved enough space for a complete replacement 
        // of the directory which also implies there is already enough space to delete any number of 
        // ManagedObjects in the store.

        // Calculate how much file space we need to continue storing ManagedObjects.
        // We make the pessimistic assumption that the entire contents of the log might need to be written 
        // to this ObjectStore.

        // We have to take into account any pending request to increase the size of the log file, because this
        // would allow applications to over commit the store if they used the extra log space when it did not 
        // exist in the Object Store.

        long storeFileSizeRequired = storeFileSizeAllocated;

        if (simulateFullReservedSize > 0) {
            // We are simulating a a full filesystem.
            allocationAllowed = false;
            reservationThreshold = 0;

        }
        else
        {
            // do we have enough space to accomdate the whole log in the store plus reserved space in the store
            long currentReservedSize = reservedSize.get();

            long pesimisticSpaceRequired = Math.max(objectManagerState.logOutput.getLogFileSize(),
                                                    objectManagerState.logOutput.getLogFileSizeRequested())
                                           + directoryReservedSize
                                           + currentReservedSize;

            long largestFreeSpace = 0;
            if (freeSpaceByLength.size() > 0) {
                largestFreeSpace = ((FreeSpace) freeSpaceByLength.last()).length;
            }

            if (pesimisticSpaceRequired <= largestFreeSpace) {
                // we can at least fit the whole log plus reserved space in the largest free space entry
                // so we are ok
                allocationAllowed = true;
            }
            else
            {
                storeFileSizeRequired = storeFileSizeUsed +
                                        pesimisticSpaceRequired;

                // See if we need to change the size of the store file.
                if (storeFileSizeRequired <= storeFileSizeAllocated) {
                    // we have allocated more than is required, its just not in the free space map yet
                    allocationAllowed = true;

                } else if (storeFileSizeRequired <= maximumStoreFileSize) {
                    // we need more than we have allocated, and that is less than the maximum allowed, try grow to the required...
                    allocationAllowed = setStoreFileSizeInternal(storeFileSizeRequired);

                } else {
                    // We need greater than the maximum allowed, make sure we have all the space we are
                    // allowed to have.
                    if (storeFileSizeAllocated < maximumStoreFileSize)
                        setStoreFileSizeInternal(maximumStoreFileSize);
                    // TODO We could still allow allocation until we really are full when the reservation scheme will catch it!
                    allocationAllowed = false;
                    // Request a checkpoint, see if we can clear some space.
                    numberOfStoreFullCheckpointsTriggered++;
                    objectManagerState.requestCheckpoint(persistent);

                } // if ( storeFileSizeRequired...

                reservationThreshold = storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize;
                reservationCheckpointThreshold = Math.min(reservationThreshold,
                                                          currentReservedSize + reservationCheckpointMaximum);
            }
        }
        // Release at least one blocked reservation request.
        if (reservationPacing) {
            synchronized (reservationPacingLock) {
                reservationPacing = false;
                reservationPacingLock.notify();
            } // synchronized (reservationPacingLock).
        }

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       methodName,
                       new Object[] { new Boolean(allocationAllowed), new Long(storeFileSizeRequired) });
    }
560150
private final void complete(boolean reUse,
                                Transaction transaction)
                    throws ObjectManagerException {
        final String methodName = "complete";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { new Boolean(reUse),
                                                                transaction });

        // No longer any need to include this transaction in a Checkpoint.
        requiresPersistentCheckpoint = false;
        // Clear any remaining state.
        logicalUnitOfWork.XID = null;
        transactionLock = new TransactionLock(this);
        includedManagedObjects.clear();
        callbackTokens.clear();
        allPersistentTokensToNotify.clear();
        loggedSerializedBytes.clear();
        logSequenceNumbers.clear();
        managedObjectSequenceNumbers.clear();
        useCount++;

        if (reUse) { // Reset the transaction for further use.
            // Note that we do not clear the transactionReference because the caller is still holding it.
            // If the caller releases his reference then the reference will be found by ObjectManagerState
            // and this InternalTransaction may be reused for another external Transaction.

        } else { // Do not chain.
            // Make sure the external Transaction cannot reach this internal one.
            transaction.internalTransaction = objectManagerState.dummyInternalTransaction;
            // This may not be sufficient to prevent its being used if the external Transaction already has passed
            // the point where it has picked up the referenece to the Internaltransaction. Hence we terminate the
            // InternalTransaction if it is preemptively backed out. See ObjectManagerstate.performCheckpoint()
            // where transactions are backed out without holding the internal transaction synchronize lock.
            if (transactionReference != null)
                transactionReference.clear(); // Inhibt an enqueue of the transactionReference.
            // If a reference is enqueued we are already in inactive state for this
            // transactionReferenceSequence so no action will occur.

            // Tell the ObjectManager that we no longer exist as an active transaction.
            objectManagerState.deRegisterTransaction(this);

        } // if (reUse).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
530050
public static boolean      isRetryException(Throwable exception)
    {
        if ( exception instanceof KeeperException )
        {
            KeeperException     keeperException = (KeeperException)exception;
            return shouldRetry(keeperException.code().intValue());
        }
        return false;
    }
484743
public final void reserve(int deltaSize, boolean paced)
                    throws ObjectManagerException
    {
        final String methodName = "reserve";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        methodName,
                        new Object[] { new Integer(deltaSize), new Boolean(paced) });

        long newReservedSize = reservedSize.addAndGet(deltaSize);

        if (newReservedSize > reservationCheckpointThreshold) {
            numberOfReservationCheckpointsTriggered++;
            objectManagerState.requestCheckpoint(persistent);

            // Pacing: slow paced requests.
            // ----------------------------   
            if (paced) {
                synchronized (reservationPacingLock) {

                    // TODO not during restart!
                    // TODO Need to release all waiters at shutdown.
                    while (newReservedSize > reservationCheckpointThreshold
                           && reservationPacing
                           && paced) {
                        if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                            trace.debug(this, cclass, methodName, new Object[] { "wait:728",
                                                                                new Long(newReservedSize),
                                                                                new Long(reservationCheckpointThreshold),
                                                                                new Long(reservationThreshold),
                                                                                new Boolean(reservationPacing) });
                        try {
                            newReservedSize = reservedSize.addAndGet(-deltaSize);
                            reservationPacingLock.wait();

                        } catch (InterruptedException exception) {
                            // No FFDC Code Needed.
                            ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:739:1.57");
                            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                                trace.exit(this, cclass, methodName, exception);
                            throw new UnexpectedExceptionException(this, exception);

                        } finally {
                            newReservedSize = reservedSize.addAndGet(deltaSize);
                        } // try...
                    } // while (newReservedSize > reservationCheckpointThreshold...

                    // If we have a big enough backlog of reserved space in the store, 
                    // make subsequent paced requests also wait, 
                    // except during restart or shutdown.
                    if (newReservedSize > reservationCheckpointThreshold
                        && (objectManagerState.state == ObjectManagerState.stateColdStarted
                        || objectManagerState.state == ObjectManagerState.stateWarmStarted)) {
                        reservationPacing = true;
                    } else {
                        // Allow at least one more waiter to proceed.
                        reservationPacing = false;
                        reservationPacingLock.notify();
                    } // if (newReservedSize...
                } // synchronized (reservationPacingLock).

            } // if (paced)..

            // Expand the file size if necessary.
            // ----------------------------------

            if (newReservedSize > reservationThreshold) {
                synchronized (this) {
                    // Try extending the file.
                    // TODO setAllocationAllowed() will release another paced reservation.
                    setAllocationAllowed();

                    if (newReservedSize > (storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize)) {
                        // Suppress storeFull exceptions during recovery.
                        // Also suppress the exception if we are releasing space by using a negative delta size.
                        // During commit surplus space is released into the store. If the directory depth has
                        // increased meanwhile this may mean that there is still insufficient space in the store to allow
                        // further reservation requests, but we still allow negative requests.
                        if (objectManagerState.getObjectManagerStateState() == ObjectManagerState.stateReplayingLog
                            || deltaSize <= 0) {
                            if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                                trace.debug(this, cclass, methodName, new Object[] { "Objectstorefull exception supressed:783",
                                                                                    new Long(newReservedSize) });
                        } else {
                            // We can't make the reservation so take it back.
                            reservedSize.addAndGet(-deltaSize);

                            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                                trace.exit(this, cclass, methodName, new Object[] { new Long(newReservedSize) });
                            throw new ObjectStoreFullException(this, null); // TODO objectToStore
                        } // if (objectManagerState...
                    } // if (reservedSize > (storeFileSizeAllocated - storeFileSizeUsed)).
                } // synchronized (this).

            } // if (newReservedSize > reservationThreshold).

        } else if (reservationPacing) {
            // We are below the limit so release any paced reservations.
            synchronized (reservationPacingLock) {
                pacedReservationsReleased++;
                reservationPacing = false;
                reservationPacingLock.notify();
            } // synchronized (reservationPacingLock).

        } // if (newReservedSize > reservationCheckpointThreshold).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
996795
public void performRecovery(ObjectManagerState objectManagerState)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "performRecovery",
                        "ObjectManagerState=" + objectManagerState);

        if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
            trace.debug(this, cclass,
                        "logicalUnitOfWork.identifier=" + logicalUnitOfWork.identifier + "(long)");

        Transaction transactionForRecovery = objectManagerState.getTransaction(logicalUnitOfWork);
        transactionForRecovery.commit(false); // Do not re use this Transaction.

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "performRecovery");
    }
326427
public void setImplementor(ResourceManager implementor)
    {
        KunderaTransaction tx = threadLocal.get();
        if (tx == null)
        {
            throw new IllegalStateException("Cannot get Transaction to start");
        }
        tx.setImplementor(implementor);

    }
1216705
@Override
  public void deleteObjects(List<StorageResourceId> fullObjectNames) throws IOException {
    logger.atFine().log("deleteObjects(%s)", fullObjectNames);

    if (fullObjectNames.isEmpty()) {
      return;
    }

    // Validate that all the elements represent StorageObjects.
    for (StorageResourceId fullObjectName : fullObjectNames) {
      Preconditions.checkArgument(
          fullObjectName.isStorageObject(),
          "Expected full StorageObject names only, got: %s", fullObjectName);
    }

    // Gather exceptions to wrap in a composite exception at the end.
    final KeySetView<IOException, Boolean> innerExceptions = ConcurrentHashMap.newKeySet();
    BatchHelper batchHelper =
        batchFactory.newBatchHelper(
            httpRequestInitializer,
            gcs,
            storageOptions.getMaxRequestsPerBatch(),
            fullObjectNames.size(),
            storageOptions.getBatchThreads());

    for (StorageResourceId fullObjectName : fullObjectNames) {
      queueSingleObjectDelete(fullObjectName, innerExceptions, batchHelper, 1);
    }

    batchHelper.flush();

    if (innerExceptions.size() > 0) {
      throw GoogleCloudStorageExceptions.createCompositeException(innerExceptions);
    }
  }
304327
private void handleRetryForStorageException(final StorageException exs) throws StorageException {
    retries++;
    if (retries > maxRetries) {
      throw new StorageException(
          exs.getCode(),
          "All "
              + maxRetries
              + " retries failed. Waited a total of "
              + totalWaitTime
              + " ms between attempts",
          exs);
    }
    sleepForAttempt(retries);
  }
1368056
private void objectManagerStopped()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "objectManagerStopped");

        // Stop any new work coming in as we do not have a working
        // ObjectManager to service any requests.
        _available = false;

        // Only treat this shutdown as an error if we haven't
        // asked for it. In the case of a normal ME stop we
        // will still get the callback but don't have to worry
        // about it.
        if (!_shutdownRequested)
        {
            // Report a local error so that we can begin failover to a
            // new ME instance. This will allow the new instance to
            // enter it's startup retry loop and try to re-connect to
            // a working ObjectManager.
            _ms.reportLocalError();

            SibTr.error(tc, "FILE_STORE_STOP_UNEXPECTED_SIMS1590");
        }
        else
        {
            SibTr.info(tc, "FILE_STORE_STOP_EXPECTED_SIMS1589");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "objectManagerStopped");
    }
1265286
public void rollbackBreakIteration(List objectsToStore)
    {
        // now we mix up different api's and use PB-api too
        log.info("rollbackBreakIteration");
        /*
        store list of objects, then get these objects with Iterator, start
        iteration, then break
        */
        storeObjects(objectsToStore);
        Class searchClass = objectsToStore.get(0).getClass();
        PersistenceBroker broker = getBroker();
        try
        {
            Query q = new QueryByCriteria(searchClass);
            // we get the iterator and step into the first found object
            Iterator it = broker.getIteratorByQuery(q);
            it.next();
        }
        /*
        Now we want to break iteration or something wrong. In this case we have to
        cleanup the used PB instance by a close call
        */
        finally
        {
            if(broker != null) broker.close();
        }

        // to notify the client about the failure we throw an exception
        // if we don't throw such an exception the client don't get notified
        // about the failure
        throw new EJBException("## Testing of rollback behaviour - rollbackBreakIteration ##");
    }
592947
private static boolean isTenant(@NotNull ResourceResolver resourceResolver) {
    Tenant tenant = resourceResolver.adaptTo(Tenant.class);
    return tenant != null;
  }
800359
public void setFullUrl(String fullUrl) {
        if (fullUrl == null) {
            return;
        }

        Uri parsedUri = Uri.parse(fullUrl);

        if (!WonderPushUriHelper.isAPIUri(parsedUri)) {
            mWebView.loadUrl(fullUrl);
        } else {
            setResource(WonderPushUriHelper.getResource(parsedUri), WonderPushUriHelper.getParams(parsedUri));
        }
    }
96489
def isFullPreferenceOrder(self, candList):
        

        # If a candidate is missing from the wmgMap or if there is a pair of candidates for which 
        # there is no value in the wmgMap, then the wmgMap cannot be a full preference order.
        for cand1 in candList:            
            if cand1 not in self.wmgMap.keys():
                return False
            for cand2 in candList:
                if cand1 == cand2:
                    continue
                if cand2 not in self.wmgMap[cand1].keys():
                    return False
        return True
1234059
public boolean storeFullRegistry() {
        long currentGeneration = fetchRegistryGeneration.get();
        Applications apps = fetchRemoteRegistry(false);
        if (apps == null) {
            logger.error("The application is null for some reason. Not storing this information");
        } else if (fetchRegistryGeneration.compareAndSet(currentGeneration, currentGeneration + 1)) {
            applications.set(apps);
            applicationsDelta.set(apps);
            logger.info("Successfully updated registry with the latest content");
            return true;
        } else {
            logger.warn("Not updating applications as another thread is updating it already");
        }
        return false;
    }
750086
@Override
    public void registerStore(IStore store) {
        _store = store;
        _store.setStoreCallback(_storeCallback);
        if (store instanceof ISessionObserver) {
            this.registerSessionObserver((ISessionObserver) store);
        }
        if (store instanceof ISessionStateObserver) {
            this.registerSessionStateObserver((ISessionStateObserver) store);
        }
    }