本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.proto.JournalProtocolProtos.FenceResponseProto类的典型用法代码示例。如果您正苦于以下问题:Java FenceResponseProto类的具体用法?Java FenceResponseProto怎么用?Java FenceResponseProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FenceResponseProto类属于org.apache.hadoop.hdfs.protocol.proto.JournalProtocolProtos包,在下文中一共展示了FenceResponseProto类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fence
import org.apache.hadoop.hdfs.protocol.proto.JournalProtocolProtos.FenceResponseProto; //导入依赖的package包/类
@Override
public FenceResponse fence(JournalInfo journalInfo, long epoch,
String fencerInfo) throws IOException {
FenceRequestProto req = FenceRequestProto.newBuilder().setEpoch(epoch)
.setJournalInfo(PBHelper.convert(journalInfo)).build();
try {
FenceResponseProto resp = rpcProxy.fence(NULL_CONTROLLER, req);
return new FenceResponse(resp.getPreviousEpoch(),
resp.getLastTransactionId(), resp.getInSync());
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
示例2: fence
import org.apache.hadoop.hdfs.protocol.proto.JournalProtocolProtos.FenceResponseProto; //导入依赖的package包/类
@Override
public FenceResponseProto fence(RpcController controller,
FenceRequestProto req) throws ServiceException {
try {
FenceResponse resp = impl.fence(PBHelper.convert(req.getJournalInfo()), req.getEpoch(),
req.getFencerInfo());
return FenceResponseProto.newBuilder().setInSync(resp.isInSync())
.setLastTransactionId(resp.getLastTransactionId())
.setPreviousEpoch(resp.getPreviousEpoch()).build();
} catch (IOException e) {
throw new ServiceException(e);
}
}