summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhu2011-08-24 20:24:06 (EDT)
committer xgu2011-08-31 02:00:52 (EDT)
commita6cce35e6bedf7e46182508775c0460bb29d335f (patch)
tree01047f10b8db806037a15c2300fbde89cfb5da02
parente37e4094bdbdf2ed328d10076b56b90a24a115f1 (diff)
downloadorg.eclipse.birt-a6cce35e6bedf7e46182508775c0460bb29d335f.zip
org.eclipse.birt-a6cce35e6bedf7e46182508775c0460bb29d335f.tar.gz
org.eclipse.birt-a6cce35e6bedf7e46182508775c0460bb29d335f.tar.bz2
CheckIN:Fix TED 39424 Enhance Level Member ACL performance.
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/api/CubeQueryExecutorHelper.java35
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/facttable/FactTableRowIterator.java2
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryResults.java4
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/PreparedCubeQuery.java8
4 files changed, 41 insertions, 8 deletions
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/api/CubeQueryExecutorHelper.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/api/CubeQueryExecutorHelper.java
index 26def44..85b043c 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/api/CubeQueryExecutorHelper.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/api/CubeQueryExecutorHelper.java
@@ -28,9 +28,11 @@ import org.eclipse.birt.core.archive.FileArchiveWriter;
import org.eclipse.birt.core.archive.IDocArchiveReader;
import org.eclipse.birt.core.archive.IDocArchiveWriter;
import org.eclipse.birt.core.exception.BirtException;
+import org.eclipse.birt.data.engine.api.IShutdownListener;
import org.eclipse.birt.data.engine.cache.Constants;
import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.data.engine.i18n.ResourceConstants;
+import org.eclipse.birt.data.engine.impl.DataEngineSession;
import org.eclipse.birt.data.engine.impl.StopSign;
import org.eclipse.birt.data.engine.impl.document.stream.VersionManager;
import org.eclipse.birt.data.engine.olap.data.api.cube.ICube;
@@ -156,17 +158,46 @@ public class CubeQueryExecutorHelper implements ICubeQueryExcutorHelper
* @throws IOException
*/
public static ICube loadCube( String cubeName,
+ IDocumentManager documentManager, DataEngineSession session ) throws IOException, DataException
+ {
+ if ( documentManager == null )
+ {
+ throw new DataException( ResourceConstants.FAIL_LOAD_CUBE, cubeName );
+ }
+ final Cube cube = new Cube( cubeName, documentManager );
+ cube.load( session.getStopSign( ) );
+ session.getEngine( ).addShutdownListener( new IShutdownListener(){
+
+ public void dataEngineShutdown( )
+ {
+ try
+ {
+ cube.close( );
+ }
+ catch ( Exception e )
+ {
+ }
+
+ }} );
+ return cube;
+ }
+ /**
+ *
+ * @param cube
+ * @throws BirtException
+ * @throws IOException
+ */
+ public static ICube loadCube( String cubeName,
IDocumentManager documentManager, StopSign stopSign ) throws IOException, DataException
{
if ( documentManager == null )
{
throw new DataException( ResourceConstants.FAIL_LOAD_CUBE, cubeName );
}
- Cube cube = new Cube( cubeName, documentManager );
+ final Cube cube = new Cube( cubeName, documentManager );
cube.load( stopSign );
return cube;
}
-
/**
*
* @param cube
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/facttable/FactTableRowIterator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/facttable/FactTableRowIterator.java
index 8fb2dc8..6c5cb2a 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/facttable/FactTableRowIterator.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/facttable/FactTableRowIterator.java
@@ -323,6 +323,8 @@ public class FactTableRowIterator implements IFactTableRowIterator
throw DataException.wrap( e );
}
}
+ if ( this.currentSegment!= null )
+ this.currentSegment.close( );
}
/**
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryResults.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryResults.java
index 80cf8b7..6b60e41 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryResults.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryResults.java
@@ -275,7 +275,7 @@ public class CubeQueryResults implements ICubeQueryResults
CubeQueryExecutor executor = new CubeQueryExecutor( this.outResults, cubeQueryDefinition, this.session,
this.scope,
this.context );
- executor.getFacttableBasedFilterHelpers( ).addAll( this.preparedQuery.getInternalFilters( ) );
+ executor.getdimensionSimpleFilter( ).addAll( this.preparedQuery.getInternalFilters( ) );
IDocumentManager documentManager = getDocumentManager( executor );
ICube cube = null;
@@ -371,7 +371,7 @@ public class CubeQueryResults implements ICubeQueryResults
cube = CubeQueryExecutorHelper.loadCube( executor.getCubeQueryDefinition( )
.getName( ),
documentManager,
- executor.getSession( ).getStopSign( ) );
+ executor.getSession( ) );
else
cube = CubeQueryExecutorHelper.loadCube( executor.getCubeQueryDefinition( )
.getName( ),
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/PreparedCubeQuery.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/PreparedCubeQuery.java
index 24a68df..ed4fd96 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/PreparedCubeQuery.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/PreparedCubeQuery.java
@@ -28,8 +28,8 @@ import org.eclipse.birt.data.engine.olap.api.ICubeQueryResults;
import org.eclipse.birt.data.engine.olap.api.IPreparedCubeQuery;
import org.eclipse.birt.data.engine.olap.api.query.IBaseCubeQueryDefinition;
import org.eclipse.birt.data.engine.olap.api.query.ICubeQueryDefinition;
+import org.eclipse.birt.data.engine.olap.data.impl.aggregation.filter.SimpleLevelFilter;
import org.eclipse.birt.data.engine.olap.util.OlapQueryUtil;
-import org.eclipse.birt.data.engine.olap.util.filter.IJSFacttableFilterEvalHelper;
import org.mozilla.javascript.Scriptable;
@@ -43,7 +43,7 @@ public class PreparedCubeQuery implements IPreparedCubeQuery
private DataEngineSession session;
private DataEngineContext context;
private Map appContext;
- private List<IJSFacttableFilterEvalHelper> internalFilters;
+ private List<SimpleLevelFilter> internalFilters;
private Map<String, Set<String>> inaccessibleDimLevels;
/**
@@ -57,7 +57,7 @@ public class PreparedCubeQuery implements IPreparedCubeQuery
this.session = session;
this.context = context;
this.appContext = appContext;
- this.internalFilters = new ArrayList<IJSFacttableFilterEvalHelper> ();
+ this.internalFilters = new ArrayList<SimpleLevelFilter> ();
if ( !containsDrillFilter( defn ) )
validateQuery( );
}
@@ -71,7 +71,7 @@ public class PreparedCubeQuery implements IPreparedCubeQuery
return null;
}
- public List<IJSFacttableFilterEvalHelper> getInternalFilters( )
+ public List<SimpleLevelFilter> getInternalFilters( )
{
return this.internalFilters;
}