org.apache.hadoop.metrics2.lib.MutableGaugeInt.decr() - java examples

Here are the examples of the java api org.apache.hadoop.metrics2.lib.MutableGaugeInt.decr() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

43 Examples 7

19 View Complete Implementation : MRAppMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void endRunningJob(Job job) {
    jobsRunning.decr();
}

19 View Complete Implementation : MRAppMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void endPreparingJob(Job job) {
    jobsPreparing.decr();
}

19 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void endInitingContainer() {
    containersIniting.decr();
}

19 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void endRunningContainer() {
    containersRunning.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrNumUnhealthyNMs() {
    numUnhealthyNMs.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrDecommissioningNMs() {
    numDecommissioningNMs.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrDecommisionedNMs() {
    numDecommissionedNMs.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrNumActiveNodes() {
    numActiveNMs.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrNumRebootedNMs() {
    numRebootedNMs.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrNumLostNMs() {
    numLostNMs.decr();
}

19 View Complete Implementation : ClusterMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrNumShutdownNMs() {
    numShutdownNMs.decr();
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void deactivateApp(String user) {
    activeApplications.decr();
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.deactivateApp(user);
    }
    if (parent != null) {
        parent.deactivateApp(user);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void runAppAttempt(ApplicationId appId, String user) {
    runBuckets.add(appId, System.currentTimeMillis());
    appsRunning.incr();
    appsPending.decr();
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.runAppAttempt(appId, user);
    }
    if (parent != null) {
        parent.runAppAttempt(appId, user);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void finishAppAttempt(ApplicationId appId, boolean isPending, String user) {
    runBuckets.remove(appId);
    if (isPending) {
        appsPending.decr();
    } else {
        appsRunning.decr();
    }
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.finishAppAttempt(appId, isPending, user);
    }
    if (parent != null) {
        parent.finishAppAttempt(appId, isPending, user);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
private void _decrPendingResources(int containers, Resource res) {
    // if #container = 0, means change container resource
    pendingContainers.decr(containers);
    pendingMB.decr(res.getMemory() * Math.max(containers, 1));
    pendingVCores.decr(res.getVirtualCores() * Math.max(containers, 1));
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void moveAppFrom(AppSchedulingInfo app) {
    if (app.isPending()) {
        appsPending.decr();
    } else {
        appsRunning.decr();
    }
    QueueMetrics userMetrics = getUserMetrics(app.getUser());
    if (userMetrics != null) {
        userMetrics.moveAppFrom(app);
    }
    if (parent != null) {
        parent.moveAppFrom(app);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void unreserveResource(String user, Resource res) {
    reservedContainers.decr();
    reservedMB.decr(res.getMemory());
    reservedVCores.decr(res.getVirtualCores());
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.unreserveResource(user, res);
    }
    if (parent != null) {
        parent.unreserveResource(user, res);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decrActiveUsers() {
    activeUsers.decr();
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void releaseResources(String user, int containers, Resource res) {
    // if #container = 0, means change container resource.
    allocatedContainers.decr(containers);
    aggregateContainersReleased.incr(containers);
    allocatedMB.decr(res.getMemory() * Math.max(containers, 1));
    allocatedVCores.decr(res.getVirtualCores() * Math.max(containers, 1));
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.releaseResources(user, containers, res);
    }
    if (parent != null) {
        parent.releaseResources(user, containers, res);
    }
}

19 View Complete Implementation : DataNodeMetrics.java
Copyright Apache License 2.0
Author : apache
public void decrDataNodeActiveXceiversCount() {
    dataNodeActiveXceiversCount.decr();
}

19 View Complete Implementation : ShuffleClientMetrics.java
Copyright Apache License 2.0
Author : apache
public void threadFree() {
    numThreadsBusy.decr();
}

19 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : apache
public void endReInitingContainer() {
    containersReIniting.decr();
}

19 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : apache
public void endPausedContainer() {
    containersPaused.decr();
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : apache
/**
 * Allocate Resource for container size change.
 * @param parreplacedion Node Parreplacedion
 * @param user
 * @param res
 */
public void allocateResources(String parreplacedion, String user, Resource res) {
    if (parreplacedion == null || parreplacedion.equals(RMNodeLabelsManager.NO_LABEL)) {
        allocatedMB.incr(res.getMemorySize());
        allocatedVCores.incr(res.getVirtualCores());
        if (queueMetricsForCustomResources != null) {
            queueMetricsForCustomResources.increaseAllocated(res);
            registerCustomResources(queueMetricsForCustomResources.getAllocatedValues(), ALLOCATED_RESOURCE_METRIC_PREFIX, ALLOCATED_RESOURCE_METRIC_DESC);
        }
        pendingMB.decr(res.getMemorySize());
        pendingVCores.decr(res.getVirtualCores());
        if (queueMetricsForCustomResources != null) {
            queueMetricsForCustomResources.decreasePending(res);
            registerCustomResources(queueMetricsForCustomResources.getPendingValues(), PENDING_RESOURCE_METRIC_PREFIX, PENDING_RESOURCE_METRIC_DESC);
        }
        QueueMetrics userMetrics = getUserMetrics(user);
        if (userMetrics != null) {
            userMetrics.allocateResources(parreplacedion, user, res);
        }
        if (parent != null) {
            parent.allocateResources(parreplacedion, user, res);
        }
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : apache
public void releaseResources(String parreplacedion, String user, int containers, Resource res) {
    if (parreplacedion == null || parreplacedion.equals(RMNodeLabelsManager.NO_LABEL)) {
        allocatedContainers.decr(containers);
        aggregateContainersReleased.incr(containers);
        allocatedMB.decr(res.getMemorySize() * containers);
        allocatedVCores.decr(res.getVirtualCores() * containers);
        if (queueMetricsForCustomResources != null) {
            queueMetricsForCustomResources.decreaseAllocated(res, containers);
            registerCustomResources(queueMetricsForCustomResources.getAllocatedValues(), ALLOCATED_RESOURCE_METRIC_PREFIX, ALLOCATED_RESOURCE_METRIC_DESC);
        }
        QueueMetrics userMetrics = getUserMetrics(user);
        if (userMetrics != null) {
            userMetrics.releaseResources(parreplacedion, user, containers, res);
        }
        if (parent != null) {
            parent.releaseResources(parreplacedion, user, containers, res);
        }
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : apache
/**
 * Release Resource for container size change.
 *
 * @param user
 * @param res
 */
private void releaseResources(String user, Resource res) {
    allocatedMB.decr(res.getMemorySize());
    allocatedVCores.decr(res.getVirtualCores());
    if (queueMetricsForCustomResources != null) {
        queueMetricsForCustomResources.decreaseAllocated(res);
        registerCustomResources(queueMetricsForCustomResources.getAllocatedValues(), ALLOCATED_RESOURCE_METRIC_PREFIX, ALLOCATED_RESOURCE_METRIC_DESC);
    }
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.releaseResources(user, res);
    }
    if (parent != null) {
        parent.releaseResources(user, res);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : apache
private void unreserveResource(String user, Resource res) {
    reservedContainers.decr();
    reservedMB.decr(res.getMemorySize());
    reservedVCores.decr(res.getVirtualCores());
    if (queueMetricsForCustomResources != null) {
        queueMetricsForCustomResources.decreaseReserved(res);
        registerCustomResources(queueMetricsForCustomResources.getReservedValues(), RESERVED_RESOURCE_METRIC_PREFIX, RESERVED_RESOURCE_METRIC_DESC);
    }
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.unreserveResource(user, res);
    }
    if (parent != null) {
        parent.unreserveResource(user, res);
    }
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : apache
private void _decrPendingResources(int containers, Resource res) {
    pendingContainers.decr(containers);
    pendingMB.decr(res.getMemorySize() * containers);
    pendingVCores.decr(res.getVirtualCores() * containers);
    if (queueMetricsForCustomResources != null) {
        queueMetricsForCustomResources.decreasePending(res, containers);
        registerCustomResources(queueMetricsForCustomResources.getPendingValues(), PENDING_RESOURCE_METRIC_PREFIX, PENDING_RESOURCE_METRIC_DESC);
    }
}

19 View Complete Implementation : ContainerDataScrubberMetrics.java
Copyright Apache License 2.0
Author : apache
public void resetNumUnhealthyContainers() {
    numUnHealthyContainers.decr(getNumUnHealthyContainers());
}

19 View Complete Implementation : ContainerDataScrubberMetrics.java
Copyright Apache License 2.0
Author : apache
public void resetNumContainersScanned() {
    numContainersScanned.decr(getNumContainersScanned());
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : yncxcw
private void _decrPendingResources(int containers, Resource res) {
    pendingContainers.decr(containers);
    pendingMB.decr(res.getMemory() * containers);
    pendingVCores.decr(res.getVirtualCores() * containers);
}

19 View Complete Implementation : QueueMetrics.java
Copyright Apache License 2.0
Author : yncxcw
public void releaseResources(String user, int containers, Resource res) {
    allocatedContainers.decr(containers);
    aggregateContainersReleased.incr(containers);
    allocatedMB.decr(res.getMemory() * containers);
    allocatedVCores.decr(res.getVirtualCores() * containers);
    QueueMetrics userMetrics = getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.releaseResources(user, containers, res);
    }
    if (parent != null) {
        parent.releaseResources(user, containers, res);
    }
}

18 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void changeContainer(Resource before, Resource now) {
    int deltaMB = now.getMemory() - before.getMemory();
    int deltaVCores = now.getVirtualCores() - before.getVirtualCores();
    allocatedMB = allocatedMB + deltaMB;
    allocatedGB.set((int) Math.ceil(allocatedMB / 1024d));
    availableMB = availableMB - deltaMB;
    availableGB.set((int) Math.floor(availableMB / 1024d));
    allocatedVCores.incr(deltaVCores);
    availableVCores.decr(deltaVCores);
}

18 View Complete Implementation : CSQueueMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void decAMUsed(String user, Resource res) {
    usedAMResourceMB.decr(res.getMemory());
    usedAMResourceVCores.decr(res.getVirtualCores());
    CSQueueMetrics userMetrics = (CSQueueMetrics) getUserMetrics(user);
    if (userMetrics != null) {
        userMetrics.decAMUsed(user, res);
    }
}

18 View Complete Implementation : OpportunisticSchedulerMetrics.java
Copyright Apache License 2.0
Author : apache
public void incrReleasedOppContainers(int numContainers) {
    aggregateOContainersReleased.incr(numContainers);
    allocatedOContainers.decr(numContainers);
}

18 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : apache
public void changeContainer(Resource before, Resource now) {
    long deltaMB = now.getMemorySize() - before.getMemorySize();
    int deltaVCores = now.getVirtualCores() - before.getVirtualCores();
    allocatedMB = allocatedMB + deltaMB;
    allocatedGB.set((int) Math.ceil(allocatedMB / 1024d));
    availableMB = availableMB - deltaMB;
    availableGB.set((int) Math.floor(availableMB / 1024d));
    allocatedVCores.incr(deltaVCores);
    availableVCores.decr(deltaVCores);
}

18 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : apache
public void completeOpportunisticContainer(Resource res) {
    runningOpportunisticContainers.decr();
    allocatedOpportunisticMB = allocatedOpportunisticMB - res.getMemorySize();
    allocatedOpportunisticGB.set((int) Math.ceil(allocatedOpportunisticMB / 1024d));
    allocatedOpportunisticVCores.decr(res.getVirtualCores());
}

17 View Complete Implementation : MRAppMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void endWaitingTask(Task task) {
    switch(task.getType()) {
        case MAP:
            mapsWaiting.decr();
            break;
        case REDUCE:
            reducesWaiting.decr();
            break;
    }
}

17 View Complete Implementation : MRAppMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void endRunningTask(Task task) {
    switch(task.getType()) {
        case MAP:
            mapsRunning.decr();
            break;
        case REDUCE:
            reducesRunning.decr();
            break;
    }
}

17 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void allocateContainer(Resource res) {
    allocatedContainers.incr();
    allocatedMB = allocatedMB + res.getMemory();
    allocatedGB.set((int) Math.ceil(allocatedMB / 1024d));
    availableMB = availableMB - res.getMemory();
    availableGB.set((int) Math.floor(availableMB / 1024d));
    allocatedVCores.incr(res.getVirtualCores());
    availableVCores.decr(res.getVirtualCores());
}

17 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : aliyun-beta
public void releaseContainer(Resource res) {
    allocatedContainers.decr();
    allocatedMB = allocatedMB - res.getMemory();
    allocatedGB.set((int) Math.ceil(allocatedMB / 1024d));
    availableMB = availableMB + res.getMemory();
    availableGB.set((int) Math.floor(availableMB / 1024d));
    allocatedVCores.decr(res.getVirtualCores());
    availableVCores.incr(res.getVirtualCores());
}

17 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : apache
public void allocateContainer(Resource res) {
    allocatedContainers.incr();
    allocatedMB = allocatedMB + res.getMemorySize();
    allocatedGB.set((int) Math.ceil(allocatedMB / 1024d));
    availableMB = availableMB - res.getMemorySize();
    availableGB.set((int) Math.floor(availableMB / 1024d));
    allocatedVCores.incr(res.getVirtualCores());
    availableVCores.decr(res.getVirtualCores());
}

17 View Complete Implementation : NodeManagerMetrics.java
Copyright Apache License 2.0
Author : apache
public void releaseContainer(Resource res) {
    allocatedContainers.decr();
    allocatedMB = allocatedMB - res.getMemorySize();
    allocatedGB.set((int) Math.ceil(allocatedMB / 1024d));
    availableMB = availableMB + res.getMemorySize();
    availableGB.set((int) Math.floor(availableMB / 1024d));
    allocatedVCores.decr(res.getVirtualCores());
    availableVCores.incr(res.getVirtualCores());
}