Recent round of changes to improve performance in the benchmarks.

- Added more queries to help identify root causes of performance issues.
- Now allow join hash size to be larger than 2G. (int vs long)
- Cache dictionary for node trees.
- In child unnesting, the filter is now cached between calls.
- Created a string builder to help with parsing. (It now skips converting to a 
string.)
- Added CC and NC start up options in a new cluster.properties file.


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/f13d3780
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/f13d3780
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/f13d3780

Branch: refs/heads/prestonc/november_update
Commit: f13d37801f1f0073d3c4b72a79198107e67d3b46
Parents: f884ad8
Author: Preston Carman <[email protected]>
Authored: Thu Dec 18 09:58:23 2014 -0800
Committer: Preston Carman <[email protected]>
Committed: Thu Feb 5 12:11:39 2015 -0800

----------------------------------------------------------------------
 .../builders/nodes/UTF8StringBuilder.java       | 53 ++++++++++++++++++++
 .../vxquery/xmlparser/SAXContentHandler.java    |  1 +
 .../xmlquery/query/XMLQueryCompiler.java        |  4 ++
 .../src/main/resources/conf/cluster.properties  |  1 -
 4 files changed, 58 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/f13d3780/vxquery-core/src/main/java/org/apache/vxquery/datamodel/builders/nodes/UTF8StringBuilder.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/datamodel/builders/nodes/UTF8StringBuilder.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/builders/nodes/UTF8StringBuilder.java
new file mode 100644
index 0000000..3b4eea0
--- /dev/null
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/builders/nodes/UTF8StringBuilder.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.vxquery.datamodel.builders.nodes;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.UTFDataFormatException;
+
+import org.apache.vxquery.runtime.functions.util.FunctionHelper;
+
+import edu.uci.ics.hyracks.data.std.api.IMutableValueStorage;
+import edu.uci.ics.hyracks.data.std.primitive.BytePointable;
+
+public class UTF8StringBuilder extends AbstractNodeBuilder {
+    private IMutableValueStorage mvs;
+    private DataOutput out;
+
+    @Override
+    public void reset(IMutableValueStorage mvs) throws IOException {
+        this.mvs = mvs;
+        out = mvs.getDataOutput();
+        out.write(0);
+        out.write(0);
+    }
+
+    @Override
+    public void finish() throws IOException {
+        int utflen = mvs.getLength() - 2;
+        BytePointable.setByte(mvs.getByteArray(), 0, (byte) ((utflen >>> 8) & 
0xFF));
+        BytePointable.setByte(mvs.getByteArray(), 1, (byte) ((utflen >>> 0) & 
0xFF));
+    }
+
+    public void appendCharArray(char[] ch, int start, int length) throws 
IOException {
+        FunctionHelper.writeCharArray(ch, start, length, out);
+        if (mvs.getLength() > 65535) {
+            throw new UTFDataFormatException("encoded string too long: " + 
mvs.getLength() + " bytes");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/f13d3780/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
index 296d062..d4d3bd1 100644
--- 
a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
@@ -31,6 +31,7 @@ import 
org.apache.vxquery.datamodel.builders.nodes.DocumentNodeBuilder;
 import org.apache.vxquery.datamodel.builders.nodes.ElementNodeBuilder;
 import org.apache.vxquery.datamodel.builders.nodes.PINodeBuilder;
 import org.apache.vxquery.datamodel.builders.nodes.TextNodeBuilder;
+import org.apache.vxquery.datamodel.builders.nodes.UTF8StringBuilder;
 import org.apache.vxquery.datamodel.values.ValueTag;
 import org.apache.vxquery.types.BuiltinTypeQNames;
 import org.apache.vxquery.types.ElementType;

http://git-wip-us.apache.org/repos/asf/vxquery/blob/f13d3780/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
index 263a93d..06b5918 100644
--- 
a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
@@ -119,6 +119,10 @@ public class XMLQueryCompiler {
             
builder.getPhysicalOptimizationConfig().setMaxFramesLeftInputHybridHash(
                     (int) (maximumDataSize / this.frameSize));
         }
+
+        
builder.getPhysicalOptimizationConfig().setMaxFramesLeftInputHybridHash(
+                (int) (60L * 1024 * 1048576 / this.frameSize));
+
         builder.setLogicalRewrites(buildDefaultLogicalRewrites());
         builder.setPhysicalRewrites(buildDefaultPhysicalRewrites());
         builder.setSerializerDeserializerProvider(new 
ISerializerDeserializerProvider() {

http://git-wip-us.apache.org/repos/asf/vxquery/blob/f13d3780/vxquery-server/src/main/resources/conf/cluster.properties
----------------------------------------------------------------------
diff --git a/vxquery-server/src/main/resources/conf/cluster.properties 
b/vxquery-server/src/main/resources/conf/cluster.properties
index 107f4a5..fd015d4 100644
--- a/vxquery-server/src/main/resources/conf/cluster.properties
+++ b/vxquery-server/src/main/resources/conf/cluster.properties
@@ -37,7 +37,6 @@ JAVA_HOME=$JAVA_HOME
 #The directory to put cc logs
 CCOPTS=" -cc-root ${CCTMP_DIR} -heartbeat-period 60000 
-max-heartbeat-lapse-periods 10 "
 
-
 #The directory to put nc logs
 NCOPTS=" -iodevices /home/ecarman/disk1/tmp/,/home/ecarman/disk2/tmp/ "
 #NCOPTS=" -iodevices $NCTMP_DIR "

Reply via email to