001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hdfs.server.blockmanagement;
019
020import org.apache.hadoop.hdfs.protocol.ClientProtocol;
021
022/** Datanode statistics */
023public interface DatanodeStatistics {
024
025  /** @return the total capacity */
026  public long getCapacityTotal();
027
028  /** @return the used capacity */
029  public long getCapacityUsed();
030
031  /** @return the percentage of the used capacity over the total capacity. */
032  public float getCapacityUsedPercent();
033
034  /** @return the remaining capacity */
035  public long getCapacityRemaining();
036
037  /** @return the percentage of the remaining capacity over the total capacity. */
038  public float getCapacityRemainingPercent();
039
040  /** @return the block pool used. */
041  public long getBlockPoolUsed();
042
043  /** @return the percentage of the block pool used space over the total capacity. */
044  public float getPercentBlockPoolUsed();
045  
046  /** @return the total cache capacity of all DataNodes */
047  public long getCacheCapacity();
048
049  /** @return the total cache used by all DataNodes */
050  public long getCacheUsed();
051
052  /** @return the xceiver count */
053  public int getXceiverCount();
054
055  /** @return average xceiver count for non-decommission(ing|ed) nodes */
056  public int getInServiceXceiverCount();
057  
058  /** @return number of non-decommission(ing|ed) nodes */
059  public int getNumDatanodesInService();
060  
061  /**
062   * @return the total used space by data nodes for non-DFS purposes
063   * such as storing temporary files on the local file system
064   */
065  public long getCapacityUsedNonDFS();
066
067  /** The same as {@link ClientProtocol#getStats()}.
068   * The block related entries are set to -1.
069   */
070  public long[] getStats();
071
072  /** @return the expired heartbeats */
073  public int getExpiredHeartbeats();
074}