Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4CEDC68B4 for ; Tue, 28 Jun 2011 23:57:25 +0000 (UTC) Received: (qmail 13391 invoked by uid 500); 28 Jun 2011 23:57:25 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 13374 invoked by uid 500); 28 Jun 2011 23:57:24 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 13366 invoked by uid 99); 28 Jun 2011 23:57:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 23:57:24 +0000 X-ASF-Spam-Status: No, hits=-1996.4 required=5.0 tests=ALL_TRUSTED,FS_REPLICA X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 23:57:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1F13E23888FD; Tue, 28 Jun 2011 23:57:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1140913 - in /hadoop/common/trunk/hdfs: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/blockmanagement/NumberReplicas.java Date: Tue, 28 Jun 2011 23:57:03 -0000 To: hdfs-commits@hadoop.apache.org From: szetszwo@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110628235703.1F13E23888FD@eris.apache.org> Author: szetszwo Date: Tue Jun 28 23:57:02 2011 New Revision: 1140913 URL: http://svn.apache.org/viewvc?rev=1140913&view=rev Log: Fix CHANGES.txt (HDFS-2106 should be HDFS-2107) and add NumberReplicas.java. Added: hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/NumberReplicas.java Modified: hadoop/common/trunk/hdfs/CHANGES.txt Modified: hadoop/common/trunk/hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/CHANGES.txt?rev=1140913&r1=1140912&r2=1140913&view=diff ============================================================================== --- hadoop/common/trunk/hdfs/CHANGES.txt (original) +++ hadoop/common/trunk/hdfs/CHANGES.txt Tue Jun 28 23:57:02 2011 @@ -534,7 +534,7 @@ Trunk (unreleased changes) HDFS-2110. StreamFile and ByteRangeInputStream cleanup. (eli) - HDFS-2106. Move block management code from o.a.h.h.s.namenode to a new + HDFS-2107. Move block management code from o.a.h.h.s.namenode to a new package o.a.h.h.s.blockmanagement. (szetszwo) OPTIMIZATIONS Added: hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/NumberReplicas.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/NumberReplicas.java?rev=1140913&view=auto ============================================================================== --- hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/NumberReplicas.java (added) +++ hadoop/common/trunk/hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/NumberReplicas.java Tue Jun 28 23:57:02 2011 @@ -0,0 +1,57 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hdfs.server.blockmanagement; + +/** + * A immutable object that stores the number of live replicas and + * the number of decommissined Replicas. + */ +public class NumberReplicas { + private int liveReplicas; + private int decommissionedReplicas; + private int corruptReplicas; + private int excessReplicas; + + NumberReplicas() { + initialize(0, 0, 0, 0); + } + + NumberReplicas(int live, int decommissioned, int corrupt, int excess) { + initialize(live, decommissioned, corrupt, excess); + } + + void initialize(int live, int decommissioned, int corrupt, int excess) { + liveReplicas = live; + decommissionedReplicas = decommissioned; + corruptReplicas = corrupt; + excessReplicas = excess; + } + + public int liveReplicas() { + return liveReplicas; + } + public int decommissionedReplicas() { + return decommissionedReplicas; + } + public int corruptReplicas() { + return corruptReplicas; + } + public int excessReplicas() { + return excessReplicas; + } +}