Verify or refresh the state of the shared library store.
171393
@Override
  protected void prepare(int flags) throws IOException {
    SysUtil.mkdirOrThrow(soDirectory);
    File lockFileName = new File(soDirectory, LOCK_FILE_NAME);
    FileLocker lock = FileLocker.lock(lockFileName);
    try {
      Log.v(TAG, "locked dso store " + soDirectory);
      if (refreshLocked(lock, flags, getDepsBlock())) {
        lock = null; // Lock transferred to syncer thread
      } else {
        Log.i(TAG, "dso store is up-to-date: " + soDirectory);
      }
    } finally {
      if (lock != null) {
        Log.v(TAG, "releasing dso store lock for " + soDirectory);
        lock.close();
      } else {
        Log.v(TAG, "not releasing dso store lock for "
            + soDirectory + " (syncer thread started)");
      }
    }
  }
242109
def refresh(self, *args, **kwargs):
        
        result = self.fetch(*args, **kwargs)
        self.store(self.key(*args, **kwargs), self.expiry(*args, **kwargs), result)
        return result
1274634
public void monitor(LocalStore ls) {
    int in = 0;
    EventRecord er = null;
    Environment.logInfo("Started processing log...");

    while ((er = getNext()) != null) {
      // Environment.logInfo("Processing log line:\t" + in++);
      if (er.isValid()) {
        ls.insert(er);
      }
    }

    PersistentState.updateState(file.getAbsolutePath(), firstLine, offset);
    PersistentState.writeState("conf/parsing.state");
  }
801024
@Api
	public void refresh() {
		if (state == State.INITIALIZED) { // to prevent refresh before the map is drawn
			state = State.REFRESHING;
			clear();
			ClientConfigurationService.clear(); // refresh because configuration changed, clear cache
			refreshFromConfiguration();
		}
	}
1264593
def sync(
    ctx,
    state,
    bare=False,
    user=False,
    unused=False,
    **kwargs
):
    """"""
    from ..core import do_sync

    retcode = do_sync(
        ctx=ctx,
        dev=state.installstate.dev,
        three=state.three,
        python=state.python,
        bare=bare,
        dont_upgrade=(not state.installstate.keep_outdated),
        user=user,
        clear=state.clear,
        unused=unused,
        sequential=state.installstate.sequential,
        pypi_mirror=state.pypi_mirror,
    )
    if retcode:
        ctx.abort()
335394
def update(self):
        
        with self._lock:
            if self._state == Bundle.ACTIVE:
                self.stop()
                self.start()
1116551
def assert_reset(self, asserted):
        """"""
        self._link.drive_nreset(asserted)
        self._nreset_state = asserted
1076842
def refresh(self):
        ""

        # Construct the credentials for the verification request
        oauth = OAuth1(
            self.consumer_key,
            client_secret=self.consumer_secret,
            resource_owner_key=self.oauth_token,
            resource_owner_secret=self.oauth_token_secret,
            rsa_key=self.rsa_key,
            signature_method=self._signature_method
        )

        # Make the verification request, getting back an access token
        headers = {'User-Agent': self.user_agent}
        params = {'oauth_session_handle': self.oauth_session_handle}
        response = requests.post(url=self.base_url + ACCESS_TOKEN_URL,
                params=params, headers=headers, auth=oauth)
        self._process_oauth_response(response)
485812
def get_library_state_copy_instance(self, lib_os_path):
        

        # originally libraries were called like this; DO NOT DELETE; interesting for performance tests
        # state_machine = storage.load_state_machine_from_path(lib_os_path)
        # return state_machine.version, state_machine.root_state

        # TODO observe changes on file system and update data
        if lib_os_path in self._loaded_libraries:
            # this list can also be taken to open library state machines TODO -> implement it -> because faster
            state_machine = self._loaded_libraries[lib_os_path]
            # logger.info("Take copy of {0}".format(lib_os_path))
            # as long as the a library state root state is never edited so the state first has to be copied here
            state_copy = copy.deepcopy(state_machine.root_state)
            return state_machine.version, state_copy
        else:
            state_machine = storage.load_state_machine_from_path(lib_os_path)
            self._loaded_libraries[lib_os_path] = state_machine
            if config.global_config.get_config_value("NO_PROGRAMMATIC_CHANGE_OF_LIBRARY_STATES_PERFORMED", False):
                return state_machine.version, state_machine.root_state
            else:
                state_copy = copy.deepcopy(state_machine.root_state)
                return state_machine.version, state_copy
