use of org.apache.hadoop.hdfs.qjournal.client.AsyncLogger in project hadoop by apache.
the class TestQuorumJournalManagerUnit method setup.
@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();
}
Aggregations