From: <tho...@us...> - 2010-10-07 20:23:11
|
Revision: 3749 http://bigdata.svn.sourceforge.net/bigdata/?rev=3749&view=rev Author: thompsonbry Date: 2010-10-07 20:23:05 +0000 (Thu, 07 Oct 2010) Log Message: ----------- Trying another code change. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/RunningQuery.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/RunningQuery.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/RunningQuery.java 2010-10-07 20:04:21 UTC (rev 3748) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/RunningQuery.java 2010-10-07 20:23:05 UTC (rev 3749) @@ -366,28 +366,8 @@ runState = new RunState(this); - statsMap = new ConcurrentHashMap<Integer, BOpStats>(); - - for (Map.Entry<Integer, BOp> e : bopIndex.entrySet()) { - - final int bopId = e.getKey(); - - final BOp tmp = e.getValue(); - - if ((tmp instanceof PipelineOp)) { - - final PipelineOp bop = (PipelineOp) tmp; - - statsMap.put(bopId, bop.newStats()); - - } - } + statsMap = createStatsMap(bopIndex); -// final BOpStats queryStats = query.newStats(); -// -// statsMap.put((Integer) query -// .getRequiredProperty(BOp.Annotations.BOP_ID), queryStats); - if (!query.isMutation()) { final BOpStats queryStats = statsMap.get(query.getId()); @@ -417,6 +397,41 @@ } /** + * Pre-populate a map with {@link BOpStats} objects for a query. + * + * @param bopIndex + * A map of the operators in the query which have assigned + * bopIds. + * + * @return A new map with an entry for each operator with a bopId which + * associates that operator with its {@link BOpStats} object. + */ + static private ConcurrentHashMap<Integer, BOpStats> createStatsMap( + final Map<Integer, BOp> bopIndex) { + + ConcurrentHashMap<Integer, BOpStats> statsMap = new ConcurrentHashMap<Integer, BOpStats>(); + + for (Map.Entry<Integer, BOp> e : bopIndex.entrySet()) { + + final int bopId = e.getKey(); + + final BOp tmp = e.getValue(); + + if ((tmp instanceof PipelineOp)) { + + final PipelineOp bop = (PipelineOp) tmp; + + statsMap.put(bopId, bop.newStats()); + + } + + } + + return statsMap; + + } + + /** * Take a chunk generated by some pass over an operator and make it * available to the target operator. How this is done depends on whether the * query is running against a standalone database or the scale-out database. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |