示例#1
0
            /// <exception cref="System.IO.IOException"/>
            public virtual int Run(Configuration conf, IList <string> args)
            {
                string name = StringUtils.PopFirstNonOption(args);

                if (name == null)
                {
                    System.Console.Error.WriteLine("You must specify a name when deleting a " + "cache pool."
                                                   );
                    return(1);
                }
                if (!args.IsEmpty())
                {
                    System.Console.Error.Write("Can't understand arguments: " + Joiner.On(" ").Join(args
                                                                                                    ) + "\n");
                    System.Console.Error.WriteLine("Usage is " + GetShortUsage());
                    return(1);
                }
                DistributedFileSystem dfs = AdminHelper.GetDFS(conf);

                try
                {
                    dfs.RemoveCachePool(name);
                }
                catch (IOException e)
                {
                    System.Console.Error.WriteLine(AdminHelper.PrettifyException(e));
                    return(2);
                }
                System.Console.Out.WriteLine("Successfully removed cache pool " + name + ".");
                return(0);
            }
示例#2
0
 /// <summary>Remove a cache pool.</summary>
 /// <param name="poolName">Name of the cache pool to remove.</param>
 /// <exception cref="System.IO.IOException">
 ///
 /// if the cache pool did not exist, or could not be removed.
 /// </exception>
 public virtual void RemoveCachePool(string poolName)
 {
     dfs.RemoveCachePool(poolName);
 }