Restarts a VNFR in a running NSR.

@param idNsr the ID of the NetworkServiceRecord
@param idVnfr the ID of the VNFR to restart
@param imageName rebuilding the VNFR with a different image if defined
@throws SDKException if the request fails
776259
@Help(help = "Scales out/add a VNF to a running NetworkServiceRecord with specific id")
  public void restartVnfr(final String idNsr, final String idVnfr, String imageName)
      throws SDKException {
    HashMap<String, Serializable> jsonBody = new HashMap<>();
    jsonBody.put("imageName", imageName);
    String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/restart";
    requestPost(url, jsonBody);
  }
189020
@Help(
    help =
        "Executes a script at runtime for a VNFR of a defined VNFD in a running NSR with specific id"
  )
  public void executeScript(final String idNsr, final String idVnfr, String script)
      throws SDKException {
    String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/execute-script";
    requestPost(url, script);
  }
622765
protected void reConnect(VirtualConnection inVC, IOException ioe) {

        if (getLink().isReconnectAllowed()) {
            // start the reconnect
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Attempting reconnect: " + getLink().getVirtualConnection());
            }
            // 359362 - null out the JIT read buffers
            getTSC().getReadInterface().setBuffer(null);
            getLink().reConnectAsync(ioe);
        } else {
            callErrorCallback(inVC, ioe);
        }
    }
682975
@Help(
    help =
        "Create the VirtualNetworkFunctionDescriptor dependency of a NetworkServiceDescriptor with specific id"
  )
  public VNFDependency createVNFDependency(final String idNSD, final VNFDependency vnfDependency)
      throws SDKException {
    String url = idNSD + "/vnfdependencies" + "/";
    return (VNFDependency) requestPost(url, vnfDependency);
  }
617861
public OvhTask serviceName_modem_reset_POST(String serviceName, Boolean resetOvhConfig) throws IOException {
		String qPath = "/xdsl/{serviceName}/modem/reset";
		StringBuilder sb = path(qPath, serviceName);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "resetOvhConfig", resetOvhConfig);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhTask.class);
	}
858072
@Help(help = "Delete the VirtualNetworkFunctionRecord of NetworkServiceRecord with specific id")
  public void deleteVirtualNetworkFunctionRecord(final String id, final String idVnfr)
      throws SDKException {
    String url = id + "/vnfrecords" + "/" + idVnfr;
    requestDelete(url);
  }
1260653
void reset() throws KNXPortClosedException, KNXTimeoutException, InterruptedException
	{
		write(createSetValue(AddrSystemState, new byte[] { (byte) OperationMode.Reset.mode }));
	}
1305754
public static base_response reset(nitro_service client, Interface resource) throws Exception {
		Interface resetresource = new Interface();
		resetresource.id = resource.id;
		return resetresource.perform_operation(client,"reset");
	}
367288
public void resetLink(String linkName) 
    throws SIMPRuntimeOperationFailedException 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "resetLink", linkName);
    
    try
    {  
      destinationManager.resetLink(linkName);
    }
    catch (Exception e)
    {
      // No FFDC code needed.
      throw new SIMPRuntimeOperationFailedException(e);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "resetLink");    
	}
1311730
public static br_restart[] restart(nitro_service client, br_restart[] resources) throws Exception
	{
		if(resources == null)
			throw new Exception("Null resource array");
		
		
		if(resources.length == 1)
			return ((br_restart[]) resources[0].perform_operation(client, "restart"));
		
		return ((br_restart[]) perform_operation_bulk_request(client, resources, "restart"));
	}
1072796
private void doMerge(CheckpointSignature sig, RemoteEditLogManifest manifest,
      boolean loadImage, FSImage dstImage) throws IOException {
    if (loadImage) { // create an empty namespace if new image
      namesystem = new FSNamesystem(checkpointImage, conf);
      checkpointImage.setFSNamesystem(namesystem);
    }
    assert namesystem.dir.fsImage == checkpointImage;
    checkpointImage.doMerge(sig, manifest, loadImage);
  }
