Examples of MasterContainerAllocatorConfigurer


Examples of org.springframework.yarn.config.annotation.configurers.MasterContainerAllocatorConfigurer

    public void configure(YarnAppmasterConfigurer master) throws Exception {
      master
        .appmasterClass(syap.getAppmasterClass() != null ? syap.getAppmasterClass() : appmasterClass)
        .containerCommands(createContainerCommands(syalcp));

      MasterContainerAllocatorConfigurer containerAllocatorConfigurer = master.withContainerAllocator();
      containerAllocatorConfigurer
        .locality(syalcp.isLocality())
        .memory(syarp.getMemory())
        .priority(syarp.getPriority())
        .virtualCores(syarp.getVirtualCores());

      if (syap.getContainercluster() != null && syap.getContainercluster().getClusters() != null) {
        for (java.util.Map.Entry<String, ContainerClustersProperties> entry : syap.getContainercluster().getClusters().entrySet()) {
          SpringYarnAppmasterResourceProperties resource = entry.getValue().getResource();
          SpringYarnAppmasterLaunchContextProperties launchcontext = entry.getValue().getLaunchcontext();

          master
            .containerCommands(entry.getKey(), createContainerCommands(launchcontext));

          containerAllocatorConfigurer
            .withCollection(entry.getKey())
              .priority(resource != null ? resource.getPriority() : null)
              .memory(resource != null ? resource.getMemory() : null)
              .virtualCores(resource != null ? resource.getVirtualCores() : null)
              .locality(launchcontext != null ? launchcontext.isLocality() : false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.