コード例 #1
0
ファイル: KeyShell.cs プロジェクト: orf53975/hadoop.net
 public override bool Validate()
 {
     this.provider = this.GetKeyProvider();
     if (this.provider == null)
     {
         [email protected]("There are no valid KeyProviders configured. Nothing\n"
                                        + "was deleted. Use the -provider option to specify a provider.");
         return(false);
     }
     if (this.keyName == null)
     {
         [email protected]("There is no keyName specified. Please specify a "
                                        + "<keyname>. See the usage description with -help.");
         return(false);
     }
     if (this._enclosing.interactive)
     {
         try
         {
             this.cont = ToolRunner.ConfirmPrompt("You are about to DELETE all versions of " +
                                                  " key " + this.keyName + " from KeyProvider " + this.provider + ". Continue? ");
             if (!this.cont)
             {
                 [email protected](this.keyName + " has not been deleted.");
             }
             return(this.cont);
         }
         catch (IOException e)
         {
             [email protected](this.keyName + " will not be deleted.");
             Runtime.PrintStackTrace(e, this._enclosing.err);
         }
     }
     return(true);
 }
コード例 #2
0
ファイル: HAAdmin.cs プロジェクト: orf53975/hadoop.net
 /// <exception cref="System.IO.IOException"/>
 private bool ConfirmForceManual()
 {
     return(ToolRunner.ConfirmPrompt("You have specified the --" + Forcemanual + " flag. This flag is "
                                     + "dangerous, as it can induce a split-brain scenario that WILL " + "CORRUPT your HDFS namespace, possibly irrecoverably.\n"
                                     + "\n" + "It is recommended not to use this flag, but instead to shut down the "
                                     + "cluster and disable automatic failover if you prefer to manually " + "manage your HA state.\n"
                                     + "\n" + "You may abort safely by answering 'n' or hitting ^C now.\n" + "\n" +
                                     "Are you sure you want to continue?"));
 }
コード例 #3
0
        private bool ConfirmFormat()
        {
            string parentZnode = GetParentZnode();

            System.Console.Error.WriteLine("===============================================\n"
                                           + "The configured parent znode " + parentZnode + " already exists.\n" + "Are you sure you want to clear all failover information from\n"
                                           + "ZooKeeper?\n" + "WARNING: Before proceeding, ensure that all HDFS services and\n"
                                           + "failover controllers are stopped!\n" + "==============================================="
                                           );
            try
            {
                return(ToolRunner.ConfirmPrompt("Proceed formatting " + parentZnode + "?"));
            }
            catch (IOException e)
            {
                Log.Debug("Failed to confirm", e);
                return(false);
            }
        }
コード例 #4
0
 public override bool Validate()
 {
     this.provider = this.GetCredentialProvider();
     if (this.provider == null)
     {
         [email protected]("There are no valid CredentialProviders configured.\n"
                                        + "Nothing will be deleted.\n" + "Consider using the -provider option to indicate the provider"
                                        + " to use.");
         return(false);
     }
     if (this.alias == null)
     {
         [email protected]("There is no alias specified. Please provide the"
                                        + "mandatory <alias>. See the usage description with -help.");
         return(false);
     }
     if (this._enclosing.interactive)
     {
         try
         {
             this.cont = ToolRunner.ConfirmPrompt("You are about to DELETE the credential " +
                                                  this.alias + " from CredentialProvider " + this.provider.ToString() + ". Continue? "
                                                  );
             if (!this.cont)
             {
                 [email protected]("Nothing has been be deleted.");
             }
             return(this.cont);
         }
         catch (IOException e)
         {
             [email protected](this.alias + " will not be deleted.");
             Runtime.PrintStackTrace(e, this._enclosing.err);
         }
     }
     return(true);
 }