hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1380990 [7/8] - in /hadoop/common/branches/HDFS-3077/hadoop-common-project: hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/ hadoop-common/ hadoop-common/src/ hadoop-common/src/main/conf/ hadoop-common/src/main/docs...
Date Wed, 05 Sep 2012 04:58:05 GMT
Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java Wed Sep  5 04:57:47 2012
@@ -30,7 +30,6 @@ import org.apache.hadoop.fs.TestTrash;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.mortbay.log.Log;
 
 public class TestViewFsTrash {
   FileSystem fsTarget;  // the target file system - the mount will point here
@@ -46,6 +45,7 @@ public class TestViewFsTrash {
       super();
       this.home = home;
     }
+    @Override
     public Path getHomeDirectory() {
       return home;
     }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java Wed Sep  5 04:57:47 2012
@@ -41,6 +41,7 @@ import org.junit.Test;
 public class TestViewFsWithAuthorityLocalFs extends ViewFsBaseTest {
   URI schemeWithAuthority;
 
+  @Override
   @Before
   public void setUp() throws Exception {
     // create the test root on local_fs
@@ -54,11 +55,13 @@ public class TestViewFsWithAuthorityLoca
     fcView = FileContext.getFileContext(schemeWithAuthority, conf);  
   }
 
+  @Override
   @After
   public void tearDown() throws Exception {
     super.tearDown();
   }
   
+  @Override
   @Test
   public void testBasicPaths() {
       Assert.assertEquals(schemeWithAuthority,

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewfsFileStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewfsFileStatus.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewfsFileStatus.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewfsFileStatus.java Wed Sep  5 04:57:47 2012
@@ -23,7 +23,6 @@ import java.io.IOException;
 import java.net.URISyntaxException;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileChecksum;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileUtil;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/ClientBaseWithFixes.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/ClientBaseWithFixes.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/ClientBaseWithFixes.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/ClientBaseWithFixes.java Wed Sep  5 04:57:47 2012
@@ -25,7 +25,6 @@ import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.net.Socket;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
@@ -82,6 +81,7 @@ public abstract class ClientBaseWithFixe
      *
      */
     protected class NullWatcher implements Watcher {
+        @Override
         public void process(WatchedEvent event) { /* nada */ }
     }
 
@@ -97,6 +97,7 @@ public abstract class ClientBaseWithFixe
             clientConnected = new CountDownLatch(1);
             connected = false;
         }
+        @Override
         synchronized public void process(WatchedEvent event) {
             if (event.getState() == KeeperState.SyncConnected ||
                 event.getState() == KeeperState.ConnectedReadOnly) {

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java Wed Sep  5 04:57:47 2012
@@ -184,6 +184,7 @@ class DummyHAService extends HAServiceTa
   }
   
   public static class DummyFencer implements FenceMethod {
+    @Override
     public void checkArgs(String args) throws BadFencingConfigurationException {
     }
 

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestGlobalFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestGlobalFilter.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestGlobalFilter.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestGlobalFilter.java Wed Sep  5 04:57:47 2012
@@ -46,14 +46,17 @@ public class TestGlobalFilter extends Ht
   static public class RecordingFilter implements Filter {
     private FilterConfig filterConfig = null;
 
+    @Override
     public void init(FilterConfig filterConfig) {
       this.filterConfig = filterConfig;
     }
 
+    @Override
     public void destroy() {
       this.filterConfig = null;
     }
 
+    @Override
     public void doFilter(ServletRequest request, ServletResponse response,
         FilterChain chain) throws IOException, ServletException {
       if (filterConfig == null)
@@ -69,6 +72,7 @@ public class TestGlobalFilter extends Ht
     static public class Initializer extends FilterInitializer {
       public Initializer() {}
 
+      @Override
       public void initFilter(FilterContainer container, Configuration conf) {
         container.addGlobalFilter("recording", RecordingFilter.class.getName(), null);
       }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestPathFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestPathFilter.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestPathFilter.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestPathFilter.java Wed Sep  5 04:57:47 2012
@@ -46,14 +46,17 @@ public class TestPathFilter extends Http
   static public class RecordingFilter implements Filter {
     private FilterConfig filterConfig = null;
 
+    @Override
     public void init(FilterConfig filterConfig) {
       this.filterConfig = filterConfig;
     }
 
+    @Override
     public void destroy() {
       this.filterConfig = null;
     }
 
+    @Override
     public void doFilter(ServletRequest request, ServletResponse response,
         FilterChain chain) throws IOException, ServletException {
       if (filterConfig == null)
@@ -69,6 +72,7 @@ public class TestPathFilter extends Http
     static public class Initializer extends FilterInitializer {
       public Initializer() {}
 
+      @Override
       public void initFilter(FilterContainer container, Configuration conf) {
         container.addFilter("recording", RecordingFilter.class.getName(), null);
       }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestServletFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestServletFilter.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestServletFilter.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestServletFilter.java Wed Sep  5 04:57:47 2012
@@ -45,14 +45,17 @@ public class TestServletFilter extends H
   static public class SimpleFilter implements Filter {
     private FilterConfig filterConfig = null;
 
+    @Override
     public void init(FilterConfig filterConfig) throws ServletException {
       this.filterConfig = filterConfig;
     }
 
+    @Override
     public void destroy() {
       this.filterConfig = null;
     }
 
+    @Override
     public void doFilter(ServletRequest request, ServletResponse response,
         FilterChain chain) throws IOException, ServletException {
       if (filterConfig == null)
@@ -67,6 +70,7 @@ public class TestServletFilter extends H
     static public class Initializer extends FilterInitializer {
       public Initializer() {}
 
+      @Override
       public void initFilter(FilterContainer container, Configuration conf) {
         container.addFilter("simple", SimpleFilter.class.getName(), null);
       }
@@ -149,6 +153,7 @@ public class TestServletFilter extends H
       public Initializer() {
       }
 
+      @Override
       public void initFilter(FilterContainer container, Configuration conf) {
         container.addFilter("simple", ErrorFilter.class.getName(), null);
       }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java Wed Sep  5 04:57:47 2012
@@ -18,12 +18,10 @@
 
 package org.apache.hadoop.io;
 
-import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.lang.reflect.Type;
 
 import org.apache.avro.Schema;
-import org.apache.avro.io.BinaryEncoder;
 import org.apache.avro.io.EncoderFactory;
 import org.apache.avro.reflect.ReflectData;
 import org.apache.avro.reflect.ReflectDatumWriter;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/RandomDatum.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/RandomDatum.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/RandomDatum.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/RandomDatum.java Wed Sep  5 04:57:47 2012
@@ -40,11 +40,13 @@ public class RandomDatum implements Writ
     return length;
   }
   
+  @Override
   public void write(DataOutput out) throws IOException {
     out.writeInt(length);
     out.write(data);
   }
 
+  @Override
   public void readFields(DataInput in) throws IOException {
     length = in.readInt();
     if (data == null || length > data.length)
@@ -102,6 +104,7 @@ public class RandomDatum implements Writ
       super(RandomDatum.class);
     }
 
+    @Override
     public int compare(byte[] b1, int s1, int l1,
                        byte[] b2, int s2, int l2) {
       int n1 = readInt(b1, s1);

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestEnumSetWritable.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestEnumSetWritable.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestEnumSetWritable.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestEnumSetWritable.java Wed Sep  5 04:57:47 2012
@@ -19,17 +19,9 @@
 package org.apache.hadoop.io;
 
 import java.io.IOException;
-import java.io.ByteArrayOutputStream;
 import java.util.EnumSet;
 import java.lang.reflect.Type;
 
-import org.apache.avro.Schema;
-import org.apache.avro.reflect.ReflectData;
-import org.apache.avro.reflect.ReflectDatumWriter;
-import org.apache.avro.reflect.ReflectDatumReader;
-import org.apache.avro.io.BinaryEncoder;
-import org.apache.avro.io.DecoderFactory;
-
 import junit.framework.TestCase;
 
 /** Unit test for EnumSetWritable */

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestGenericWritable.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestGenericWritable.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestGenericWritable.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestGenericWritable.java Wed Sep  5 04:57:47 2012
@@ -48,9 +48,11 @@ public class TestGenericWritable extends
   /** Dummy class for testing {@link GenericWritable} */
   public static class Foo implements Writable {
     private String foo = "foo";
+    @Override
     public void readFields(DataInput in) throws IOException {
       foo = Text.readString(in);
     }
+    @Override
     public void write(DataOutput out) throws IOException {
       Text.writeString(out, foo);
     }
@@ -65,15 +67,19 @@ public class TestGenericWritable extends
   public static class Bar implements Writable, Configurable {
     private int bar = 42; //The Answer to The Ultimate Question Of Life, the Universe and Everything
     private Configuration conf = null;
+    @Override
     public void readFields(DataInput in) throws IOException {
       bar = in.readInt();
     }
+    @Override
     public void write(DataOutput out) throws IOException {
       out.writeInt(bar);
     }
+    @Override
     public Configuration getConf() {
       return conf;
     }
+    @Override
     public void setConf(Configuration conf) {
       this.conf = conf;
     }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMD5Hash.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMD5Hash.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMD5Hash.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMD5Hash.java Wed Sep  5 04:57:47 2012
@@ -91,6 +91,7 @@ public class TestMD5Hash extends TestCas
                closeHash1.hashCode() != closeHash2.hashCode());
      
     Thread t1 = new Thread() {      
+      @Override
       public void run() {
         for (int i = 0; i < 100; i++) {
           MD5Hash hash = new MD5Hash(DFF);
@@ -100,6 +101,7 @@ public class TestMD5Hash extends TestCas
     };
     
     Thread t2 = new Thread() {
+      @Override
       public void run() {
         for (int i = 0; i < 100; i++) {
           MD5Hash hash = new MD5Hash(D00);

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSecureIOUtils.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSecureIOUtils.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSecureIOUtils.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSecureIOUtils.java Wed Sep  5 04:57:47 2012
@@ -21,17 +21,14 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.io.nativeio.NativeIO;
 
 import org.junit.BeforeClass;
-import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assume.*;
 import static org.junit.Assert.*;
 import java.io.IOException;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileOutputStream;
 
 public class TestSecureIOUtils {

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFile.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFile.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFile.java Wed Sep  5 04:57:47 2012
@@ -481,6 +481,7 @@ public class TestSequenceFile extends Te
       super(in);
     }
 
+    @Override
     public void close() throws IOException {
       closed = true;
       super.close();
@@ -505,6 +506,7 @@ public class TestSequenceFile extends Te
     try {
       new SequenceFile.Reader(fs, path, conf) {
         // this method is called by the SequenceFile.Reader constructor, overwritten, so we can access the opened file
+        @Override
         protected FSDataInputStream openFile(FileSystem fs, Path file, int bufferSize, long length) throws IOException {
           final InputStream in = super.openFile(fs, file, bufferSize, length);
           openedFile[0] = new TestFSDataInputStream(in);

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java Wed Sep  5 04:57:47 2012
@@ -284,6 +284,7 @@ public class TestText extends TestCase {
       super(name);
     }
 
+    @Override
     public void run() {
       String name = this.getName();
       DataOutputBuffer out = new DataOutputBuffer();

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestVersionedWritable.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestVersionedWritable.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestVersionedWritable.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestVersionedWritable.java Wed Sep  5 04:57:47 2012
@@ -37,16 +37,19 @@ public class TestVersionedWritable exten
 
 		
     private static byte VERSION = 1;
+    @Override
     public byte getVersion() { 
       return VERSION; 
     }		
 		
 
+    @Override
     public void write(DataOutput out) throws IOException {
       super.write(out); // version.
       out.writeInt(state);
     }
 		
+    @Override
     public void readFields(DataInput in) throws IOException {
       super.readFields(in); // version
       this.state = in.readInt();
@@ -61,6 +64,7 @@ public class TestVersionedWritable exten
 		
 
     /** Required by test code, below. */
+    @Override
     public boolean equals(Object o) {
       if (!(o instanceof SimpleVersionedWritable))
         return false;
@@ -85,6 +89,7 @@ public class TestVersionedWritable exten
     SimpleVersionedWritable containedObject = new SimpleVersionedWritable();
     String[] testStringArray = {"The", "Quick", "Brown", "Fox", "Jumped", "Over", "The", "Lazy", "Dog"};
 
+    @Override
     public void write(DataOutput out) throws IOException {
       super.write(out);
       out.writeUTF(shortTestString); 
@@ -97,6 +102,7 @@ public class TestVersionedWritable exten
     }
 		
 		
+    @Override
     public void readFields(DataInput in) throws IOException {
       super.readFields(in);
       shortTestString = in.readUTF();
@@ -108,6 +114,7 @@ public class TestVersionedWritable exten
 			
 
 
+    @Override
     public boolean equals(Object o) {
       super.equals(o);
 
@@ -134,6 +141,7 @@ public class TestVersionedWritable exten
   /* This one checks that version mismatch is thrown... */
   public static class SimpleVersionedWritableV2 extends SimpleVersionedWritable {
     static byte VERSION = 2;
+    @Override
     public byte getVersion() { 
       return VERSION; 
     }		

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritable.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritable.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritable.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritable.java Wed Sep  5 04:57:47 2012
@@ -38,10 +38,12 @@ public class TestWritable extends TestCa
 
     int state = RANDOM.nextInt();
 
+    @Override
     public void write(DataOutput out) throws IOException {
       out.writeInt(state);
     }
 
+    @Override
     public void readFields(DataInput in) throws IOException {
       this.state = in.readInt();
     }
@@ -53,6 +55,7 @@ public class TestWritable extends TestCa
     }
 
     /** Required by test code, below. */
+    @Override
     public boolean equals(Object o) {
       if (!(o instanceof SimpleWritable))
         return false;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritableName.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritableName.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritableName.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestWritableName.java Wed Sep  5 04:57:47 2012
@@ -39,10 +39,12 @@ public class TestWritableName extends Te
 
     int state = RANDOM.nextInt();
 
+    @Override
     public void write(DataOutput out) throws IOException {
       out.writeInt(state);
     }
 
+    @Override
     public void readFields(DataInput in) throws IOException {
       this.state = in.readInt();
     }
@@ -54,6 +56,7 @@ public class TestWritableName extends Te
     }
 
     /** Required by test code, below. */
+    @Override
     public boolean equals(Object o) {
       if (!(o instanceof SimpleWritable))
         return false;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodecFactory.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodecFactory.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodecFactory.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodecFactory.java Wed Sep  5 04:57:47 2012
@@ -40,68 +40,81 @@ public class TestCodecFactory extends Te
       return conf;
     }
     
+    @Override
     public CompressionOutputStream createOutputStream(OutputStream out) 
     throws IOException {
       return null;
     }
     
+    @Override
     public Class<? extends Compressor> getCompressorType() {
       return null;
     }
 
+    @Override
     public Compressor createCompressor() {
       return null;
     }
 
+    @Override
     public CompressionInputStream createInputStream(InputStream in, 
                                                     Decompressor decompressor) 
     throws IOException {
       return null;
     }
 
+    @Override
     public CompressionInputStream createInputStream(InputStream in) 
     throws IOException {
       return null;
     }
 
+    @Override
     public CompressionOutputStream createOutputStream(OutputStream out, 
                                                       Compressor compressor) 
     throws IOException {
       return null;
     }
 
+    @Override
     public Class<? extends Decompressor> getDecompressorType() {
       return null;
     }
 
+    @Override
     public Decompressor createDecompressor() {
       return null;
     }
 
+    @Override
     public String getDefaultExtension() {
       return ".base";
     }
   }
   
   private static class BarCodec extends BaseCodec {
+    @Override
     public String getDefaultExtension() {
       return "bar";
     }
   }
   
   private static class FooBarCodec extends BaseCodec {
+    @Override
     public String getDefaultExtension() {
       return ".foo.bar";
     }
   }
   
   private static class FooCodec extends BaseCodec {
+    @Override
     public String getDefaultExtension() {
       return ".foo";
     }
   }
   
   private static class NewGzipCodec extends BaseCodec {
+    @Override
     public String getDefaultExtension() {
       return ".gz";
     }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/NanoTimer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/NanoTimer.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/NanoTimer.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/NanoTimer.java Wed Sep  5 04:57:47 2012
@@ -93,6 +93,7 @@ public class NanoTimer {
    * 
    * Note: If timer is never started, "ERR" will be returned.
    */
+  @Override
   public String toString() {
     if (!readable()) {
       return "ERR";

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java Wed Sep  5 04:57:47 2012
@@ -35,7 +35,6 @@ import org.apache.hadoop.io.file.tfile.T
 import org.apache.hadoop.io.file.tfile.TFile.Writer;
 import org.apache.hadoop.io.file.tfile.TFile.Reader.Location;
 import org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner;
-import org.apache.hadoop.util.NativeCodeLoader;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileNoneCodecsJClassComparatorByteArrays.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileNoneCodecsJClassComparatorByteArrays.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileNoneCodecsJClassComparatorByteArrays.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileNoneCodecsJClassComparatorByteArrays.java Wed Sep  5 04:57:47 2012
@@ -19,9 +19,6 @@ package org.apache.hadoop.io.file.tfile;
 
 import java.io.IOException;
 
-import org.apache.hadoop.io.RawComparator;
-import org.apache.hadoop.io.WritableComparator;
-
 /**
  * 
  * Byte arrays test case class using GZ compression codec, base class of none

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileSeqFileComparison.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileSeqFileComparison.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileSeqFileComparison.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileSeqFileComparison.java Wed Sep  5 04:57:47 2012
@@ -148,12 +148,14 @@ public class TestTFileSeqFileComparison 
       this.writer = new TFile.Writer(fsdos, minBlkSize, compress, null, conf);
     }
 
+    @Override
     public void append(BytesWritable key, BytesWritable value)
         throws IOException {
       writer.append(key.get(), 0, key.getSize(), value.get(), 0, value
           .getSize());
     }
 
+    @Override
     public void close() throws IOException {
       writer.close();
       fsdos.close();
@@ -196,22 +198,27 @@ public class TestTFileSeqFileComparison 
               - valueBuffer.length)];
     }
 
+    @Override
     public byte[] getKey() {
       return keyBuffer;
     }
 
+    @Override
     public int getKeyLength() {
       return keyLength;
     }
 
+    @Override
     public byte[] getValue() {
       return valueBuffer;
     }
 
+    @Override
     public int getValueLength() {
       return valueLength;
     }
 
+    @Override
     public boolean next() throws IOException {
       if (scanner.atEnd()) return false;
       Entry entry = scanner.entry();
@@ -225,6 +232,7 @@ public class TestTFileSeqFileComparison 
       return true;
     }
 
+    @Override
     public void close() throws IOException {
       scanner.close();
       reader.close();
@@ -266,11 +274,13 @@ public class TestTFileSeqFileComparison 
       }
     }
 
+    @Override
     public void append(BytesWritable key, BytesWritable value)
         throws IOException {
       writer.append(key, value);
     }
 
+    @Override
     public void close() throws IOException {
       writer.close();
       fsdos.close();
@@ -291,26 +301,32 @@ public class TestTFileSeqFileComparison 
       value = new BytesWritable();
     }
 
+    @Override
     public byte[] getKey() {
       return key.get();
     }
 
+    @Override
     public int getKeyLength() {
       return key.getSize();
     }
 
+    @Override
     public byte[] getValue() {
       return value.get();
     }
 
+    @Override
     public int getValueLength() {
       return value.getSize();
     }
 
+    @Override
     public boolean next() throws IOException {
       return reader.next(key, value);
     }
 
+    @Override
     public void close() throws IOException {
       reader.close();
     }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java Wed Sep  5 04:57:47 2012
@@ -88,6 +88,7 @@ public class TestNativeIO {
     List<Thread> statters = new ArrayList<Thread>();
     for (int i = 0; i < 10; i++) {
       Thread statter = new Thread() {
+        @Override
         public void run() {
           long et = Time.now() + 5000;
           while (Time.now() < et) {

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/TestFailoverProxy.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/TestFailoverProxy.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/TestFailoverProxy.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/TestFailoverProxy.java Wed Sep  5 04:57:47 2012
@@ -252,6 +252,7 @@ public class TestFailoverProxy {
       this.unreliable = unreliable;
     }
     
+    @Override
     public void run() {
       try {
         result = unreliable.failsIfIdentifierDoesntMatch("impl2");

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/UnreliableImplementation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/UnreliableImplementation.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/UnreliableImplementation.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/retry/UnreliableImplementation.java Wed Sep  5 04:57:47 2012
@@ -19,7 +19,6 @@ package org.apache.hadoop.io.retry;
 
 import java.io.IOException;
 
-import org.apache.hadoop.io.retry.UnreliableInterface.UnreliableException;
 import org.apache.hadoop.ipc.RemoteException;
 import org.apache.hadoop.ipc.StandbyException;
 
@@ -60,24 +59,29 @@ public class UnreliableImplementation im
     this.exceptionToFailWith = exceptionToFailWith;
   }
   
+  @Override
   public void alwaysSucceeds() {
     // do nothing
   }
   
+  @Override
   public void alwaysFailsWithFatalException() throws FatalException {
     throw new FatalException();
   }
   
+  @Override
   public void alwaysFailsWithRemoteFatalException() throws RemoteException {
     throw new RemoteException(FatalException.class.getName(), "Oops");
   }
 
+  @Override
   public void failsOnceThenSucceeds() throws UnreliableException {
     if (failsOnceInvocationCount++ == 0) {
       throw new UnreliableException();
     }
   }
 
+  @Override
   public boolean failsOnceThenSucceedsWithReturnValue() throws UnreliableException {
     if (failsOnceWithValueInvocationCount++ == 0) {
       throw new UnreliableException();
@@ -85,6 +89,7 @@ public class UnreliableImplementation im
     return true;
   }
 
+  @Override
   public void failsTenTimesThenSucceeds() throws UnreliableException {
     if (failsTenTimesInvocationCount++ < 10) {
       throw new UnreliableException();

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/TestWritableSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/TestWritableSerialization.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/TestWritableSerialization.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/TestWritableSerialization.java Wed Sep  5 04:57:47 2012
@@ -18,25 +18,34 @@
 
 package org.apache.hadoop.io.serializer;
 
+import java.io.Serializable;
+
+import org.apache.hadoop.io.DataInputBuffer;
+import org.apache.hadoop.io.DataOutputBuffer;
 import static org.apache.hadoop.io.TestGenericWritable.CONF_TEST_KEY;
 import static org.apache.hadoop.io.TestGenericWritable.CONF_TEST_VALUE;
-import junit.framework.TestCase;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.TestGenericWritable.Baz;
 import org.apache.hadoop.io.TestGenericWritable.FooGenericWritable;
+import org.apache.hadoop.io.WritableComparator;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
 
-public class TestWritableSerialization extends TestCase {
+public class TestWritableSerialization {
 
   private static final Configuration conf = new Configuration();
 
+  @Test
   public void testWritableSerialization() throws Exception {
     Text before = new Text("test writable"); 
     Text after = SerializationTestUtil.testSerialization(conf, before);
     assertEquals(before, after);
   }
   
+  @Test
   public void testWritableConfigurable() throws Exception {
     
     //set the configuration parameter
@@ -52,4 +61,42 @@ public class TestWritableSerialization e
     assertEquals(baz, result);
     assertNotNull(result.getConf());
   }
+
+  @Test
+  @SuppressWarnings({"rawtypes", "unchecked"})
+  public void testWritableComparatorJavaSerialization() throws Exception {
+    Serialization ser = new JavaSerialization();
+
+    Serializer<TestWC> serializer = ser.getSerializer(TestWC.class);
+    DataOutputBuffer dob = new DataOutputBuffer();
+    serializer.open(dob);
+    TestWC orig = new TestWC(0);
+    serializer.serialize(orig);
+    serializer.close();
+
+    Deserializer<TestWC> deserializer = ser.getDeserializer(TestWC.class);
+    DataInputBuffer dib = new DataInputBuffer();
+    dib.reset(dob.getData(), 0, dob.getLength());
+    deserializer.open(dib);
+    TestWC deser = deserializer.deserialize(null);
+    deserializer.close();
+    assertEquals(orig, deser);
+  }
+
+  static class TestWC extends WritableComparator implements Serializable {
+    static final long serialVersionUID = 0x4344;
+    final int val;
+    TestWC() { this(7); }
+    TestWC(int val) { this.val = val; }
+    @Override
+    public boolean equals(Object o) {
+      if (o instanceof TestWC) {
+        return ((TestWC)o).val == val;
+      }
+      return false;
+    }
+    @Override
+    public int hashCode() { return val; }
+  }
+
 }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/Record.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/Record.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/Record.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/Record.java Wed Sep  5 04:57:47 2012
@@ -21,10 +21,12 @@ package org.apache.hadoop.io.serializer.
 public class Record {
   public int x = 7;
 
+  @Override
   public int hashCode() {
     return x;
   }
 
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/TestAvroSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/TestAvroSerialization.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/TestAvroSerialization.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/TestAvroSerialization.java Wed Sep  5 04:57:47 2012
@@ -70,10 +70,12 @@ public class TestAvroSerialization exten
   public static class InnerRecord {
     public int x = 7;
 
+    @Override
     public int hashCode() {
       return x;
     }
 
+    @Override
     public boolean equals(Object obj) {
       if (this == obj)
         return true;
@@ -91,10 +93,12 @@ public class TestAvroSerialization exten
   public static class RefSerializable implements AvroReflectSerializable {
     public int x = 7;
 
+    @Override
     public int hashCode() {
       return x;
     }
 
+    @Override
     public boolean equals(Object obj) {
       if (this == obj)
         return true;

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/MiniRPCBenchmark.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/MiniRPCBenchmark.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/MiniRPCBenchmark.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/MiniRPCBenchmark.java Wed Sep  5 04:57:47 2012
@@ -165,8 +165,10 @@ public class MiniRPCBenchmark {
         new TestDelegationTokenSecretManager(24*60*60*1000,
             7*24*60*60*1000,24*60*60*1000,3600000);
       secretManager.startThreads();
-      rpcServer = RPC.getServer(MiniProtocol.class,
-          this, DEFAULT_SERVER_ADDRESS, 0, 1, false, conf, secretManager);
+      rpcServer = new RPC.Builder(conf).setProtocol(MiniProtocol.class)
+          .setInstance(this).setBindAddress(DEFAULT_SERVER_ADDRESS).setPort(0)
+          .setNumHandlers(1).setVerbose(false).setSecretManager(secretManager)
+          .build();
       rpcServer.start();
     }
 
@@ -208,6 +210,7 @@ public class MiniRPCBenchmark {
       
       try {
         client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
+          @Override
           public MiniProtocol run() throws IOException {
             MiniProtocol p = (MiniProtocol) RPC.getProxy(MiniProtocol.class,
                 MiniProtocol.versionID, addr, conf);
@@ -235,6 +238,7 @@ public class MiniRPCBenchmark {
       long start = Time.now();
       try {
         client = currentUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
+          @Override
           public MiniProtocol run() throws IOException {
             return (MiniProtocol) RPC.getProxy(MiniProtocol.class,
                 MiniProtocol.versionID, addr, conf);

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/RPCCallBenchmark.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/RPCCallBenchmark.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/RPCCallBenchmark.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/RPCCallBenchmark.java Wed Sep  5 04:57:47 2012
@@ -227,11 +227,14 @@ public class RPCCallBenchmark implements
       BlockingService service = TestProtobufRpcProto
           .newReflectiveBlockingService(serverImpl);
 
-      server = RPC.getServer(TestRpcService.class, service,
-          opts.host, opts.port, opts.serverThreads, false, conf, null);
+      server = new RPC.Builder(conf).setProtocol(TestRpcService.class)
+          .setInstance(service).setBindAddress(opts.host).setPort(opts.port)
+          .setNumHandlers(opts.serverThreads).setVerbose(false).build();
     } else if (opts.rpcEngine == WritableRpcEngine.class) {
-      server = RPC.getServer(TestProtocol.class, new TestRPC.TestImpl(),
-          opts.host, opts.port, opts.serverThreads, false, conf, null);
+      server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+          .setInstance(new TestRPC.TestImpl()).setBindAddress(opts.host)
+          .setPort(opts.port).setNumHandlers(opts.serverThreads)
+          .setVerbose(false).build();
     } else {
       throw new RuntimeException("Bad engine: " + opts.rpcEngine);
     }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java Wed Sep  5 04:57:47 2012
@@ -130,6 +130,7 @@ public class TestIPC {
       this.count = count;
     }
 
+    @Override
     public void run() {
       for (int i = 0; i < count; i++) {
         try {
@@ -219,6 +220,7 @@ public class TestIPC {
   private static class IOEOnReadWritable extends LongWritable {
     public IOEOnReadWritable() {}
 
+    @Override
     public void readFields(DataInput in) throws IOException {
       super.readFields(in);
       maybeThrowIOE();
@@ -229,6 +231,7 @@ public class TestIPC {
   private static class RTEOnReadWritable extends LongWritable {
     public RTEOnReadWritable() {}
     
+    @Override
     public void readFields(DataInput in) throws IOException {
       super.readFields(in);
       maybeThrowRTE();

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestMultipleProtocolServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestMultipleProtocolServer.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestMultipleProtocolServer.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestMultipleProtocolServer.java Wed Sep  5 04:57:47 2012
@@ -175,8 +175,9 @@ public class TestMultipleProtocolServer 
   @Before
   public void setUp() throws Exception {
     // create a server with two handlers
-    server = RPC.getServer(Foo0.class,
-                              new Foo0Impl(), ADDRESS, 0, 2, false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(Foo0.class)
+        .setInstance(new Foo0Impl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(2).setVerbose(false).build();
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, Foo1.class, new Foo1Impl());
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, Bar.class, new BarImpl());
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, Mixin.class, new BarImpl());
@@ -263,8 +264,9 @@ public class TestMultipleProtocolServer 
   
   @Test(expected=IOException.class)
   public void testIncorrectServerCreation() throws IOException {
-    RPC.getServer(Foo1.class,
-        new Foo0Impl(), ADDRESS, 0, 2, false, conf, null);
+    new RPC.Builder(conf).setProtocol(Foo1.class).setInstance(new Foo0Impl())
+        .setBindAddress(ADDRESS).setPort(0).setNumHandlers(2).setVerbose(false)
+        .build();
   } 
   
   // Now test a PB service - a server  hosts both PB and Writable Rpcs.

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestProtoBufRpc.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestProtoBufRpc.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestProtoBufRpc.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestProtoBufRpc.java Wed Sep  5 04:57:47 2012
@@ -113,7 +113,8 @@ public class TestProtoBufRpc {
         .newReflectiveBlockingService(serverImpl);
 
     // Get RPC server for server side implementation
-    server = RPC.getServer(TestRpcService.class, service, ADDRESS, PORT, conf);
+    server = new RPC.Builder(conf).setProtocol(TestRpcService.class)
+        .setInstance(service).setBindAddress(ADDRESS).setPort(PORT).build();
     addr = NetUtils.getConnectAddress(server);
     
     // now the second protocol

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java Wed Sep  5 04:57:47 2012
@@ -106,17 +106,21 @@ public class TestRPC {
   public static class TestImpl implements TestProtocol {
     int fastPingCounter = 0;
     
+    @Override
     public long getProtocolVersion(String protocol, long clientVersion) {
       return TestProtocol.versionID;
     }
     
+    @Override
     public ProtocolSignature getProtocolSignature(String protocol, long clientVersion,
         int hashcode) {
       return new ProtocolSignature(TestProtocol.versionID, null);
     }
     
+    @Override
     public void ping() {}
 
+    @Override
     public synchronized void slowPing(boolean shouldSlow) {
       if (shouldSlow) {
         while (fastPingCounter < 2) {
@@ -131,17 +135,22 @@ public class TestRPC {
       }
     }
     
+    @Override
     public String echo(String value) throws IOException { return value; }
 
+    @Override
     public String[] echo(String[] values) throws IOException { return values; }
 
+    @Override
     public Writable echo(Writable writable) {
       return writable;
     }
+    @Override
     public int add(int v1, int v2) {
       return v1 + v2;
     }
 
+    @Override
     public int add(int[] values) {
       int sum = 0;
       for (int i = 0; i < values.length; i++) {
@@ -150,16 +159,19 @@ public class TestRPC {
       return sum;
     }
 
+    @Override
     public int error() throws IOException {
       throw new IOException("bobo");
     }
 
+    @Override
     public void testServerGet() throws IOException {
       if (!(Server.get() instanceof RPC.Server)) {
         throw new IOException("Server.get() failed");
       }
     }
 
+    @Override
     public int[] exchange(int[] values) {
       for (int i = 0; i < values.length; i++) {
         values[i] = i;
@@ -186,6 +198,7 @@ public class TestRPC {
     }
 
     // do two RPC that transfers data.
+    @Override
     public void run() {
       int[] indata = new int[datasize];
       int[] outdata = null;
@@ -220,6 +233,7 @@ public class TestRPC {
       return done;
     }
 
+    @Override
     public void run() {
       try {
         proxy.slowPing(true);   // this would hang until two fast pings happened
@@ -300,8 +314,9 @@ public class TestRPC {
   
   @Test
   public void testConfRpc() throws Exception {
-    Server server = RPC.getServer(TestProtocol.class,
-                                  new TestImpl(), ADDRESS, 0, 1, false, conf, null);
+    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(1).setVerbose(false).build();
     // Just one handler
     int confQ = conf.getInt(
               CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
@@ -314,8 +329,11 @@ public class TestRPC {
     assertEquals(confReaders, server.getNumReaders());
     server.stop();
     
-    server = RPC.getServer(TestProtocol.class,
-                                  new TestImpl(), ADDRESS, 0, 1, 3, 200, false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(1).setnumReaders(3).setQueueSizePerHandler(200)
+        .setVerbose(false).build();        
+        
     assertEquals(3, server.getNumReaders());
     assertEquals(200, server.getMaxQueueSize());
     server.stop();    
@@ -323,8 +341,8 @@ public class TestRPC {
 
   @Test
   public void testProxyAddress() throws Exception {
-    Server server = RPC.getServer(TestProtocol.class,
-                                  new TestImpl(), ADDRESS, 0, conf);
+    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0).build();
     TestProtocol proxy = null;
     
     try {
@@ -348,8 +366,10 @@ public class TestRPC {
   public void testSlowRpc() throws Exception {
     System.out.println("Testing Slow RPC");
     // create a server with two handlers
-    Server server = RPC.getServer(TestProtocol.class,
-                                  new TestImpl(), ADDRESS, 0, 2, false, conf, null);
+    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(2).setVerbose(false).build();
+    
     TestProtocol proxy = null;
     
     try {
@@ -395,8 +415,8 @@ public class TestRPC {
   }
   
   private void testCallsInternal(Configuration conf) throws Exception {
-    Server server = RPC.getServer(TestProtocol.class,
-                                  new TestImpl(), ADDRESS, 0, conf);
+    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0).build();
     TestProtocol proxy = null;
     try {
     server.start();
@@ -514,8 +534,9 @@ public class TestRPC {
   }
   
   private void doRPCs(Configuration conf, boolean expectFailure) throws Exception {
-    Server server = RPC.getServer(TestProtocol.class,
-                                  new TestImpl(), ADDRESS, 0, 5, true, conf, null);
+    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(5).setVerbose(true).build();
 
     server.refreshServiceAcl(conf, new TestPolicyProvider());
 
@@ -559,8 +580,9 @@ public class TestRPC {
   
   @Test
   public void testServerAddress() throws IOException {
-    Server server = RPC.getServer(TestProtocol.class,
-        new TestImpl(), ADDRESS, 0, 5, true, conf, null);
+    Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(5).setVerbose(true).build();
     InetSocketAddress bindAddr = null;
     try {
       bindAddr = NetUtils.getConnectAddress(server);
@@ -654,8 +676,9 @@ public class TestRPC {
   
   @Test
   public void testErrorMsgForInsecureClient() throws Exception {
-    final Server server = RPC.getServer(TestProtocol.class,
-        new TestImpl(), ADDRESS, 0, 5, true, conf, null);
+    final Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(5).setVerbose(true).build();
     server.enableSecurity();
     server.start();
     boolean succeeded = false;
@@ -679,8 +702,10 @@ public class TestRPC {
 
     conf.setInt(CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_KEY, 2);
 
-    final Server multiServer = RPC.getServer(TestProtocol.class,
-        new TestImpl(), ADDRESS, 0, 5, true, conf, null);
+    final Server multiServer = new RPC.Builder(conf)
+        .setProtocol(TestProtocol.class).setInstance(new TestImpl())
+        .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
+        .build();
     multiServer.enableSecurity();
     multiServer.start();
     succeeded = false;
@@ -734,8 +759,9 @@ public class TestRPC {
     assertEquals("Expect no Reader threads running before test",
       0, threadsBefore);
 
-    final Server server = RPC.getServer(TestProtocol.class,
-        new TestImpl(), ADDRESS, 0, 5, true, conf, null);
+    final Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
+        .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(5).setVerbose(true).build();
     server.start();
     try {
       int threadsRunning = countThreads("Server$Listener$Reader");
@@ -748,6 +774,42 @@ public class TestRPC {
       0, threadsAfter);
   }
   
+  @Test
+  public void testRPCBuilder() throws Exception {
+    // Test mandatory field conf
+    try {
+      new RPC.Builder(null).setProtocol(TestProtocol.class)
+          .setInstance(new TestImpl()).setBindAddress(ADDRESS).setPort(0)
+          .setNumHandlers(5).setVerbose(true).build();
+      fail("Didn't throw HadoopIllegalArgumentException");
+    } catch (Exception e) {
+      if (!(e instanceof HadoopIllegalArgumentException)) {
+        fail("Expecting HadoopIllegalArgumentException but caught " + e);
+      }
+    }
+    // Test mandatory field protocol
+    try {
+      new RPC.Builder(conf).setInstance(new TestImpl()).setBindAddress(ADDRESS)
+          .setPort(0).setNumHandlers(5).setVerbose(true).build();
+      fail("Didn't throw HadoopIllegalArgumentException");
+    } catch (Exception e) {
+      if (!(e instanceof HadoopIllegalArgumentException)) {
+        fail("Expecting HadoopIllegalArgumentException but caught " + e);
+      }
+    }
+    // Test mandatory field instance
+    try {
+      new RPC.Builder(conf).setProtocol(TestProtocol.class)
+          .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5)
+          .setVerbose(true).build();
+      fail("Didn't throw HadoopIllegalArgumentException");
+    } catch (Exception e) {
+      if (!(e instanceof HadoopIllegalArgumentException)) {
+        fail("Expecting HadoopIllegalArgumentException but caught " + e);
+      }
+    }
+  }
+  
   public static void main(String[] args) throws Exception {
     new TestRPC().testCallsInternal(conf);
 

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPCCompatibility.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPCCompatibility.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPCCompatibility.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPCCompatibility.java Wed Sep  5 04:57:47 2012
@@ -131,8 +131,9 @@ public class TestRPCCompatibility {
   public void testVersion0ClientVersion1Server() throws Exception {
     // create a server with two handlers
     TestImpl1 impl = new TestImpl1();
-    server = RPC.getServer(TestProtocol1.class,
-                            impl, ADDRESS, 0, 2, false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol1.class)
+        .setInstance(impl).setBindAddress(ADDRESS).setPort(0).setNumHandlers(2)
+        .setVerbose(false).build();
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, TestProtocol0.class, impl);
     server.start();
     addr = NetUtils.getConnectAddress(server);
@@ -147,8 +148,9 @@ public class TestRPCCompatibility {
   @Test  // old client vs new server
   public void testVersion1ClientVersion0Server() throws Exception {
     // create a server with two handlers
-    server = RPC.getServer(TestProtocol0.class,
-                              new TestImpl0(), ADDRESS, 0, 2, false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol0.class)
+        .setInstance(new TestImpl0()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(2).setVerbose(false).build();
     server.start();
     addr = NetUtils.getConnectAddress(server);
 
@@ -198,8 +200,9 @@ System.out.println("echo int is NOT supp
   public void testVersion2ClientVersion1Server() throws Exception {
     // create a server with two handlers
     TestImpl1 impl = new TestImpl1();
-    server = RPC.getServer(TestProtocol1.class,
-                              impl, ADDRESS, 0, 2, false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol1.class)
+        .setInstance(impl).setBindAddress(ADDRESS).setPort(0).setNumHandlers(2)
+        .setVerbose(false).build();
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, TestProtocol0.class, impl);
     server.start();
     addr = NetUtils.getConnectAddress(server);
@@ -219,8 +222,9 @@ System.out.println("echo int is NOT supp
     ProtocolSignature.resetCache();
     // create a server with two handlers
     TestImpl2 impl = new TestImpl2();
-    server = RPC.getServer(TestProtocol2.class,
-                             impl, ADDRESS, 0, 2, false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol2.class)
+        .setInstance(impl).setBindAddress(ADDRESS).setPort(0).setNumHandlers(2)
+        .setVerbose(false).build();
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, TestProtocol0.class, impl);
     server.start();
     addr = NetUtils.getConnectAddress(server);
@@ -284,13 +288,15 @@ System.out.println("echo int is NOT supp
       "org.apache.hadoop.ipc.TestRPCCompatibility$TestProtocol1")
   public interface TestProtocol4 extends TestProtocol2 {
     public static final long versionID = 4L;
+    @Override
     int echo(int value)  throws IOException;
   }
   
   @Test
   public void testVersionMismatch() throws IOException {
-    server = RPC.getServer(TestProtocol2.class, new TestImpl2(), ADDRESS, 0, 2,
-        false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol2.class)
+        .setInstance(new TestImpl2()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(2).setVerbose(false).build();
     server.start();
     addr = NetUtils.getConnectAddress(server);
 
@@ -307,8 +313,9 @@ System.out.println("echo int is NOT supp
   
   @Test
   public void testIsMethodSupported() throws IOException {
-    server = RPC.getServer(TestProtocol2.class, new TestImpl2(), ADDRESS, 0, 2,
-        false, conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol2.class)
+        .setInstance(new TestImpl2()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(2).setVerbose(false).build();
     server.start();
     addr = NetUtils.getConnectAddress(server);
 
@@ -331,8 +338,9 @@ System.out.println("echo int is NOT supp
   @Test
   public void testProtocolMetaInfoSSTranslatorPB() throws Exception {
     TestImpl1 impl = new TestImpl1();
-    server = RPC.getServer(TestProtocol1.class, impl, ADDRESS, 0, 2, false,
-        conf, null);
+    server = new RPC.Builder(conf).setProtocol(TestProtocol1.class)
+        .setInstance(impl).setBindAddress(ADDRESS).setPort(0).setNumHandlers(2)
+        .setVerbose(false).build();
     server.addProtocol(RPC.RpcKind.RPC_WRITABLE, TestProtocol0.class, impl);
     server.start();
 

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestSaslRPC.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestSaslRPC.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestSaslRPC.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestSaslRPC.java Wed Sep  5 04:57:47 2012
@@ -136,15 +136,18 @@ public class TestSaslRPC {
   
   public static class TestTokenSecretManager extends
       SecretManager<TestTokenIdentifier> {
+    @Override
     public byte[] createPassword(TestTokenIdentifier id) {
       return id.getBytes();
     }
 
+    @Override
     public byte[] retrievePassword(TestTokenIdentifier id) 
         throws InvalidToken {
       return id.getBytes();
     }
     
+    @Override
     public TestTokenIdentifier createIdentifier() {
       return new TestTokenIdentifier();
     }
@@ -152,6 +155,7 @@ public class TestSaslRPC {
   
   public static class BadTokenSecretManager extends TestTokenSecretManager {
 
+    @Override
     public byte[] retrievePassword(TestTokenIdentifier id) 
         throws InvalidToken {
       throw new InvalidToken(ERROR_MESSAGE);
@@ -186,6 +190,7 @@ public class TestSaslRPC {
   
   public static class TestSaslImpl extends TestRPC.TestImpl implements
       TestSaslProtocol {
+    @Override
     public AuthenticationMethod getAuthMethod() throws IOException {
       return UserGroupInformation.getCurrentUser().getAuthenticationMethod();
     }
@@ -230,9 +235,11 @@ public class TestSaslRPC {
   @Test
   public void testDigestRpc() throws Exception {
     TestTokenSecretManager sm = new TestTokenSecretManager();
-    final Server server = RPC.getServer(TestSaslProtocol.class,
-        new TestSaslImpl(), ADDRESS, 0, 5, true, conf, sm);
-
+    final Server server = new RPC.Builder(conf)
+        .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
+        .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
+        .setSecretManager(sm).build();
+    
     doDigestRpc(server, sm);
   }
 
@@ -241,9 +248,10 @@ public class TestSaslRPC {
     TestTokenSecretManager sm = new TestTokenSecretManager();
     try {
       SecurityUtil.setSecurityInfoProviders(new CustomSecurityInfo());
-      final Server server = RPC.getServer(TestSaslProtocol.class,
-                                          new TestSaslImpl(), ADDRESS, 0, 5, 
-                                          true, conf, sm);
+      final Server server = new RPC.Builder(conf)
+          .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
+          .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5)
+          .setVerbose(true).setSecretManager(sm).build();
       doDigestRpc(server, sm);
     } finally {
       SecurityUtil.setSecurityInfoProviders(new SecurityInfo[0]);
@@ -252,8 +260,9 @@ public class TestSaslRPC {
 
   @Test
   public void testSecureToInsecureRpc() throws Exception {
-    Server server = RPC.getServer(TestSaslProtocol.class,
-        new TestSaslImpl(), ADDRESS, 0, 5, true, conf, null);
+    Server server = new RPC.Builder(conf).setProtocol(TestSaslProtocol.class)
+        .setInstance(new TestSaslImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(5).setVerbose(true).build();
     server.disableSecurity();
     TestTokenSecretManager sm = new TestTokenSecretManager();
     doDigestRpc(server, sm);
@@ -262,8 +271,10 @@ public class TestSaslRPC {
   @Test
   public void testErrorMessage() throws Exception {
     BadTokenSecretManager sm = new BadTokenSecretManager();
-    final Server server = RPC.getServer(TestSaslProtocol.class,
-        new TestSaslImpl(), ADDRESS, 0, 5, true, conf, sm);
+    final Server server = new RPC.Builder(conf)
+        .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
+        .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
+        .setSecretManager(sm).build();
 
     boolean succeeded = false;
     try {
@@ -350,8 +361,10 @@ public class TestSaslRPC {
   @Test
   public void testPerConnectionConf() throws Exception {
     TestTokenSecretManager sm = new TestTokenSecretManager();
-    final Server server = RPC.getServer(TestSaslProtocol.class,
-        new TestSaslImpl(), ADDRESS, 0, 5, true, conf, sm);
+    final Server server = new RPC.Builder(conf)
+        .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
+        .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
+        .setSecretManager(sm).build();
     server.start();
     final UserGroupInformation current = UserGroupInformation.getCurrentUser();
     final InetSocketAddress addr = NetUtils.getConnectAddress(server);
@@ -413,8 +426,10 @@ public class TestSaslRPC {
     UserGroupInformation current = UserGroupInformation.getCurrentUser();
     System.out.println("UGI: " + current);
 
-    Server server = RPC.getServer(TestSaslProtocol.class, new TestSaslImpl(),
-        ADDRESS, 0, 5, true, newConf, null);
+    Server server = new RPC.Builder(newConf)
+        .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
+        .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
+        .build();
     TestSaslProtocol proxy = null;
 
     server.start();
@@ -436,8 +451,9 @@ public class TestSaslRPC {
   @Test
   public void testDigestAuthMethod() throws Exception {
     TestTokenSecretManager sm = new TestTokenSecretManager();
-    Server server = RPC.getServer(TestSaslProtocol.class,
-        new TestSaslImpl(), ADDRESS, 0, 5, true, conf, sm);
+    Server server = new RPC.Builder(conf).setProtocol(TestSaslProtocol.class)
+        .setInstance(new TestSaslImpl()).setBindAddress(ADDRESS).setPort(0)
+        .setNumHandlers(5).setVerbose(true).setSecretManager(sm).build();      
     server.start();
 
     final UserGroupInformation current = UserGroupInformation.getCurrentUser();
@@ -450,6 +466,7 @@ public class TestSaslRPC {
     current.addToken(token);
 
     current.doAs(new PrivilegedExceptionAction<Object>() {
+      @Override
       public Object run() throws IOException {
         TestSaslProtocol proxy = null;
         try {

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics/TestMetricsServlet.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics/TestMetricsServlet.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics/TestMetricsServlet.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics/TestMetricsServlet.java Wed Sep  5 04:57:47 2012
@@ -43,6 +43,7 @@ public class TestMetricsServlet extends 
    * Initializes, for testing, two NoEmitMetricsContext's, and adds one value 
    * to the first of them.
    */
+  @Override
   public void setUp() throws IOException {
     nc1 = new NoEmitMetricsContext();
     nc1.init("test1", ContextFactory.getFactory());

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsAnnotations.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsAnnotations.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsAnnotations.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsAnnotations.java Wed Sep  5 04:57:47 2012
@@ -21,8 +21,6 @@ package org.apache.hadoop.metrics2.lib;
 import org.junit.Test;
 import static org.junit.Assert.*;
 import static org.mockito.Mockito.*;
-import static org.apache.hadoop.test.MockitoMaker.*;
-
 import org.apache.hadoop.metrics2.MetricsCollector;
 import org.apache.hadoop.metrics2.MetricsException;
 import org.apache.hadoop.metrics2.MetricsRecordBuilder;
@@ -145,6 +143,7 @@ public class TestMetricsAnnotations {
 
     @Metric int getG0() { return 0; }
 
+    @Override
     public void getMetrics(MetricsCollector collector, boolean all) {
       collector.addRecord("foo")
                   .setContext("foocontext")
@@ -183,6 +182,7 @@ public class TestMetricsAnnotations {
 
     @Metric MutableCounterInt c1;
 
+    @Override
     public void getMetrics(MetricsCollector collector, boolean all) {
       collector.addRecord("foo");
     }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsRegistry.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsRegistry.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsRegistry.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/lib/TestMetricsRegistry.java Wed Sep  5 04:57:47 2012
@@ -51,6 +51,7 @@ public class TestMetricsRegistry {
     assertTrue("s1 found", r.get("s1") instanceof MutableStat);
 
     expectMetricsException("Metric name c1 already exists", new Runnable() {
+      @Override
       public void run() { r.newCounter("c1", "test dup", 0); }
     });
   }
@@ -70,10 +71,12 @@ public class TestMetricsRegistry {
     r.newGauge("g1", "test add", 1);
 
     expectMetricsException("Unsupported add", new Runnable() {
+      @Override
       public void run() { r.add("c1", 42); }
     });
 
     expectMetricsException("Unsupported add", new Runnable() {
+      @Override
       public void run() { r.add("g1", 42); }
     });
   }

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java Wed Sep  5 04:57:47 2012
@@ -21,10 +21,8 @@ import org.apache.hadoop.conf.Configurat
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 /**
  * Implements the {@link DNSToSwitchMapping} via static mappings. Used

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/FromCpp.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/FromCpp.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/FromCpp.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/FromCpp.java Wed Sep  5 04:57:47 2012
@@ -33,9 +33,11 @@ public class FromCpp extends TestCase {
     super(testName);
   }
 
+  @Override
   protected void setUp() throws Exception {
   }
 
+  @Override
   protected void tearDown() throws Exception {
   }
     

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/RecordBench.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/RecordBench.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/RecordBench.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/RecordBench.java Wed Sep  5 04:57:47 2012
@@ -23,8 +23,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Random;
 

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordIO.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordIO.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordIO.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordIO.java Wed Sep  5 04:57:47 2012
@@ -34,9 +34,11 @@ public class TestRecordIO extends TestCa
     super(testName);
   }
 
+  @Override
   protected void setUp() throws Exception {
   }
 
+  @Override
   protected void tearDown() throws Exception {
   }
     

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordVersioning.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordVersioning.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordVersioning.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/TestRecordVersioning.java Wed Sep  5 04:57:47 2012
@@ -35,9 +35,11 @@ public class TestRecordVersioning extend
     super(testName);
   }
 
+  @Override
   protected void setUp() throws Exception {
   }
 
+  @Override
   protected void tearDown() throws Exception {
   }
     

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/ToCpp.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/ToCpp.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/ToCpp.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/record/ToCpp.java Wed Sep  5 04:57:47 2012
@@ -33,9 +33,11 @@ public class ToCpp extends TestCase {
     super(testName);
   }
 
+  @Override
   protected void setUp() throws Exception {
   }
 
+  @Override
   protected void tearDown() throws Exception {
   }
     

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestAuthenticationFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestAuthenticationFilter.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestAuthenticationFilter.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestAuthenticationFilter.java Wed Sep  5 04:57:47 2012
@@ -22,7 +22,6 @@ import org.apache.hadoop.http.HttpServer
 import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.http.FilterContainer;
-import org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler;
 import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -55,6 +54,7 @@ public class TestAuthenticationFilter ex
     FilterContainer container = Mockito.mock(FilterContainer.class);
     Mockito.doAnswer(
       new Answer() {
+        @Override
         public Object answer(InvocationOnMock invocationOnMock)
           throws Throwable {
           Object[] args = invocationOnMock.getArguments();

Modified: hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestCredentials.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestCredentials.java?rev=1380990&r1=1380989&r2=1380990&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestCredentials.java (original)
+++ hadoop/common/branches/HDFS-3077/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestCredentials.java Wed Sep  5 04:57:47 2012
@@ -29,13 +29,10 @@ import java.io.IOException;
 import java.security.Key;
 import java.security.NoSuchAlgorithmException;
 import java.util.HashMap;
-import java.util.List;
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.Collection;
 
-import static org.mockito.Mockito.mock;
-
 import javax.crypto.KeyGenerator;
 
 import org.apache.hadoop.io.Text;
@@ -223,7 +220,7 @@ public class TestCredentials {
     for (int i=0; i < service.length; i++) {
       creds.addToken(service[i], token[i]);
     }
-    creds.addTokensToUGI(ugi);
+    ugi.addCredentials(creds);
 
     creds = ugi.getCredentials();
     for (int i=0; i < service.length; i++) {



Mime
View raw message