hi-adachi commented on PR #4398:
URL: https://github.com/apache/hadoop/pull/4398#issuecomment-1152877937

   It would be good to add a test case where decommission in progress to 
testPendingRecoveryTasks.
   ```
      private void verifyPendingRecoveryTasks(
          int numReplicationBlocks, int numECBlocks,
   -      int maxTransfers, int numReplicationTasks, int numECTasks)
   +      int maxTransfers, int maxTransfersHardLimit, int numReplicationTasks, 
int numECTasks, boolean isDecommissioning)
          throws IOException {
        FSNamesystem fsn = Mockito.mock(FSNamesystem.class);
        Mockito.when(fsn.hasWriteLock()).thenReturn(true);
        Configuration conf = new Configuration();
        conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY, 
maxTransfers);
   +    
conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_STREAMS_HARD_LIMIT_KEY, 
maxTransfersHardLimit);
        DatanodeManager dm = Mockito.spy(mockDatanodeManager(fsn, conf));
    
        DatanodeDescriptor nodeInfo = Mockito.mock(DatanodeDescriptor.class);
        Mockito.when(nodeInfo.isRegistered()).thenReturn(true);
        Mockito.when(nodeInfo.getStorageInfos())
            .thenReturn(new DatanodeStorageInfo[0]);
   +    
Mockito.when(nodeInfo.isDecommissionInProgress()).thenReturn(isDecommissioning);
   ```
   ```
   verifyPendingRecoveryTasks(30, 30, 20, 30, 15, 15, true);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to