accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/2] git commit: ACCUMUL-2056 work around HostAndPort not being serializable
Date Thu, 19 Dec 2013 21:29:07 GMT
Updated Branches:
  refs/heads/master f7fd2989d -> cbeac8ebf


ACCUMUL-2056 work around HostAndPort not being serializable


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f0ea80a1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f0ea80a1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f0ea80a1

Branch: refs/heads/master
Commit: f0ea80a1127db82ea7ea3eab42599e354bd3a1ac
Parents: 674fa95
Author: Eric Newton <eric.newton@gmail.com>
Authored: Thu Dec 19 16:29:03 2013 -0500
Committer: Eric Newton <eric.newton@gmail.com>
Committed: Thu Dec 19 16:29:03 2013 -0500

----------------------------------------------------------------------
 .../server/master/state/TServerInstance.java        | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f0ea80a1/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
b/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
index 54d7e71..e7dce67 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
@@ -16,6 +16,9 @@
  */
 package org.apache.accumulo.server.master.state;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
 
 import org.apache.accumulo.core.data.Mutation;
@@ -35,7 +38,8 @@ public class TServerInstance implements Comparable<TServerInstance>,
Serializabl
   
   private static final long serialVersionUID = 1L;
   
-  private HostAndPort location;
+  // HostAndPort is not Serializable
+  private transient HostAndPort location;
   private String session;
   private String cachedStringRepresentation;
   
@@ -125,4 +129,14 @@ public class TServerInstance implements Comparable<TServerInstance>,
Serializabl
   public String getSession() {
     return session;
   }
+  
+  private void writeObject(ObjectOutputStream out) throws IOException {
+    out.defaultWriteObject();
+    out.writeObject(location.toString());
+  }
+  
+  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
+    in.defaultReadObject();
+    location = HostAndPort.fromString(in.readObject().toString());
+  }
 }


Mime
View raw message