本文整理汇总了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();
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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);
}
}
示例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);
}
}
示例13: getResultShepherd
import mondrian.olap.MondrianException; //导入依赖的package包/类
@Override
public RolapResultShepherd getResultShepherd() {
if (shutdown) {
throw new MondrianException("Server already shutdown.");
}
return this.shepherd;
}
示例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());
}
示例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));
}