Merge branch 'release/2.11.2'

This commit is contained in:
Eyck Jentzsch 2021-01-12 20:25:45 +01:00
commit f27bcd7109
22 changed files with 47 additions and 43 deletions

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>3.0.0-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -34,8 +34,10 @@ import java.util.zip.GZIPInputStream;
import org.eclipse.collections.impl.map.mutable.UnifiedMap; import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.mapdb.DB; import org.mapdb.DB;
import org.mapdb.DB.HashMapMaker;
import org.mapdb.DB.TreeMapSink; import org.mapdb.DB.TreeMapSink;
import org.mapdb.DBMaker; import org.mapdb.DBMaker;
import org.mapdb.HTreeMap;
import org.mapdb.Serializer; import org.mapdb.Serializer;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
@ -55,6 +57,13 @@ import com.minres.scviewer.database.tx.ITx;
*/ */
public class TextDbLoader implements IWaveformDbLoader { 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. */ /** The max time. */
private Long maxTime = 0L; private Long maxTime = 0L;
@ -76,8 +85,6 @@ public class TextDbLoader implements IWaveformDbLoader {
/** The transactions. */ /** The transactions. */
Map<Long, ScvTx> transactions = null; Map<Long, ScvTx> transactions = null;
Map<Long, Long> id2index = new HashMap<>();
/** The attribute types. */ /** The attribute types. */
final Map<String, TxAttributeType> attributeTypes = UnifiedMap.newMap(); final Map<String, TxAttributeType> attributeTypes = UnifiedMap.newMap();
@ -110,7 +117,7 @@ public class TextDbLoader implements IWaveformDbLoader {
} }
public ScvTx getScvTx(long id) { 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 { public void load(IWaveformDb db, File file) throws InputFormatException {
dispose(); dispose();
boolean gzipped = isGzipped(file); 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"))) || "memory".equals(System.getProperty("ScvBackingDB", "file")))
mapDb = DBMaker.memoryDirectDB().allocateStartSize(512l * 1024l * 1024l) mapDb = DBMaker.memoryDirectDB().make();
.allocateIncrement(128l * 1024l * 1024l).cleanerHackEnable().make();
else { else {
File mapDbFile; File mapDbFile;
try { try {
@ -175,15 +181,18 @@ public class TextDbLoader implements IWaveformDbLoader {
throw new InputFormatException(e.toString()); throw new InputFormatException(e.toString());
} }
mapDb = DBMaker.fileDB(mapDbFile).fileMmapEnable() // Always enable mmap mapDb = DBMaker.fileDB(mapDbFile).fileMmapEnable() // Always enable mmap
.fileMmapEnableIfSupported().fileMmapPreclearDisable().allocateStartSize(512l * 1024l * 1024l) .fileMmapPreclearDisable().allocateStartSize(MAPDB_INITIAL_ALLOC)
.allocateIncrement(128l * 1024l * 1024l).cleanerHackEnable().make(); .allocateIncrement(MAPDB_INCREMENTAL_ALLOC).cleanerHackEnable().make();
mapDbFile.deleteOnExit(); mapDbFile.deleteOnExit();
} }
TextDbParser parser = new TextDbParser(this); TextDbParser parser = new TextDbParser(this);
try { 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)); 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 (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
} catch (Exception e) { } catch (Exception e) {
throw new InputFormatException(e.toString()); throw new InputFormatException(e.toString());
@ -275,7 +284,7 @@ public class TextDbLoader implements IWaveformDbLoader {
HashMap<Long, ScvTx> transactionById = new HashMap<>(); HashMap<Long, ScvTx> transactionById = new HashMap<>();
/** The tx sink. */ /** The tx sink. */
TreeMapSink<Long, ScvTx> txSink; HTreeMap<Long, ScvTx> txSink;
/** The reader. */ /** The reader. */
BufferedReader reader = null; BufferedReader reader = null;
@ -286,7 +295,6 @@ public class TextDbLoader implements IWaveformDbLoader {
/** The attr value lut. */ /** The attr value lut. */
Map<String, Integer> attrValueLut = new HashMap<>(); Map<String, Integer> attrValueLut = new HashMap<>();
long indexCount = 0;
/** /**
* Instantiates a new text db parser. * Instantiates a new text db parser.
* *
@ -348,10 +356,9 @@ public class TextDbLoader implements IWaveformDbLoader {
String[] tokens = curLine.split("\\s+"); String[] tokens = curLine.split("\\s+");
if ("tx_record_attribute".equals(tokens[0])) { if ("tx_record_attribute".equals(tokens[0])) {
Long id = Long.parseLong(tokens[1]); 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]); 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); TxAttributeType attrType = getAttrType(name, type, AssociationType.RECORD);
transactionById.get(id).attributes.add(new TxAttribute(attrType, getAttrString(attrType, remaining))); transactionById.get(id).attributes.add(new TxAttribute(attrType, getAttrString(attrType, remaining)));
} else if ("tx_begin".equals(tokens[0])) { } else if ("tx_begin".equals(tokens[0])) {
@ -407,8 +414,7 @@ public class TextDbLoader implements IWaveformDbLoader {
nextLine = reader.readLine(); nextLine = reader.readLine();
} }
} }
txSink.put(indexCount, scvTx); txSink.put(scvTx.getId(), scvTx);
loader.id2index.put(scvTx.getId(), indexCount++);
transactionById.remove(id); transactionById.remove(id);
} else if ("tx_relation".equals(tokens[0])) { } else if ("tx_relation".equals(tokens[0])) {
Long tr2 = Long.parseLong(tokens[2]); Long tr2 = Long.parseLong(tokens[2]);

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>3.0.0-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true 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 Bundle-Vendor: %Bundle-Vendor
Require-Bundle: javax.inject;bundle-version="1.0.0", Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1", org.eclipse.core.runtime;bundle-version="3.11.1",

View File

@ -3,11 +3,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>com.minres.scviewer.e4.application</artifactId> <artifactId>com.minres.scviewer.e4.application</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -3,6 +3,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/> <classpathentry kind="src" path="src/"/>
<classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -33,7 +33,6 @@
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
</natures> </natures>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>releng/com.minres.scviewer.target</module> <module>releng/com.minres.scviewer.target</module>
@ -55,7 +55,7 @@
<artifact> <artifact>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.target</artifactId> <artifactId>com.minres.scviewer.target</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
</artifact> </artifact>
</target> </target>
<environments> <environments>

View File

@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<artifactId>com.minres.scviewer.e4.product</artifactId> <artifactId>com.minres.scviewer.e4.product</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<packaging>eclipse-repository</packaging> <packaging>eclipse-repository</packaging>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<build> <build>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?> <?pde version="3.5"?>
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.11.1.qualifier" useFeatures="true" includeLaunchers="true"> <product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.11.2.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default"> <configIni use="default">
</configIni> </configIni>
@ -9,7 +9,7 @@
<launcherArgs> <launcherArgs>
<programArgs>-clearPersistedState <programArgs>-clearPersistedState
</programArgs> </programArgs>
<vmArgs>-Xmx2G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer <vmArgs>-Xmx1G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer
</vmArgs> </vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac> </vmArgsMac>

View File

@ -12,7 +12,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>

View File

@ -3,12 +3,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>com.minres.scviewer.updateSite</artifactId> <artifactId>com.minres.scviewer.updateSite</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<packaging>eclipse-repository</packaging> <packaging>eclipse-repository</packaging>
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<build> <build>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version> <version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-test-plugin</packaging> <packaging>eclipse-test-plugin</packaging>