示例#1
0
 /// <summary>
 /// 检查Dbtune配置流程涉及参数
 /// </summary>
 /// <returns></returns>
 internal static bool CheckDbtuneConfigParam(MemoEdit txbBlog, DbtuneConfigParam dbtuneConfigParam)
 {
     if (dbtuneConfigParam.DBHelper == null)
     {
         WriteBlog(txbBlog, "---  数据库连接异常, 请查看错误日志");
         return(false);
     }
     else if (dbtuneConfigParam.FeatureClass == null)
     {
         WriteBlog(txbBlog, "---  未指定要素类");
         return(false);
     }
     else if (RegexCheck.IsEmpty(dbtuneConfigParam.BasicField))
     {
         WriteBlog(txbBlog, "---  未指定分区列");
         return(false);
     }
     else if (dbtuneConfigParam.PartitionWay == EnumPartitionWay.Unknow)
     {
         WriteBlog(txbBlog, "---  未指定分区方式");
         return(false);
     }
     else if (!RegexCheck.IsFull(dbtuneConfigParam.TablespaceSet))
     {
         WriteBlog(txbBlog, "---  存在没有指定表空间的分区");
         return(false);
     }
     else if (DbtuneXMLOperate.CheckKeyWordExist(dbtuneConfigParam.DbtuneKeyWord))
     {
         WriteBlog(txbBlog, "---  关键字为 " + dbtuneConfigParam.DbtuneKeyWord + "的配置项已经存在,请更改关键字");
         return(false);
     }
     else
     {
         if (dbtuneConfigParam.PartitionWay == EnumPartitionWay.Range)
         {
             if (dbtuneConfigParam.PartitionCount == -1)
             {
                 WriteBlog(txbBlog, "---  未指定范围分区数");
                 return(false);
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(true);
         }
     }
 }
示例#2
0
        /// <summary>
        /// 获取配置关键字集合
        /// </summary>
        /// <returns></returns>
        internal static List <string> GetDbtuneKeyWordSet(IDBHelper dbHelper = null, string filePath = null)
        {
            List <DbtuneInfo> dbtuneInfoSet = DbtuneXMLOperate.ListKeyWord(dbHelper: dbHelper, filePath: filePath);

            List <string> dbtuneKeyWordSet = new List <string>();

            foreach (var dbtuneInfo in dbtuneInfoSet)
            {
                dbtuneKeyWordSet.Add(dbtuneInfo.KeyWord);
            }

            return(dbtuneKeyWordSet);
        }