You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2014/02/24 02:42:26 UTC

[13/25] git commit: A few more little clean up items.

A few more little clean up items.


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

Branch: refs/heads/master
Commit: e88b8e16fdac581945540d616e4fa8af44a2f537
Parents: 6a4624e
Author: Preston Carman <pr...@apache.org>
Authored: Thu Feb 13 16:17:17 2014 -0800
Committer: Preston Carman <pr...@apache.org>
Committed: Thu Feb 13 16:17:17 2014 -0800

----------------------------------------------------------------------
 .../ElementNodeConstructorScalarEvaluator.java  |  5 ---
 .../AbstractNumericScalarEvaluatorFactory.java  | 42 +------------------
 ...tractNumericUnaryScalarEvaluatorFactory.java | 44 +-------------------
 .../src/main/resources/scripts/README.md        | 16 +++++++
 4 files changed, 18 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/e88b8e16/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/ElementNodeConstructorScalarEvaluator.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/ElementNodeConstructorScalarEvaluator.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/ElementNodeConstructorScalarEvaluator.java
index f3e9065..bf9b484 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/ElementNodeConstructorScalarEvaluator.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/node/ElementNodeConstructorScalarEvaluator.java
@@ -20,8 +20,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.vxquery.datamodel.accessors.PointablePool;
-import org.apache.vxquery.datamodel.accessors.PointablePoolFactory;
 import org.apache.vxquery.datamodel.accessors.SequencePointable;
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.accessors.atomic.CodedQNamePointable;
@@ -58,8 +56,6 @@ public class ElementNodeConstructorScalarEvaluator extends AbstractNodeConstruct
 
     private final SequencePointable seqp;
 
-    private final PointablePool ppool;
-
     public ElementNodeConstructorScalarEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args) {
         super(ctx, args);
         enb = new ElementNodeBuilder();
@@ -69,7 +65,6 @@ public class ElementNodeConstructorScalarEvaluator extends AbstractNodeConstruct
         cqp = (CodedQNamePointable) CodedQNamePointable.FACTORY.createPointable();
         strp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
         seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();
-        ppool = PointablePoolFactory.INSTANCE.createPointablePool();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/e88b8e16/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/AbstractNumericScalarEvaluatorFactory.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/AbstractNumericScalarEvaluatorFactory.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/AbstractNumericScalarEvaluatorFactory.java
index ff7b8fa..65aaac4 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/AbstractNumericScalarEvaluatorFactory.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/AbstractNumericScalarEvaluatorFactory.java
@@ -100,7 +100,7 @@ public abstract class AbstractNumericScalarEvaluatorFactory extends AbstractTagg
                                 case ValueTag.XS_BYTE_TAG:
                                 case ValueTag.XS_UNSIGNED_BYTE_TAG:
                                     abvsInteger.reset();
-                                    getIntegerPointable(tp, tvp, dOutInteger);
+                                    FunctionHelper.getIntegerPointable(tvp, dOutInteger);
                                     longp.set(abvsInteger.getByteArray(), abvsInteger.getStartOffset() + 1,
                                             LongPointable.TYPE_TRAITS.getFixedLength());
                             }
@@ -128,46 +128,6 @@ public abstract class AbstractNumericScalarEvaluatorFactory extends AbstractTagg
                 throw new SystemException(ErrorCode.XPTY0004);
             }
 
