r65820 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65819‎ | r65820 | r65821 >
Date:20:52, 2 May 2010
Author:daniel
Status:deferred
Tags:
Comment:
made term stats optional
Modified paths:
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/BuildStatistics.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseGlobalConceptStoreBuilder.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseStatisticsStoreBuilder.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DebugLocalConceptStoreBuilder.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/StatisticsStoreBuilder.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/BuildStatistics.java
@@ -23,6 +23,7 @@
2424 @Override
2525 protected void declareOptions() {
2626 super.declareOptions();
 27+ args.declare("no-term-stats", null, false, Boolean.class, "skip (slow) term frequency statistics.");
2728 }
2829
2930 //protected WikiWordConceptStoreBuilder<?> conceptStore;
@@ -37,8 +38,13 @@
3839
3940 @Override
4041 protected void run() throws Exception {
41 - section("-- buildstats --------------------------------------------------");
42 - this.statisticsStore.buildStatistics();
 42+ if (!args.isSet("no-term-stats")) {
 43+ section("-- term stats --------------------------------------------------");
 44+ this.statisticsStore.buildTermStatistics();
 45+ }
 46+
 47+ section("-- concept stats --------------------------------------------------");
 48+ this.statisticsStore.buildConceptStatistics();
4349
4450 section("-- statistics --------------------------------------------------");
4551 conceptStore.getConceptStore().getStatisticsStore().dumpStatistics(getLogOutput());
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DebugLocalConceptStoreBuilder.java
@@ -255,10 +255,14 @@
256256 log("* prepareImport *");
257257 }
258258
259 - public void buildStatistics() throws PersistenceException {
260 - log("* buildStatistics *");
 259+ public void buildTermStatistics() throws PersistenceException {
 260+ log("* buildTermStatistics *");
261261 }
262262
 263+ public void buildConceptStatistics() throws PersistenceException {
 264+ log("* buildConceptStatistics *");
 265+ }
 266+
263267 public void clear() throws PersistenceException {
264268 log("* clearStatistics *");
265269 }
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseStatisticsStoreBuilder.java
@@ -55,10 +55,14 @@
5656 }
5757 }
5858
 59+ public void buildTermStatistics() throws PersistenceException {
 60+ //noop
 61+ }
 62+
5963 /**
6064 * Builds the statistics tables. For a specification of their content, refer to StatisticsStoreSchema
6165 */
62 - public void buildStatistics() throws PersistenceException {
 66+ public void buildConceptStatistics() throws PersistenceException {
6367 if (beginTask("buildStatistics", "stats.prepareDegreeTable")) {
6468 int n = prepareDegreeTable();
6569 endTask("buildStatistics", "stats.prepareDegreeTable", n+" entries");
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/StatisticsStoreBuilder.java
@@ -4,7 +4,9 @@
55
66 public interface StatisticsStoreBuilder extends WikiWordStoreBuilder {
77
8 - public void buildStatistics() throws PersistenceException;
 8+ public void buildTermStatistics() throws PersistenceException;
 9+ public void buildConceptStatistics() throws PersistenceException;
 10+
911 public void clear() throws PersistenceException;
1012
1113 }
\ No newline at end of file
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java
@@ -1342,7 +1342,7 @@
13431343 }
13441344
13451345 @Override
1346 - public void buildStatistics() throws PersistenceException {
 1346+ public void buildTermStatistics() throws PersistenceException {
13471347 //TODO: characteristic path length and cluster coef
13481348 //TODO: stats about collocations
13491349
@@ -1355,11 +1355,14 @@
13561356 buildDistributionStats("term zipf", termTable, "rank", "freq");
13571357 endTask("buildStatistics", "stats.termZipf");
13581358 }
1359 -
1360 - super.buildStatistics();
13611359 }
13621360
 1361+ @Override
 1362+ public void buildConceptStatistics() throws PersistenceException {
 1363+ super.buildConceptStatistics();
 1364+ }
13631365
 1366+
13641367 /**
13651368 * Builds term frequency statistics.
13661369 */
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseGlobalConceptStoreBuilder.java
@@ -915,13 +915,12 @@
916916
917917 protected DatabaseGlobalStatisticsStoreBuilder(StatisticsStoreSchema database, TweakSet tweaks, Agenda agenda) throws SQLException {
918918 super(DatabaseGlobalConceptStoreBuilder.this, database, tweaks, agenda);
919 - // TODO Auto-generated constructor stub
920919 }
921920
922921 @Override
923 - public void buildStatistics() throws PersistenceException {
924 - //TODO: node-degree stats, etc!
925 - super.buildStatistics();
 922+ public void buildConceptStatistics() throws PersistenceException {
 923+ //TODO: langlink-stats, etc
 924+ super.buildConceptStatistics();
926925 }
927926
928927 }

Status & tagging log