Java 类org.apache.hadoop.hdfs.qjournal.client.QuorumException 实例源码

项目:hadoop    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  try {
    qjm.startLogSegment(1, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  try {
    qjm.startLogSegment(1, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:big-c    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  try {
    qjm.startLogSegment(1, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  try {
    qjm.startLogSegment(1, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:FlexMap    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  try {
    qjm.startLogSegment(1, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:hadoop-on-lustre2    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong(),
      Mockito.eq(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION));
  try {
    qjm.startLogSegment(1, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:hadoop-EAR    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong());
  try {
    qjm.startLogSegment(1);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:hadoop-plus    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong());
  try {
    qjm.startLogSegment(1);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:hadoop-TCP    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong());
  try {
    qjm.startLogSegment(1);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}
项目:hardfs    文件:TestQuorumJournalManagerUnit.java   
@Test
public void testQuorumOfLoggersFail() throws Exception {
  futureReturns(null).when(spyLoggers.get(0)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
  .when(spyLoggers.get(1)).startLogSegment(Mockito.anyLong());
  futureThrows(new IOException("logger failed"))
    .when(spyLoggers.get(2)).startLogSegment(Mockito.anyLong());
  try {
    qjm.startLogSegment(1);
    fail("Did not throw when quorum failed");
  } catch (QuorumException qe) {
    GenericTestUtils.assertExceptionContains("logger failed", qe);
  }
}