Example usage for org.apache.hadoop.hdfs.server.protocol InterDatanodeProtocol versionID

List of usage examples for org.apache.hadoop.hdfs.server.protocol InterDatanodeProtocol versionID

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.server.protocol InterDatanodeProtocol versionID.

Prototype

long versionID

To view the source code for org.apache.hadoop.hdfs.server.protocol InterDatanodeProtocol versionID.

Click Source Link

Document

Until version 9, this class InterDatanodeProtocol served as both the interface to the DN AND the RPC protocol used to communicate with the DN.

Usage

From source file:common.DataNode.java

License:Apache License

public static InterDatanodeProtocol createInterDataNodeProtocolProxy(DatanodeID datanodeid, Configuration conf)
        throws IOException {
    InetSocketAddress addr = NetUtils.createSocketAddr(datanodeid.getHost() + ":" + datanodeid.getIpcPort());
    if (InterDatanodeProtocol.LOG.isDebugEnabled()) {
        InterDatanodeProtocol.LOG.info("InterDatanodeProtocol addr=" + addr);
    }/*from w w  w . j a  v a 2  s  .c om*/
    return (InterDatanodeProtocol) RPC.getProxy(InterDatanodeProtocol.class, InterDatanodeProtocol.versionID,
            addr, conf);
}

From source file:common.DataNode.java

License:Apache License

/** {@inheritDoc} */
public long getProtocolVersion(String protocol, long clientVersion) throws IOException {
    if (protocol.equals(InterDatanodeProtocol.class.getName())) {
        return InterDatanodeProtocol.versionID;
    } else if (protocol.equals(ClientDatanodeProtocol.class.getName())) {
        return ClientDatanodeProtocol.versionID;
    }/*from  ww w. j a  v a2  s  .  co m*/
    throw new IOException("Unknown protocol to " + getClass().getSimpleName() + ": " + protocol);
}