You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by su...@apache.org on 2010/09/14 20:48:14 UTC

svn commit: r997035 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java

Author: suresh
Date: Tue Sep 14 18:48:14 2010
New Revision: 997035

URL: http://svn.apache.org/viewvc?rev=997035&view=rev
Log:
HDFS-1395. Add @Override to FSDataset methods that implement FSDatasetInterface methods. Contributed by Suresh Srinivas.


Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=997035&r1=997034&r2=997035&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Sep 14 18:48:14 2010
@@ -126,6 +126,9 @@ Trunk (unreleased changes)
 
     HDFS-1111. Introduce getCorruptFileBlocks() for fsck. (Sriram Rao via shv)
 
+    HDFS-1395. Add @Override to FSDataset methods that implement
+    FSDatasetInterface methods. (suresh)
+
   OPTIMIZATIONS
 
     HDFS-1140. Speedup INode.getPathComponents. (Dmytro Molkov via shv)

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java?rev=997035&r1=997034&r2=997035&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java Tue Sep 14 18:48:14 2010
@@ -766,7 +766,7 @@ public class FSDataset implements FSCons
     return getFile(blockId);
   }
 
-  /** {@inheritDoc} */
+  @Override // FSDatasetInterface
   public synchronized Block getStoredBlock(long blkid) throws IOException {
     File blockfile = findBlockFile(blkid);
     if (blockfile == null) {
@@ -802,15 +802,18 @@ public class FSDataset implements FSCons
     return null;
   }
 
+  @Override // FSDatasetInterface
   public boolean metaFileExists(Block b) throws IOException {
     return getMetaFile(b).exists();
   }
   
+  @Override // FSDatasetInterface
   public long getMetaDataLength(Block b) throws IOException {
     File checksumFile = getMetaFile( b );
     return checksumFile.length();
   }
 
+  @Override // FSDatasetInterface
   public MetaDataInputStream getMetaDataInputStream(Block b)
       throws IOException {
     File checksumFile = getMetaFile( b );
@@ -894,6 +897,7 @@ public class FSDataset implements FSCons
   /**
    * Return true - if there are still valid volumes on the DataNode. 
    */
+  @Override // FSDatasetInterface
   public boolean hasEnoughResource() {
     return volumes.numberOfVolumes() >= validVolsRequired; 
   }
@@ -919,6 +923,7 @@ public class FSDataset implements FSCons
   /**
    * Find the block's on-disk length
    */
+  @Override // FSDatasetInterface
   public long getLength(Block b) throws IOException {
     return getBlockFile(b).length();
   }
@@ -937,10 +942,12 @@ public class FSDataset implements FSCons
     return f;
   }
   
+  @Override // FSDatasetInterface
   public synchronized InputStream getBlockInputStream(Block b) throws IOException {
     return new FileInputStream(getBlockFile(b));
   }
 
+  @Override // FSDatasetInterface
   public synchronized InputStream getBlockInputStream(Block b, long seekOffset) throws IOException {
 
     File blockFile = getBlockFile(b);
@@ -969,6 +976,7 @@ public class FSDataset implements FSCons
   /**
    * Returns handles to the block file and its metadata file
    */
+  @Override // FSDatasetInterface
   public synchronized BlockInputStreams getTmpInputStreams(Block b, 
                           long blkOffset, long ckoff) throws IOException {
 
@@ -1232,7 +1240,7 @@ public class FSDataset implements FSCons
     }
   }
 
-  @Override
+  @Override // FSDatasetInterface
   public void recoverClose(Block b, long newGS,
       long expectedBlockLen) throws IOException {
     DataNode.LOG.info("Recover failed close " + b);
@@ -1273,7 +1281,7 @@ public class FSDataset implements FSCons
     }
   }
 
-  @Override
+  @Override // FSDatasetInterface
   public synchronized ReplicaInPipelineInterface createRbw(Block b)
       throws IOException {
     ReplicaInfo replicaInfo = volumeMap.get(b.getBlockId());
@@ -1292,7 +1300,7 @@ public class FSDataset implements FSCons
     return newReplicaInfo;
   }
   
