TODO: Better invalidation
13345
private void invalidateSync() {
        Log.d("AndroidClockSync", "Starting sync...");
        new Thread() {
            @Override
            public void run() {
                SntpClient client = new SntpClient();
                ExponentialBackoff exponentialBackoff = new ExponentialBackoff();
                while (!client.requestTime(serverHost, 10000)) {
                    exponentialBackoff.onFailure();
                    try {
                        Thread.sleep(exponentialBackoff.exponentialWait());
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                syncDelta = client.getClockOffset();
                preference.edit().putLong("delta", syncDelta).commit();
                Log.d("AndroidClockSync", "Synced. Time delta: " + syncDelta + " ms");
            }
        }.start();
    }
915784
private void putWithValidation(String key, Object value) throws BitcoinURIParseException {
        if (parameterMap.containsKey(key)) {
            throw new BitcoinURIParseException(String.format(Locale.US, "'%s' is duplicated, URI is invalid", key));
        } else {
            parameterMap.put(key, value);
        }
    }
697081
private int invalidateWorkForOneNode(String nodeId) {
    List<Block> blocksToInvalidate = null;
    DatanodeDescriptor dn = null;
    writeLock();
    try {
      // blocks should not be replicated or removed if safe mode is on
      if (isInSafeMode()) {
        return 0;
      }
      // get blocks to invalidate for the nodeId
      assert nodeId != null;
      dn = datanodeMap.get(nodeId);
      if (dn == null) {
        recentInvalidateSets.remove(nodeId);
        return 0;
      }

      LightWeightHashSet<Block> invalidateSet = recentInvalidateSets
          .get(nodeId);
      if (invalidateSet == null) {
        return 0;
      }
      // # blocks that can be sent in one message is limited
      blocksToInvalidate = invalidateSet.pollN(ReplicationConfigKeys.blockInvalidateLimit);

      // If we send everything in this message, remove this node entry
      if (invalidateSet.isEmpty()) {
        recentInvalidateSets.remove(nodeId);
      }

      dn.addBlocksToBeInvalidated(blocksToInvalidate);
      pendingDeletionBlocksCount -= blocksToInvalidate.size();
    } finally {
      writeUnlock();
      if (NameNode.stateChangeLog.isInfoEnabled() && blocksToInvalidate != null
          && blocksToInvalidate.size() != 0) {
        StringBuffer blockList = new StringBuffer();
        for (Block blk : blocksToInvalidate) {
          blockList.append(' ');
          blockList.append(blk);
        }
        NameNode.stateChangeLog.info("BLOCK* ask "
          + dn.getName() + " to delete " + blockList);
      }
    }
    return blocksToInvalidate.size();
  }
1079769
public function invalidate()
    {
        list($key, $groupKey) = $this->getKeys(func_get_args());

        $this->engine->setGroupKey($groupKey);

        if (!$this->engine->isValid($key)) {
            return true;
        }

        return $this->engine->invalidate($key);
    }
818179
public function validate()
    {
        $this->validateRequiredParameters();

        if (!is_string($this->getId())) {
            throw new InvalidPersonException("The id parameter must be a string");
        }

        if (!is_string($this->getName())) {
            throw new InvalidPersonException("The name parameter must be a string");
        }

        if ($this->hasParameter('type')) {
            if (!is_string($this->getType())) {
                throw new InvalidPersonException("The type parameter must be a string");
            }
        }

        if ($this->hasParameter('email')) {
            if (!filter_var($this->getEmail(), FILTER_VALIDATE_EMAIL)) {
                throw new InvalidPersonException("The email parameter must be a valid email");
            }
        }

        if ($this->hasParameter('phone')) {
            if (!is_string($this->getPhone())) {
                throw new InvalidPersonException("The phone parameter must be a string");
            }
        }

        if ($this->hasParameter('fax')) {
            if (!is_string($this->getFax())) {
                throw new InvalidPersonException("The fax parameter must be a string");
            }
        }

        if ($this->hasParameter('address')) {
            $address = $this->getAddress();
            if (!($address instanceof Address)) {
                throw new InvalidPersonException("The address parameter must be an Address object");
            }
            $address->validate();
        }
    }
900992
def force_invalidate(self, vts):
    """"""
    for vt in vts.versioned_targets:
      self._invalidator.force_invalidate(vt.cache_key)
      vt.valid = False
    self._invalidator.force_invalidate(vts.cache_key)
    vts.valid = False
517242
@Override
    public void invalidate(String appName, @Nullable String vipAddress, @Nullable String secureVipAddress) {
        for (Key.KeyType type : Key.KeyType.values()) {
            for (Version v : Version.values()) {
                invalidate(
                        new Key(Key.EntityType.Application, appName, type, v, EurekaAccept.full),
                        new Key(Key.EntityType.Application, appName, type, v, EurekaAccept.compact),
                        new Key(Key.EntityType.Application, ALL_APPS, type, v, EurekaAccept.full),
                        new Key(Key.EntityType.Application, ALL_APPS, type, v, EurekaAccept.compact),
                        new Key(Key.EntityType.Application, ALL_APPS_DELTA, type, v, EurekaAccept.full),
                        new Key(Key.EntityType.Application, ALL_APPS_DELTA, type, v, EurekaAccept.compact)
                );
                if (null != vipAddress) {
                    invalidate(new Key(Key.EntityType.VIP, vipAddress, type, v, EurekaAccept.full));
                }
                if (null != secureVipAddress) {
                    invalidate(new Key(Key.EntityType.SVIP, secureVipAddress, type, v, EurekaAccept.full));
                }
            }
        }
    }
1023903
public synchronized V invalidate(K key) {
        Singleton<V> singleton = _cache.get(key);
        if (singleton != null) {
            return singleton.clear();
        } else {
            return null;
        }
    }
924951
public void invalidateAll(Predicate<? super C> predicate) {
        cache.invalidateAll(Sets.filter(cache.asMap().keySet(), predicate));
    }
1343357
public void invalidateAll(Predicate<? super C> predicate) {
        final Set<C> keys = cache.asMap().keySet().stream()
                .filter(predicate)
                .collect(Collectors.toSet());
        cache.invalidateAll(keys);
    }
17969
public Invalidation[] getInvalidations(){
		Invalidation[] invalidations = new Invalidation[configEntry.invalidations.length];
		for ( int i=0; i<configEntry.invalidations.length; i++ ){
			invalidations[i] = new Invalidation(configEntry.invalidations[i]);
		}
		return invalidations;
	}
634408
static FirestoreException invalidState(String message, Object... params) {
    return new FirestoreException(String.format(message, params), Status.INVALID_ARGUMENT);
  }
1367399
public void validate() throws InvalidStoreConfigException {
        if(getSegmentFactory() == null) {
            throw new InvalidStoreConfigException("Segment factory not found");
        }
        
        if(getHashFunction() == null) {
            throw new InvalidStoreConfigException("Store hash function not found");
        }
        
        if(getBatchSize() < StoreParams.BATCH_SIZE_MIN) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_BATCH_SIZE + "=" + getBatchSize());
        }
        
        if(getNumSyncBatches() < StoreParams.NUM_SYNC_BATCHES_MIN) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_NUM_SYNC_BATCHES + "=" + getNumSyncBatches());
        }
        
        if(getHashLoadFactor() < StoreParams.HASH_LOAD_FACTOR_MIN || getHashLoadFactor() > StoreParams.HASH_LOAD_FACTOR_MAX) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_HASH_LOAD_FACTOR + "=" + getHashLoadFactor());
        }
        
        if(getSegmentFileSizeMB() < StoreParams.SEGMENT_FILE_SIZE_MB_MIN || getSegmentFileSizeMB() > StoreParams.SEGMENT_FILE_SIZE_MB_MAX) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_SEGMENT_FILE_SIZE_MB + "=" + getSegmentFileSizeMB());
        }
        
        if(getSegmentCompactFactor() < StoreParams.SEGMENT_COMPACT_FACTOR_MIN || getSegmentCompactFactor() > StoreParams.SEGMENT_COMPACT_FACTOR_MAX) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_SEGMENT_COMPACT_FACTOR + "=" + getSegmentCompactFactor());
        }
    }
747975
def _invalidate_entry(self, key):
        ""
        old_entry = self.access_lookup.get(key)
        if old_entry:
            old_entry.is_valid = False

        return old_entry
242363
void invalidate() {
		if (isInvalidationRequired()) {
			view.postInvalidate();
			LOGGER.trace("Called view invalidation");
		}
		if (isInvalidationDelayedRequired()) {
			view.postInvalidateDelayed(getInvalidationDelay());
			LOGGER.trace("Called view delayed invalidation. Delay time is: {}", getInvalidationDelay());
		}
		reset();
	}
65970
def invalidate(strategy, value = nil)
      (value = strategy; strategy = :id) unless strategy.is_a?(Symbol)
      # call the invalidate method of the chosen strategy
      @strategy_by_attribute[strategy].invalidate(value) if @strategy_by_attribute[strategy]
    end
874244
@Override
    public void invalidate() {
        // thread-safety on cache operations
        synchronized (requestCache) {
            requestCache = new HashMap<String, ResponseCtx>(CACHE_SIZE);
            requestCacheTimeTracker = new HashMap<String, Long>(CACHE_SIZE);
            requestCacheUsageTracker = new ArrayList<String>(CACHE_SIZE);
        }
    }