r57976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57975‎ | r57976 | r57977 >
Date:15:02, 21 October 2009
Author:daniel
Status:deferred
Tags:
Comment:
name map
Modified paths:
  • /trunk/WikiWord/WikiWordBuilder/.classpath (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/NameMaps.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/processor/TitleSetFilter.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/processor/TitleSetFilter.java
@@ -16,7 +16,7 @@
1717 public class TitleSetFilter extends PageTitleFilter {
1818
1919 protected static Set<String> slurpCursor(DataCursor<String> titleCursor) throws PersistenceException {
20 - Map<String, Integer> map = NameMaps.newMap();
 20+ Map<String, Integer> map = NameMaps.newMap("hash");
2121
2222 final Integer ONE = new Integer(1);
2323
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/NameMaps.java
@@ -7,12 +7,14 @@
88 import org.ardverk.collection.StringKeyAnalyzer;
99
1010 public class NameMaps {
11 - public static <V> Map<String, V> newMap() {
12 - try {
13 - PatriciaTrie<String, V> trie = new PatriciaTrie<String, V>(new StringKeyAnalyzer());
14 - return trie;
15 - } catch (LinkageError ex) {
16 - //noop
 11+ public static <V> Map<String, V> newMap(String mapType) {
 12+ if (mapType.equals("patricia")) {
 13+ try {
 14+ PatriciaTrie<String, V> trie = new PatriciaTrie<String, V>(new StringKeyAnalyzer());
 15+ return trie;
 16+ } catch (LinkageError ex) {
 17+ //noop
 18+ }
1719 }
1820
1921 return new HashMap<String, V>();
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java
@@ -173,7 +173,7 @@
174174 log("storing ID mappings in "+f);
175175 int bsz = tweaks.getTweak("dbstore.idManager.bufferSize", 16*1024);
176176
177 - Map<String, Integer> map = NameMaps.newMap();
 177+ Map<String, Integer> map = NameMaps.newMap(tweaks.getTweak("dbstore.idManager.mapType", "hash"));
178178 idManager = new PersistentIdManager(map, f, "UTF-8", bsz);
179179 } catch (SQLException e) {
180180 throw new PersistenceException(e);
Index: trunk/WikiWord/WikiWordBuilder/.classpath
@@ -15,5 +15,6 @@
1616 </attributes>
1717 </classpathentry>
1818 <classpathentry kind="var" path="M2_REPO/org/javolution/javolution/5.2.6/javolution-5.2.6.jar"/>
 19+ <classpathentry kind="lib" path="lib/jzlib-1.0.7.jar" sourcepath="/home/daniel/src/jzlib-1.0.7"/>
1920 <classpathentry kind="output" path="bin"/>
2021 </classpath>

Status & tagging log