874933
@Override
  protected void serviceInit(Configuration conf) throws Exception {
    _conf = conf;

    boolean stopOnFailure = conf.getBoolean(STOP_ON_FAILURE_KEY, DEFAULT_STOP_ON_FAILURE);

    try {
      // In case this NM was killed while there were running spark applications, we need to restore
      // lost state for the existing executors. We look for an existing file in the NM's local dirs.
      // If we don't find one, then we choose a file to use to save the state next time.  Even if
      // an application was stopped while the NM was down, we expect yarn to call stopApplication()
      // when it comes back
      if (_recoveryPath != null) {
        registeredExecutorFile = initRecoveryDb(RECOVERY_FILE_NAME);
      }

      TransportConf transportConf = new TransportConf("shuffle", new HadoopConfigProvider(conf));
      blockHandler = new ExternalShuffleBlockHandler(transportConf, registeredExecutorFile);

      // If authentication is enabled, set up the shuffle server to use a
      // special RPC handler that filters out unauthenticated fetch requests
      List<TransportServerBootstrap> bootstraps = Lists.newArrayList();
      boolean authEnabled = conf.getBoolean(SPARK_AUTHENTICATE_KEY, DEFAULT_SPARK_AUTHENTICATE);
      if (authEnabled) {
        secretManager = new ShuffleSecretManager();
        if (_recoveryPath != null) {
          loadSecretsFromDb();
        }
        bootstraps.add(new AuthServerBootstrap(transportConf, secretManager));
      }

      int port = conf.getInt(
        SPARK_SHUFFLE_SERVICE_PORT_KEY, DEFAULT_SPARK_SHUFFLE_SERVICE_PORT);
      transportContext = new TransportContext(transportConf, blockHandler);
      shuffleServer = transportContext.createServer(port, bootstraps);
      // the port should normally be fixed, but for tests its useful to find an open port
      port = shuffleServer.getPort();
      boundPort = port;
      String authEnabledString = authEnabled ? "enabled" : "not enabled";

      // register metrics on the block handler into the Node Manager's metrics system.
      blockHandler.getAllMetrics().getMetrics().put("numRegisteredConnections",
          shuffleServer.getRegisteredConnections());
      YarnShuffleServiceMetrics serviceMetrics =
          new YarnShuffleServiceMetrics(blockHandler.getAllMetrics());

      MetricsSystemImpl metricsSystem = (MetricsSystemImpl) DefaultMetricsSystem.instance();
      metricsSystem.register(
          "sparkShuffleService", "Metrics on the Spark Shuffle Service", serviceMetrics);
      logger.info("Registered metrics with Hadoop's DefaultMetricsSystem");

      logger.info("Started YARN shuffle service for Spark on port {}. " +
        "Authentication is {}.  Registered executor file is {}", port, authEnabledString,
        registeredExecutorFile);
    } catch (Exception e) {
      if (stopOnFailure) {
        throw e;
      } else {
        noteFailure(e);
      }
    }
  }
747850
@Override
    public void updateServerLease(String recoveryIdentity, String recoveryGroup, boolean isServerStartup) throws Exception {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "updateServerLease", new Object[] { recoveryIdentity, recoveryGroup, isServerStartup, this });

        if (tc.isDebugEnabled())
            Tr.debug(tc, "Using recoveryIdentity " + recoveryIdentity + " and log directory " + _tranRecoveryLogDirStem);

        // At this point we already have a lock on the file prior to attempting to write to it.
        // And if we have successfully written to the lease file in this instantiation of the server, then
        // we don't want to rewrite, each time we update the lease.
        try {
            // Only "touch" the server file if it belongs to the local server
            if (recoveryIdentity.equals(_localRecoveryIdentity)) {
                if (_localLeaseLock != null) {
                    // Write the Transaction Log directory string to the file
                    if (!leaseLogWrittenInThisRun) {
                        try {
                            //fooWriter.write(_logDirStem); // was "\n"
                            ByteBuffer byteBuffer = null;
                            FileChannel fChannel = _localLeaseLock.getFileChannel();
                            byteBuffer = ByteBuffer.wrap(_tranRecoveryLogDirStem.getBytes());
                            fChannel.write(byteBuffer);
                            fChannel.force(false);
                            leaseLogWrittenInThisRun = true;
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Have written to file");
                        } catch (IOException iox) {
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Caught I/O exception when trying to write to file");
                        }
                    }

                    // "Touch" the file for this server
                    final File leaseFile = new File(_serverInstallLeaseLogDir + String.valueOf(File.separatorChar) + recoveryIdentity);
                    if (leaseLogWrittenInThisRun) {
                        boolean success = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
                            @Override
                            public Boolean run() {
                                return leaseFile.setLastModified(System.currentTimeMillis());
                            }
                        });
                        if (!success) {
                            // TODO Auto-generated catch block
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Unable to set the last modification time for " + leaseFile);
                        }
                    }
                }
            } else {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Don't modify time as this is not the local server");
            }
        } catch (OverlappingFileLockException e) {
            // File is already locked in this thread or virtual machine, We're not expecting this to happen. Log the event
            if (tc.isDebugEnabled())
                Tr.debug(tc, "The file aleady appears to be locked in another thread");
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "updateServerLease", this);

    }
43845
public void zone_zoneName_reset_POST(String zoneName, OvhResetRecord[] DnsRecords, Boolean minimized) throws IOException {
		String qPath = "/domain/zone/{zoneName}/reset";
		StringBuilder sb = path(qPath, zoneName);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "DnsRecords", DnsRecords);
		addBody(o, "minimized", minimized);
		exec(qPath, "POST", sb.toString(), o);
	}
646282
public void restart(String workflowId, boolean useLatestDefinitions) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        stub.restartWorkflow(WorkflowServicePb.RestartWorkflowRequest.newBuilder()
                .setWorkflowId(workflowId)
                .setUseLatestDefinitions(useLatestDefinitions)
                .build()
        );
    }
992423
public static base_response enable(nitro_service client, dnsnameserver resource) throws Exception {
		dnsnameserver enableresource = new dnsnameserver();
		enableresource.ip = resource.ip;
		enableresource.dnsvservername = resource.dnsvservername;
		return enableresource.perform_operation(client,"enable");
	}
280907
@Override
    public void writeDefaultNamespace(String nsURI)
    {
        if (mOpenElement == null) {
            throw new IllegalStateException("No currently open START_ELEMENT, cannot write attribute");
        }
        setDefaultNamespace(nsURI);
        mOpenElement.addAttribute(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns", nsURI);
    }