重新编译mondrian

2023-06-29 10:41:53 浏览数 (1)

mondrian.rolap:

class RolapConnectionPool{

......

private synchronized ObjectPool getPool(Object key, ConnectionFactory connectionFactory) {

ObjectPool connectionPool = (ObjectPool)this.mapConnectKeyToPool.get(key); 

 if (connectionPool == null) 

 { connectionPool = new GenericObjectPool

( null, 300, (byte)1, 3000L, 10, false, false, 60000L, 5, 30000L, true);

  .......

.......

}

.......

.......

}

}

mondrian.rolap:

public class RolapSchema

   1、修改 mondrian.rolap.RolapSchema.load(String,String)方法:

           a、注释://in = Util.readVirtualFile(catalogUrl);

           b、修改:def = xmlParser.parse(in) 为:

                           DOMWrapper def = xmlParser.parse(Util.readVirtualFileAsString(catalogUrl));

mondrian.olap:

public class Util

public static String readVirtualFileAsString(String catalogUrl)

      throws IOException

    {

      InputStream in = readVirtualFile(catalogUrl);

      try

      {

        return IOUtils.toString(in, "UTF-8");//读文件的编码

      }

      finally

      {

        IOUtils.closeQuietly(in);

      }

    }

用Phoenix的时候修改:

mondrian.RolapStar

RolapStar.addToFrom -》 将mdx查询语句转换为传统sql查询语句

public void addToFrom(

            SqlQuery query,

            boolean failIfExists,

            boolean joinToParent)

        {

            Util.assertTrue((parent == null) == (joinCondition == null));

            if (joinToParent) {

                if (parent != null) {

                    parent.addToFrom(query, failIfExists, joinToParent);

                }

                if (joinCondition != null) {

                    query.addWhere(joinCondition.toString(query));

                }

            }

            query.addFrom(relation, alias, failIfExists);//将这一句挪到方法最后

        }

可以查看我的上传资源,可以下载:

mondrian-3.11

0 人点赞