public void insertDataValue(long data) {
    // if current number of data points already equals rolling period and rolling period is
    // non-zero then remove one data and update the statistics
    if (numberOfDataValues >= rollingPeriod && rollingPeriod > 0) {
      this.removeData(dataValues[currentIndexPosition]);
    }
    numberOfDataValues++;
    currentSum = currentSum + (double) data;
    currentSqrSum = currentSqrSum + ((double) data * data);
    if (rollingPeriod > 0) {
      dataValues[currentIndexPosition] = data;
      currentIndexPosition = (currentIndexPosition + 1) % rollingPeriod;
    }
  }
Inserts given data value to array of data values to be considered for statistics calculation
hbase-server/src/main/java/org/apache/hadoop/hbase/util/RollingStatCalculator.java