Package org.apache.hadoop.hdfs.server.namenode.FSImageTransactionalStorageInspector

Examples of org.apache.hadoop.hdfs.server.namenode.FSImageTransactionalStorageInspector.LogGroup


        mockDirectoryWithEditLogs("/foo2/current/"
                                  + getFinalizedEditsFileName(123,456)));
    inspector.inspectDirectory(
        mockDirectoryWithEditLogs("/foo3/current/"
                                  + getFinalizedEditsFileName(123,456)));
    LogGroup lg = inspector.logGroups.get(123L);
    assertEquals(3, lg.logs.size());
   
    lg.planRecovery();
   
    assertFalse(lg.logs.get(0).isCorrupt());
    assertFalse(lg.logs.get(1).isCorrupt());
    assertFalse(lg.logs.get(2).isCorrupt());
  }
View Full Code Here


    inspector.inspectDirectory(FSImageTestUtil.mockStorageDirectory(
        NameNodeDirType.IMAGE,
        false,
        "/foo4/current/" + getImageFileName(122)));

    LogGroup lg = inspector.logGroups.get(123L);
    assertEquals(3, lg.logs.size());
    EditLogFile inProgressLog = lg.logs.get(2);
    assertTrue(inProgressLog.isInProgress());
   
    LoadPlan plan = inspector.createLoadPlan();
View Full Code Here

                                  + getFinalizedEditsFileName(123,456)));
    inspector.inspectDirectory(
        mockDirectoryWithEditLogs("/foo2/current/"
                                  + getFinalizedEditsFileName(123,678)));

    LogGroup lg = inspector.logGroups.get(123L);
    assertEquals(2, lg.logs.size());

    try {
      lg.planRecovery();
      fail("Didn't throw IOE on inconsistent end txids");
    } catch (IOException ioe) {
      assertTrue(ioe.getMessage().contains("More than one ending txid"));
    }
  }
View Full Code Here

    // Inject spies to return the valid counts we would like to see
    mockLogValidation(inspector, paths[0], 2000);
    mockLogValidation(inspector, paths[1], 2000);
    mockLogValidation(inspector, paths[2], 1000);

    LogGroup lg = inspector.logGroups.get(123L);
    assertEquals(3, lg.logs.size());
   
    lg.planRecovery();
   
    // Check that the short one was marked corrupt
    assertFalse(lg.logs.get(0).isCorrupt());
    assertFalse(lg.logs.get(1).isCorrupt());
    assertTrue(lg.logs.get(2).isCorrupt());
   
    // Calling recover should move it aside
    EditLogFile badLog = lg.logs.get(2);
    Mockito.doNothing().when(badLog).moveAsideCorruptFile();
    Mockito.doNothing().when(lg.logs.get(0)).finalizeLog();
    Mockito.doNothing().when(lg.logs.get(1)).finalizeLog();
   
    lg.recover();
   
    Mockito.verify(badLog).moveAsideCorruptFile();
    Mockito.verify(lg.logs.get(0)).finalizeLog();
    Mockito.verify(lg.logs.get(1)).finalizeLog();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.FSImageTransactionalStorageInspector.LogGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.