diff --git a/features/com.minres.scviewer.database.feature/pom.xml b/features/com.minres.scviewer.database.feature/pom.xml
index 3fff455..5b88e3b 100644
--- a/features/com.minres.scviewer.database.feature/pom.xml
+++ b/features/com.minres.scviewer.database.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
3.0.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.e4.feature/pom.xml b/features/com.minres.scviewer.e4.feature/pom.xml
index da946ac..c574dac 100644
--- a/features/com.minres.scviewer.e4.feature/pom.xml
+++ b/features/com.minres.scviewer.e4.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
1.1.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.e4.platform.feature/pom.xml b/features/com.minres.scviewer.e4.platform.feature/pom.xml
index cb6e536..fd4d313 100644
--- a/features/com.minres.scviewer.e4.platform.feature/pom.xml
+++ b/features/com.minres.scviewer.e4.platform.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
1.0.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.feature/pom.xml b/features/com.minres.scviewer.feature/pom.xml
index 08cc401..8a5f5f7 100644
--- a/features/com.minres.scviewer.feature/pom.xml
+++ b/features/com.minres.scviewer.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
1.1.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.ui.feature/pom.xml b/features/com.minres.scviewer.ui.feature/pom.xml
index a15b693..a494169 100644
--- a/features/com.minres.scviewer.ui.feature/pom.xml
+++ b/features/com.minres.scviewer.ui.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
1.1.0-SNAPSHOT
diff --git a/plugins/com.minres.scviewer.database.sqlite/pom.xml b/plugins/com.minres.scviewer.database.sqlite/pom.xml
index 89b5c92..051a506 100644
--- a/plugins/com.minres.scviewer.database.sqlite/pom.xml
+++ b/plugins/com.minres.scviewer.database.sqlite/pom.xml
@@ -4,7 +4,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database.text/pom.xml b/plugins/com.minres.scviewer.database.text/pom.xml
index 97abe67..51da48c 100644
--- a/plugins/com.minres.scviewer.database.text/pom.xml
+++ b/plugins/com.minres.scviewer.database.text/pom.xml
@@ -6,7 +6,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
index f84577c..63621df 100644
--- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
+++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
@@ -34,8 +34,10 @@ import java.util.zip.GZIPInputStream;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.mapdb.DB;
+import org.mapdb.DB.HashMapMaker;
import org.mapdb.DB.TreeMapSink;
import org.mapdb.DBMaker;
+import org.mapdb.HTreeMap;
import org.mapdb.Serializer;
import com.google.common.collect.HashMultimap;
@@ -55,6 +57,13 @@ import com.minres.scviewer.database.tx.ITx;
*/
public class TextDbLoader implements IWaveformDbLoader {
+ /** the file size limit of a zipped txlog where the loader starts to use a file mapped database */
+ private static final long MEMMAP_LIMIT=256l*1024l*1024l;
+
+ private static final long MAPDB_INITIAL_ALLOC = 512l*1024l*1024l;
+
+ private static final long MAPDB_INCREMENTAL_ALLOC = 128l*1024l*1024l;
+
/** The max time. */
private Long maxTime = 0L;
@@ -76,8 +85,6 @@ public class TextDbLoader implements IWaveformDbLoader {
/** The transactions. */
Map transactions = null;
- Map id2index = new HashMap<>();
-
/** The attribute types. */
final Map attributeTypes = UnifiedMap.newMap();
@@ -110,7 +117,7 @@ public class TextDbLoader implements IWaveformDbLoader {
}
public ScvTx getScvTx(long id) {
- return transactions.get(id2index.get(id));
+ return transactions.get(id);
}
/**
@@ -162,10 +169,9 @@ public class TextDbLoader implements IWaveformDbLoader {
public void load(IWaveformDb db, File file) throws InputFormatException {
dispose();
boolean gzipped = isGzipped(file);
- if (file.length() < 75000000 * (gzipped ? 1 : 10)
+ if (file.length() < MEMMAP_LIMIT * (gzipped ? 1 : 10)
|| "memory".equals(System.getProperty("ScvBackingDB", "file")))
- mapDb = DBMaker.memoryDirectDB().allocateStartSize(512l * 1024l * 1024l)
- .allocateIncrement(128l * 1024l * 1024l).cleanerHackEnable().make();
+ mapDb = DBMaker.memoryDirectDB().make();
else {
File mapDbFile;
try {
@@ -175,15 +181,18 @@ public class TextDbLoader implements IWaveformDbLoader {
throw new InputFormatException(e.toString());
}
mapDb = DBMaker.fileDB(mapDbFile).fileMmapEnable() // Always enable mmap
- .fileMmapEnableIfSupported().fileMmapPreclearDisable().allocateStartSize(512l * 1024l * 1024l)
- .allocateIncrement(128l * 1024l * 1024l).cleanerHackEnable().make();
+ .fileMmapPreclearDisable().allocateStartSize(MAPDB_INITIAL_ALLOC)
+ .allocateIncrement(MAPDB_INCREMENTAL_ALLOC).cleanerHackEnable().make();
mapDbFile.deleteOnExit();
}
TextDbParser parser = new TextDbParser(this);
try {
- parser.txSink = mapDb.treeMap("transactions", Serializer.LONG, Serializer.JAVA).createFromSink();
+
+// parser.txSink = mapDb.treeMap("transactions", Serializer.LONG, Serializer.JAVA).createFromSink();
+ parser.txSink = mapDb.hashMap("transactions", Serializer.LONG, Serializer.JAVA).create();
parser.parseInput(gzipped ? new GZIPInputStream(new FileInputStream(file)) : new FileInputStream(file));
- transactions = parser.txSink.create();
+// transactions = parser.txSink.create();
+ transactions = parser.txSink;
} catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
} catch (Exception e) {
throw new InputFormatException(e.toString());
@@ -275,7 +284,7 @@ public class TextDbLoader implements IWaveformDbLoader {
HashMap transactionById = new HashMap<>();
/** The tx sink. */
- TreeMapSink txSink;
+ HTreeMap txSink;
/** The reader. */
BufferedReader reader = null;
@@ -286,7 +295,6 @@ public class TextDbLoader implements IWaveformDbLoader {
/** The attr value lut. */
Map attrValueLut = new HashMap<>();
- long indexCount = 0;
/**
* Instantiates a new text db parser.
*
@@ -348,10 +356,9 @@ public class TextDbLoader implements IWaveformDbLoader {
String[] tokens = curLine.split("\\s+");
if ("tx_record_attribute".equals(tokens[0])) {
Long id = Long.parseLong(tokens[1]);
- String name = tokens[2].substring(1, tokens[2].length());
+ String name = tokens[2].substring(1, tokens[2].length()-1);
DataType type = DataType.valueOf(tokens[3]);
- String remaining = tokens.length > 5 ? String.join(" ", Arrays.copyOfRange(tokens, 5, tokens.length))
- : "";
+ String remaining = tokens.length > 5 ? String.join(" ", Arrays.copyOfRange(tokens, 5, tokens.length)) : "";
TxAttributeType attrType = getAttrType(name, type, AssociationType.RECORD);
transactionById.get(id).attributes.add(new TxAttribute(attrType, getAttrString(attrType, remaining)));
} else if ("tx_begin".equals(tokens[0])) {
@@ -407,8 +414,7 @@ public class TextDbLoader implements IWaveformDbLoader {
nextLine = reader.readLine();
}
}
- txSink.put(indexCount, scvTx);
- loader.id2index.put(scvTx.getId(), indexCount++);
+ txSink.put(scvTx.getId(), scvTx);
transactionById.remove(id);
} else if ("tx_relation".equals(tokens[0])) {
Long tr2 = Long.parseLong(tokens[2]);
diff --git a/plugins/com.minres.scviewer.database.ui.swt/pom.xml b/plugins/com.minres.scviewer.database.ui.swt/pom.xml
index 13e0266..33b5eed 100644
--- a/plugins/com.minres.scviewer.database.ui.swt/pom.xml
+++ b/plugins/com.minres.scviewer.database.ui.swt/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
3.0.0-SNAPSHOT
diff --git a/plugins/com.minres.scviewer.database.vcd/pom.xml b/plugins/com.minres.scviewer.database.vcd/pom.xml
index 0643716..1a27b50 100644
--- a/plugins/com.minres.scviewer.database.vcd/pom.xml
+++ b/plugins/com.minres.scviewer.database.vcd/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database/pom.xml b/plugins/com.minres.scviewer.database/pom.xml
index b07f716..10bea0e 100644
--- a/plugins/com.minres.scviewer.database/pom.xml
+++ b/plugins/com.minres.scviewer.database/pom.xml
@@ -4,7 +4,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
index e9e48d3..0459005 100644
--- a/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
+++ b/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
-Bundle-Version: 2.11.1.qualifier
+Bundle-Version: 2.11.2.qualifier
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1",
diff --git a/plugins/com.minres.scviewer.e4.application/pom.xml b/plugins/com.minres.scviewer.e4.application/pom.xml
index 0c52590..abc9a75 100644
--- a/plugins/com.minres.scviewer.e4.application/pom.xml
+++ b/plugins/com.minres.scviewer.e4.application/pom.xml
@@ -3,11 +3,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.minres.scviewer.e4.application
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.ui/.classpath b/plugins/com.minres.scviewer.ui/.classpath
index 1619e35..cf36b56 100644
--- a/plugins/com.minres.scviewer.ui/.classpath
+++ b/plugins/com.minres.scviewer.ui/.classpath
@@ -3,6 +3,5 @@
-
diff --git a/plugins/com.minres.scviewer.ui/.project b/plugins/com.minres.scviewer.ui/.project
index b604161..32fa8d0 100644
--- a/plugins/com.minres.scviewer.ui/.project
+++ b/plugins/com.minres.scviewer.ui/.project
@@ -33,7 +33,6 @@
org.eclipse.m2e.core.maven2Nature
- org.eclipse.jdt.groovy.core.groovyNature
org.eclipse.pde.PluginNature
org.eclipse.jdt.core.javanature
diff --git a/plugins/com.minres.scviewer.ui/pom.xml b/plugins/com.minres.scviewer.ui/pom.xml
index bd37d24..c7a4b35 100644
--- a/plugins/com.minres.scviewer.ui/pom.xml
+++ b/plugins/com.minres.scviewer.ui/pom.xml
@@ -4,7 +4,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-plugin
diff --git a/pom.xml b/pom.xml
index 452ed5c..b1885bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
releng/com.minres.scviewer.target
@@ -55,7 +55,7 @@
com.minres.scviewer
com.minres.scviewer.target
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
diff --git a/products/com.minres.scviewer.e4.product/pom.xml b/products/com.minres.scviewer.e4.product/pom.xml
index d4d8e1d..c7563cc 100644
--- a/products/com.minres.scviewer.e4.product/pom.xml
+++ b/products/com.minres.scviewer.e4.product/pom.xml
@@ -6,11 +6,11 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
com.minres.scviewer.e4.product
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
eclipse-repository
com.minres.scviewer
diff --git a/products/com.minres.scviewer.e4.product/scviewer.product b/products/com.minres.scviewer.e4.product/scviewer.product
index 5f64c15..5f00e43 100644
--- a/products/com.minres.scviewer.e4.product/scviewer.product
+++ b/products/com.minres.scviewer.e4.product/scviewer.product
@@ -1,7 +1,7 @@
-
+
@@ -9,7 +9,7 @@
-clearPersistedState
- -Xmx2G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer
+ -Xmx1G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer
-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
diff --git a/releng/com.minres.scviewer.target/pom.xml b/releng/com.minres.scviewer.target/pom.xml
index 13bece7..97968fd 100644
--- a/releng/com.minres.scviewer.target/pom.xml
+++ b/releng/com.minres.scviewer.target/pom.xml
@@ -12,7 +12,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
diff --git a/releng/com.minres.scviewer.updateSite/pom.xml b/releng/com.minres.scviewer.updateSite/pom.xml
index d20e819..dc470fa 100644
--- a/releng/com.minres.scviewer.updateSite/pom.xml
+++ b/releng/com.minres.scviewer.updateSite/pom.xml
@@ -3,12 +3,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.minres.scviewer.updateSite
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
eclipse-repository
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
diff --git a/tests/com.minres.scviewer.database.test/pom.xml b/tests/com.minres.scviewer.database.test/pom.xml
index 50c2977..be980a5 100644
--- a/tests/com.minres.scviewer.database.test/pom.xml
+++ b/tests/com.minres.scviewer.database.test/pom.xml
@@ -6,7 +6,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.11.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
../..
eclipse-test-plugin