当前位置: 首页>>代码示例>>Java>>正文


Java MondrianException类代码示例

本文整理汇总了Java中mondrian.olap.MondrianException的典型用法代码示例。如果您正苦于以下问题:Java MondrianException类的具体用法?Java MondrianException怎么用?Java MondrianException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MondrianException类属于mondrian.olap包,在下文中一共展示了MondrianException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shutdown

import mondrian.olap.MondrianException; //导入依赖的package包/类
private void shutdown(boolean silent) {
    if (this == MondrianServerRegistry.INSTANCE.staticServer) {
        LOGGER.warn("Can't shutdown the static server.");
        return;
    }
    if (shutdown) {
        if (silent) {
            return;
        }
        throw new MondrianException("Server already shutdown.");
    }
    this.shutdown  = true;
    aggMgr.shutdown();
    monitor.shutdown();
    repository.shutdown();
    shepherd.shutdown();
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:18,代码来源:MondrianServerImpl.java

示例2: addConnection

import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
synchronized public void addConnection(RolapConnection connection) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(
            "addConnection "
            + ", id=" + id
            + ", statements=" + statementMap.size()
            + ", connections=" + connectionMap.size());
    }
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    connectionMap.put(
        connection.getId(),
        connection);
    monitor.sendEvent(
        new ConnectionStartEvent(
            System.currentTimeMillis(),
            connection.getServer().getId(),
            connection.getId()));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:22,代码来源:MondrianServerImpl.java

示例3: removeConnection

import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
synchronized public void removeConnection(RolapConnection connection) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(
            "removeConnection "
            + ", id=" + id
            + ", statements=" + statementMap.size()
            + ", connections=" + connectionMap.size());
    }
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    connectionMap.remove(connection.getId());
    monitor.sendEvent(
        new ConnectionEndEvent(
            System.currentTimeMillis(),
            getId(),
            connection.getId()));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:20,代码来源:MondrianServerImpl.java

示例4: addStatement

import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
synchronized public void addStatement(Statement statement) {
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(
            "addStatement "
            + ", id=" + id
            + ", statements=" + statementMap.size()
            + ", connections=" + connectionMap.size());
    }
    statementMap.put(
        statement.getId(),
        statement);
    final RolapConnection connection =
        statement.getMondrianConnection();
    monitor.sendEvent(
        new StatementStartEvent(
            System.currentTimeMillis(),
            connection.getServer().getId(),
            connection.getId(),
            statement.getId()));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:25,代码来源:MondrianServerImpl.java

示例5: removeStatement

import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
synchronized public void removeStatement(Statement statement) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(
            "removeStatement "
            + ", id=" + id
            + ", statements=" + statementMap.size()
            + ", connections=" + connectionMap.size());
    }
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    statementMap.remove(statement.getId());
    final RolapConnection connection =
        statement.getMondrianConnection();
    monitor.sendEvent(
        new StatementEndEvent(
            System.currentTimeMillis(),
            connection.getServer().getId(),
            connection.getId(),
            statement.getId()));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:23,代码来源:MondrianServerImpl.java

示例6: testSucces_CodeSetContainsOnlyCodeForPostgresDialect

import mondrian.olap.MondrianException; //导入依赖的package包/类
/**
 * ISSUE MONDRIAN-2335 If SqlQuery.CodeSet contains only sql code
 * for dialect="postgres", this code should be chosen.
 * No error should be thrown
 *
 * @throws Exception
 */
