Package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AppSchedulable


 
  @Override
  public void trackApp(ApplicationAttemptId appAttemptId, String oldAppId) {
    super.trackApp(appAttemptId, oldAppId);
    FairScheduler fair = (FairScheduler) scheduler;
    final AppSchedulable app = fair.getSchedulerApp(appAttemptId)
            .getAppSchedulable();
    metrics.register("variable.app." + oldAppId + ".demand.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getDemand().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".demand.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getDemand().getVirtualCores();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".usage.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getResourceUsage().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".usage.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getResourceUsage().getVirtualCores();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".minshare.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getMinShare().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".minshare.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getMinShare().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".maxshare.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return Math.min(app.getMaxShare().getMemory(), totalMemoryMB);
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".maxshare.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return Math.min(app.getMaxShare().getVirtualCores(), totalVCores);
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".fairshare.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getFairShare().getVirtualCores();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".fairshare.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getFairShare().getVirtualCores();
        }
      }
    );
  }
View Full Code Here


 
  @Override
  public void trackApp(ApplicationAttemptId appAttemptId, String oldAppId) {
    super.trackApp(appAttemptId, oldAppId);
    FairScheduler fair = (FairScheduler) scheduler;
    final AppSchedulable app = fair.getSchedulerApp(appAttemptId)
            .getAppSchedulable();
    metrics.register("variable.app." + oldAppId + ".demand.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getDemand().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".demand.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getDemand().getVirtualCores();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".usage.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getResourceUsage().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".usage.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getResourceUsage().getVirtualCores();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".minshare.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getMinShare().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".minshare.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getMinShare().getMemory();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".maxshare.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return Math.min(app.getMaxShare().getMemory(), totalMemoryMB);
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".maxshare.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return Math.min(app.getMaxShare().getVirtualCores(), totalVCores);
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".fairshare.memory",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getFairShare().getVirtualCores();
        }
      }
    );
    metrics.register("variable.app." + oldAppId + ".fairshare.vcores",
      new Gauge<Integer>() {
        @Override
        public Integer getValue() {
          return app.getFairShare().getVirtualCores();
        }
      }
    );
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AppSchedulable

Copyright © 2018 www.massapicom. 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.