945461
private static boolean ifExistsAndFresh(Configuration conf, FileSystem fs,
                                          URI cache, long confFileStamp,
                                          CacheStatus lcacheStatus,
                                          FileStatus fileStatus)
  throws IOException {
    // check for existence of the cache
    long dfsFileStamp;
    if (fileStatus != null) {
      dfsFileStamp = fileStatus.getModificationTime();
    } else {
      dfsFileStamp = getTimestamp(conf, cache);
    }

    // ensure that the file on hdfs hasn't been modified since the job started
    if (dfsFileStamp != confFileStamp) {
      LOG.fatal("File: " + cache + " has changed on HDFS since job started");
      throw new IOException("File: " + cache +
          " has changed on HDFS since job started");
    }

    if (dfsFileStamp != lcacheStatus.mtime) {
      // needs refreshing
      return false;
    }

    return true;
  }
88603
private void ensureInitialized() {
    if (!mInitialized) {
     lock.lock();
      try {
        if (!mInitialized) {
          mInternalPath = Environment.getDataDirectory();
          mExternalPath = Environment.getExternalStorageDirectory();
          updateStats();
          mInitialized = true;
        }
      } finally {
        lock.unlock();
      }
    }
  }
836016
def update_check(self, existing, new):
        
        old_state = existing.state
        if 'NowPlayingItem' in existing.session_raw:
            try:
                old_theme = existing.session_raw['NowPlayingItem']['IsThemeMedia']
            except KeyError:
                old_theme = False
        else:
            old_theme = False

        if 'NowPlayingItem' in new:
            if new['PlayState']['IsPaused']:
                new_state = STATE_PAUSED
            else:
                new_state = STATE_PLAYING

            try:
                new_theme = new['NowPlayingItem']['IsThemeMedia']
            except KeyError:
                new_theme = False

        else:
            new_state = STATE_IDLE
            new_theme = False

        if old_theme or new_theme:
            return False
        elif old_state == STATE_PLAYING or new_state == STATE_PLAYING:
            return True
        elif old_state != new_state:
            return True
        else:
            return False
1250092
def refresh(self, force_cache=False):
        
        if self.check_if_ok_to_update() or force_cache:
            for sync_name, sync_module in self.sync.items():
                _LOGGER.debug("Attempting refresh of sync %s", sync_name)
                sync_module.refresh(force_cache=force_cache)
            if not force_cache:
                # Prevents rapid clearing of motion detect property
                self.last_refresh = int(time.time())
            return True
        return False
61302
def refresh(self):
        
        if lib.EnvRefresh(self._env, self._rule) != 1:
            raise CLIPSError(self._env)
5360
protected void refreshFromSystem() {
        try {
            // Re-read and re-register all of the namespaces ...
            SessionCache systemCache = repository.createSystemSession(repository.context(), false);
            SystemContent system = new SystemContent(systemCache);
            CachedNode locks = system.locksNode();
            MutableCachedNode mutableLocks = null;
            Set<NodeKey> corruptedLocks = new HashSet<>();
            for (ChildReference ref : locks.getChildReferences(systemCache)) {
                CachedNode node = systemCache.getNode(ref);
                if (node == null) {
                    if (mutableLocks == null) {
                        mutableLocks = system.mutableLocksNode();
                    }
                    NodeKey lockKey = ref.getKey();
                    logger.warn(JcrI18n.lockNotFound, lockKey);
                    mutableLocks.removeChild(systemCache, lockKey);
                    corruptedLocks.add(lockKey);
                    continue;
                }
                ModeShapeLock lock = new ModeShapeLock(node, systemCache);
                locksByNodeKey.put(lock.getLockedNodeKey(), lock);
            }
            if (mutableLocks != null) {
                system.save();
                for (Iterator<Map.Entry<NodeKey, ModeShapeLock>> locksIterator = locksByNodeKey.entrySet().iterator(); 
                     locksIterator.hasNext();) {
                    NodeKey lockKey = locksIterator.next().getValue().getLockKey();
                    if (corruptedLocks.contains(lockKey)) {
                        locksIterator.remove();
                    }
                }
            }
        } catch (Throwable e) {
            logger.error(e, JcrI18n.errorRefreshingLocks, repository.name());
        }
    }
1248185
def _check_lib(self, remake, compiler, debug, profile):
        
        from os import path
        if self.link is None or not path.isfile(self.link):
            self.makelib(remake, True, compiler, debug, profile)
149301
def _refresh_state(self):
    
    self._info = self._api.projects().jobs().get(name=self._name).execute()
    self._fatal_error = self._info.get('errorMessage', None)
    state = str(self._info.get('state'))
    self._is_complete = (state == 'SUCCEEDED' or state == 'FAILED')