Refresh the authorization policy on the {@link NameNode}.
@return exitcode 0 on success, non-zero on failure
@throws IOException
164408
public int refreshServiceAcl() throws IOException {
    // Get the current configuration
    Configuration conf = getConf();
    
    // Create the client
    RefreshAuthorizationPolicyProtocol refreshProtocol = 
      (RefreshAuthorizationPolicyProtocol) 
      RPC.getProxy(RefreshAuthorizationPolicyProtocol.class, 
                   RefreshAuthorizationPolicyProtocol.versionID, 
                   NameNode.getClientProtocolAddress(conf), getUGI(conf), conf,
                   NetUtils.getSocketFactory(conf, 
                                             RefreshAuthorizationPolicyProtocol.class));
    
    // Refresh the authorization policy in-effect
    refreshProtocol.refreshServiceAcl();
    
    return 0;
  }
811682
private void requestAuthorization(HttpServletResponse resp) throws IOException {

        // Authorisation is required for the requested action.
        resp.setHeader(CmsRequestUtil.HEADER_WWW_AUTHENTICATE, "Basic realm=\"" + BASIC_REALM + "\"");

        resp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    }
231638
public synchronized void refreshWithPassword(String username, String password) throws AuthenticationException {
		refreshWithPassword(username, password, null);
	}
631448
public BaasResult<BaasDocument> refreshSync(boolean withAcl) {
        BaasBox box = BaasBox.getDefaultChecked();
        if (id == null)
            throw new IllegalStateException("this document is not bound to any remote entity");
        Refresh refresh = new Refresh(box, this,withAcl, RequestOptions.DEFAULT, null);
        return box.submitSync(refresh);
    }
1043191
private HeaderCacheElement syncRefresh(long timeout, TimeUnit timeUnit) {
    Span span = TRACER.spanBuilder("Bigtable.CredentialsRefresh").startSpan();
    try (Scope scope = TRACER.withSpan(span)) {
      return asyncRefresh().get(timeout, timeUnit);
    } catch (InterruptedException e) {
      LOG.warn("Interrupted while trying to refresh google credentials.", e);
      Status status = Status.UNAUTHENTICATED
          .withDescription("Authentication was interrupted.")
          .withCause(e);
      span.setStatus(StatusConverter.fromGrpcStatus(status));
      Thread.currentThread().interrupt();
      return new HeaderCacheElement(status);
    } catch (ExecutionException e) {
      LOG.warn("ExecutionException while trying to refresh google credentials.", e);
      Status status = Status.UNAUTHENTICATED
          .withDescription("ExecutionException during Authentication.")
          .withCause(e);
      span.setStatus(StatusConverter.fromGrpcStatus(status));
      return new HeaderCacheElement(status);
    } catch (TimeoutException e) {
      LOG.warn("TimeoutException while trying to refresh google credentials.", e);
      Status status = Status.UNAUTHENTICATED
          .withDescription("TimeoutException during Authentication.")
          .withCause(e);
      span.setStatus(StatusConverter.fromGrpcStatus(status));
      return new HeaderCacheElement(status);
    } catch (Exception e) {
      LOG.warn("Unexpected execption while trying to refresh google credentials.", e);
      Status status = Status.UNAUTHENTICATED
          .withDescription("Unexpected execption during Authentication.")
          .withCause(e);
      span.setStatus(StatusConverter.fromGrpcStatus(status));
      return new HeaderCacheElement(status);
    } finally {
      span.end();
    }
  }
1220194
protected boolean refreshFromSystem() {
        Lock lock = this.namespacesLock.writeLock();
        try {
            lock.lock();
            // Re-read and re-register all of the namespaces ...
            SessionCache systemCache = repository.createSystemSession(context, false);
            SystemContent system = new SystemContent(systemCache);
            Collection<Namespace> namespaces = system.readAllNamespaces();
            if (namespaces.isEmpty()) return false;
            this.cache.clear();
            this.cache.register(namespaces);
        } catch (Throwable e) {
            logger.error(e, JcrI18n.errorRefreshingNodeTypes, repository.name());
        } finally {
            lock.unlock();
        }
        return true;
    }
