diff --git a/log4j.properties b/log4j.properties index b585469bf1..ccea3715f6 100644 --- a/log4j.properties +++ b/log4j.properties @@ -25,11 +25,6 @@ log4j.logger.edu.brown.hstore.conf=INFO log4j.logger.edu.brown.catalog=INFO log4j.logger.edu.brown.utils=INFO -log4j.logger.edu.brown.markov=INFO -log4j.logger.edu.brown.hstore.estimators=INFO -log4j.logger.edu.brown.hstore.estimators.markov=INFO -log4j.logger.edu.brown.hstore.specexec=INFO - ## VoltDB Stuff log4j.logger.org.voltdb.VoltProcedure=INFO log4j.logger.org.voltdb.client=INFO @@ -39,8 +34,9 @@ log4j.logger.org.voltdb.sysprocs.LoadMultipartitionTable=INFO log4j.logger.org.voltdb.sysprocs=INFO ## Research Projects -log4j.logger.edu.brown.catalog.FixCatalog=INFO -log4j.logger.edu.brown.catalog.special.VerticalPartitionColumn=INFO +log4j.logger.edu.brown.hstore.estimators=INFO +log4j.logger.edu.brown.hstore.estimators.markov=INFO +log4j.logger.edu.brown.hstore.specexec=INFO log4j.logger.edu.brown.statistics=INFO log4j.logger.edu.brown.markov=INFO log4j.logger.edu.brown.costmodel=INFO diff --git a/src/frontend/edu/brown/hstore/estimators/markov/MarkovPathEstimator.java b/src/frontend/edu/brown/hstore/estimators/markov/MarkovPathEstimator.java index 0662796feb..a89027216a 100644 --- a/src/frontend/edu/brown/hstore/estimators/markov/MarkovPathEstimator.java +++ b/src/frontend/edu/brown/hstore/estimators/markov/MarkovPathEstimator.java @@ -239,7 +239,6 @@ protected void populate_children(Children children, MarkovVertex e Collection next_vertices = markov.getSuccessors(element); if (next_vertices == null || next_vertices.isEmpty()) { if (t) LOG.trace("No succesors were found for " + element + ". Halting traversal"); - this.stop(); return; } if (t) LOG.trace("Successors: " + next_vertices); @@ -500,6 +499,7 @@ else if (t) { @Override protected void callback(MarkovVertex v) { + this.estimate.path.add(v); if (v.isQueryVertex() == false) { if (v.isCommitVertex()) { if (t) LOG.trace("Reached COMMIT. Stopping..."); @@ -509,7 +509,6 @@ protected void callback(MarkovVertex v) { this.stop(); } } - this.estimate.path.add(v); } diff --git a/tests/frontend/edu/brown/hstore/estimators/markov/TestMarkovPathEstimator.java b/tests/frontend/edu/brown/hstore/estimators/markov/TestMarkovPathEstimator.java index 4aa1f58d37..a6fb5003d9 100644 --- a/tests/frontend/edu/brown/hstore/estimators/markov/TestMarkovPathEstimator.java +++ b/tests/frontend/edu/brown/hstore/estimators/markov/TestMarkovPathEstimator.java @@ -2,9 +2,7 @@ import java.io.File; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; import org.voltdb.VoltProcedure; import org.voltdb.benchmark.tpcc.procedures.neworder; @@ -14,8 +12,6 @@ import edu.brown.BaseTestCase; import edu.brown.catalog.CatalogUtil; -import edu.brown.hstore.estimators.markov.MarkovEstimate; -import edu.brown.hstore.estimators.markov.MarkovPathEstimator; import edu.brown.mappings.ParameterMappingsSet; import edu.brown.markov.MarkovGraph; import edu.brown.markov.MarkovVertex; @@ -23,8 +19,8 @@ import edu.brown.markov.containers.MarkovGraphsContainer; import edu.brown.utils.CollectionUtil; import edu.brown.utils.MathUtil; +import edu.brown.utils.PartitionSet; import edu.brown.utils.ProjectType; -import edu.brown.utils.StringUtil; import edu.brown.workload.TransactionTrace; import edu.brown.workload.Workload; import edu.brown.workload.filters.BasePartitionTxnFilter; @@ -45,10 +41,10 @@ public class TestMarkovPathEstimator extends BaseTestCase { private static Workload workload; private static MarkovGraphsContainer markovs; - private static ParameterMappingsSet correlations; + private static ParameterMappingsSet mappings; private static TransactionTrace singlep_trace; private static TransactionTrace multip_trace; - private static final Set multip_partitions = new HashSet(); + private static final PartitionSet multip_partitions = new PartitionSet(); private static final List multip_path = new ArrayList(); private MarkovPathEstimator pathEstimator; @@ -63,8 +59,8 @@ public void setUp() throws Exception { if (markovs == null) { File file = this.getParameterMappingsFile(ProjectType.TPCC); - correlations = new ParameterMappingsSet(); - correlations.load(file, catalog_db); + mappings = new ParameterMappingsSet(); + mappings.load(file, catalog_db); // Workload Filter: // (1) Only include TARGET_PROCEDURE traces @@ -150,13 +146,13 @@ public void testMarkovEstimate() throws Exception { pathEstimator.traverse(this.graph.getStartVertex()); List visitPath = pathEstimator.getVisitPath(); - System.err.println(StringUtil.columns(StringUtil.join("\n", visitPath), this.estimate.toString())); +// System.err.println(StringUtil.columns(StringUtil.join("\n", visitPath), this.estimate.toString())); assertFalse(singlep_trace.isAborted()); assertFalse(visitPath.contains(this.graph.getAbortVertex())); // System.err.println(singlep_trace.debug(catalog_db)); - System.err.println("Base Partition = " + p_estimator.getBasePartition(singlep_trace)); +// System.err.println("Base Partition = " + p_estimator.getBasePartition(singlep_trace)); // for (QueryTrace qtrace : singlep_trace.getQueries()) { // System.err.println(qtrace.debug(catalog_db) + " => " + p_estimator.getAllPartitions(qtrace, BASE_PARTITION)); // } @@ -191,18 +187,20 @@ public void testSinglePartition() throws Exception { MarkovVertex commit = this.graph.getCommitVertex(); MarkovVertex abort = this.graph.getAbortVertex(); -// MarkovPathEstimator.LOG.setLevel(Level.DEBUG); pathEstimator.init(this.graph, this.estimate, BASE_PARTITION, singlep_trace.getParams()); pathEstimator.setForceTraversal(true); pathEstimator.traverse(this.graph.getStartVertex()); - ArrayList path = new ArrayList(pathEstimator.getVisitPath()); assertTrue(estimate.isConfidenceCoefficientSet()); float confidence = this.estimate.getConfidenceCoefficient(); // System.err.println("INITIAL PATH:\n" + StringUtil.join("\n", path)); // System.err.println("CONFIDENCE: " + confidence); // System.err.println("DUMPED FILE: " + MarkovUtil.exportGraphviz(this.graph, false, this.graph.getPath(path)).writeToTempFile()); - +// System.err.println(singlep_trace.debug(catalog_db)); +// System.err.println(StringUtil.columns(StringUtil.join("\n", path), this.estimate.toString())); + + ArrayList path = new ArrayList(this.estimate.getMarkovPath()); + assertEquals(path, new ArrayList(pathEstimator.getVisitPath())); assertEquals(start, CollectionUtil.first(path)); assertEquals(commit, CollectionUtil.last(path)); assertFalse(path.contains(abort)); @@ -214,8 +212,6 @@ public void testSinglePartition() throws Exception { assertEquals(1, v.getPartitions().size()); assert(v.getPartitions().contains(BASE_PARTITION)); } // FOR -// MarkovPathEstimator.LOG.setLevel(Level.INFO); - // GraphvizExport gv = MarkovUtil.exportGraphviz(this.graph, true, this.graph.getPath(path)); // FileUtil.writeStringToFile("/tmp/dump.dot", gv.export(this.graph.getProcedure().getName())); } @@ -233,16 +229,21 @@ public void testMultiPartition() throws Exception { pathEstimator.init(this.graph, this.estimate, BASE_PARTITION, multip_trace.getParams()); pathEstimator.setForceTraversal(true); pathEstimator.traverse(this.graph.getStartVertex()); - ArrayList path = new ArrayList(pathEstimator.getVisitPath()); -// System.err.println("INITIAL PATH:\n" + StringUtil.join("\n", path)); +// System.err.println("INITIAL PATH:\n" + StringUtil.join("\n", path)); +// System.err.println("CONFIDENCE: " + confidence); +// System.err.println("DUMPED FILE: " + MarkovUtil.exportGraphviz(this.graph, false, this.graph.getPath(path)).writeToTempFile()); +// System.err.println(multip_trace.debug(catalog_db)); +// System.err.println(StringUtil.columns(StringUtil.join("\n", path), this.estimate.toString())); + ArrayList path = new ArrayList(this.estimate.getMarkovPath()); + assertEquals(path, new ArrayList(pathEstimator.getVisitPath())); assertEquals(start, CollectionUtil.first(path)); assertEquals(commit, CollectionUtil.last(path)); assertFalse(path.contains(abort)); // All of the vertices should only have the base partition in their partition set - Set touched_partitions = new HashSet(); + PartitionSet touched_partitions = new PartitionSet(); for (MarkovVertex v : path) { touched_partitions.addAll(v.getPartitions()); } // FOR @@ -252,6 +253,6 @@ public void testMultiPartition() throws Exception { // this.writeGraphviz(multip_path); // this.writeGraphviz(path); -// assertEquals(multip_partitions, touched_partitions); + assertEquals(multip_partitions, touched_partitions); } }