This method has the same effect as by calling get until <code>hasReminder()</code> returns
false;
@param discard
9339
public void getAll(boolean discard)
    {
        if (discard)
        {
            mark = position;
            marked = remaining;
        }
        else
        {
            marked += remaining;
        }
        position = (position+remaining) % capacity;
        remaining = 0;
        updated();
    }
873968
@VisibleForTesting
  /* package protected */ synchronized DiskStorage get() throws IOException {
    if (shouldCreateNewStorage()) {
      // discard anything we created
      deleteOldStorageIfNecessary();
      createStorage();
    }
    return Preconditions.checkNotNull(mCurrentState.delegate);
  }
709909
public static boolean deleteOrDie(@Nonnull final String file) throws IOException {
        // this returns true if the file was actually deleted
        // and false for 2 cases:
        //   1. file did not exist to start with
        //   2. File.delete() failed at some point for some reason
        // so we disambiguate the 'false' case below by checking for file existence
        final boolean fileWasDeleted = delete(file);

        if (fileWasDeleted) {
            // file was definitely deleted
            return true;
        } else {
            final File fileObj = new File(file);
            if (fileObj.exists()) {
                throw new IOException("File still exists after erasure, cannot write object to file: " + file);
            }

            // file was not deleted, because it does not exist
            return false;
        }
    }
305507
private boolean delete(final File f) throws IOException {

		if (f.isDirectory()) {

			final File[] files = f.listFiles();
			for (int i = 0; i < files.length; i++) {
				final boolean del = delete(files[i]);
				if (del == false) {
					return false;
				}
			}

		} else {
			return f.delete();
		}

		// Now directory is empty
		return f.delete();
	}
298131
public void fireResultRemoved(Result r, Result parent) {
    for(int i = resultListenerList.size(); --i >= 0;) {
      resultListenerList.get(i).resultRemoved(r, parent);
    }
  }
1271033
def discardi(self, begin, end, data=None):
        
        return self.discard(Interval(begin, end, data))
253687
@Override
  public synchronized boolean cancel(boolean mayInterruptIfRunning) {
    if (isDone())
      return false;

    boolean cancelResult = super.cancel(mayInterruptIfRunning);
    if (delegate != null)
      cancelResult = delegate.cancel(mayInterruptIfRunning);
    Throwable failure = new CancellationException();
    complete(null, failure);
    executor.handleComplete(ExecutionResult.failure(failure), execution);
    return cancelResult;
  }
1018006
@Override
	public boolean delete() {
        for (CallbackListener callbackListener : this.callbackListeners) {
            callbackListener.beforeDelete(this);
        }
		boolean ret = super.delete();
		if (this.syncToRedis && ret) {
			//delete from Redis
			this.redis().del(this.redisKey(this));
		}
        for (CallbackListener callbackListener : this.callbackListeners) {
            callbackListener.afterDelete(this);
        }
		return ret;
	}
1252523
@SuppressWarnings("unused")
    private void discard(IRTMPEvent event) {
        if (event instanceof IStreamData<?>) {
            log.debug("Discarding: {}", ((IStreamData<?>) event).toString());
            IoBuffer data = ((IStreamData<?>) event).getData();
            if (data != null) {
                log.trace("Freeing discarded event data");
                data.free();
                data = null;
            }
        }
        event.setHeader(null);
    }
872048
public static boolean      shouldRetry(int rc)
    {
        return (rc == KeeperException.Code.CONNECTIONLOSS.intValue()) ||
            (rc == KeeperException.Code.OPERATIONTIMEOUT.intValue()) ||
            (rc == KeeperException.Code.SESSIONMOVED.intValue()) ||
            (rc == KeeperException.Code.SESSIONEXPIRED.intValue());
    }
1008187
public boolean setCancellerHandle(ScheduledFuture<?> cancellerHandle) {
		synchronized (lock) {
			if (this.cancellerHandle == null) {
				if (!discarded) {
					this.cancellerHandle = cancellerHandle;
					return true;
				} else {
					return false;
				}
			}
			else {
				throw new IllegalStateException("A canceller handle was already set");
			}
		}
	}
1004940
@Override
    public void discardObject(EJBCache cache, Object key, Object object)
                    throws RemoteException
    {
        BeanO bean = (BeanO) object;
        bean.getActivationStrategy().atDiscard(bean);
    }
1138526
public void incrementRemoved() {
        if (removed == false && rctxt != null) {
            rctxt.removeWrapper(jspUri);
        }
        removed = true;
    }
543426
private boolean abandonFetchHolds(String entityIdentifier, boolean healthyConnection) {
    Hold hold = fetchHolds.remove(entityIdentifier);
    return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
  }
1273351
public boolean deleteExisting(final File file) {
    if (!file.exists()) {
      return true;
    }
    boolean deleted = false;
    if (file.canWrite()) {
      deleted = file.delete();
    } else {
      LogLog.debug(file + " is not writeable for delete (retrying)");
    }
    if (!deleted) {
      if (!file.exists()) {
        deleted = true;
      } else {
        file.delete();
        deleted = (!file.exists());
      }
    }
    return deleted;
  }
823855
@Override
  public void delete(Object obj) {
    String id = this.keyOf(obj);
    lock.writeLock().lock();
    try {
      this.populated = true;
      if (this.knownObjects == null) {
        if (!this.items.containsKey(id)) {
          // Presumably, this was deleted when a relist happened.
          // Don't provide a second report of the same deletion.
          return;
        }
      } else {
        // We only want to skip the "deletion" action if the object doesn't
        // exist in knownObjects and it doesn't have corresponding item in items.
        if (this.knownObjects.getByKey(id) == null && !this.items.containsKey(id)) {
          return;
        }
      }
      this.queueActionLocked(DeltaType.Deleted, obj);
    } finally {
      lock.writeLock().unlock();
    }
  }
152371
@Override
    public void discard(Event event) {
        File eventFile = new File(bufferDir, event.getId().toString() + FILE_SUFFIX);
        if (eventFile.exists()) {
            logger.debug("Discarding Event from offline storage: " + eventFile.getAbsolutePath());
            if (!eventFile.delete()) {
                logger.warn("Failed to delete Event: " + eventFile.getAbsolutePath());
            }
        }
    }