hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r825589 - in /hadoop/hdfs/trunk: CHANGES.txt src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNodeAdapter.java
Date Thu, 15 Oct 2009 17:53:16 GMT
Author: cos
Date: Thu Oct 15 17:53:15 2009
New Revision: 825589

URL: http://svn.apache.org/viewvc?rev=825589&view=rev
Log:
HDFS-705. Create an adapter to access some of package-private methods of DataNode from tests.
Contributed by Konstantin Boudnik

Added:
    hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNodeAdapter.java
Modified:
    hadoop/hdfs/trunk/CHANGES.txt

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=825589&r1=825588&r2=825589&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Thu Oct 15 17:53:15 2009
@@ -281,6 +281,9 @@
 
     HDFS-680. Add new access method to a copy of a block's replica. (shv)
 
+    HDFS-705. Create an adapter to access some of package-private methods of
+    DataNode from tests (cos)
+
   BUG FIXES
 
     HDFS-76. Better error message to users when commands fail because of 

Added: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNodeAdapter.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNodeAdapter.java?rev=825589&view=auto
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNodeAdapter.java
(added)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNodeAdapter.java
Thu Oct 15 17:53:15 2009
@@ -0,0 +1,38 @@
+/**
+ * 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.datanode;
+
+/**
+ * WARNING!! This is TEST ONLY class: it never has to be used
+ * for ANY development purposes.
+ * 
+ * This is a utility class to expose DataNode functionality for
+ * unit and functional tests.
+ */
+public class DataNodeAdapter {
+  /**
+   * Fetch a copy of ReplicaInfo from a datanode by block id
+   * @param dn datanode to retrieve a replicainfo object from
+   * @param blkId id of the replica's block
+   * @return copy of ReplicaInfo object @link{FSDataset#fetchReplicaInfo}
+   */
+  public static ReplicaInfo fetchReplicaInfo (final DataNode dn,
+                                              final long blkId) {
+    return ((FSDataset)dn.data).fetchReplicaInfo(blkId);
+  }
+}



Mime
View raw message