本文整理汇总了Java中org.apache.hadoop.ipc.proto.GenericRefreshProtocolProtos.GenericRefreshRequestProto类的典型用法代码示例。如果您正苦于以下问题:Java GenericRefreshRequestProto类的具体用法?Java GenericRefreshRequestProto怎么用?Java GenericRefreshRequestProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericRefreshRequestProto类属于org.apache.hadoop.ipc.proto.GenericRefreshProtocolProtos包,在下文中一共展示了GenericRefreshRequestProto类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refresh
import org.apache.hadoop.ipc.proto.GenericRefreshProtocolProtos.GenericRefreshRequestProto; //导入依赖的package包/类
@Override
public GenericRefreshResponseCollectionProto refresh(
RpcController controller, GenericRefreshRequestProto request)
throws ServiceException {
try {
List<String> argList = request.getArgsList();
String[] args = argList.toArray(new String[argList.size()]);
if (!request.hasIdentifier()) {
throw new ServiceException("Request must contain identifier");
}
Collection<RefreshResponse> results = impl.refresh(request.getIdentifier(), args);
return pack(results);
} catch (IOException e) {
throw new ServiceException(e);
}
}
示例2: refresh
import org.apache.hadoop.ipc.proto.GenericRefreshProtocolProtos.GenericRefreshRequestProto; //导入依赖的package包/类
@Override
public Collection<RefreshResponse> refresh(String identifier, String[] args) throws IOException {
List<String> argList = Arrays.asList(args);
try {
GenericRefreshRequestProto request = GenericRefreshRequestProto.newBuilder()
.setIdentifier(identifier)
.addAllArgs(argList)
.build();
GenericRefreshResponseCollectionProto resp = rpcProxy.refresh(NULL_CONTROLLER, request);
return unpack(resp);
} catch (ServiceException se) {
throw ProtobufHelper.getRemoteException(se);
}
}