public void testSucces_CodeSetContainsOnlyCodeForPostgresDialect()
  throws Exception
  {
  PostgreSqlDialect postgreSqlDialect = new PostgreSqlDialect(
      mockConnection(
          POSTGRESQL_PRODUCT_NAME,
          POSTGRESQL_PRODUCT_VERSION));
  codeSet = new SqlQuery.CodeSet();
  codeSet.put(POSTGRES_DIALECT, SQL_CODE_FOR_POSTGRES_DIALECT);
  try {
    String chooseQuery = codeSet.chooseQuery(postgreSqlDialect);
    assertEquals(SQL_CODE_FOR_POSTGRES_DIALECT, chooseQuery);
  } catch (MondrianException mExc) {
    fail(
        "Not expected any MondrianException but it occured: "
        + mExc.getLocalizedMessage());
  }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:26,代码来源:CodeSetTest.java

示例7: testSucces_CodeSetContainsCodeForBothPostgresAndGenericDialects

import mondrian.olap.MondrianException; //导入依赖的package包/类
/**
 * ISSUE MONDRIAN-2335 If SqlQuery.CodeSet contains sql code
 * for both dialect="postgres" and dialect="generic",
 * the code for dialect="postgres"should be chosen. No error should be thrown
 *
 * @throws Exception
 */
public void testSucces_CodeSetContainsCodeForBothPostgresAndGenericDialects()
  throws Exception
  {
  PostgreSqlDialect postgreSqlDialect = new PostgreSqlDialect(
      mockConnection(
          POSTGRESQL_PRODUCT_NAME,
          POSTGRESQL_PRODUCT_VERSION));
  codeSet = new SqlQuery.CodeSet();
  codeSet.put(POSTGRES_DIALECT, SQL_CODE_FOR_POSTGRES_DIALECT);
  codeSet.put(GENERIC_DIALECT, SQL_CODE_FOR_GENERIC_DIALECT);
  try {
    String chooseQuery = codeSet.chooseQuery(postgreSqlDialect);
    assertEquals(SQL_CODE_FOR_POSTGRES_DIALECT, chooseQuery);
  } catch (MondrianException mExc) {
    fail(
        "Not expected any MondrianException but it occured: "
        + mExc.getLocalizedMessage());
  }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:27,代码来源:CodeSetTest.java

示例8: testSucces_CodeSetContainsCodeForBothPostgresAndPostgresqlDialects

import mondrian.olap.MondrianException; //导入依赖的package包/类
/**
 * ISSUE MONDRIAN-2335 If SqlQuery.CodeSet contains sql code
 * for both dialect="postgres" and dialect="postgresql",
 * the code for dialect="postgres"should be chosen. No error should be thrown
 *
 * @throws Exception
 */
public void
  testSucces_CodeSetContainsCodeForBothPostgresAndPostgresqlDialects()
    throws Exception
    {
  PostgreSqlDialect postgreSqlDialect = new PostgreSqlDialect(
      mockConnection(
          POSTGRESQL_PRODUCT_NAME,
          POSTGRESQL_PRODUCT_VERSION));
  codeSet = new SqlQuery.CodeSet();
  codeSet.put(POSTGRES_DIALECT, SQL_CODE_FOR_POSTGRES_DIALECT);
  codeSet.put(POSTGRESQL_DIALECT, SQL_CODE_FOR_POSTGRESQL_DIALECT);
  try {
    String chooseQuery = codeSet.chooseQuery(postgreSqlDialect);
    assertEquals(SQL_CODE_FOR_POSTGRES_DIALECT, chooseQuery);
  } catch (MondrianException mExc) {
    fail(
        "Not expected any MondrianException but it occured: "
        + mExc.getLocalizedMessage());
  }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:28,代码来源:CodeSetTest.java

示例9: testSucces_CodeSetContainsOnlyCodeForGenericlDialect

import mondrian.olap.MondrianException; //导入依赖的package包/类
/**
 * If SqlQuery.CodeSet contains sql code for dialect="generic" ,
 * the code for dialect="generic" should be chosen. No error should be thrown
 *
 * @throws Exception
 */
public void testSucces_CodeSetContainsOnlyCodeForGenericlDialect()
  throws Exception
  {
  PostgreSqlDialect postgreSqlDialect = new PostgreSqlDialect(
      mockConnection(
          POSTGRESQL_PRODUCT_NAME,
          POSTGRESQL_PRODUCT_VERSION));
  codeSet = new SqlQuery.CodeSet();
  codeSet.put(GENERIC_DIALECT, SQL_CODE_FOR_GENERIC_DIALECT);
  try {
    String chooseQuery = codeSet.chooseQuery(postgreSqlDialect);
    assertEquals(SQL_CODE_FOR_GENERIC_DIALECT, chooseQuery);
  } catch (MondrianException mExc) {
    fail(
        "Not expected any MondrianException but it occured: "
        + mExc.getLocalizedMessage());
  }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:25,代码来源:CodeSetTest.java

示例10: testMondrianExceptionThrown_WhenCodeSetContainsNOCodeForDialect

import mondrian.olap.MondrianException; //导入依赖的package包/类
/**
 * If SqlQuery.CodeSet contains no sql code with specified dialect at all
 * (even 'generic'), the MondrianException should be thrown.
 *
 * @throws Exception
 */
public void testMondrianExceptionThrown_WhenCodeSetContainsNOCodeForDialect()
  throws Exception
  {
  PostgreSqlDialect postgreSqlDialect = new PostgreSqlDialect(
      mockConnection(
          POSTGRESQL_PRODUCT_NAME,
          POSTGRESQL_PRODUCT_VERSION));
  codeSet = new SqlQuery.CodeSet();
  try {
    String chooseQuery = codeSet.chooseQuery(postgreSqlDialect);
    fail(
        "Expected MondrianException but not occured");
    assertEquals(SQL_CODE_FOR_GENERIC_DIALECT, chooseQuery);
  } catch (MondrianException mExc) {
    assertEquals(
        MONDRIAN_ERROR_NO_GENERIC_VARIANT,
        mExc.getLocalizedMessage());
  }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:26,代码来源:CodeSetTest.java

示例11: initWriter

import mondrian.olap.MondrianException; //导入依赖的package包/类
private void initWriter( String encoding, Enumeration.ResponseMimeType responseMimeType, OutputStream outputStream) {
   try {
      switch (responseMimeType) {
      case JSON:
         writer = null;
         LOGGER.error("Can not support JSON message, please use SOAP instead");
         throw new MondrianException("Can not support JSON message, please use SOAP instead");
      case SOAP:
      default:
          writer = new DefaultSaxWriter(outputStream, encoding);
          break;
      }
  } catch (UnsupportedEncodingException uee) {
      throw Util.newError(uee, MSG_ENCODING_ERROR + encoding);
  }
}
 
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:17,代码来源:DefaultXmlaResponse.java

示例12: load

import mondrian.olap.MondrianException; //导入依赖的package包/类
/**
 * Loads data for all the segments of the GroupingSets. If the grouping sets
 * list contains more than one Grouping Set then data is loaded using the
 * GROUP BY GROUPING SETS sql. Else if only one grouping set is passed in
 * the list data is loaded without using GROUP BY GROUPING SETS sql. If the
 * database does not support grouping sets
 * {@link mondrian.spi.Dialect#supportsGroupingSets()} then
 * grouping sets list should always have only one element in it.
 *
 * <p>For example, if list has 2 grouping sets with columns A, B, C and B, C
 * respectively, then the SQL will be
 * "GROUP BY GROUPING SETS ((A, B, C), (B, C))".
 *
 * <p>Else if the list has only one grouping set then sql would be without
 * grouping sets.
 *
 * <p>The <code>groupingSets</code> list should be topological order, with
 * more detailed higher-level grouping sets occurring first. In other words,
 * the first element of the list should always be the detailed grouping
 * set (default grouping set), followed by grouping sets which can be
 * rolled-up on this detailed grouping set.
 * In the example (A, B, C) is the detailed grouping set and (B, C) is
 * rolled-up using the detailed.
 *
 * <p>Grouping sets are removed from the {@code groupingSets} list as they
 * are loaded.</p>
 *
 * @param cellRequestCount Number of missed cells that led to this request
 * @param groupingSets   List of grouping sets whose segments are loaded
 * @param compoundPredicateList Compound predicates
 * @param segmentFutures List of futures wherein each statement will place
 *                       a list of the segments it has loaded, when it
 *                       completes
 */
public void load(
    int cellRequestCount,
    List<GroupingSet> groupingSets,
    List<StarPredicate> compoundPredicateList,
    List<Future<Map<Segment, SegmentWithData>>> segmentFutures)
{
    if (!MondrianProperties.instance().DisableCaching.get()) {
        for (GroupingSet groupingSet : groupingSets) {
            for (Segment segment : groupingSet.getSegments()) {
                final SegmentCacheIndex index =
                    cacheMgr.getIndexRegistry().getIndex(segment.star);
                index.add(
                    segment.getHeader(),
                    new SegmentBuilder.StarSegmentConverter(
                        segment.measure,
                        compoundPredicateList),
                    true);
                // Make sure that we are registered as a client of
                // the segment by invoking getFuture.
                Util.discard(
                    index.getFuture(
                        Locus.peek().execution,
                        segment.getHeader()));
            }
        }
    }
    try {
        segmentFutures.add(
            cacheMgr.sqlExecutor.submit(
                new SegmentLoadCommand(
                    Locus.peek(),
                    this,
                    cellRequestCount,
                    groupingSets,
                    compoundPredicateList)));
    } catch (Exception e) {
        throw new MondrianException(e);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:74,代码来源:SegmentLoader.java

示例13: getResultShepherd

import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
public RolapResultShepherd getResultShepherd() {
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    return this.shepherd;
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:8,代码来源:MondrianServerImpl.java

示例14: getConnection

import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
public OlapConnection getConnection(
    String databaseName,
    String catalogName,
    String roleName)
    throws SQLException
{
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    return this.getConnection(
        databaseName, catalogName, roleName,
        new Properties());
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:15,代码来源:MondrianServerImpl.java

示例15: getCatalogNames

import mondrian.olap.MondrianException; //导入依赖的package包/类
public List<String> getCatalogNames(
    RolapConnection connection)
{
    if (shutdown) {
        throw new MondrianException("Server already shutdown.");
    }
    return
        repository.getCatalogNames(
            connection,
            // We assume that Mondrian supports a single database
            // per server.
            repository.getDatabaseNames(connection).get(0));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:14,代码来源:MondrianServerImpl.java


注:本文中的mondrian.olap.MondrianException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。