Java 类org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.AppendRequestProto 实例源码

项目:hadoop    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    EnumSetWritable<CreateFlag> flags = req.hasFlag() ?
        PBHelper.convertCreateFlag(req.getFlag()) :
        new EnumSetWritable<>(EnumSet.of(CreateFlag.APPEND));
    LastBlockWithStatus result = server.append(req.getSrc(),
        req.getClientName(), flags);
    AppendResponseProto.Builder builder = AppendResponseProto.newBuilder();
    if (result.getLastBlock() != null) {
      builder.setBlock(PBHelper.convert(result.getLastBlock()));
    }
    if (result.getFileStatus() != null) {
      builder.setStat(PBHelper.convert(result.getFileStatus()));
    }
    return builder.build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LastBlockWithStatus append(String src, String clientName,
    EnumSetWritable<CreateFlag> flag) throws AccessControlException,
    DSQuotaExceededException, FileNotFoundException, SafeModeException,
    UnresolvedLinkException, IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder().setSrc(src)
      .setClientName(clientName).setFlag(PBHelper.convertCreateFlag(flag))
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    LocatedBlock lastBlock = res.hasBlock() ? PBHelper
        .convert(res.getBlock()) : null;
    HdfsFileStatus stat = (res.hasStat()) ? PBHelper.convert(res.getStat())
        : null;
    return new LastBlockWithStatus(lastBlock, stat);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:aliyun-oss-hadoop-fs    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LastBlockWithStatus append(String src, String clientName,
    EnumSetWritable<CreateFlag> flag) throws IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder().setSrc(src)
      .setClientName(clientName).setFlag(
          PBHelperClient.convertCreateFlag(flag))
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    LocatedBlock lastBlock = res.hasBlock() ? PBHelperClient
        .convertLocatedBlockProto(res.getBlock()) : null;
    HdfsFileStatus stat = (res.hasStat()) ?
        PBHelperClient.convert(res.getStat()) : null;
    return new LastBlockWithStatus(lastBlock, stat);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:aliyun-oss-hadoop-fs    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    EnumSetWritable<CreateFlag> flags = req.hasFlag() ?
        PBHelperClient.convertCreateFlag(req.getFlag()) :
        new EnumSetWritable<>(EnumSet.of(CreateFlag.APPEND));
    LastBlockWithStatus result = server.append(req.getSrc(),
        req.getClientName(), flags);
    AppendResponseProto.Builder builder = AppendResponseProto.newBuilder();
    if (result.getLastBlock() != null) {
      builder.setBlock(PBHelperClient.convertLocatedBlock(
          result.getLastBlock()));
    }
    if (result.getFileStatus() != null) {
      builder.setStat(PBHelperClient.convert(result.getFileStatus()));
    }
    return builder.build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:big-c    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    EnumSetWritable<CreateFlag> flags = req.hasFlag() ?
        PBHelper.convertCreateFlag(req.getFlag()) :
        new EnumSetWritable<>(EnumSet.of(CreateFlag.APPEND));
    LastBlockWithStatus result = server.append(req.getSrc(),
        req.getClientName(), flags);
    AppendResponseProto.Builder builder = AppendResponseProto.newBuilder();
    if (result.getLastBlock() != null) {
      builder.setBlock(PBHelper.convert(result.getLastBlock()));
    }
    if (result.getFileStatus() != null) {
      builder.setStat(PBHelper.convert(result.getFileStatus()));
    }
    return builder.build();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:big-c    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LastBlockWithStatus append(String src, String clientName,
    EnumSetWritable<CreateFlag> flag) throws AccessControlException,
    DSQuotaExceededException, FileNotFoundException, SafeModeException,
    UnresolvedLinkException, IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder().setSrc(src)
      .setClientName(clientName).setFlag(PBHelper.convertCreateFlag(flag))
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    LocatedBlock lastBlock = res.hasBlock() ? PBHelper
        .convert(res.getBlock()) : null;
    HdfsFileStatus stat = (res.hasStat()) ? PBHelper.convert(res.getStat())
        : null;
    return new LastBlockWithStatus(lastBlock, stat);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder()
      .setSrc(src)
      .setClientName(clientName)
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hadoop-plus    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder()
      .setSrc(src)
      .setClientName(clientName)
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:FlexMap    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder()
      .setSrc(src)
      .setClientName(clientName)
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hadoop-TCP    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder()
      .setSrc(src)
      .setClientName(clientName)
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hardfs    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder()
      .setSrc(src)
      .setClientName(clientName)
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hadoop-on-lustre2    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req = AppendRequestProto.newBuilder()
      .setSrc(src)
      .setClientName(clientName)
      .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop-plus    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:FlexMap    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hops    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hops    文件:ClientNamenodeProtocolTranslatorPB.java   
@Override
public LocatedBlock append(String src, String clientName)
    throws AccessControlException, DSQuotaExceededException,
    FileNotFoundException, SafeModeException, UnresolvedLinkException,
    IOException {
  AppendRequestProto req =
      AppendRequestProto.newBuilder().setSrc(src).setClientName(clientName)
          .build();
  try {
    AppendResponseProto res = rpcProxy.append(null, req);
    return res.hasBlock() ? PBHelper.convert(res.getBlock()) : null;
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
项目:hadoop-TCP    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hardfs    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop-on-lustre2    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@Override
public AppendResponseProto append(RpcController controller,
    AppendRequestProto req) throws ServiceException {
  try {
    LocatedBlock result = server.append(req.getSrc(), req.getClientName());
    if (result != null) {
      return AppendResponseProto.newBuilder()
          .setBlock(PBHelper.convert(result)).build();
    }
    return VOID_APPEND_RESPONSE;
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}