Search in sources :

Example 1 with AsyncLogger

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();
}
Also used : AsyncLogger(org.apache.hadoop.hdfs.qjournal.client.AsyncLogger) QuorumJournalManager(org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) URI(java.net.URI) Before(org.junit.Before)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 URI (java.net.URI)1 List (java.util.List)1 AsyncLogger (org.apache.hadoop.hdfs.qjournal.client.AsyncLogger)1 QuorumJournalManager (org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager)1 Before (org.junit.Before)1