Tabnine Logo
ContainerUpdateRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
ContainerUpdateRequest
in
org.apache.hadoop.yarn.api.protocolrecords

Best Java code snippets using org.apache.hadoop.yarn.api.protocolrecords.ContainerUpdateRequest (Showing top 8 results out of 315)

origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

/**
 * Increase resource of a list of containers on this NodeManager.
 */
@Override
@Deprecated
public IncreaseContainersResourceResponse increaseContainersResource(
  IncreaseContainersResourceRequest requests)
    throws YarnException, IOException {
 ContainerUpdateResponse resp = updateContainer(
   ContainerUpdateRequest.newInstance(requests.getContainersToIncrease()));
 return IncreaseContainersResourceResponse.newInstance(
   resp.getSuccessfullyUpdatedContainers(), resp.getFailedRequests());
}
origin: org.apache.hadoop/hadoop-yarn-api

@Public
@Unstable
public static ContainerUpdateRequest newInstance(
  List<Token> containersToIncrease) {
 ContainerUpdateRequest request =
   Records.newRecord(ContainerUpdateRequest.class);
 request.setContainersToUpdate(containersToIncrease);
 return request;
}
origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

 request.getContainersToUpdate()) {
ContainerId containerId = null;
try {
origin: org.apache.hadoop/hadoop-yarn-common

@Override
@Deprecated
public IncreaseContainersResourceResponse increaseContainersResource(
  IncreaseContainersResourceRequest request) throws YarnException,
  IOException {
 try {
  ContainerUpdateRequest req =
    ContainerUpdateRequest.newInstance(request.getContainersToIncrease());
  ContainerUpdateRequestProto reqProto =
    ((ContainerUpdateRequestPBImpl) req).getProto();
  ContainerUpdateResponse resp = new ContainerUpdateResponsePBImpl(
    proxy.updateContainer(null, reqProto));
  return IncreaseContainersResourceResponse
    .newInstance(resp.getSuccessfullyUpdatedContainers(),
      resp.getFailedRequests());
 } catch (ServiceException e) {
  RPCUtil.unwrapAndThrowException(e);
  return null;
 }
}
origin: org.apache.hadoop/hadoop-yarn-client

@Deprecated
@Override
public void increaseContainerResource(Container container)
  throws YarnException, IOException {
 ContainerManagementProtocolProxyData proxy = null;
 try {
  proxy = cmProxy.getProxy(
    container.getNodeId().toString(), container.getId());
  List<Token> increaseTokens = new ArrayList<>();
  increaseTokens.add(container.getContainerToken());
  ContainerUpdateRequest request =
    ContainerUpdateRequest.newInstance(increaseTokens);
  ContainerUpdateResponse response =
    proxy.getContainerManagementProtocol().updateContainer(request);
  if (response.getFailedRequests() != null
    && response.getFailedRequests().containsKey(container.getId())) {
   Throwable t = response.getFailedRequests().get(container.getId())
     .deSerialize();
   parseAndThrowException(t);
  }
 } finally {
  if (proxy != null) {
   cmProxy.mayBeCloseProxy(proxy);
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-client

@Override
public void updateContainerResource(Container container)
  throws YarnException, IOException {
 ContainerManagementProtocolProxyData proxy = null;
 try {
  proxy =
    cmProxy.getProxy(container.getNodeId().toString(), container.getId());
  List<Token> updateTokens = new ArrayList<>();
  updateTokens.add(container.getContainerToken());
  ContainerUpdateRequest request =
    ContainerUpdateRequest.newInstance(updateTokens);
  ContainerUpdateResponse response =
    proxy.getContainerManagementProtocol().updateContainer(request);
  if (response.getFailedRequests() != null && response.getFailedRequests()
    .containsKey(container.getId())) {
   Throwable t =
     response.getFailedRequests().get(container.getId()).deSerialize();
   parseAndThrowException(t);
  }
 } finally {
  if (proxy != null) {
   cmProxy.mayBeCloseProxy(proxy);
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-common

@Override
public IncreaseContainersResourceResponseProto increaseContainersResource(
  RpcController controller, IncreaseContainersResourceRequestProto proto)
  throws ServiceException {
 IncreaseContainersResourceRequestPBImpl request =
   new IncreaseContainersResourceRequestPBImpl(proto);
 try {
  ContainerUpdateResponse resp = real.updateContainer(ContainerUpdateRequest
    .newInstance(request.getContainersToIncrease()));
  IncreaseContainersResourceResponse response =
    IncreaseContainersResourceResponse
      .newInstance(resp.getSuccessfullyUpdatedContainers(),
        resp.getFailedRequests());
  return ((IncreaseContainersResourceResponsePBImpl)response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}
origin: org.apache.hadoop/hadoop-yarn-common

increaseTokens.add(containerToken);
ContainerUpdateRequest request = ContainerUpdateRequest
  .newInstance(increaseTokens);
org.apache.hadoop.yarn.api.protocolrecordsContainerUpdateRequest

Javadoc

The request sent by Application Master to the Node Manager to change the resource quota of a container.

Most used methods

  • newInstance
  • getContainersToUpdate
    Get a list of container tokens to be used for authorization during container resource update. Note:
  • setContainersToUpdate
    Set container tokens to be used during container resource increase. The token is acquired fromAlloca

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now