本文整理汇总了Java中org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto类的典型用法代码示例。如果您正苦于以下问题:Java GetJournalStateResponseProto类的具体用法?Java GetJournalStateResponseProto怎么用?Java GetJournalStateResponseProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GetJournalStateResponseProto类属于org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos包,在下文中一共展示了GetJournalStateResponseProto类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareRecovery
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public ListenableFuture<PrepareRecoveryResponseProto> prepareRecovery(
final long segmentTxId) {
return singleThreadExecutor.submit(new Callable<PrepareRecoveryResponseProto>() {
@Override
public PrepareRecoveryResponseProto call() throws IOException {
if (!hasHttpServerEndPoint()) {
// force an RPC call so we know what the HTTP port should be if it
// haven't done so.
GetJournalStateResponseProto ret = getProxy().getJournalState(
journalId);
constructHttpServerURI(ret);
}
return getProxy().prepareRecovery(createReqInfo(), segmentTxId);
}
});
}
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:IPCLoggerChannel.java
示例2: prepareRecovery
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public ListenableFuture<PrepareRecoveryResponseProto> prepareRecovery(
final long segmentTxId) {
return executor.submit(new Callable<PrepareRecoveryResponseProto>() {
@Override
public PrepareRecoveryResponseProto call() throws IOException {
if (!hasHttpServerEndPoint()) {
// force an RPC call so we know what the HTTP port should be if it
// haven't done so.
GetJournalStateResponseProto ret = getProxy().getJournalState(
journalId);
constructHttpServerURI(ret);
}
return getProxy().prepareRecovery(createReqInfo(), segmentTxId);
}
});
}
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:18,代码来源:IPCLoggerChannel.java
示例3: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
public QuorumCall<AsyncLogger, GetJournalStateResponseProto> getJournalState() {
Map<AsyncLogger, ListenableFuture<GetJournalStateResponseProto>> calls =
Maps.newHashMap();
for (AsyncLogger logger : loggers) {
calls.put(logger, logger.getJournalState());
}
return QuorumCall.create(calls);
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:AsyncLoggerSet.java
示例4: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public ListenableFuture<GetJournalStateResponseProto> getJournalState() {
return singleThreadExecutor.submit(new Callable<GetJournalStateResponseProto>() {
@Override
public GetJournalStateResponseProto call() throws IOException {
GetJournalStateResponseProto ret =
getProxy().getJournalState(journalId);
constructHttpServerURI(ret);
return ret;
}
});
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:IPCLoggerChannel.java
示例5: constructHttpServerURI
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
private void constructHttpServerURI(GetJournalStateResponseProto ret) {
if (ret.hasFromURL()) {
URI uri = URI.create(ret.getFromURL());
httpServerURL = getHttpServerURI(uri.getScheme(), uri.getPort());
} else {
httpServerURL = getHttpServerURI("http", ret.getHttpPort());;
}
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:IPCLoggerChannel.java
示例6: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public GetJournalStateResponseProto getJournalState(String journalId)
throws IOException {
long epoch = jn.getOrCreateJournal(journalId).getLastPromisedEpoch();
return GetJournalStateResponseProto.newBuilder()
.setLastPromisedEpoch(epoch)
.setHttpPort(jn.getBoundHttpAddress().getPort())
.setFromURL(jn.getHttpServerURI())
.build();
}
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:JournalNodeRpcServer.java
示例7: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public GetJournalStateResponseProto getJournalState(RpcController controller,
GetJournalStateRequestProto request) throws ServiceException {
try {
return impl.getJournalState(
convert(request.getJid()));
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:QJournalProtocolServerSideTranslatorPB.java
示例8: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public GetJournalStateResponseProto getJournalState(String jid)
throws IOException {
try {
GetJournalStateRequestProto req = GetJournalStateRequestProto.newBuilder()
.setJid(convertJournalId(jid))
.build();
return rpcProxy.getJournalState(NULL_CONTROLLER, req);
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:QJournalProtocolTranslatorPB.java
示例9: setup
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Before
public void setup() throws Exception {
spyLoggers = ImmutableList.of(
mockLogger(),
mockLogger(),
mockLogger());
qjm = new QuorumJournalManager(conf, new URI("qjournal://host/jid"), FAKE_NSINFO) {
@Override
protected List<AsyncLogger> createLoggers(AsyncLogger.Factory factory) {
return spyLoggers;
}
};
for (AsyncLogger logger : spyLoggers) {
futureReturns(GetJournalStateResponseProto.newBuilder()
.setLastPromisedEpoch(0)
.setHttpPort(-1)
.build())
.when(logger).getJournalState();
futureReturns(
NewEpochResponseProto.newBuilder().build()
).when(logger).newEpoch(Mockito.anyLong());
futureReturns(null).when(logger).format(Mockito.<NamespaceInfo>any());
}
qjm.recoverUnfinalizedSegments();
}
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:TestQuorumJournalManagerUnit.java
示例10: setup
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Before
public void setup() throws Exception {
spyLoggers = ImmutableList.of(
mockLogger(),
mockLogger(),
mockLogger());
qjm = new QuorumJournalManager(conf, new URI("qjournal://host/jid"),
FAKE_NSINFO, null, false) {
@Override
protected List<AsyncLogger> createLoggers(AsyncLogger.Factory factory) {
return spyLoggers;
}
};
for (AsyncLogger logger : spyLoggers) {
GetJournalStateResponseProto p = new GetJournalStateResponseProto();
p.setLastPromisedEpoch(0);
p.setHttpPort(-1);
futureReturns(p)
.when(logger).getJournalState();
futureReturns(
new NewEpochResponseProto()
).when(logger).newEpoch(Mockito.anyLong());
StartupOption startOpt = null;
futureReturns(null).when(logger).transitionJournal(
Mockito.<NamespaceInfo> any(), Mockito.eq(Transition.FORMAT),
Mockito.eq(startOpt));
}
qjm.recoverUnfinalizedSegments();
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:35,代码来源:TestQuorumJournalManagerUnit.java
示例11: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public ListenableFuture<GetJournalStateResponseProto> getJournalState() {
return executor.submit(new Callable<GetJournalStateResponseProto>() {
@Override
public GetJournalStateResponseProto call() throws IOException {
GetJournalStateResponseProto ret =
getProxy().getJournalState(journalIdBytes);
httpPort = ret.getHttpPort();
return ret;
}
});
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:13,代码来源:IPCLoggerChannel.java
示例12: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public GetJournalStateResponseProto getJournalState(byte[] journalId)
throws IOException {
long epoch = jn.getOrCreateJournal(journalId).getLastPromisedEpoch();
GetJournalStateResponseProto ret = new GetJournalStateResponseProto();
ret.setLastPromisedEpoch(epoch);
ret.setHttpPort(jn.getBoundHttpAddress().getPort());
return ret;
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:11,代码来源:JournalNodeRpcServer.java
示例13: getJournalState
import org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto; //导入依赖的package包/类
@Override
public ListenableFuture<GetJournalStateResponseProto> getJournalState() {
return executor.submit(new Callable<GetJournalStateResponseProto>() {
@Override
public GetJournalStateResponseProto call() throws IOException {
GetJournalStateResponseProto ret =
getProxy().getJournalState(journalId);
httpPort = ret.getHttpPort();
return ret;
}
});
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:13,代码来源:IPCLoggerChannel.java
注:本文中的org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.GetJournalStateResponseProto类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论