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 xceiver count */
047  public int getXceiverCount();
048
049  /**
050   * @return the total used space by data nodes for non-DFS purposes
051   * such as storing temporary files on the local file system
052   */
053  public long getCapacityUsedNonDFS();
054
055  /** The same as {@link ClientProtocol#getStats()}.
056   * The block related entries are set to -1.
057   */
058  public long[] getStats();
059
060  /** @return the expired heartbeats */
061  public int getExpiredHeartbeats();
062}