Package mondrian.rolap

Examples of mondrian.rolap.RolapConnection


            }
        };
    }

    public int getChildMemberCount() throws OlapException {
        final RolapConnection conn =
            olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData
                .olap4jConnection.getMondrianConnection();
        return
            Locus.execute(
                conn,
                "MondrianOlap4jMember.getChildMemberCount",
                new Locus.Action<Integer>() {
                    public Integer execute() {
                        return
                            conn.getSchemaReader()
                                .getMemberChildren(member).size();
                    }
                });
    }
View Full Code Here


    public MondrianOlap4jMember getParentMember() {
        final mondrian.olap.Member parentMember = member.getParentMember();
        if (parentMember == null) {
            return null;
        }
        final RolapConnection conn =
            olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData
                .olap4jConnection.getMondrianConnection2();
        final boolean isVisible =
            Locus.execute(
                conn,
                "MondrianOlap4jMember.getParentMember",
                new Locus.Action<Boolean>() {
                    public Boolean execute() {
                        return
                            conn.getSchemaReader()
                                .isVisible(parentMember);
                    }
                });
        if (!isVisible) {
            return null;
View Full Code Here

    protected Pair<Query, MondrianOlap4jCellSetMetaData>
    parseQuery(final String mdx)
        throws OlapException
    {
        try {
            final RolapConnection mondrianConnection = getMondrianConnection();
            return Locus.execute(
                mondrianConnection,
                "Parsing query",
                new Locus.Action<Pair<Query, MondrianOlap4jCellSetMetaData>>() {
                    public Pair<Query, MondrianOlap4jCellSetMetaData> execute()
                    {
                        final Query query =
                            (Query) mondrianConnection.parseStatement(
                                MondrianOlap4jStatement.this,
                                mdx,
                                null,
                                false);
                        final MondrianOlap4jCellSetMetaData cellSetMetaData =
View Full Code Here

        propSaver.set(props.AggregateRules, "DefaultRules.xml");
        propSaver.set(props.UseAggregates, true);
        propSaver.set(props.ReadAggregates, true);
        propSaver.set(props.GenerateAggregateSql, true);

        final RolapConnection rolapConn = (RolapConnection) getConnection();
        Query query =
            rolapConn.parseQuery(
                "select {[Measures].[Count]} on columns from [HR]");
        rolapConn.execute(query);

        logger.removeAppender(myAppender);

        final DataSource dataSource = rolapConn.getDataSource();
        Connection sqlConnection = null;
        try {
            sqlConnection = dataSource.getConnection();
            DatabaseMetaData dbmeta = sqlConnection.getMetaData();
            JdbcSchema jdbcSchema = JdbcSchema.makeDB(dataSource);
View Full Code Here

    }

    public List<Member> getMembers() throws OlapException {
        final MondrianOlap4jConnection olap4jConnection =
            olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData.olap4jConnection;
        final RolapConnection mondrianConnection =
            olap4jConnection.getMondrianConnection();
        return Locus.execute(
            mondrianConnection,
            "Reading members of level",
            new Locus.Action<List<Member>>() {
                public List<Member> execute() {
                    final mondrian.olap.SchemaReader schemaReader =
                        mondrianConnection.getSchemaReader().withLocus();
                    final List<mondrian.olap.Member> levelMembers =
                        schemaReader.getLevelMembers(level, true);
                    return new AbstractList<Member>() {
                        public Member get(int index) {
                            return olap4jConnection.toOlap4j(
View Full Code Here

    private void assertQueryIsReWritten(
        TestContext testContext,
        final String query,
        final String expectedQuery)
    {
        final RolapConnection connection =
            (RolapConnection) testContext.getConnection();
        String actualOutput =
            Locus.execute(
                connection,
                NativizeSetFunDefTest.class.getName(),
                new Locus.Action<String>() {
                    public String execute() {
                        return connection.parseQuery(query).toString();
                    }
                }
            );
        if (!Util.nl.equals("\n")) {
            actualOutput = actualOutput.replace(Util.nl, "\n");
View Full Code Here

                + ", 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()));
    }
View Full Code Here

        }
        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()));
    }
View Full Code Here

    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,
View Full Code Here

            }
        }
    }

    private void fireExecutionEndEvent() {
        final RolapConnection connection =
            statement.getMondrianConnection();
        final MondrianServer server = connection.getServer();
        server.getMonitor().sendEvent(
            new ExecutionEndEvent(
                this.startTimeMillis,
                server.getId(),
                connection.getId(),
                this.statement.getId(),
                this.id,
                this.phase,
                this.state,
                this.cellCacheHitCount,
View Full Code Here

TOP

Related Classes of mondrian.rolap.RolapConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.