48817
protected void refreshPeers ()
    {
        if (_adHoc) {
            return;
        }

        // load up information on our nodes
        _invoker.postUnit(new RepositoryUnit("refreshPeers") {
            @Override
            public void invokePersist () throws Exception {
                // let the world know that we're alive
                _noderepo.heartbeatNode(_nodeName);

                // then load up all the peer records
                _nodes = Maps.newHashMap();
                for (NodeRecord record : _noderepo.loadNodes(_nodeNamespace)) {
                    _nodes.put(record.nodeName, record);
                }
            }
            @Override
            public void handleSuccess () {
                // refresh peers with loaded records
                long now = System.currentTimeMillis();
                for (Iterator<NodeRecord> it = _nodes.values().iterator(); it.hasNext(); ) {
                    NodeRecord record = it.next();
                    if (Objects.equal(record.nodeName, _nodeName)) {
                        continue;
                    }
                    if ((now - record.lastUpdated.getTime()) > PeerNode.STALE_INTERVAL) {
                        it.remove();
                        continue;
                    }
                    try {
                        refreshPeer(record);
                    } catch (Exception e) {
                        log.warning("Failure refreshing peer " + record + ".", e);
                    }
                }

                // remove peers for which we no longer have up-to-date records
                for (Iterator<PeerNode> it = _peers.values().iterator(); it.hasNext(); ) {
                    PeerNode peer = it.next();
                    if (!_nodes.containsKey(peer.getNodeName())) {
                        peer.shutdown();
                        it.remove();
                    }
                }
            }
            @Override
            public long getLongThreshold () {
                return 700L;
            }
            protected Map<String, NodeRecord> _nodes;
        });
    }
709933
public Boolean get(String name) throws IOException {
        if (name.equalsIgnoreCase(DIGITAL_SIGNATURE)) {
            return Boolean.valueOf(isSet(0));
        } else if (name.equalsIgnoreCase(NON_REPUDIATION)) {
            return Boolean.valueOf(isSet(1));
        } else if (name.equalsIgnoreCase(KEY_ENCIPHERMENT)) {
            return Boolean.valueOf(isSet(2));
        } else if (name.equalsIgnoreCase(DATA_ENCIPHERMENT)) {
            return Boolean.valueOf(isSet(3));
        } else if (name.equalsIgnoreCase(KEY_AGREEMENT)) {
            return Boolean.valueOf(isSet(4));
        } else if (name.equalsIgnoreCase(KEY_CERTSIGN)) {
            return Boolean.valueOf(isSet(5));
        } else if (name.equalsIgnoreCase(CRL_SIGN)) {
            return Boolean.valueOf(isSet(6));
        } else if (name.equalsIgnoreCase(ENCIPHER_ONLY)) {
            return Boolean.valueOf(isSet(7));
        } else if (name.equalsIgnoreCase(DECIPHER_ONLY)) {
            return Boolean.valueOf(isSet(8));
        } else {
          throw new IOException("Attribute name not recognized by"
                                + " CertAttrSet:KeyUsage.");
        }
    }
416834
@RequirePOST
    public void doReload() throws IOException {
        checkPermission(CONFIGURE);

        // try to reflect the changes by reloading
        getConfigFile().unmarshal(this);
        Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() {
            @Override
            public Void call() throws IOException {
                onLoad(getParent(), getRootDir().getName());
                return null;
            }
        });
        Jenkins.getInstance().rebuildDependencyGraphAsync();

        SaveableListener.fireOnChange(this, getConfigFile());
    }
73531
void saveNamespace(boolean force, boolean uncompressed)
  throws AccessControlException, IOException {
    try {
      if (namenodeProtocolProxy == null) {
        versionBasedSaveNamespace(force, uncompressed);
      } else {
        methodBasedSaveNamespace(force, uncompressed);
      }
    } catch(RemoteException re) {
      throw re.unwrapRemoteException(AccessControlException.class);
    }
  }
941631
protected boolean refreshFromSystem() {
        this.nodeTypesLock.writeLock().lock();
        try {
            // Re-read and re-register all of the node types ...
            SessionCache systemCache = repository.createSystemSession(context, true);
            SystemContent system = new SystemContent(systemCache);
            Collection<NodeTypeDefinition> nodeTypes = system.readAllNodeTypes();
            if (nodeTypes.isEmpty()) return false;
            registerNodeTypes(nodeTypes, false, false, false);
            return true;
        } catch (Throwable e) {
            logger.error(e, JcrI18n.errorRefreshingNodeTypes, repository.name());
            return false;
        } finally {
            this.nodeTypesLock.writeLock().unlock();
        }
    }
