Java 类org.apache.hadoop.hdfs.protocol.proto.InterDatanodeProtocolProtos.InitReplicaRecoveryResponseProto 实例源码

项目:hadoop    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:hadoop    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:aliyun-oss-hadoop-fs    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:aliyun-oss-hadoop-fs    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelperClient.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:big-c    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:big-c    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hadoop-plus    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:hadoop-plus    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:FlexMap    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:FlexMap    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hops    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false).build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder().setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hadoop-TCP    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:hadoop-TCP    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hardfs    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:hardfs    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hadoop-on-lustre2    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req = InitReplicaRecoveryRequestProto
      .newBuilder().setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}
项目:hadoop-on-lustre2    文件:InterDatanodeProtocolServerSideTranslatorPB.java   
@Override
public InitReplicaRecoveryResponseProto initReplicaRecovery(
    RpcController unused, InitReplicaRecoveryRequestProto request)
    throws ServiceException {
  RecoveringBlock b = PBHelper.convert(request.getBlock());
  ReplicaRecoveryInfo r;
  try {
    r = impl.initReplicaRecovery(b);
  } catch (IOException e) {
    throw new ServiceException(e);
  }

  if (r == null) {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(false)
        .build();
  } else {
    return InitReplicaRecoveryResponseProto.newBuilder()
        .setReplicaFound(true)
        .setBlock(PBHelper.convert(r))
        .setState(PBHelper.convert(r.getOriginalReplicaState())).build();
  }
}
项目:hops    文件:InterDatanodeProtocolTranslatorPB.java   
@Override
public ReplicaRecoveryInfo initReplicaRecovery(RecoveringBlock rBlock)
    throws IOException {
  InitReplicaRecoveryRequestProto req =
      InitReplicaRecoveryRequestProto.newBuilder()
          .setBlock(PBHelper.convert(rBlock)).build();
  InitReplicaRecoveryResponseProto resp;
  try {
    resp = rpcProxy.initReplicaRecovery(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
  if (!resp.getReplicaFound()) {
    // No replica found on the remote node.
    return null;
  } else {
    if (!resp.hasBlock() || !resp.hasState()) {
      throw new IOException("Replica was found but missing fields. " +
          "Req: " + req + "\n" +
          "Resp: " + resp);
    }
  }

  BlockProto b = resp.getBlock();
  return new ReplicaRecoveryInfo(b.getBlockId(), b.getNumBytes(),
      b.getGenStamp(), PBHelper.convert(resp.getState()));
}