-            private void getIntegerPointable(TypedPointables tp, TaggedValuePointable tvp, DataOutput dOut)
-                    throws SystemException, IOException {
-                long value;
-                switch (tvp.getTag()) {
-                    case ValueTag.XS_INTEGER_TAG:
-                    case ValueTag.XS_LONG_TAG:
-                    case ValueTag.XS_NEGATIVE_INTEGER_TAG:
-                    case ValueTag.XS_NON_POSITIVE_INTEGER_TAG:
-                    case ValueTag.XS_NON_NEGATIVE_INTEGER_TAG:
-                    case ValueTag.XS_POSITIVE_INTEGER_TAG:
-                    case ValueTag.XS_UNSIGNED_INT_TAG:
-                    case ValueTag.XS_UNSIGNED_LONG_TAG:
-                        tvp.getValue(tp.longp);
-                        value = tp.longp.longValue();
-                        break;
-
-                    case ValueTag.XS_INT_TAG:
-                    case ValueTag.XS_UNSIGNED_SHORT_TAG:
-                        tvp.getValue(tp.intp);
-                        value = tp.intp.longValue();
-                        break;
-
-                    case ValueTag.XS_SHORT_TAG:
-                    case ValueTag.XS_UNSIGNED_BYTE_TAG:
-                        tvp.getValue(tp.shortp);
-                        value = tp.shortp.longValue();
-                        break;
-
-                    case ValueTag.XS_BYTE_TAG:
-                        tvp.getValue(tp.bytep);
-                        value = tp.bytep.longValue();
-                        break;
-
-                    default:
-                        value = 0;
-                }
-                dOut.write(ValueTag.XS_INTEGER_TAG);
-                dOut.writeLong(value);
-            }
-
             private int getBaseTypeForArithmetics(int tid) throws SystemException {
                 while (true) {
                     switch (tid) {

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/e88b8e16/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/unary/AbstractNumericUnaryScalarEvaluatorFactory.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/unary/AbstractNumericUnaryScalarEvaluatorFactory.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/unary/AbstractNumericUnaryScalarEvaluatorFactory.java
index ba818da..9919f34 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/unary/AbstractNumericUnaryScalarEvaluatorFactory.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/unary/AbstractNumericUnaryScalarEvaluatorFactory.java
@@ -17,7 +17,6 @@
 package org.apache.vxquery.runtime.functions.unary;
 
 import java.io.DataOutput;
-import java.io.IOException;
 
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.values.ValueTag;
@@ -26,7 +25,6 @@ import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
 import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluatorFactory;
 import org.apache.vxquery.runtime.functions.util.FunctionHelper;
-import org.apache.vxquery.runtime.functions.util.FunctionHelper.TypedPointables;
 import org.apache.vxquery.types.BuiltinTypeRegistry;
 
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -87,7 +85,7 @@ public abstract class AbstractNumericUnaryScalarEvaluatorFactory extends
                                 case ValueTag.XS_BYTE_TAG:
                                 case ValueTag.XS_UNSIGNED_BYTE_TAG:
                                     abvsInteger.reset();
-                                    getIntegerPointable(tp, tvp, dOutInteger);
+                                    FunctionHelper.getIntegerPointable(tvp, ppool, dOutInteger);
                                     longp.set(abvsInteger.getByteArray(), abvsInteger.getStartOffset() + 1,
                                             LongPointable.TYPE_TRAITS.getFixedLength());
                             }
@@ -115,46 +113,6 @@ public abstract class AbstractNumericUnaryScalarEvaluatorFactory extends
                 throw new SystemException(ErrorCode.XPTY0004);
             }
 
-            private void getIntegerPointable(TypedPointables tp, TaggedValuePointable tvp, DataOutput dOut)
-                    throws SystemException, IOException {
-                long value;
-                switch (tvp.getTag()) {
-                    case ValueTag.XS_INTEGER_TAG:
-                    case ValueTag.XS_LONG_TAG:
-                    case ValueTag.XS_NEGATIVE_INTEGER_TAG:
-                    case ValueTag.XS_NON_POSITIVE_INTEGER_TAG:
-                    case ValueTag.XS_NON_NEGATIVE_INTEGER_TAG:
-                    case ValueTag.XS_POSITIVE_INTEGER_TAG:
-                    case ValueTag.XS_UNSIGNED_INT_TAG:
-                    case ValueTag.XS_UNSIGNED_LONG_TAG:
-                        tvp.getValue(tp.longp);
-                        value = tp.longp.longValue();
-                        break;
-
-                    case ValueTag.XS_INT_TAG:
-                    case ValueTag.XS_UNSIGNED_SHORT_TAG:
-                        tvp.getValue(tp.intp);
-                        value = tp.intp.longValue();
-                        break;
-
-                    case ValueTag.XS_SHORT_TAG:
-                    case ValueTag.XS_UNSIGNED_BYTE_TAG:
-                        tvp.getValue(tp.shortp);
-                        value = tp.shortp.longValue();
-                        break;
-
-                    case ValueTag.XS_BYTE_TAG:
-                        tvp.getValue(tp.bytep);
-                        value = tp.bytep.longValue();
-                        break;
-
-                    default:
-                        value = 0;
-                }
-                dOut.write(ValueTag.XS_INTEGER_TAG);
-                dOut.writeLong(value);
-            }
-
             private int getBaseTypeForArithmetics(int tid) throws SystemException {
                 while (true) {
                     switch (tid) {

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/e88b8e16/vxquery-server/src/main/resources/scripts/README.md
----------------------------------------------------------------------
diff --git a/vxquery-server/src/main/resources/scripts/README.md b/vxquery-server/src/main/resources/scripts/README.md
new file mode 100644
index 0000000..921e6ee
--- /dev/null
+++ b/vxquery-server/src/main/resources/scripts/README.md
@@ -0,0 +1,16 @@
+Utilities for Cluster Operations
+=====================
+
+# Introduction
+
+Helpful scripts to work with the VXQuery cluster.
+
+## Cluster Cli
+
+The CLI script includes options to deploy, start, and stop a cluster.
+
+Example commands:
+python cluster_cli.py -c ../conf/cluster.xml -a deploy -d /apache-vxquery/vxquery-server
+python cluster_cli.py -c ../conf/cluster.xml -a deploy -d /apache-vxquery/vxquery-cli
+python cluster_cli.py -c ../conf/cluster.xml -a start
+python cluster_cli.py -c ../conf/cluster.xml -a stop
\ No newline at end of file