89601
public Credential authorize(String userId) throws IOException {
    try {
      Credential credential = flow.loadCredential(userId);
      if (credential != null
          && (credential.getRefreshToken() != null ||
              credential.getExpiresInSeconds() == null ||
              credential.getExpiresInSeconds() > 60)) {
        return credential;
      }
      // open in browser
      String redirectUri = receiver.getRedirectUri();
      AuthorizationCodeRequestUrl authorizationUrl =
          flow.newAuthorizationUrl().setRedirectUri(redirectUri);
      onAuthorization(authorizationUrl);
      // receive authorization code and exchange it for an access token
      String code = receiver.waitForCode();
      TokenResponse response = flow.newTokenRequest(code).setRedirectUri(redirectUri).execute();
      // store credential and return it
      return flow.createAndStoreCredential(response, userId);
    } finally {
      receiver.stop();
    }
  }
793940
def Refresh(self, autoRelogin=False, dumpXml=YesOrNo.FALSE):
		
		self._Stop_refresh_timer()

		response = self.AaaRefresh(self._username, self._password, dumpXml)
		if (response.errorCode != 0):
			self._cookie = None
			if (autoRelogin):
				return self.Login(self._name, self._username, self._password, self._noSsl, self._port, dumpXml,
								  self._proxy, autoRefresh=YesOrNo.TRUE)
			return False

		self._domains = response.OutDomains
		self._priv = response.OutPriv.split(',')
		self._refreshPeriod = int(response.OutRefreshPeriod)
		self._cookie = response.OutCookie

		# re-enable the timer
		self._Start_refresh_timer()
		return True
777345
public synchronized void refreshNodes() throws IOException {
    hostsReader.refresh();
    LOG.info("After refresh Included hosts: " +
        hostsReader.getHostNames().size() +
        " Excluded hosts: " + hostsReader.getExcludedHosts().size());
    Set<String> newHosts = hostsReader.getHostNames();
    Set<String> newExcludes = hostsReader.getExcludedHosts();
    Set<ClusterNode> hostsToExclude = new HashSet<ClusterNode>();
    for (ClusterNode tmpNode : nameToNode.values()) {
      String host = tmpNode.getHost();
      // Check if not included or explicitly excluded.
      if (!newHosts.contains(host) || newExcludes.contains(host)) {
        hostsToExclude.add(tmpNode);
      }
    }
    for (ClusterNode node: hostsToExclude) {
      synchronized (node) {
        for (Map.Entry<ResourceType, RunnableIndices> entry :
          typeToIndices.entrySet()) {
          ResourceType type = entry.getKey();
          RunnableIndices r = entry.getValue();
          if (r.hasRunnable(node)) {
            LOG.info("Node " + node.getName() + " is no longer " +
              type + " runnable because it is excluded");
            r.deleteRunnable(node);
          }
        }
      }
    }
  }
439511
private void invalidateBlock(Block blk, DatanodeInfo dn, boolean ackRequired)
    throws IOException {
    NameNode.stateChangeLog.info("DIR* NameSystem.invalidateBlock: "
      + blk + " on "
      + dn.getName());
    DatanodeDescriptor node = getDatanode(dn);
    if (node == null) {
      throw new IOException("Cannot invalidate block " + blk +
        " because datanode " + dn.getName() +
        " does not exist.");
    }

    // Check how many copies we have of the block.  If we have at least one
    // copy on a live node, then we can delete it.
    int count = countNodes(blk).liveReplicas();
    if (count > 1) {
      // delete with ACK
      addToInvalidates(blk, dn, ackRequired);
      removeStoredBlock(blk, node);
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("BLOCK* NameSystem.invalidateBlocks: "
          + blk + " on "
          + dn.getName() + " listed for deletion.");
      }
    } else {
      NameNode.stateChangeLog.info("BLOCK* NameSystem.invalidateBlocks: "
        + blk + " on "
        + dn.getName() + " is the only copy and was not deleted.");
    }
  }
787964
public Response<AccessTokenDetails> refreshAccessToken(final String refreshToken) throws FreesoundClientException {
		final RefreshOAuth2AccessTokenRequest tokenRequest =
				new RefreshOAuth2AccessTokenRequest(clientId, clientSecret, refreshToken);

		return executeQuery(tokenRequest);
	}
1099383
public synchronized boolean startUpgrade() throws IOException {
    if(!upgradeState) {
      initializeUpgrade();
      if(!upgradeState) return false;
      // write new upgrade state into disk
      namesystem.getFSImage().storage.writeAll();
    }
    assert currentUpgrades != null : "currentUpgrades is null";
    this.broadcastCommand = currentUpgrades.first().startUpgrade();
    NameNode.LOG.info("\n   Distributed upgrade for NameNode version " 
        + getUpgradeVersion() + " to current LV " 
        + FSConstants.LAYOUT_VERSION + " is started.");
    return true;
  }