コード例 #1
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        protected internal bool VerifyDeletedBlocks(LocatedBlocks locatedBlocks)
        {
            Log.Info("Verifying replica has no saved copy after deletion.");
            TriggerBlockReport();
            while (DataNodeTestUtils.GetPendingAsyncDeletions(cluster.GetDataNodes()[0]) > 0L
                   )
            {
                Sharpen.Thread.Sleep(1000);
            }
            string bpid = cluster.GetNamesystem().GetBlockPoolId();
            IList <FsVolumeSpi> volumes = cluster.GetDataNodes()[0].GetFSDataset().GetVolumes(
                );

            // Make sure deleted replica does not have a copy on either finalized dir of
            // transient volume or finalized dir of non-transient volume
            foreach (FsVolumeSpi v in volumes)
            {
                FsVolumeImpl volume    = (FsVolumeImpl)v;
                FilePath     targetDir = (v.IsTransientStorage()) ? volume.GetBlockPoolSlice(bpid).GetFinalizedDir
                                             () : volume.GetBlockPoolSlice(bpid).GetLazypersistDir();
                if (VerifyBlockDeletedFromDir(targetDir, locatedBlocks) == false)
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
ファイル: HATestUtil.cs プロジェクト: orf53975/hadoop.net
 public bool Get()
 {
     foreach (DataNode dn in cluster.GetDataNodes())
     {
         if (DataNodeTestUtils.GetPendingAsyncDeletions(dn) > 0)
         {
             return(false);
         }
     }
     return(true);
 }