-  @Override
+  @Override // FSDatasetInterface
   public synchronized ReplicaInPipelineInterface recoverRbw(Block b,
       long newGS, long minBytesRcvd, long maxBytesRcvd)
       throws IOException {
@@ -1341,7 +1349,7 @@ public class FSDataset implements FSCons
     return rbw;
   }
   
-  @Override
+  @Override // FSDatasetInterface
   public synchronized ReplicaInPipelineInterface createTemporary(Block b)
       throws IOException {
     ReplicaInfo replicaInfo = volumeMap.get(b.getBlockId());
@@ -1365,6 +1373,7 @@ public class FSDataset implements FSCons
    * Sets the offset in the meta file so that the
    * last checksum will be overwritten.
    */
+  @Override // FSDatasetInterface
   public void adjustCrcChannelPosition(Block b, BlockWriteStreams streams, 
       int checksumSize) throws IOException {
     FileOutputStream file = (FileOutputStream) streams.checksumOut;
@@ -1397,6 +1406,7 @@ public class FSDataset implements FSCons
   /**
    * Complete the block write!
    */
+  @Override // FSDatasetInterface
   public synchronized void finalizeBlock(Block b) throws IOException {
     ReplicaInfo replicaInfo = getReplicaInfo(b);
     if (replicaInfo.getState() == ReplicaState.FINALIZED) {
@@ -1433,6 +1443,7 @@ public class FSDataset implements FSCons
   /**
    * Remove the temporary block file (if any)
    */
+  @Override // FSDatasetInterface
   public synchronized void unfinalizeBlock(Block b) throws IOException {
     ReplicaInfo replicaInfo = volumeMap.get(b);
     if (replicaInfo != null && replicaInfo.getState() == ReplicaState.TEMPORARY) {
@@ -1476,6 +1487,7 @@ public class FSDataset implements FSCons
   /**
    * Generates a block report from the in-memory block map.
    */
+  @Override // FSDatasetInterface
   public BlockListAsLongs getBlockReport() {
     ArrayList<ReplicaInfo> finalized =
       new ArrayList<ReplicaInfo>(volumeMap.size());
@@ -1537,6 +1549,7 @@ public class FSDataset implements FSCons
    * Check whether the given block is a valid one.
    * valid means finalized
    */
+  @Override // FSDatasetInterface
   public boolean isValidBlock(Block b) {
     ReplicaInfo replicaInfo = volumeMap.get(b);
     if (replicaInfo == null || 
@@ -1595,6 +1608,7 @@ public class FSDataset implements FSCons
    * could lazily garbage-collect the block, but why bother?
    * just get rid of it.
    */
+  @Override // FSDatasetInterface
   public void invalidate(Block invalidBlks[]) throws IOException {
     boolean error = false;
     for (int i = 0; i < invalidBlks.length; i++) {
@@ -1681,6 +1695,7 @@ public class FSDataset implements FSCons
    * to these volumes
    * @throws DiskErrorException
    */
+  @Override // FSDatasetInterface
   public void checkDataDir() throws DiskErrorException {
     long total_blocks=0, removed_blocks=0;
     List<FSVolume> failed_vols =  volumes.checkDirs();
@@ -1725,6 +1740,7 @@ public class FSDataset implements FSCons
   }
     
 
+  @Override // FSDatasetInterface
   public String toString() {
     return "FSDataset{dirpath='"+volumes+"'}";
   }
@@ -1757,6 +1773,7 @@ public class FSDataset implements FSCons
     DataNode.LOG.info("Registered FSDatasetStatusMBean");
   }
 
+  @Override // FSDatasetInterface
   public void shutdown() {
     if (mbeanName != null)
       MBeanUtil.unregisterMBean(mbeanName);
@@ -1942,7 +1959,7 @@ public class FSDataset implements FSCons
   /**
    * @deprecated use {@link #fetchReplicaInfo(long)} instead.
    */
-  @Override
+  @Override // FSDatasetInterface
   @Deprecated
   public ReplicaInfo getReplica(long blockId) {
     assert(Thread.holdsLock(this));