Exemplo n.º 1
0
        internal virtual void WaitCheckpointDone(MiniDFSCluster cluster, long txid)
        {
            long thisCheckpointTxId;

            do
            {
                try
                {
                    Log.Info("Waiting checkpoint to complete... " + "checkpoint txid should increase above "
                             + txid);
                    Sharpen.Thread.Sleep(1000);
                }
                catch (Exception)
                {
                }
                // The checkpoint is not done until the nn has received it from the bn
                thisCheckpointTxId = cluster.GetNameNode().GetFSImage().GetStorage().GetMostRecentCheckpointTxId
                                         ();
            }while (thisCheckpointTxId < txid);
            // Check that the checkpoint got uploaded to NN successfully
            FSImageTestUtil.AssertNNHasCheckpoints(cluster, Collections.SingletonList((int)thisCheckpointTxId
                                                                                      ));
        }