Ejemplo n.º 1
0
        private static void LogBlockReplicationInfo(Block block, BlockCollection bc, DatanodeDescriptor
                                                    srcNode, NumberReplicas num, IEnumerable <DatanodeStorageInfo> storages)
        {
            int           curReplicas         = num.LiveReplicas();
            int           curExpectedReplicas = bc.GetBlockReplication();
            StringBuilder nodeList            = new StringBuilder();

            foreach (DatanodeStorageInfo storage in storages)
            {
                DatanodeDescriptor node = storage.GetDatanodeDescriptor();
                nodeList.Append(node);
                nodeList.Append(" ");
            }
            Log.Info("Block: " + block + ", Expected Replicas: " + curExpectedReplicas + ", live replicas: "
                     + curReplicas + ", corrupt replicas: " + num.CorruptReplicas() + ", decommissioned replicas: "
                     + num.DecommissionedReplicas() + ", excess replicas: " + num.ExcessReplicas() +
                     ", Is Open File: " + bc.IsUnderConstruction() + ", Datanodes having this block: "
                     + nodeList + ", Current Datanode: " + srcNode + ", Is current datanode decommissioning: "
                     + srcNode.IsDecommissionInProgress());
        }
Ejemplo n.º 2
0
 /* check for timeout, then wait for cycleTime msec */
 /// <exception cref="Sharpen.TimeoutException"/>
 internal virtual void CheckTimeout(string testLabel, long cycleTime)
 {
     if (Time.MonotonicNow() > failtime)
     {
         throw new TimeoutException("Timeout: " + testLabel + " for block " + lastBlock +
                                    " after " + timeout + " msec.  Last counts: live = " + lastNum.LiveReplicas() +
                                    ", excess = " + lastNum.ExcessReplicas() + ", corrupt = " + lastNum.CorruptReplicas
                                        ());
     }
     if (cycleTime > 0)
     {
         try
         {
             Sharpen.Thread.Sleep(cycleTime);
         }
         catch (Exception)
         {
         }
     }
 }