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>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>3.0.0-SNAPSHOT</version>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<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.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<Long, ScvTx> transactions = null;
Map<Long, Long> id2index = new HashMap<>();
/** The attribute types. */
final Map<String, TxAttributeType> 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<Long, ScvTx> transactionById = new HashMap<>();
/** The tx sink. */
TreeMapSink<Long, ScvTx> txSink;
HTreeMap<Long, ScvTx> txSink;
/** The reader. */
BufferedReader reader = null;
@ -286,7 +295,6 @@ public class TextDbLoader implements IWaveformDbLoader {
/** The attr value lut. */
Map<String, Integer> 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]);

View File

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

View File

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

View File

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

View File

@ -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",

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">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.minres.scviewer.e4.application</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<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.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?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>
@ -9,7 +9,7 @@
<launcherArgs>
<programArgs>-clearPersistedState
</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>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>

View File

@ -12,7 +12,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</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">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.minres.scviewer.updateSite</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.1-SNAPSHOT</version>
<version>2.11.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<build>

View File

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