hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r800199 - in /hadoop/common/trunk: ./ src/java/org/apache/hadoop/io/file/tfile/ src/test/core/org/apache/hadoop/io/file/tfile/
Date Mon, 03 Aug 2009 05:07:00 GMT
Author: mahadev
Date: Mon Aug  3 05:06:59 2009
New Revision: 800199

URL: http://svn.apache.org/viewvc?rev=800199&view=rev
Log:
HADOOP-6169. Removing deprecated method calls in TFile. (hong tang via mahadev)

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BCFile.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/ByteArray.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/CompareUtils.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/TFile.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/Utils.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFile.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFileJClassComparatorByteArrays.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestVLong.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Mon Aug  3 05:06:59 2009
@@ -487,7 +487,9 @@
 
     HADOOP-6160. Fix releaseaudit target to run on specific directories.
     (gkesavan)
-     
+    
+    HADOOP-6169. Removing deprecated method calls in TFile. (hong tang via mahadev)
+ 
   OPTIMIZATIONS
 
     HADOOP-5595. NameNode does not need to run a replicator to choose a

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BCFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BCFile.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BCFile.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BCFile.java Mon Aug  3 05:06:59
2009
@@ -125,7 +125,7 @@
         fsOutputBuffer.setCapacity(TFile.getFSOutputBufferSize(conf));
 
         this.fsBufferedOutput =
-            new SimpleBufferedOutputStream(this.fsOut, fsOutputBuffer.get());
+            new SimpleBufferedOutputStream(this.fsOut, fsOutputBuffer.getBytes());
         this.compressor = compressAlgo.getCompressor();
 
         try {

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java
Mon Aug  3 05:06:59 2009
@@ -116,12 +116,12 @@
   }
 
   @Override
-  public void mark(int readlimit) {
+  public synchronized void mark(int readlimit) {
     mark = pos;
   }
 
   @Override
-  public void reset() throws IOException {
+  public synchronized void reset() throws IOException {
     if (mark < 0) throw new IOException("Resetting to invalid mark");
     pos = mark;
   }

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/ByteArray.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/ByteArray.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/ByteArray.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/ByteArray.java Mon Aug  3
05:06:59 2009
@@ -34,7 +34,7 @@
    * @param other
    */
   public ByteArray(BytesWritable other) {
-    this(other.get(), 0, other.getSize());
+    this(other.getBytes(), 0, other.getLength());
   }
 
   /**

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/CompareUtils.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/CompareUtils.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/CompareUtils.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/CompareUtils.java Mon Aug
 3 05:06:59 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.hadoop.io.file.tfile;
 
+import java.io.Serializable;
 import java.util.Comparator;
 
 import org.apache.hadoop.io.RawComparator;
@@ -72,7 +73,7 @@
     }
   }
 
-  public static final class ScalarComparator implements Comparator<Scalar> {
+  public static final class ScalarComparator implements Comparator<Scalar>, Serializable
{
     @Override
     public int compare(Scalar o1, Scalar o2) {
       long diff = o1.magnitude() - o2.magnitude();
@@ -83,7 +84,7 @@
   }
 
   public static final class MemcmpRawComparator implements
-      RawComparator<Object> {
+      RawComparator<Object>, Serializable {
     @Override
     public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
       return WritableComparator.compareBytes(b1, s1, l1, b2, s2, l2);

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/TFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/TFile.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/TFile.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/TFile.java Mon Aug  3 05:06:59
2009
@@ -325,10 +325,7 @@
             outIndex.close();
           }
 
-          if (writerBCF != null) {
-            writerBCF.close();
-            writerBCF = null;
-          }
+          writerBCF.close();
         }
       } finally {
         IOUtils.cleanup(LOG, blkAppender, writerBCF);
@@ -1583,8 +1580,8 @@
          */
         public int getKey(BytesWritable key) throws IOException {
           key.setSize(getKeyLength());
-          getKey(key.get());
-          return key.getSize();
+          getKey(key.getBytes());
+          return key.getLength();
         }
 
         /**
@@ -1603,10 +1600,10 @@
             int remain;
             while ((remain = valueBufferInputStream.getRemain()) > 0) {
               value.setSize(size + remain);
-              dis.readFully(value.get(), size, remain);
+              dis.readFully(value.getBytes(), size, remain);
               size += remain;
             }
-            return value.getSize();
+            return value.getLength();
           } finally {
             dis.close();
           }
@@ -1645,8 +1642,8 @@
             while ((chunkSize = valueBufferInputStream.getRemain()) > 0) {
               chunkSize = Math.min(chunkSize, MAX_VAL_TRANSFER_BUF_SIZE);
               valTransferBuffer.setSize(chunkSize);
-              dis.readFully(valTransferBuffer.get(), 0, chunkSize);
-              out.write(valTransferBuffer.get(), 0, chunkSize);
+              dis.readFully(valTransferBuffer.getBytes(), 0, chunkSize);
+              out.write(valTransferBuffer.getBytes(), 0, chunkSize);
               size += chunkSize;
             }
             return size;

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/Utils.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/Utils.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/Utils.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/file/tfile/Utils.java Mon Aug  3 05:06:59
2009
@@ -353,6 +353,7 @@
     /**
      * Return a string representation of the version.
      */
+    @Override
     public String toString() {
       return new StringBuilder("v").append(major).append(".").append(minor)
           .toString();

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFile.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFile.java (original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFile.java Mon Aug
 3 05:06:59 2009
@@ -42,9 +42,9 @@
       System.getProperty("test.build.data", "/tmp/tfile-test");
   private FileSystem fs;
   private Configuration conf;
-  private final int minBlockSize = 512;
-  private final int largeVal = 3 * 1024 * 1024;
-  private static String localFormatter = "%010d";
+  private static final int minBlockSize = 512;
+  private static final int largeVal = 3 * 1024 * 1024;
+  private static final String localFormatter = "%010d";
 
   @Override
   public void setUp() throws IOException {

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFileJClassComparatorByteArrays.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFileJClassComparatorByteArrays.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFileJClassComparatorByteArrays.java
(original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestTFileJClassComparatorByteArrays.java
Mon Aug  3 05:06:59 2009
@@ -18,6 +18,7 @@
 package org.apache.hadoop.io.file.tfile;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.hadoop.io.RawComparator;
 import org.apache.hadoop.io.WritableComparator;
@@ -42,7 +43,7 @@
   }
 }
 
-class MyComparator implements RawComparator<byte[]> {
+class MyComparator implements RawComparator<byte[]>, Serializable {
 
   @Override
   public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestVLong.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestVLong.java?rev=800199&r1=800198&r2=800199&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestVLong.java (original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/io/file/tfile/TestVLong.java Mon Aug
 3 05:06:59 2009
@@ -140,7 +140,7 @@
     for (int i = 0; i < data.length; ++i) {
       int shift = rng.nextInt(Long.SIZE) + 1;
       long mask = (1L << shift) - 1;
-      long a = rng.nextInt() << 32;
+      long a = ((long) rng.nextInt()) << 32;
       long b = ((long) rng.nextInt()) & 0xffffffff;
       data[i] = (a + b) & mask;
     }



Mime
View raw message