org.apache.hadoop.hbase.ipc
Class ProtocolSignature

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.ProtocolSignature
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class ProtocolSignature
extends Object
implements org.apache.hadoop.io.Writable


Constructor Summary
ProtocolSignature()
          default constructor
ProtocolSignature(long version, int[] methodHashcodes)
          Constructor
 
Method Summary
 int[] getMethods()
           
static ProtocolSignature getProtocolSignature(VersionedProtocol server, String protocol, long clientVersion, int clientMethodsHash)
          Get a server protocol's signature
 long getVersion()
           
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolSignature

public ProtocolSignature()
default constructor


ProtocolSignature

public ProtocolSignature(long version,
                         int[] methodHashcodes)
Constructor

Parameters:
version - server version
methodHashcodes - hash codes of the methods supported by server
Method Detail

getVersion

public long getVersion()

getMethods

public int[] getMethods()

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

getProtocolSignature

public static ProtocolSignature getProtocolSignature(VersionedProtocol server,
                                                     String protocol,
                                                     long clientVersion,
                                                     int clientMethodsHash)
                                              throws IOException
Get a server protocol's signature

Parameters:
server - server implementation
protocol - server protocol
clientVersion - client's version
clientMethodsHash - client's protocol's hash code
Returns:
the server protocol's signature
Throws:
IOException - if any error occurs


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.