当前位置: 首页>>代码示例>>Java>>正文


Java DatanodeProtocol.versionID方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.versionID方法的典型用法代码示例。如果您正苦于以下问题:Java DatanodeProtocol.versionID方法的具体用法?Java DatanodeProtocol.versionID怎么用?Java DatanodeProtocol.versionID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol的用法示例。


在下文中一共展示了DatanodeProtocol.versionID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol, 
                               long clientVersion) throws IOException {
  if (protocol.equals(ClientProtocol.class.getName())) {
    return ClientProtocol.versionID; 
  } else if (protocol.equals(DatanodeProtocol.class.getName())){
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName())){
    return NamenodeProtocol.versionID;
  } else if (protocol.equals(RefreshAuthorizationPolicyProtocol.class.getName())){
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else if (protocol.equals(RefreshUserMappingsProtocol.class.getName())){
    return RefreshUserMappingsProtocol.versionID;
  } else if (protocol.equals(RefreshCallQueueProtocol.class.getName())) {
    return RefreshCallQueueProtocol.versionID;
  } else if (protocol.equals(GetUserMappingsProtocol.class.getName())){
    return GetUserMappingsProtocol.versionID;
  } else if (protocol.equals(TraceAdminProtocol.class.getName())){
    return TraceAdminProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:NameNode.java

示例2: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol, 
                               long clientVersion) throws IOException {
  if (protocol.equals(ClientProtocol.class.getName())) {
    return ClientProtocol.versionID; 
  } else if (protocol.equals(DatanodeProtocol.class.getName())){
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName())){
    return NamenodeProtocol.versionID;
  } else if (protocol.equals(RefreshAuthorizationPolicyProtocol.class.getName())){
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else if (protocol.equals(RefreshUserMappingsProtocol.class.getName())){
    return RefreshUserMappingsProtocol.versionID;
  } else if (protocol.equals(GetUserMappingsProtocol.class.getName())){
    return GetUserMappingsProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:19,代码来源:NameNode.java

示例3: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol, long clientVersion)
    throws IOException {
  if (protocol.equals(ClientProtocol.class.getName())) {
    return ClientProtocol.versionID;
  } else if (protocol.equals(DatanodeProtocol.class.getName())) {
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName())) {
    return NamenodeProtocol.versionID;
  } else if (protocol
      .equals(RefreshAuthorizationPolicyProtocol.class.getName())) {
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else if (protocol.equals(RefreshUserMappingsProtocol.class.getName())) {
    return RefreshUserMappingsProtocol.versionID;
  } else if (protocol.equals(GetUserMappingsProtocol.class.getName())) {
    return GetUserMappingsProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:20,代码来源:NameNode.java

示例4: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol, 
                               long clientVersion) throws IOException {
  if (protocol.equals(ClientProtocol.class.getName())) {
    return ClientProtocol.versionID; 
  } else if (protocol.equals(DatanodeProtocol.class.getName())){
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName())){
    return NamenodeProtocol.versionID;
  } else if (protocol.equals(RefreshAuthorizationPolicyProtocol.class.getName())){
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else if (protocol.equals(RefreshUserMappingsProtocol.class.getName())){
    return RefreshUserMappingsProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:17,代码来源:NameNode.java

示例5: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol,
                               long clientVersion) throws IOException {
  InetSocketAddress requestAddress = Server.get().getListenerAddress();
  boolean dnRequest = false, clientRequest = false;
  // If dnProtocolAddress is null - there is only one server running
  // otherwise check the address of the incoming request.
  if (dnProtocolAddress == null ||
      dnProtocolAddress.equals(requestAddress)) {
    dnRequest = true;
  }
  if (dnProtocolAddress == null || requestAddress.equals(serverAddress)) {
    clientRequest = true;
  }
  if (protocol.equals(ClientProtocol.class.getName())) {
    long namenodeVersion = ClientProtocol.versionID;
    if (namenodeVersion > clientVersion &&
        !ProtocolCompatible.isCompatibleClientProtocol(
            clientVersion, namenodeVersion)) {
      throw new RPC.VersionIncompatible(
          protocol, clientVersion, namenodeVersion);
    }
    return namenodeVersion;
  } else if (protocol.equals(DatanodeProtocol.class.getName()) && dnRequest){
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName()) && clientRequest){
    return NamenodeProtocol.versionID;
  } else if (protocol.equals(RefreshAuthorizationPolicyProtocol.class.getName()) && clientRequest){
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else if (protocol.equals(ClientProxyProtocol.class.getName())) {
    return ClientProxyProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:35,代码来源:NameNode.java

示例6: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol, 
                               long clientVersion) throws IOException {
  InetSocketAddress requestAddress = Server.get().getListenerAddress();
  boolean dnRequest = false, clientRequest = false;
  // If dnProtocolAddress is null - there is only one server running
  // otherwise check the address of the incoming request.
  if (dnProtocolAddress == null ||
      dnProtocolAddress.equals(requestAddress)) {
    dnRequest = true;
  }
  if (dnProtocolAddress == null || requestAddress.equals(serverAddress)) {
    clientRequest = true;
  }
  if (protocol.equals(ClientProtocol.class.getName())) {
    long namenodeVersion = ClientProtocol.versionID;
    if (namenodeVersion > clientVersion &&
        !ProtocolCompatible.isCompatibleClientProtocol(
            clientVersion, namenodeVersion)) {
      throw new RPC.VersionIncompatible(
          protocol, clientVersion, namenodeVersion);
    }
    return namenodeVersion;
  } else if (protocol.equals(DatanodeProtocol.class.getName()) && dnRequest){
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName()) && clientRequest){
    return NamenodeProtocol.versionID;
  } else if (protocol.equals(RefreshAuthorizationPolicyProtocol.class.getName()) && clientRequest){
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:33,代码来源:NameNode.java

示例7: getProtocolVersion

import org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol; //导入方法依赖的package包/类
public long getProtocolVersion(String protocol, 
                               long clientVersion) throws IOException { 
  if (protocol.equals(ClientProtocol.class.getName())) {
    return ClientProtocol.versionID; 
  } else if (protocol.equals(DatanodeProtocol.class.getName())){
    return DatanodeProtocol.versionID;
  } else if (protocol.equals(NamenodeProtocol.class.getName())){
    return NamenodeProtocol.versionID;
  } else if (protocol.equals(RefreshAuthorizationPolicyProtocol.class.getName())){
    return RefreshAuthorizationPolicyProtocol.versionID;
  } else {
    throw new IOException("Unknown protocol to name node: " + protocol);
  }
}
 
开发者ID:thisisvoa,项目名称:hadoop-0.20,代码行数:15,代码来源:NameNode.java


注:本文中的org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.versionID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。