Search in sources :

Example 6 with RolapConnection

use of mondrian.rolap.RolapConnection in project mondrian by pentaho.

the class MondrianOlap4jMember method getChildMembers.

public NamedList<MondrianOlap4jMember> getChildMembers() throws OlapException {
    final RolapConnection conn = olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData.olap4jConnection.getMondrianConnection();
    final List<mondrian.olap.Member> children = Locus.execute(conn, "MondrianOlap4jMember.getChildMembers", new Locus.Action<List<mondrian.olap.Member>>() {

        public List<mondrian.olap.Member> execute() {
            return conn.getSchemaReader().getMemberChildren(member);
        }
    });
    return new AbstractNamedList<MondrianOlap4jMember>() {

        public String getName(Object member) {
            return ((MondrianOlap4jMember) member).getName();
        }

        public MondrianOlap4jMember get(int index) {
            return new MondrianOlap4jMember(olap4jSchema, children.get(index));
        }

        public int size() {
            return children.size();
        }
    };
}
Also used : RolapConnection(mondrian.rolap.RolapConnection) List(java.util.List) AbstractNamedList(org.olap4j.impl.AbstractNamedList) ArrayList(java.util.ArrayList) Locus(mondrian.server.Locus) AbstractNamedList(org.olap4j.impl.AbstractNamedList)

Example 7 with RolapConnection

use of mondrian.rolap.RolapConnection in project mondrian by pentaho.

the class Execution method fireExecutionStartEvent.

private void fireExecutionStartEvent() {
    final RolapConnection connection = statement.getMondrianConnection();
    final MondrianServer server = connection.getServer();
    server.getMonitor().sendEvent(new ExecutionStartEvent(startTimeMillis, server.getId(), connection.getId(), statement.getId(), id, getMdx()));
}
Also used : RolapConnection(mondrian.rolap.RolapConnection)

Example 8 with RolapConnection

use of mondrian.rolap.RolapConnection in project mondrian by pentaho.

the class Execution method tracePhase.

public void tracePhase(int hitCount, int missCount, int pendingCount) {
    final RolapConnection connection = statement.getMondrianConnection();
    final MondrianServer server = connection.getServer();
    final int hitCountInc = hitCount - this.cellCacheHitCount;
    final int missCountInc = missCount - this.cellCacheMissCount;
    final int pendingCountInc = pendingCount - this.cellCachePendingCount;
    server.getMonitor().sendEvent(new ExecutionPhaseEvent(System.currentTimeMillis(), server.getId(), connection.getId(), statement.getId(), id, phase, hitCountInc, missCountInc, pendingCountInc));
    ++phase;
    this.cellCacheHitCount = hitCount;
    this.cellCacheMissCount = missCount;
    this.cellCachePendingCount = pendingCount;
}
Also used : RolapConnection(mondrian.rolap.RolapConnection)

Example 9 with RolapConnection

use of mondrian.rolap.RolapConnection in project mondrian by pentaho.

the class MondrianServerImpl method addStatement.

@Override
public synchronized 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()));
}
Also used : RolapConnection(mondrian.rolap.RolapConnection) MondrianException(mondrian.olap.MondrianException)

Example 10 with RolapConnection

use of mondrian.rolap.RolapConnection in project mondrian by pentaho.

the class MondrianServerImpl method removeStatement.

@Override
public synchronized 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()));
}
Also used : RolapConnection(mondrian.rolap.RolapConnection) MondrianException(mondrian.olap.MondrianException)

Aggregations

RolapConnection (mondrian.rolap.RolapConnection)19 Locus (mondrian.server.Locus)4 Connection (java.sql.Connection)3 SQLException (java.sql.SQLException)3 DataSource (javax.sql.DataSource)3 ArrayList (java.util.ArrayList)2 MondrianException (mondrian.olap.MondrianException)2 Util (mondrian.olap.Util)2 RolapCube (mondrian.rolap.RolapCube)2 RolapSchema (mondrian.rolap.RolapSchema)2 Logger (org.apache.logging.log4j.Logger)2 Appender (org.apache.logging.log4j.core.Appender)2 OlapConnection (org.olap4j.OlapConnection)2 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 DatabaseMetaData (java.sql.DatabaseMetaData)1 ResultSet (java.sql.ResultSet)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1