address part of Alex's comments
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_opentype@368 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
index a8e6961..b6d75bf 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
@@ -184,7 +184,7 @@
@SuppressWarnings("rawtypes")
ISerializerDeserializer serde = _jobGenCtx.getSerializerDeserializerProvider().getSerializerDeserializer(t);
- bbis.setByteBuffer(ByteBuffer.wrap(resStore.getBytes(), resStore.getStartIndex(), resStore.getLength()), 0);
+ bbis.setByteBuffer(ByteBuffer.wrap(resStore.getByteArray(), resStore.getStartOffset(), resStore.getLength()), 0);
IAObject o;
try {
o = (IAObject) serde.deserialize(dis);
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java
index b91abe7..2768902 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceStaticTypeCastRule.java
@@ -35,7 +35,7 @@
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.accessors.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
@@ -169,10 +169,14 @@
/**
* only called when funcExpr is record constructor
- * @param funcExpr record constructor function expression
- * @param requiredListType required record type
- * @param inputRecordType
- * @param env type environment
+ *
+ * @param funcExpr
+ * record constructor function expression
+ * @param requiredListType
+ * required record type
+ * @param inputRecordType
+ * @param env
+ * type environment
* @throws AlgebricksException
*/
private void rewriteRecordFuncExpr(ScalarFunctionCallExpression funcExpr, ARecordType requiredRecordType,
@@ -186,10 +190,14 @@
/**
* only called when funcExpr is list constructor
- * @param funcExpr list constructor function expression
- * @param requiredListType required list type
- * @param inputListType
- * @param env type environment
+ *
+ * @param funcExpr
+ * list constructor function expression
+ * @param requiredListType
+ * required list type
+ * @param inputListType
+ * @param env
+ * type environment
* @throws AlgebricksException
*/
private void rewriteListFuncExpr(ScalarFunctionCallExpression funcExpr, AbstractCollectionType requiredListType,
@@ -229,7 +237,7 @@
int[] fieldPermutation = new int[reqFieldTypes.length];
boolean[] nullFields = new boolean[reqFieldTypes.length];
boolean[] openFields = new boolean[inputFieldTypes.length];
-
+
Arrays.fill(nullFields, false);
Arrays.fill(openFields, true);
Arrays.fill(fieldPermutation, -1);
@@ -295,7 +303,7 @@
}
// the input has extra fields
if (!matched && !reqType.isOpen())
- throw new AlgebricksException("static type mismatch: including an extra closed field " + fieldName);
+ throw new AlgebricksException("static type mismatch: including an extra closed field " + fieldName);
}
// backward match: match from required to actual
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java
index fc5c930..3e03c0a 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java
@@ -1,7 +1,7 @@
package edu.uci.ics.asterix.common.utils;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
public class UTF8CharSequence implements CharSequence {
@@ -48,7 +48,7 @@
int sStart = start + 2;
int c = 0;
int i = 0;
- byte[] bytes = valueRef.getBytes();
+ byte[] bytes = valueRef.getByteArray();
while (c < len) {
buf[i++] = UTF8StringPointable.charAt(bytes, sStart + c);
c += UTF8StringPointable.charSize(bytes, sStart + c);
@@ -57,7 +57,7 @@
}
private void resetLength(IValueReference valueRef) {
- this.len = UTF8StringPointable.getUTFLen(valueRef.getBytes(), start);
+ this.len = UTF8StringPointable.getUTFLen(valueRef.getByteArray(), start);
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java
index 881c302..0ca40a5 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAOrderedListBuilder.java
@@ -4,7 +4,7 @@
import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
public interface IAOrderedListBuilder {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IARecordBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IARecordBuilder.java
index 18699f1..544b532 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IARecordBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IARecordBuilder.java
@@ -19,7 +19,7 @@
import java.io.IOException;
import edu.uci.ics.asterix.om.types.ARecordType;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
/**
* A record builder helps to construct Asterix Records in a serialized format.
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java
index f962dfb..50d2038 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/IAUnorderedListBuilder.java
@@ -4,7 +4,7 @@
import edu.uci.ics.asterix.om.types.AUnorderedListType;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
public interface IAUnorderedListBuilder {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java
index dcb0b87..18cec15 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/OrderedListBuilder.java
@@ -10,7 +10,7 @@
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
public class OrderedListBuilder implements IAOrderedListBuilder {
@@ -60,10 +60,10 @@
this.offsets.add((short) outputStream.size());
if (itemTypeTag == ATypeTag.ANY) {
this.numberOfItems++;
- this.outputStream.write(item.getBytes(), item.getStartIndex(), item.getLength());
- } else if (item.getBytes()[0] != serNullTypeTag) {
+ this.outputStream.write(item.getByteArray(), item.getStartOffset(), item.getLength());
+ } else if (item.getByteArray()[0] != serNullTypeTag) {
this.numberOfItems++;
- this.outputStream.write(item.getBytes(), item.getStartIndex() + 1, item.getLength() - 1);
+ this.outputStream.write(item.getByteArray(), item.getStartOffset() + 1, item.getLength() - 1);
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilder.java
index fb8d2e4..03f0e20 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/RecordBuilder.java
@@ -11,8 +11,8 @@
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.hyracks.api.dataflow.value.IBinaryHashFunction;
import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryHashFunctionFactory;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
public class RecordBuilder implements IARecordBuilder {
private int openPartOffset;
@@ -127,9 +127,9 @@
closedPartOffsets[id] = closedPartOutputStream.size();
int len = value.getLength() - 1;
// +1 because we do not store the value tag.
- closedPartOutputStream.write(value.getBytes(), value.getStartIndex() + 1, len);
+ closedPartOutputStream.write(value.getByteArray(), value.getStartOffset() + 1, len);
numberOfClosedFields++;
- if (isNullable && value.getBytes()[0] != SER_NULL_TYPE_TAG) {
+ if (isNullable && value.getByteArray()[0] != SER_NULL_TYPE_TAG) {
nullBitMap[id / 8] |= (byte) (1 << (7 - (id % 8)));
}
}
@@ -142,12 +142,12 @@
for (int i = 0; i < tempOpenPartOffsets.length; i++)
openPartOffsets[i] = tempOpenPartOffsets[i];
}
- fieldNameHashCode = utf8HashFunction.hash(name.getBytes(), name.getStartIndex() + 1, name.getLength());
+ fieldNameHashCode = utf8HashFunction.hash(name.getByteArray(), name.getStartOffset() + 1, name.getLength());
openPartOffsets[this.numberOfOpenFields] = fieldNameHashCode;
openPartOffsets[this.numberOfOpenFields] = (openPartOffsets[numberOfOpenFields] << 32);
openPartOffsets[numberOfOpenFields++] += openPartOutputStream.size();
- openPartOutputStream.write(name.getBytes(), name.getStartIndex() + 1, name.getLength() - 1);
- openPartOutputStream.write(value.getBytes(), value.getStartIndex(), value.getLength());
+ openPartOutputStream.write(name.getByteArray(), name.getStartOffset() + 1, name.getLength() - 1);
+ openPartOutputStream.write(value.getByteArray(), value.getStartOffset(), value.getLength());
}
@Override
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java
index 2f74f97..e8dbc29 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/builders/UnorderedListBuilder.java
@@ -10,7 +10,7 @@
import edu.uci.ics.asterix.om.types.AUnorderedListType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
public class UnorderedListBuilder implements IAUnorderedListBuilder {
@@ -63,10 +63,10 @@
this.offsets.add((short) outputStream.size());
if (itemTypeTag == ATypeTag.ANY) {
this.numberOfItems++;
- this.outputStream.write(item.getBytes(), item.getStartIndex(), item.getLength());
- } else if (item.getBytes()[0] != serNullTypeTag) {
+ this.outputStream.write(item.getByteArray(), item.getStartOffset(), item.getLength());
+ } else if (item.getByteArray()[0] != serNullTypeTag) {
this.numberOfItems++;
- this.outputStream.write(item.getBytes(), item.getStartIndex() + 1, item.getLength() - 1);
+ this.outputStream.write(item.getByteArray(), item.getStartOffset() + 1, item.getLength() - 1);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AFlatValueAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AFlatValueAccessor.java
deleted file mode 100644
index 83c3791..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AFlatValueAccessor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- *
- * 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 edu.uci.ics.asterix.runtime.accessors;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
-import edu.uci.ics.asterix.runtime.accessors.visitor.IBinaryAccessorVisitor;
-import edu.uci.ics.asterix.runtime.util.container.IElementFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
-
-public class AFlatValueAccessor extends AbstractBinaryAccessor {
-
- public static IElementFactory<IBinaryAccessor, IAType> FACTORY = new IElementFactory<IBinaryAccessor, IAType>() {
- public AFlatValueAccessor createElement(IAType type) {
- return new AFlatValueAccessor();
- }
- };
-
- private AFlatValueAccessor() {
-
- }
-
- @Override
- public boolean equals(Object o) {
- if (!(o instanceof IValueReference))
- return false;
- IValueReference ivf = (IValueReference) o;
- byte[] odata = ivf.getBytes();
- int ostart = ivf.getStartIndex();
- int olen = ivf.getLength();
-
- byte[] data = getBytes();
- int start = getStartIndex();
- int len = getLength();
- if ( len!= olen)
- return false;
- for (int i = 0; i < len; i++) {
- if (data[start + i] != odata[ostart + i])
- return false;
- }
- return true;
- }
-
- @Override
- public <R, T> R accept(IBinaryAccessorVisitor<R, T> vistor, T tag) throws AsterixException {
- return vistor.visit(this, tag);
- }
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/visitor/IBinaryAccessorVisitor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/visitor/IBinaryAccessorVisitor.java
deleted file mode 100644
index e35421a..0000000
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/visitor/IBinaryAccessorVisitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- *
- * 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 edu.uci.ics.asterix.runtime.accessors.visitor;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.runtime.accessors.AFlatValueAccessor;
-import edu.uci.ics.asterix.runtime.accessors.AListAccessor;
-import edu.uci.ics.asterix.runtime.accessors.ARecordAccessor;
-
-public interface IBinaryAccessorVisitor<R, T> {
-
- public R visit(AListAccessor accessor, T arg) throws AsterixException;
-
- public R visit(ARecordAccessor accessor, T arg) throws AsterixException;
-
- public R visit(AFlatValueAccessor accessor, T arg) throws AsterixException;
-}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
index acc1e09..5c6aa8e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
@@ -91,35 +91,35 @@
if (inputVal.getLength() > 0) {
++count;
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getBytes(), 1);
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
sum += val;
break;
}
case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
sum += val;
break;
}
case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
sum += val;
break;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
index b2c9be8..5b647d4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
@@ -118,7 +118,7 @@
inputVal.reset();
eval.evaluate(tuple);
- byte[] serBytes = inputVal.getBytes();
+ byte[] serBytes = inputVal.getByteArray();
if (serBytes[0] == SER_NULL_TYPE_TAG)
metNull = true;
if (serBytes[0] != SER_RECORD_TYPE_TAG) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
index 9d65ad4..9b5e5e9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
@@ -121,35 +121,35 @@
if (inputVal.getLength() > 0) {
++count;
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getBytes(), 1);
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
sum += val;
break;
}
case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
sum += val;
break;
}
case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
sum += val;
break;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
index ac1b4e1..4764cdb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
@@ -107,41 +107,41 @@
eval.evaluate(tuple);
if (inputVal.getLength() > 0) {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8s = true;
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getBytes(), 1);
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT16: {
metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT32: {
metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT64: {
metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
sum += val;
break;
}
case FLOAT: {
metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
sum += val;
break;
}
case DOUBLE: {
metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
sum += val;
break;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
index 028a9a2..f5c9816 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
@@ -120,35 +120,35 @@
if (inputVal.getLength() > 0) {
++count;
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getBytes(), 1);
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
sum += val;
break;
}
case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
sum += val;
break;
}
case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
sum += val;
break;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
index f1d6fbd..530f790 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
@@ -116,7 +116,7 @@
public void step(IFrameTupleReference tuple) throws AlgebricksException {
inputVal.reset();
eval.evaluate(tuple);
- byte[] serBytes = inputVal.getBytes();
+ byte[] serBytes = inputVal.getByteArray();
if (serBytes[0] == SER_NULL_TYPE_TAG)
metNull = true;
if (serBytes[0] != SER_RECORD_TYPE_TAG) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
index 88d917f..5523b0d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
@@ -121,35 +121,35 @@
if (inputVal.getLength() > 0) {
++count;
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getBytes(), 1);
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT16: {
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT32: {
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT64: {
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
sum += val;
break;
}
case FLOAT: {
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
sum += val;
break;
}
case DOUBLE: {
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
sum += val;
break;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
index 6f7ac58..43a8cb1 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
@@ -106,7 +106,7 @@
eval.evaluate(tuple);
if (inputVal.getLength() > 0) {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8s = true;
@@ -114,35 +114,35 @@
}
case INT16: {
metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
if (val > shortVal)
shortVal = val;
throw new NotImplementedException("no implementation for int16's comparator");
}
case INT32: {
metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
if (val > intVal)
intVal = val;
break;
}
case INT64: {
metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
if (val > longVal)
longVal = val;
break;
}
case FLOAT: {
metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
if (val > floatVal)
floatVal = val;
break;
}
case DOUBLE: {
metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
if (val > doubleVal)
doubleVal = val;
break;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
index 2b36918..8654076 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
@@ -106,7 +106,7 @@
eval.evaluate(tuple);
if (inputVal.getLength() > 0) {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8s = true;
@@ -114,35 +114,35 @@
}
case INT16: {
metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
if (val < shortVal)
shortVal = val;
throw new NotImplementedException("no implementation for int16's comparator");
}
case INT32: {
metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
if (val < intVal)
intVal = val;
break;
}
case INT64: {
metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
if (val < longVal)
longVal = val;
break;
}
case FLOAT: {
metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
if (val < floatVal)
floatVal = val;
break;
}
case DOUBLE: {
metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
if (val < doubleVal)
doubleVal = val;
break;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
index e51badd..129d0b7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
@@ -98,41 +98,41 @@
eval.evaluate(tuple);
if (inputVal.getLength() > 0) {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(inputVal.getBytes()[0]);
+ .deserialize(inputVal.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8s = true;
- byte val = AInt8SerializerDeserializer.getByte(inputVal.getBytes(), 1);
+ byte val = AInt8SerializerDeserializer.getByte(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT16: {
metInt16s = true;
- short val = AInt16SerializerDeserializer.getShort(inputVal.getBytes(), 1);
+ short val = AInt16SerializerDeserializer.getShort(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT32: {
metInt32s = true;
- int val = AInt32SerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int val = AInt32SerializerDeserializer.getInt(inputVal.getByteArray(), 1);
sum += val;
break;
}
case INT64: {
metInt64s = true;
- long val = AInt64SerializerDeserializer.getLong(inputVal.getBytes(), 1);
+ long val = AInt64SerializerDeserializer.getLong(inputVal.getByteArray(), 1);
sum += val;
break;
}
case FLOAT: {
metFloats = true;
- float val = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float val = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
sum += val;
break;
}
case DOUBLE: {
metDoubles = true;
- double val = ADoubleSerializerDeserializer.getDouble(inputVal.getBytes(), 1);
+ double val = ADoubleSerializerDeserializer.getDouble(inputVal.getByteArray(), 1);
sum += val;
break;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/AsterixTupleFilter.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/AsterixTupleFilter.java
index 8bb0b9f..3ef8cf3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/AsterixTupleFilter.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/base/AsterixTupleFilter.java
@@ -39,6 +39,6 @@
public boolean accept(IFrameTupleReference tuple) throws Exception {
evalOut.reset();
eval.evaluate(tuple);
- return boolInspector.getBooleanValue(evalOut.getBytes(), 0, 2);
+ return boolInspector.getBooleanValue(evalOut.getByteArray(), 0, 2);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java
index 15ab112..2c14bd0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java
@@ -67,7 +67,7 @@
for (int i = 0; i < evalFields.length; i++) {
fieldValueBuffer.reset();
evalFields[i].evaluate(tuple);
- if (fieldValueBuffer.getBytes()[0] != SER_NULL_TYPE_TAG) {
+ if (fieldValueBuffer.getByteArray()[0] != SER_NULL_TYPE_TAG) {
recBuilder.addField(i, fieldValueBuffer);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
index d7404bb..165cd56 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
@@ -63,11 +63,11 @@
try {
- int dimension = AInt32SerializerDeserializer.getInt(outInput1.getBytes(), 1);
- int coordinate = AInt32SerializerDeserializer.getInt(outInput2.getBytes(), 1);
+ int dimension = AInt32SerializerDeserializer.getInt(outInput1.getByteArray(), 1);
+ int coordinate = AInt32SerializerDeserializer.getInt(outInput2.getByteArray(), 1);
double value;
if (dimension == 2) {
- ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getBytes()[0]);
+ ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getByteArray()[0]);
switch (tag) {
case POINT:
switch (coordinate) {
@@ -75,7 +75,7 @@
// for
// max x, and 3 for max y
case 2: {
- double x = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double x = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
value = x;
@@ -83,7 +83,7 @@
break;
case 1:
case 3: {
- double y = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double y = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
value = y;
@@ -101,9 +101,9 @@
case 0: {
value = Double.MAX_VALUE;
double startX = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), ALineSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.X));
- double endX = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double endX = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.X));
value = Math.min(Math.min(startX, endX), value);
@@ -112,9 +112,9 @@
case 1: {
value = Double.MAX_VALUE;
double startY = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), ALineSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.Y));
- double endY = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double endY = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.Y));
value = Math.min(Math.min(startY, endY), value);
@@ -123,9 +123,9 @@
case 2: {
value = Double.MIN_VALUE;
double startX = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), ALineSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.X));
- double endX = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double endX = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.X));
value = Math.max(Math.min(startX, endX), value);
@@ -134,9 +134,9 @@
case 3: {
value = Double.MIN_VALUE;
double startY = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), ALineSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.Y));
- double endY = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double endY = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.Y));
value = Math.max(Math.min(startY, endY), value);
@@ -149,14 +149,14 @@
}
break;
case POLYGON:
- int numOfPoints = AInt16SerializerDeserializer.getShort(outInput0.getBytes(),
+ int numOfPoints = AInt16SerializerDeserializer.getShort(outInput0.getByteArray(),
APolygonSerializerDeserializer.getNumberOfPointsOffset());
switch (coordinate) {
case 0: {
value = Double.MAX_VALUE;
for (int i = 0; i < numOfPoints; i++) {
double x = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), APolygonSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), APolygonSerializerDeserializer
.getCoordinateOffset(i, Coordinate.X));
value = Math.min(x, value);
}
@@ -166,7 +166,7 @@
value = Double.MAX_VALUE;
for (int i = 0; i < numOfPoints; i++) {
double y = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), APolygonSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), APolygonSerializerDeserializer
.getCoordinateOffset(i, Coordinate.Y));
value = Math.min(y, value);
}
@@ -176,7 +176,7 @@
value = Double.MIN_VALUE;
for (int i = 0; i < numOfPoints; i++) {
double x = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), APolygonSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), APolygonSerializerDeserializer
.getCoordinateOffset(i, Coordinate.X));
value = Math.max(x, value);
}
@@ -186,7 +186,7 @@
value = Double.MIN_VALUE;
for (int i = 0; i < numOfPoints; i++) {
double y = ADoubleSerializerDeserializer
- .getDouble(outInput0.getBytes(), APolygonSerializerDeserializer
+ .getDouble(outInput0.getByteArray(), APolygonSerializerDeserializer
.getCoordinateOffset(i, Coordinate.Y));
value = Math.max(y, value);
}
@@ -201,10 +201,10 @@
case CIRCLE:
switch (coordinate) {
case 0: {
- double x = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double x = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.X));
- double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.X));
@@ -212,10 +212,10 @@
}
break;
case 1: {
- double y = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double y = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.Y));
- double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.Y));
@@ -223,10 +223,10 @@
}
break;
case 2: {
- double x = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double x = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.X));
- double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.X));
@@ -234,10 +234,10 @@
}
break;
case 3: {
- double y = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double y = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.Y));
- double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double radius = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ACircleSerializerDeserializer
.getCenterPointCoordinateOffset(Coordinate.Y));
@@ -254,25 +254,25 @@
value = Double.MAX_VALUE;
switch (coordinate) {
case 0: {
- value = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ value = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ARectangleSerializerDeserializer
.getBottomLeftCoordinateOffset(Coordinate.X));
}
break;
case 1: {
- value = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ value = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ARectangleSerializerDeserializer
.getBottomLeftCoordinateOffset(Coordinate.Y));
}
break;
case 2: {
- value = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ value = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ARectangleSerializerDeserializer
.getUpperRightCoordinateOffset(Coordinate.X));
}
break;
case 3: {
- value = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ value = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
ARectangleSerializerDeserializer
.getUpperRightCoordinateOffset(Coordinate.Y));
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java
index 0f8be91..57331db 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java
@@ -56,15 +56,15 @@
if (!checkArgTypes(firstTypeTag, secondTypeTag))
return;
- itemTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[firstStart + 1]);
+ itemTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[firstStart + 1]);
if (itemTypeTag == ATypeTag.ANY)
throw new AlgebricksException("\n Edit Distance can only be called on homogenous lists");
- itemTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[secondStart + 1]);
+ itemTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[secondStart + 1]);
if (itemTypeTag == ATypeTag.ANY)
throw new AlgebricksException("\n Edit Distance can only be called on homogenous lists");
- editDistance = computeResult(argOut.getBytes(), firstStart, secondStart, firstTypeTag);
+ editDistance = computeResult(argOut.getByteArray(), firstStart, secondStart, firstTypeTag);
try {
writeResult(editDistance);
@@ -81,8 +81,8 @@
secondStart = argOut.getLength();
secondStringEval.evaluate(tuple);
- firstTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[firstStart]);
- secondTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[secondStart]);
+ firstTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[firstStart]);
+ secondTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[secondStart]);
}
protected int computeResult(byte[] bytes, int firstStart, int secondStart, ATypeTag argType)
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
index 06bcedf..49a1d99 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
@@ -73,7 +73,7 @@
eval0.evaluate(tuple);
outInput1.reset();
eval1.evaluate(tuple);
- byte[] serRecord = outInput0.getBytes();
+ byte[] serRecord = outInput0.getByteArray();
if (serRecord[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
@@ -85,7 +85,7 @@
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[0]));
}
- fieldIndex = IntegerSerializerDeserializer.getInt(outInput1.getBytes(), 1);
+ fieldIndex = IntegerSerializerDeserializer.getInt(outInput1.getByteArray(), 1);
fieldValueOffset = ARecordSerializerDeserializer.getFieldOffsetById(serRecord, fieldIndex,
nullBitmapSize, recordType.isOpen());
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
index 4713c38..4b392bd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
@@ -59,7 +59,7 @@
int prePostOff = argOut.getLength();
prePostEval.evaluate(tuple);
- byte[] bytes = argOut.getBytes();
+ byte[] bytes = argOut.getByteArray();
int gramLength = IntegerSerializerDeserializer.getInt(bytes, gramLengthOff + typeIndicatorSize);
tokenizer.setGramlength(gramLength);
boolean prePost = BooleanSerializerDeserializer.getBoolean(bytes, prePostOff + typeIndicatorSize);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java
index 932036e..0c0c36d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java
@@ -63,7 +63,7 @@
runArgEvals(tuple);
if (!checkArgTypes(firstTypeTag, secondTypeTag))
return;
- jaccSim = computeResult(argOut.getBytes(), firstStart, secondStart, firstTypeTag);
+ jaccSim = computeResult(argOut.getByteArray(), firstStart, secondStart, firstTypeTag);
try {
writeResult(jaccSim);
} catch (IOException e) {
@@ -79,8 +79,8 @@
secondStart = argOut.getLength();
secondOrdListEval.evaluate(tuple);
- firstTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[firstStart]);
- secondTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[secondStart]);
+ firstTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[firstStart]);
+ secondTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[secondStart]);
}
protected float computeResult(byte[] bytes, int firstStart, int secondStart, ATypeTag argType)
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
index 4884806..8961257 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
@@ -74,7 +74,7 @@
sim = 0;
inputVal.reset();
evalThreshold.evaluate(tuple);
- float similarityThreshold = AFloatSerializerDeserializer.getFloat(inputVal.getBytes(), 1);
+ float similarityThreshold = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), 1);
if (similarityThreshold != similarityThresholdCache || similarityFilters == null) {
similarityFilters = new SimilarityFiltersJaccard(similarityThreshold);
@@ -83,11 +83,11 @@
inputVal.reset();
evalLen1.evaluate(tuple);
- int length1 = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int length1 = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
inputVal.reset();
evalLen2.evaluate(tuple);
- int length2 = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int length2 = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
//
// -- - length filter - --
@@ -100,7 +100,7 @@
inputVal.reset();
evalTokens1.evaluate(tuple);
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
if (serList[0] != SER_ORDEREDLIST_TYPE_TAG && serList[0] != SER_UNORDEREDLIST_TYPE_TAG) {
throw new AlgebricksException("Scan collection is not defined for values of type"
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
@@ -108,7 +108,7 @@
int lengthTokens1;
if (serList[0] == SER_ORDEREDLIST_TYPE_TAG) {
- lengthTokens1 = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getBytes());
+ lengthTokens1 = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
// read tokens
for (i = 0; i < lengthTokens1; i++) {
int itemOffset;
@@ -120,7 +120,7 @@
tokens1.add(IntegerSerializerDeserializer.getInt(serList, itemOffset));
}
} else {
- lengthTokens1 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getBytes());
+ lengthTokens1 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
// read tokens
for (i = 0; i < lengthTokens1; i++) {
int itemOffset;
@@ -142,7 +142,7 @@
inputVal.reset();
evalTokens2.evaluate(tuple);
- serList = inputVal.getBytes();
+ serList = inputVal.getByteArray();
if (serList[0] != SER_ORDEREDLIST_TYPE_TAG && serList[0] != SER_UNORDEREDLIST_TYPE_TAG) {
throw new AlgebricksException("Scan collection is not defined for values of type"
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
@@ -150,7 +150,7 @@
int lengthTokens2;
if (serList[0] == SER_ORDEREDLIST_TYPE_TAG) {
- lengthTokens2 = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getBytes());
+ lengthTokens2 = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
// read tokens
for (i = 0; i < lengthTokens2; i++) {
int itemOffset;
@@ -162,7 +162,7 @@
tokens2.add(IntegerSerializerDeserializer.getInt(serList, itemOffset));
}
} else {
- lengthTokens2 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getBytes());
+ lengthTokens2 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
// read tokens
for (i = 0; i < lengthTokens2; i++) {
int itemOffset;
@@ -182,7 +182,7 @@
// -- - token prefix - --
inputVal.reset();
evalTokenPrefix.evaluate(tuple);
- int tokenPrefix = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int tokenPrefix = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
//
// -- - position filter - --
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
index 800c4ee..d9fde50 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
@@ -43,7 +43,7 @@
public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
argOut.reset();
stringEval.evaluate(tuple);
- byte[] bytes = argOut.getBytes();
+ byte[] bytes = argOut.getByteArray();
tokenizer.reset(bytes, 0, argOut.getLength());
tokenBuffer.reset();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
index 958b04b..5082c67 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
@@ -74,7 +74,7 @@
if (outLeft.getLength() == 0) {
isLeftNull = true;
} else {
- typeTag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outLeft.getBytes()[0]);
+ typeTag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outLeft.getByteArray()[0]);
if (typeTag1 == ATypeTag.NULL) {
isLeftNull = true;
}
@@ -82,7 +82,7 @@
if (outRight.getLength() == 0) {
isRightNull = true;
} else {
- typeTag2 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outRight.getBytes()[0]);
+ typeTag2 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outRight.getByteArray()[0]);
if (typeTag2 == ATypeTag.NULL) {
isRightNull = true;
}
@@ -130,8 +130,8 @@
if (typeTag2 == ATypeTag.NULL) {
return ComparisonResult.GREATER_THAN;
} else if (typeTag2 == ATypeTag.DATETIME) {
- int result = dateTimeBinaryComp.compare(outLeft.getBytes(), 1, outLeft.getLength() - 1,
- outRight.getBytes(), 1, outRight.getLength() - 1);
+ int result = dateTimeBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+ outRight.getByteArray(), 1, outRight.getLength() - 1);
if (result == 0)
return ComparisonResult.EQUAL;
else if (result < 0)
@@ -144,8 +144,8 @@
private ComparisonResult compareBooleanWithArg(ATypeTag typeTag2) throws AlgebricksException {
if (typeTag2 == ATypeTag.BOOLEAN) {
- byte b0 = outLeft.getBytes()[1];
- byte b1 = outRight.getBytes()[1];
+ byte b0 = outLeft.getByteArray()[1];
+ byte b1 = outRight.getByteArray()[1];
return compareByte(b0, b1);
}
throw new AlgebricksException("Comparison is undefined between types ABoolean and " + typeTag2 + " .");
@@ -153,7 +153,7 @@
private ComparisonResult compareStringWithArg(ATypeTag typeTag2) throws AlgebricksException {
if (typeTag2 == ATypeTag.STRING) {
- int result = strBinaryComp.compare(outLeft.getBytes(), 1, outLeft.getLength() - 1, outRight.getBytes(), 1,
+ int result = strBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1, outRight.getByteArray(), 1,
outRight.getLength() - 1);
if (result == 0)
return ComparisonResult.EQUAL;
@@ -166,30 +166,30 @@
}
private ComparisonResult compareDoubleWithArg(ATypeTag typeTag2) throws AlgebricksException {
- double s = ADoubleSerializerDeserializer.getDouble(outLeft.getBytes(), 1);
+ double s = ADoubleSerializerDeserializer.getDouble(outLeft.getByteArray(), 1);
switch (typeTag2) {
case INT8: {
- byte v2 = AInt8SerializerDeserializer.getByte(outRight.getBytes(), 1);
+ byte v2 = AInt8SerializerDeserializer.getByte(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
case INT16: {
- short v2 = AInt16SerializerDeserializer.getShort(outRight.getBytes(), 1);
+ short v2 = AInt16SerializerDeserializer.getShort(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
case INT32: {
- int v2 = AInt32SerializerDeserializer.getInt(outRight.getBytes(), 1);
+ int v2 = AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
case INT64: {
- long v2 = AInt64SerializerDeserializer.getLong(outRight.getBytes(), 1);
+ long v2 = AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
case FLOAT: {
- float v2 = AFloatSerializerDeserializer.getFloat(outRight.getBytes(), 1);
+ float v2 = AFloatSerializerDeserializer.getFloat(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
case DOUBLE: {
- double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getBytes(), 1);
+ double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
default: {
@@ -199,30 +199,30 @@
}
private ComparisonResult compareFloatWithArg(ATypeTag typeTag2) throws AlgebricksException {
- float s = FloatSerializerDeserializer.getFloat(outLeft.getBytes(), 1);
+ float s = FloatSerializerDeserializer.getFloat(outLeft.getByteArray(), 1);
switch (typeTag2) {
case INT8: {
- byte v2 = AInt8SerializerDeserializer.getByte(outRight.getBytes(), 1);
+ byte v2 = AInt8SerializerDeserializer.getByte(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case INT16: {
- short v2 = AInt16SerializerDeserializer.getShort(outRight.getBytes(), 1);
+ short v2 = AInt16SerializerDeserializer.getShort(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case INT32: {
- int v2 = AInt32SerializerDeserializer.getInt(outRight.getBytes(), 1);
+ int v2 = AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case INT64: {
- long v2 = AInt64SerializerDeserializer.getLong(outRight.getBytes(), 1);
+ long v2 = AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case FLOAT: {
- float v2 = AFloatSerializerDeserializer.getFloat(outRight.getBytes(), 1);
+ float v2 = AFloatSerializerDeserializer.getFloat(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case DOUBLE: {
- double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getBytes(), 1);
+ double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
default: {
@@ -232,30 +232,30 @@
}
private ComparisonResult compareInt64WithArg(ATypeTag typeTag2) throws AlgebricksException {
- long s = AInt64SerializerDeserializer.getLong(outLeft.getBytes(), 1);
+ long s = AInt64SerializerDeserializer.getLong(outLeft.getByteArray(), 1);
switch (typeTag2) {
case INT8: {
- byte v2 = AInt8SerializerDeserializer.getByte(outRight.getBytes(), 1);
+ byte v2 = AInt8SerializerDeserializer.getByte(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case INT16: {
- short v2 = AInt16SerializerDeserializer.getShort(outRight.getBytes(), 1);
+ short v2 = AInt16SerializerDeserializer.getShort(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case INT32: {
- int v2 = AInt32SerializerDeserializer.getInt(outRight.getBytes(), 1);
+ int v2 = AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case INT64: {
- long v2 = AInt64SerializerDeserializer.getLong(outRight.getBytes(), 1);
+ long v2 = AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case FLOAT: {
- float v2 = AFloatSerializerDeserializer.getFloat(outRight.getBytes(), 1);
+ float v2 = AFloatSerializerDeserializer.getFloat(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case DOUBLE: {
- double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getBytes(), 1);
+ double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
default: {
@@ -265,30 +265,30 @@
}
private ComparisonResult compareInt32WithArg(ATypeTag typeTag2) throws AlgebricksException {
- int s = IntegerSerializerDeserializer.getInt(outLeft.getBytes(), 1);
+ int s = IntegerSerializerDeserializer.getInt(outLeft.getByteArray(), 1);
switch (typeTag2) {
case INT8: {
- byte v2 = AInt8SerializerDeserializer.getByte(outRight.getBytes(), 1);
+ byte v2 = AInt8SerializerDeserializer.getByte(outRight.getByteArray(), 1);
return compareInt(s, v2);
}
case INT16: {
- short v2 = AInt16SerializerDeserializer.getShort(outRight.getBytes(), 1);
+ short v2 = AInt16SerializerDeserializer.getShort(outRight.getByteArray(), 1);
return compareInt(s, v2);
}
case INT32: {
- int v2 = AInt32SerializerDeserializer.getInt(outRight.getBytes(), 1);
+ int v2 = AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1);
return compareInt(s, v2);
}
case INT64: {
- long v2 = AInt64SerializerDeserializer.getLong(outRight.getBytes(), 1);
+ long v2 = AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case FLOAT: {
- float v2 = AFloatSerializerDeserializer.getFloat(outRight.getBytes(), 1);
+ float v2 = AFloatSerializerDeserializer.getFloat(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case DOUBLE: {
- double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getBytes(), 1);
+ double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
default: {
@@ -298,30 +298,30 @@
}
private ComparisonResult compareInt16WithArg(ATypeTag typeTag2) throws AlgebricksException {
- short s = AInt16SerializerDeserializer.getShort(outLeft.getBytes(), 1);
+ short s = AInt16SerializerDeserializer.getShort(outLeft.getByteArray(), 1);
switch (typeTag2) {
case INT8: {
- byte v2 = AInt8SerializerDeserializer.getByte(outRight.getBytes(), 1);
+ byte v2 = AInt8SerializerDeserializer.getByte(outRight.getByteArray(), 1);
return compareShort(s, v2);
}
case INT16: {
- short v2 = AInt16SerializerDeserializer.getShort(outRight.getBytes(), 1);
+ short v2 = AInt16SerializerDeserializer.getShort(outRight.getByteArray(), 1);
return compareShort(s, v2);
}
case INT32: {
- int v2 = AInt32SerializerDeserializer.getInt(outRight.getBytes(), 1);
+ int v2 = AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1);
return compareInt(s, v2);
}
case INT64: {
- long v2 = AInt64SerializerDeserializer.getLong(outRight.getBytes(), 1);
+ long v2 = AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case FLOAT: {
- float v2 = AFloatSerializerDeserializer.getFloat(outRight.getBytes(), 1);
+ float v2 = AFloatSerializerDeserializer.getFloat(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case DOUBLE: {
- double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getBytes(), 1);
+ double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
default: {
@@ -331,30 +331,30 @@
}
private ComparisonResult compareInt8WithArg(ATypeTag typeTag2) throws AlgebricksException {
- byte s = AInt8SerializerDeserializer.getByte(outLeft.getBytes(), 1);
+ byte s = AInt8SerializerDeserializer.getByte(outLeft.getByteArray(), 1);
switch (typeTag2) {
case INT8: {
- byte v2 = AInt8SerializerDeserializer.getByte(outRight.getBytes(), 1);
+ byte v2 = AInt8SerializerDeserializer.getByte(outRight.getByteArray(), 1);
return compareByte(s, v2);
}
case INT16: {
- short v2 = AInt16SerializerDeserializer.getShort(outRight.getBytes(), 1);
+ short v2 = AInt16SerializerDeserializer.getShort(outRight.getByteArray(), 1);
return compareShort(s, v2);
}
case INT32: {
- int v2 = AInt32SerializerDeserializer.getInt(outRight.getBytes(), 1);
+ int v2 = AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1);
return compareInt(s, v2);
}
case INT64: {
- long v2 = AInt64SerializerDeserializer.getLong(outRight.getBytes(), 1);
+ long v2 = AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1);
return compareLong(s, v2);
}
case FLOAT: {
- float v2 = AFloatSerializerDeserializer.getFloat(outRight.getBytes(), 1);
+ float v2 = AFloatSerializerDeserializer.getFloat(outRight.getByteArray(), 1);
return compareFloat(s, v2);
}
case DOUBLE: {
- double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getBytes(), 1);
+ double v2 = ADoubleSerializerDeserializer.getDouble(outRight.getByteArray(), 1);
return compareDouble(s, v2);
}
default: {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
index 701c20a..c379b58 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
@@ -66,7 +66,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
if (utf8BinaryComparator.compare(serString, 1, outInput.getLength(), TRUE, 0, 6) == 0) {
booleanSerde.serialize(ABoolean.TRUE, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
index 3e64b56..57e6f22 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
@@ -64,7 +64,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
String s = new String(serString, 3, outInput.getLength() - 3, "UTF-8");
int commaIndex = s.indexOf(',');
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
index 83c9167..ab32e1e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
@@ -66,7 +66,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
index 2f5a203..1e53cf2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
@@ -67,7 +67,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
index 6a89def..271ae78 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
@@ -77,7 +77,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
if (utf8BinaryComparator
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
index b4ded9e..1d3760f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
@@ -67,7 +67,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
if (serString[offset] == '-') {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
index 6cb6306..53a823c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
@@ -76,7 +76,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
if (utf8BinaryComparator
.compare(serString, 1, outInput.getLength(), POSITIVE_INF, 0, 5) == 0) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
index c1ac181..ce0bc25 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
@@ -65,7 +65,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
value = 0;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
index 2edfbdd..f3e2faf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
@@ -64,7 +64,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
value = 0;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
index 5fd7a3a..a307da2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
@@ -65,7 +65,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
value = 0;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
index 6719fbf..983ffe7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
@@ -65,7 +65,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
value = 0;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
index 87063c3..2cc090a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
@@ -64,7 +64,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
String s = new String(serString, 3, outInput.getLength() - 3, "UTF-8");
int commaIndex = s.indexOf(',');
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
index 963e95d..a94d581 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
@@ -59,7 +59,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
if (utf8BinaryComparator.compare(serString, 1, outInput.getLength(), NULL, 0, 6) == 0) {
nullSerde.serialize(ANull.NULL, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
index 1c0962c..5169362 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
@@ -63,7 +63,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
String s = new String(serString, 3, outInput.getLength() - 3, "UTF-8");
int firstCommaIndex = s.indexOf(',');
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
index 378e619..22c89dc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
@@ -62,7 +62,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
String s = new String(serString, 3, outInput.getLength() - 3, "UTF-8");
aPoint.setValue(Double.parseDouble(s.substring(0, s.indexOf(','))),
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
index 8a88c0e..6511b2d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
@@ -59,7 +59,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
String s = new String(serString, 3, outInput.getLength() - 3, "UTF-8");
String[] points = s.split(" ");
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
index c2b98f9..4ffd671 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
@@ -65,7 +65,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
String s = new String(serString, 3, outInput.getLength() - 3, "UTF-8");
int commaIndex = s.indexOf(',');
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
index 982871d..11aa889 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
@@ -56,9 +56,9 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
- out.write(outInput.getBytes(), outInput.getStartIndex(), outInput.getLength());
+ out.write(outInput.getByteArray(), outInput.getStartOffset(), outInput.getLength());
} else if (serString[0] == SER_NULL_TYPE_TAG)
nullSerde.serialize(ANull.NULL, out);
else
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
index 10b6af5..46f0738 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
@@ -66,7 +66,7 @@
try {
outInput.reset();
eval.evaluate(tuple);
- byte[] serString = outInput.getBytes();
+ byte[] serString = outInput.getByteArray();
if (serString[0] == SER_STRING_TYPE_TAG) {
offset = 3;
if (serString[offset + 2] != ':' || serString[offset + 5] != ':')
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java
index b0f4580..9225f6a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java
@@ -39,8 +39,8 @@
evalPattern.evaluate(tuple);
array0.reset();
evalString.evaluate(tuple);
- byte[] b1 = array0.getBytes();
- byte[] b2 = array1.getBytes();
+ byte[] b1 = array0.getByteArray();
+ byte[] b2 = array1.getByteArray();
ABoolean res = findMatch(b1, b2) ? ABoolean.TRUE : ABoolean.FALSE;
try {
boolSerde.serialize(res, dout);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
index 7e2877c..6a46c6d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
@@ -70,11 +70,11 @@
for (int i = 0; i < n; i++) {
argOut.reset();
evals[i].evaluate(tuple);
- if (argOut.getBytes()[0] == SER_NULL_TYPE_TAG) {
+ if (argOut.getByteArray()[0] == SER_NULL_TYPE_TAG) {
metNull = true;
continue;
}
- boolean argResult = ABooleanSerializerDeserializer.getBoolean(argOut.getBytes(), 1);
+ boolean argResult = ABooleanSerializerDeserializer.getBoolean(argOut.getByteArray(), 1);
res = res && argResult;
}
if (metNull) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
index 055d94b..aa8b430 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
@@ -81,7 +81,7 @@
try {
outInputList.reset();
evalList.evaluate(tuple);
- byte[] serList = outInputList.getBytes();
+ byte[] serList = outInputList.getByteArray();
if (serList[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
index c82bb9b..87e1bdd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
@@ -7,10 +7,10 @@
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.accessors.ARecordAccessor;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
-import edu.uci.ics.asterix.runtime.accessors.cast.ACastVisitor;
import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.runtime.pointables.cast.ACastVisitor;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -58,10 +58,10 @@
final IEvaluator recEvaluator = recordEvalFactory.createEvaluator(recordBuffer);
return new IEvaluator() {
- final ARecordAccessor recAccessor = new ARecordAccessor(inputType);
- final ARecordAccessor resultAccessor = new ARecordAccessor(reqType);
+ final ARecordPointable recAccessor = new ARecordPointable(inputType);
+ final ARecordPointable resultAccessor = new ARecordPointable(reqType);
final ACastVisitor castVisitor = new ACastVisitor();
- final Triple<IBinaryAccessor, IAType, Boolean> arg = new Triple<IBinaryAccessor, IAType, Boolean>(
+ final Triple<IVisitablePointable, IAType, Boolean> arg = new Triple<IVisitablePointable, IAType, Boolean>(
resultAccessor, reqType, Boolean.FALSE);
@Override
@@ -69,10 +69,9 @@
try {
recordBuffer.reset();
recEvaluator.evaluate(tuple);
- recAccessor.reset(recordBuffer.getBytes(), recordBuffer.getStartIndex(),
- recordBuffer.getLength());
+ recAccessor.set(recordBuffer);
recAccessor.accept(castVisitor, arg);
- out.write(resultAccessor.getBytes(), resultAccessor.getStartIndex(),
+ out.write(resultAccessor.getByteArray(), resultAccessor.getStartOffset(),
resultAccessor.getLength());
} catch (Exception ioe) {
throw new AlgebricksException(ioe);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
index 463dfd2..76c2206 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
@@ -64,11 +64,11 @@
eval1.evaluate(tuple);
try {
- aPoint.setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ aPoint.setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X)),
- ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y)));
- aCircle.setValue(aPoint, ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(), 1));
+ aCircle.setValue(aPoint, ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(), 1));
circleSerde.serialize(aCircle, out);
} catch (IOException e1) {
throw new AlgebricksException(e1);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
index fab060d..8ca81cd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
@@ -64,13 +64,13 @@
eval1.evaluate(tuple);
try {
- aPoint[0].setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ aPoint[0].setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X)),
- ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y)));
- aPoint[1].setValue(ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ aPoint[1].setValue(ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X)),
- ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y)));
aLine.setValue(aPoint[0], aPoint[1]);
lineSerde.serialize(aLine, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
index f7d284c..2a4a0f1 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
@@ -60,8 +60,8 @@
eval1.evaluate(tuple);
try {
- aPoint.setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(), 1),
- ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(), 1));
+ aPoint.setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(), 1),
+ ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(), 1));
pointSerde.serialize(aPoint, out);
} catch (IOException e1) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
index e0b424f..eb3959e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
@@ -62,7 +62,7 @@
outInput.reset();
argEvals[i].evaluate(tuple);
try {
- out.write(outInput.getBytes(), outInput.getStartIndex() + 1, outInput.getLength() - 1);
+ out.write(outInput.getByteArray(), outInput.getStartOffset() + 1, outInput.getLength() - 1);
} catch (IOException e) {
throw new AlgebricksException(e);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
index 1e4a98a..9d7bb5f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
@@ -63,13 +63,13 @@
eval1.evaluate(tuple);
try {
- aPoint[0].setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ aPoint[0].setValue(ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X)),
- ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y)));
- aPoint[1].setValue(ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ aPoint[1].setValue(ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X)),
- ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y)));
if (aPoint[0].getX() > aPoint[1].getX() || aPoint[0].getY() > aPoint[1].getY()) {
throw new IllegalArgumentException(
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
index cb89147..550cfc4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
@@ -75,7 +75,7 @@
super.runArgEvals(tuple);
int edThreshStart = argOut.getLength();
edThreshEval.evaluate(tuple);
- edThresh = IntegerSerializerDeserializer.getInt(argOut.getBytes(), edThreshStart + typeIndicatorSize);
+ edThresh = IntegerSerializerDeserializer.getInt(argOut.getByteArray(), edThreshStart + typeIndicatorSize);
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
index 67a8dfa..a0b4af0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
@@ -85,7 +85,7 @@
eval0.evaluate(tuple);
outInput1.reset();
eval1.evaluate(tuple);
- byte[] serRecord = outInput0.getBytes();
+ byte[] serRecord = outInput0.getByteArray();
if (serRecord[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
@@ -97,7 +97,7 @@
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[0]));
}
- byte[] serFldName = outInput1.getBytes();
+ byte[] serFldName = outInput1.getByteArray();
fieldValueOffset = ARecordSerializerDeserializer.getFieldOffsetByName(serRecord, serFldName);
if (fieldValueOffset < 0) {
out.writeByte(ATypeTag.NULL.serialize());
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
index 4ce843b..34ea593 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
@@ -87,7 +87,7 @@
evalList.evaluate(tuple);
outInputIdx.reset();
evalIdx.evaluate(tuple);
- byte[] serOrderedList = outInputList.getBytes();
+ byte[] serOrderedList = outInputList.getByteArray();
if (serOrderedList[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
@@ -99,7 +99,7 @@
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serOrderedList[0]));
}
- itemIndex = IntegerSerializerDeserializer.getInt(outInputIdx.getBytes(), 1);
+ itemIndex = IntegerSerializerDeserializer.getInt(outInputIdx.getByteArray(), 1);
if (itemIndex >= AOrderedListSerializerDeserializer.getNumberOfItems(serOrderedList)) {
out.writeByte(SER_NULL_TYPE_TAG);
return;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
index 478316f..941bd53 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
@@ -55,9 +55,9 @@
// evaluator the failure condition
argOut.reset();
evals[1].evaluate(tuple);
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[0]);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]);
if (typeTag == ATypeTag.BOOLEAN) {
- boolean argResult = ABooleanSerializerDeserializer.getBoolean(argOut.getBytes(), 1);
+ boolean argResult = ABooleanSerializerDeserializer.getBoolean(argOut.getByteArray(), 1);
if (argResult)
throw new AlgebricksException("Injecting a intended failure");
}
@@ -65,7 +65,7 @@
// evaluate the real evaluator
argOut.reset();
evals[0].evaluate(tuple);
- output.getDataOutput().write(argOut.getBytes(), argOut.getStartIndex(), argOut.getLength());
+ output.getDataOutput().write(argOut.getByteArray(), argOut.getStartOffset(), argOut.getLength());
} catch (IOException e) {
throw new AlgebricksException(e);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
index 59bce2d..9583c75 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
@@ -49,7 +49,7 @@
public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
argOut.reset();
eval.evaluate(tuple);
- boolean isNull = argOut.getBytes()[argOut.getStartIndex()] == SER_NULL_TYPE_TAG;
+ boolean isNull = argOut.getByteArray()[argOut.getStartOffset()] == SER_NULL_TYPE_TAG;
ABoolean res = isNull ? ABoolean.TRUE : ABoolean.FALSE;
try {
AObjectSerializerDeserializer.INSTANCE.serialize(res, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
index 769fdb7..b87eb37 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
@@ -67,7 +67,7 @@
inputVal.reset();
evalList.evaluate(tuple);
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
if (serList[0] == SER_NULL_TYPE_TAG) {
try {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
index 1090742..3a4af19 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
@@ -91,7 +91,7 @@
try {
array0.reset();
evalPattern.evaluate(tuple);
- if (array0.getBytes()[0] == SER_NULL_TYPE_TAG) {
+ if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, dout);
return;
}
@@ -100,7 +100,7 @@
first = false;
newPattern = true;
} else {
- int c = strComp.compare(array0.getBytes(), array0.getStartIndex(), array0.getLength(),
+ int c = strComp.compare(array0.getByteArray(), array0.getStartOffset(), array0.getLength(),
lastPattern.getByteArray(), 0, lastPattern.size());
if (c != 0) {
newPattern = true;
@@ -108,7 +108,7 @@
}
if (newPattern) {
lastPattern.reset();
- lastPattern.write(array0.getBytes(), array0.getStartIndex(), array0.getLength());
+ lastPattern.write(array0.getByteArray(), array0.getStartOffset(), array0.getLength());
// ! object creation !
DataInputStream di = new DataInputStream(new ByteArrayInputStream(
lastPattern.getByteArray()));
@@ -118,7 +118,7 @@
}
array0.reset();
evalString.evaluate(tuple);
- if (array0.getBytes()[0] == SER_NULL_TYPE_TAG) {
+ if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, dout);
return;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
index 1e4cb3e..0ddf9f6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
@@ -68,11 +68,11 @@
argOut.reset();
eval.evaluate(tuple);
try {
- if (argOut.getBytes()[0] == SER_BOOLEAN_TYPE_TAG) {
- boolean argRes = ABooleanSerializerDeserializer.getBoolean(argOut.getBytes(), 1);
+ if (argOut.getByteArray()[0] == SER_BOOLEAN_TYPE_TAG) {
+ boolean argRes = ABooleanSerializerDeserializer.getBoolean(argOut.getByteArray(), 1);
ABoolean aResult = argRes ? (ABoolean.FALSE) : (ABoolean.TRUE);
booleanSerde.serialize(aResult, out);
- } else if (argOut.getBytes()[0] == SER_NULL_TYPE_TAG)
+ } else if (argOut.getByteArray()[0] == SER_NULL_TYPE_TAG)
nullSerde.serialize(ANull.NULL, out);
else
throw new AlgebricksException(errorMessage);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java
index 405a006..b525bc3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAddDescriptor.java
@@ -88,36 +88,36 @@
evalLeft.evaluate(tuple);
else
evalRight.evaluate(tuple);
- typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[0]);
+ typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8 = true;
- operands[i] = AInt8SerializerDeserializer.getByte(argOut.getBytes(), 1);
+ operands[i] = AInt8SerializerDeserializer.getByte(argOut.getByteArray(), 1);
break;
}
case INT16: {
metInt16 = true;
- operands[i] = AInt16SerializerDeserializer.getShort(argOut.getBytes(), 1);
+ operands[i] = AInt16SerializerDeserializer.getShort(argOut.getByteArray(), 1);
break;
}
case INT32: {
metInt32 = true;
- operands[i] = AInt32SerializerDeserializer.getInt(argOut.getBytes(), 1);
+ operands[i] = AInt32SerializerDeserializer.getInt(argOut.getByteArray(), 1);
break;
}
case INT64: {
metInt64 = true;
- operands[i] = AInt64SerializerDeserializer.getLong(argOut.getBytes(), 1);
+ operands[i] = AInt64SerializerDeserializer.getLong(argOut.getByteArray(), 1);
break;
}
case FLOAT: {
metFloat = true;
- operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getBytes(), 1);
+ operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getByteArray(), 1);
break;
}
case DOUBLE: {
metDouble = true;
- operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(), 1);
+ operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(), 1);
break;
}
case NULL: {
@@ -131,7 +131,7 @@
: "Right"
+ " Operand of Addition can not be "
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut
- .getBytes()[0]));
+ .getByteArray()[0]));
}
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java
index a6d0f47..39c1fbf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericDivideDescriptor.java
@@ -88,36 +88,36 @@
evalLeft.evaluate(tuple);
else
evalRight.evaluate(tuple);
- typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[0]);
+ typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8 = true;
- operands[i] = AInt8SerializerDeserializer.getByte(argOut.getBytes(), 1);
+ operands[i] = AInt8SerializerDeserializer.getByte(argOut.getByteArray(), 1);
break;
}
case INT16: {
metInt16 = true;
- operands[i] = AInt16SerializerDeserializer.getShort(argOut.getBytes(), 1);
+ operands[i] = AInt16SerializerDeserializer.getShort(argOut.getByteArray(), 1);
break;
}
case INT32: {
metInt32 = true;
- operands[i] = AInt32SerializerDeserializer.getInt(argOut.getBytes(), 1);
+ operands[i] = AInt32SerializerDeserializer.getInt(argOut.getByteArray(), 1);
break;
}
case INT64: {
metInt64 = true;
- operands[i] = AInt64SerializerDeserializer.getLong(argOut.getBytes(), 1);
+ operands[i] = AInt64SerializerDeserializer.getLong(argOut.getByteArray(), 1);
break;
}
case FLOAT: {
metFloat = true;
- operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getBytes(), 1);
+ operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getByteArray(), 1);
break;
}
case DOUBLE: {
metDouble = true;
- operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(), 1);
+ operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(), 1);
break;
}
case NULL: {
@@ -131,7 +131,7 @@
: "Right"
+ " Operand of Division can not be "
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut
- .getBytes()[0]));
+ .getByteArray()[0]));
}
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java
index 33a1a90..ed7626e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericMultiplyDescriptor.java
@@ -88,36 +88,36 @@
evalLeft.evaluate(tuple);
else
evalRight.evaluate(tuple);
- typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[0]);
+ typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8 = true;
- operands[i] = AInt8SerializerDeserializer.getByte(argOut.getBytes(), 1);
+ operands[i] = AInt8SerializerDeserializer.getByte(argOut.getByteArray(), 1);
break;
}
case INT16: {
metInt16 = true;
- operands[i] = AInt16SerializerDeserializer.getShort(argOut.getBytes(), 1);
+ operands[i] = AInt16SerializerDeserializer.getShort(argOut.getByteArray(), 1);
break;
}
case INT32: {
metInt32 = true;
- operands[i] = AInt32SerializerDeserializer.getInt(argOut.getBytes(), 1);
+ operands[i] = AInt32SerializerDeserializer.getInt(argOut.getByteArray(), 1);
break;
}
case INT64: {
metInt64 = true;
- operands[i] = AInt64SerializerDeserializer.getLong(argOut.getBytes(), 1);
+ operands[i] = AInt64SerializerDeserializer.getLong(argOut.getByteArray(), 1);
break;
}
case FLOAT: {
metFloat = true;
- operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getBytes(), 1);
+ operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getByteArray(), 1);
break;
}
case DOUBLE: {
metDouble = true;
- operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(), 1);
+ operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(), 1);
break;
}
case NULL: {
@@ -131,7 +131,7 @@
: "Right"
+ " Operand of Multiplication can not be "
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut
- .getBytes()[0]));
+ .getByteArray()[0]));
}
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
index ffed14e..77ae37c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
@@ -88,36 +88,36 @@
evalLeft.evaluate(tuple);
else
evalRight.evaluate(tuple);
- typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[0]);
+ typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]);
switch (typeTag) {
case INT8: {
metInt8 = true;
- operands[i] = AInt8SerializerDeserializer.getByte(argOut.getBytes(), 1);
+ operands[i] = AInt8SerializerDeserializer.getByte(argOut.getByteArray(), 1);
break;
}
case INT16: {
metInt16 = true;
- operands[i] = AInt16SerializerDeserializer.getShort(argOut.getBytes(), 1);
+ operands[i] = AInt16SerializerDeserializer.getShort(argOut.getByteArray(), 1);
break;
}
case INT32: {
metInt32 = true;
- operands[i] = AInt32SerializerDeserializer.getInt(argOut.getBytes(), 1);
+ operands[i] = AInt32SerializerDeserializer.getInt(argOut.getByteArray(), 1);
break;
}
case INT64: {
metInt64 = true;
- operands[i] = AInt64SerializerDeserializer.getLong(argOut.getBytes(), 1);
+ operands[i] = AInt64SerializerDeserializer.getLong(argOut.getByteArray(), 1);
break;
}
case FLOAT: {
metFloat = true;
- operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getBytes(), 1);
+ operands[i] = AFloatSerializerDeserializer.getFloat(argOut.getByteArray(), 1);
break;
}
case DOUBLE: {
metDouble = true;
- operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(), 1);
+ operands[i] = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(), 1);
break;
}
case NULL: {
@@ -131,7 +131,7 @@
: "Right"
+ " Operand of Substraction can not be "
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut
- .getBytes()[0]));
+ .getByteArray()[0]));
}
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
index cd234cb..73181d6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
@@ -80,44 +80,44 @@
argOut.reset();
eval.evaluate(tuple);
try {
- if (argOut.getBytes()[0] == serNullTypeTag) {
+ if (argOut.getByteArray()[0] == serNullTypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ANULL);
serde.serialize(ANull.NULL, out);
return;
- } else if (argOut.getBytes()[0] == serInt8TypeTag) {
+ } else if (argOut.getByteArray()[0] == serInt8TypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT8);
- aInt8.setValue((byte) -AInt8SerializerDeserializer.getByte(argOut.getBytes(), 1));
+ aInt8.setValue((byte) -AInt8SerializerDeserializer.getByte(argOut.getByteArray(), 1));
serde.serialize(aInt8, out);
- } else if (argOut.getBytes()[0] == serInt16TypeTag) {
+ } else if (argOut.getByteArray()[0] == serInt16TypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT16);
- aInt16.setValue((short) -AInt16SerializerDeserializer.getShort(argOut.getBytes(), 1));
+ aInt16.setValue((short) -AInt16SerializerDeserializer.getShort(argOut.getByteArray(), 1));
serde.serialize(aInt16, out);
- } else if (argOut.getBytes()[0] == serInt32TypeTag) {
+ } else if (argOut.getByteArray()[0] == serInt32TypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT32);
- aInt32.setValue(-AInt32SerializerDeserializer.getInt(argOut.getBytes(), 1));
+ aInt32.setValue(-AInt32SerializerDeserializer.getInt(argOut.getByteArray(), 1));
serde.serialize(aInt32, out);
- } else if (argOut.getBytes()[0] == serInt64TypeTag) {
+ } else if (argOut.getByteArray()[0] == serInt64TypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT64);
- aInt64.setValue(-AInt64SerializerDeserializer.getLong(argOut.getBytes(), 1));
+ aInt64.setValue(-AInt64SerializerDeserializer.getLong(argOut.getByteArray(), 1));
serde.serialize(aInt64, out);
- } else if (argOut.getBytes()[0] == serFloatTypeTag) {
+ } else if (argOut.getByteArray()[0] == serFloatTypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AFLOAT);
- aFloat.setValue(-AFloatSerializerDeserializer.getFloat(argOut.getBytes(), 1));
+ aFloat.setValue(-AFloatSerializerDeserializer.getFloat(argOut.getByteArray(), 1));
serde.serialize(aFloat, out);
- } else if (argOut.getBytes()[0] == serDoubleTypeTag) {
+ } else if (argOut.getByteArray()[0] == serDoubleTypeTag) {
serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ADOUBLE);
- aDouble.setValue(-ADoubleSerializerDeserializer.getDouble(argOut.getBytes(), 1));
+ aDouble.setValue(-ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(), 1));
serde.serialize(aDouble, out);
} else {
throw new NotImplementedException("Unary minus is not implemented for "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getBytes()[0]));
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]));
}
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
index aeb6b15..cc53a04 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
@@ -81,7 +81,7 @@
evalNames[i].evaluate(tuple);
recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
} else {
- if (fieldValueBuffer.getBytes()[0] != ATypeTag.NULL.serialize()) {
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize()) {
recBuilder.addField(closedFieldId, fieldValueBuffer);
}
closedFieldId++;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
index 837d54a..c310164 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
@@ -69,11 +69,11 @@
for (int i = 0; i < n; i++) {
argOut.reset();
evals[i].evaluate(tuple);
- if (argOut.getBytes()[0] == SER_NULL_TYPE_TAG) {
+ if (argOut.getByteArray()[0] == SER_NULL_TYPE_TAG) {
metNull = true;
continue;
}
- boolean argResult = ABooleanSerializerDeserializer.getBoolean(argOut.getBytes(), 1);
+ boolean argResult = ABooleanSerializerDeserializer.getBoolean(argOut.getByteArray(), 1);
if (argResult == true) {
res = true;
break;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
index 880e84e..3e70f3c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
@@ -65,19 +65,19 @@
// length
inputVal.reset();
evalLen.evaluate(tuple);
- int length = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int length = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
// similarity threshold
inputVal.reset();
evalThreshold.evaluate(tuple);
float similarityThreshold = (float) ADoubleSerializerDeserializer.getDouble(
- inputVal.getBytes(), 1);
+ inputVal.getByteArray(), 1);
// similarity name
inputVal.reset();
evalSimilarity.evaluate(tuple);
SimilarityFilters similarityFilters = similarityFiltersCache.get(similarityThreshold,
- inputVal.getBytes());
+ inputVal.getByteArray());
int prefixLength = similarityFilters.getPrefixLength(length);
res.setValue(prefixLength);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
index ab95a36..8021c2d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
@@ -64,12 +64,12 @@
// length
inputVal.reset();
evalLen.evaluate(tuple);
- int length = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int length = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
// similarity threshold
inputVal.reset();
evalThreshold.evaluate(tuple);
- float similarityThreshold = (float) AFloatSerializerDeserializer.getFloat(inputVal.getBytes(),
+ float similarityThreshold = (float) AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(),
1);
if (similarityThreshold != similarityThresholdCache || similarityFilters == null) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
index 2a415e4..596439e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
@@ -91,7 +91,7 @@
try {
array0.reset();
evalPattern.evaluate(tuple);
- if (array0.getBytes()[0] == SER_NULL_TYPE_TAG) {
+ if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, dout);
return;
}
@@ -100,7 +100,7 @@
first = false;
newPattern = true;
} else {
- int c = strComp.compare(array0.getBytes(), array0.getStartIndex(), array0.getLength(),
+ int c = strComp.compare(array0.getByteArray(), array0.getStartOffset(), array0.getLength(),
lastPattern.getByteArray(), 0, lastPattern.size());
if (c != 0) {
newPattern = true;
@@ -108,7 +108,7 @@
}
if (newPattern) {
lastPattern.reset();
- lastPattern.write(array0.getBytes(), array0.getStartIndex(), array0.getLength());
+ lastPattern.write(array0.getByteArray(), array0.getStartOffset(), array0.getLength());
// ! object creation !
DataInputStream di = new DataInputStream(new ByteArrayInputStream(
lastPattern.getByteArray()));
@@ -118,7 +118,7 @@
}
array0.reset();
evalString.evaluate(tuple);
- if (array0.getBytes()[0] == SER_NULL_TYPE_TAG) {
+ if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, dout);
return;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
index 85adfe1..90788a6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
@@ -85,21 +85,21 @@
inputVal.reset();
evalThreshold.evaluate(tuple);
float similarityThreshold = (float) ADoubleSerializerDeserializer.getDouble(
- inputVal.getBytes(), 1);
+ inputVal.getByteArray(), 1);
// similarity name
inputVal.reset();
evalSimilarity.evaluate(tuple);
SimilarityFilters similarityFilters = similarityFiltersCache.get(similarityThreshold,
- inputVal.getBytes());
+ inputVal.getByteArray());
inputVal.reset();
evalLen1.evaluate(tuple);
- int length1 = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int length1 = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
inputVal.reset();
evalLen2.evaluate(tuple);
- int length2 = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int length2 = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
float sim = 0;
@@ -114,7 +114,7 @@
inputVal.reset();
evalTokens1.evaluate(tuple);
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
if (serList[0] != SER_ORDEREDLIST_TYPE_TAG && serList[0] != SER_UNORDEREDLIST_TYPE_TAG) {
throw new AlgebricksException("Scan collection is not defined for values of type"
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
@@ -123,7 +123,7 @@
int lengthTokens1;
if (serList[0] == SER_ORDEREDLIST_TYPE_TAG) {
lengthTokens1 = AOrderedListSerializerDeserializer
- .getNumberOfItems(inputVal.getBytes());
+ .getNumberOfItems(inputVal.getByteArray());
// read tokens
for (i = 0; i < lengthTokens1; i++) {
int itemOffset;
@@ -136,7 +136,7 @@
}
} else {
lengthTokens1 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal
- .getBytes());
+ .getByteArray());
// read tokens
for (i = 0; i < lengthTokens1; i++) {
int itemOffset;
@@ -158,7 +158,7 @@
inputVal.reset();
evalTokens2.evaluate(tuple);
- serList = inputVal.getBytes();
+ serList = inputVal.getByteArray();
if (serList[0] != SER_ORDEREDLIST_TYPE_TAG && serList[0] != SER_UNORDEREDLIST_TYPE_TAG) {
throw new AlgebricksException("Scan collection is not defined for values of type"
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
@@ -167,7 +167,7 @@
int lengthTokens2;
if (serList[0] == SER_ORDEREDLIST_TYPE_TAG) {
lengthTokens2 = AOrderedListSerializerDeserializer
- .getNumberOfItems(inputVal.getBytes());
+ .getNumberOfItems(inputVal.getByteArray());
// read tokens
for (i = 0; i < lengthTokens2; i++) {
int itemOffset;
@@ -180,7 +180,7 @@
}
} else {
lengthTokens2 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal
- .getBytes());
+ .getByteArray());
// read tokens
for (i = 0; i < lengthTokens2; i++) {
int itemOffset;
@@ -200,7 +200,7 @@
// -- - token prefix - --
inputVal.reset();
evalTokenPrefix.evaluate(tuple);
- int tokenPrefix = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ int tokenPrefix = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
//
// -- - position filter - --
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
index 3021717..971bfee 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
@@ -79,7 +79,7 @@
super.runArgEvals(tuple);
int jaccThreshStart = argOut.getLength();
jaccThreshEval.evaluate(tuple);
- jaccThresh = (float) AFloatSerializerDeserializer.getFloat(argOut.getBytes(), jaccThreshStart
+ jaccThresh = (float) AFloatSerializerDeserializer.getFloat(argOut.getByteArray(), jaccThreshStart
+ typeIndicatorSize);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
index 91496fd..7736fa7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
@@ -55,36 +55,36 @@
eval.evaluate(tuple);
try {
- byte[] bytes = argOut.getBytes();
+ byte[] bytes = argOut.getByteArray();
ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]);
double area = 0.0;
switch (tag) {
case POLYGON:
- int numOfPoints = AInt16SerializerDeserializer.getShort(argOut.getBytes(), 1);
+ int numOfPoints = AInt16SerializerDeserializer.getShort(argOut.getByteArray(), 1);
if (numOfPoints < 3) {
throw new AlgebricksException("Polygon must have at least 3 points");
}
- area = Math.abs(SpatialUtils.polygonArea(argOut.getBytes(), numOfPoints));
+ area = Math.abs(SpatialUtils.polygonArea(argOut.getByteArray(), numOfPoints));
break;
case CIRCLE:
- double radius = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(),
+ double radius = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
ACircleSerializerDeserializer.getRadiusOffset());
area = SpatialUtils.pi() * radius * radius;
break;
case RECTANGLE:
- double x1 = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(),
+ double x1 = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
ARectangleSerializerDeserializer
.getBottomLeftCoordinateOffset(Coordinate.X));
- double y1 = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(),
+ double y1 = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
ARectangleSerializerDeserializer
.getBottomLeftCoordinateOffset(Coordinate.Y));
- double x2 = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(),
+ double x2 = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
ARectangleSerializerDeserializer
.getUpperRightCoordinateOffset(Coordinate.X));
- double y2 = ADoubleSerializerDeserializer.getDouble(argOut.getBytes(),
+ double y2 = ADoubleSerializerDeserializer.getDouble(argOut.getByteArray(),
ARectangleSerializerDeserializer
.getUpperRightCoordinateOffset(Coordinate.Y));
area = (x2 - x1) * (y2 - y1);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
index 85586d8..5182ee8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
@@ -75,20 +75,20 @@
eval3.evaluate(tuple);
try {
- ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getBytes()[0]);
+ ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getByteArray()[0]);
if (tag == ATypeTag.POINT) {
- double xLoc = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double xLoc = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
- double yLoc = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double yLoc = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
- double xOrigin = ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ double xOrigin = ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
- double yOrigin = ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ double yOrigin = ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
- double xInc = ADoubleSerializerDeserializer.getDouble(outInput2.getBytes(), 1);
- double yInc = ADoubleSerializerDeserializer.getDouble(outInput3.getBytes(), 1);
+ double xInc = ADoubleSerializerDeserializer.getDouble(outInput2.getByteArray(), 1);
+ double yInc = ADoubleSerializerDeserializer.getDouble(outInput3.getByteArray(), 1);
double x = xOrigin + (Math.floor((xLoc - xOrigin) / xInc)) * xInc;
double y = yOrigin + (Math.floor((yLoc - yOrigin) / yInc)) * yInc;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
index 3ea1994..3a474ca 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
@@ -56,20 +56,20 @@
eval1.evaluate(tuple);
try {
- byte[] bytes0 = outInput0.getBytes();
- byte[] bytes1 = outInput1.getBytes();
+ byte[] bytes0 = outInput0.getByteArray();
+ byte[] bytes1 = outInput1.getByteArray();
ATypeTag tag0 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes0[0]);
ATypeTag tag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes1[0]);
double distance = 0.0;
if (tag0 == ATypeTag.POINT) {
if (tag1 == ATypeTag.POINT) {
- double x1 = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double x1 = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
- double y1 = ADoubleSerializerDeserializer.getDouble(outInput0.getBytes(),
+ double y1 = ADoubleSerializerDeserializer.getDouble(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
- double x2 = ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ double x2 = ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
- double y2 = ADoubleSerializerDeserializer.getDouble(outInput1.getBytes(),
+ double y2 = ADoubleSerializerDeserializer.getDouble(outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
} else {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
index 272e7e0..07eeb10 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
@@ -751,20 +751,20 @@
try {
boolean res = false;
- ATypeTag tag0 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getBytes()[0]);
- ATypeTag tag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput1.getBytes()[0]);
+ ATypeTag tag0 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getByteArray()[0]);
+ ATypeTag tag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput1.getByteArray()[0]);
switch (tag0) {
case POINT:
switch (tag1) {
case POINT:
- if (ascDoubleComp.compare(outInput0.getBytes(),
+ if (ascDoubleComp.compare(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X), 8,
- outInput1.getBytes(),
+ outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.X), 8) == 0) {
- if (ascDoubleComp.compare(outInput0.getBytes(),
+ if (ascDoubleComp.compare(outInput0.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y),
- 8, outInput1.getBytes(),
+ 8, outInput1.getByteArray(),
APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y),
8) == 0) {
res = true;
@@ -772,16 +772,16 @@
}
break;
case LINE:
- res = pointOnLine(outInput1.getBytes(), outInput0.getBytes());
+ res = pointOnLine(outInput1.getByteArray(), outInput0.getByteArray());
break;
case POLYGON:
- res = pointInPolygon(outInput0.getBytes(), outInput1.getBytes());
+ res = pointInPolygon(outInput0.getByteArray(), outInput1.getByteArray());
break;
case CIRCLE:
- res = pointInCircle(outInput0.getBytes(), outInput1.getBytes());
+ res = pointInCircle(outInput0.getByteArray(), outInput1.getByteArray());
break;
case RECTANGLE:
- res = pointInRectangle(outInput0.getBytes(), outInput1.getBytes());
+ res = pointInRectangle(outInput0.getByteArray(), outInput1.getByteArray());
break;
case NULL:
res = false;
@@ -796,45 +796,45 @@
case LINE:
switch (tag1) {
case POINT:
- res = pointOnLine(outInput0.getBytes(), outInput1.getBytes());
+ res = pointOnLine(outInput0.getByteArray(), outInput1.getByteArray());
break;
case LINE:
double startX1 = ADoubleSerializerDeserializer.getDouble(outInput0
- .getBytes(), ALineSerializerDeserializer
+ .getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.X));
double startY1 = ADoubleSerializerDeserializer.getDouble(outInput0
- .getBytes(), ALineSerializerDeserializer
+ .getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.Y));
double endX1 = ADoubleSerializerDeserializer.getDouble(
- outInput0.getBytes(), ALineSerializerDeserializer
+ outInput0.getByteArray(), ALineSerializerDeserializer
.getEndPointCoordinateOffset(Coordinate.X));
double endY1 = ADoubleSerializerDeserializer.getDouble(
- outInput0.getBytes(), ALineSerializerDeserializer
+ outInput0.getByteArray(), ALineSerializerDeserializer
.getEndPointCoordinateOffset(Coordinate.Y));
double startX2 = ADoubleSerializerDeserializer.getDouble(outInput1
- .getBytes(), ALineSerializerDeserializer
+ .getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.X));
double startY2 = ADoubleSerializerDeserializer.getDouble(outInput1
- .getBytes(), ALineSerializerDeserializer
+ .getByteArray(), ALineSerializerDeserializer
.getStartPointCoordinateOffset(Coordinate.Y));
double endX2 = ADoubleSerializerDeserializer.getDouble(
- outInput1.getBytes(), ALineSerializerDeserializer
+ outInput1.getByteArray(), ALineSerializerDeserializer
.getEndPointCoordinateOffset(Coordinate.X));
double endY2 = ADoubleSerializerDeserializer.getDouble(
- outInput1.getBytes(), ALineSerializerDeserializer
+ outInput1.getByteArray(), ALineSerializerDeserializer
.getEndPointCoordinateOffset(Coordinate.Y));
res = lineLineIntersection(startX1, startY1, endX1, endY1, startX2,
startY2, endX2, endY2);
break;
case POLYGON:
- res = linePolygonIntersection(outInput0.getBytes(), outInput1.getBytes());
+ res = linePolygonIntersection(outInput0.getByteArray(), outInput1.getByteArray());
break;
case CIRCLE:
- res = lineCircleIntersection(outInput0.getBytes(), outInput1.getBytes());
+ res = lineCircleIntersection(outInput0.getByteArray(), outInput1.getByteArray());
break;
case RECTANGLE:
- res = lineRectangleIntersection(outInput0.getBytes(), outInput1.getBytes());
+ res = lineRectangleIntersection(outInput0.getByteArray(), outInput1.getByteArray());
break;
case NULL:
res = false;
@@ -849,26 +849,26 @@
case POLYGON:
switch (tag1) {
case POINT:
- res = pointInPolygon(outInput1.getBytes(), outInput0.getBytes());
+ res = pointInPolygon(outInput1.getByteArray(), outInput0.getByteArray());
break;
case LINE:
- res = linePolygonIntersection(outInput1.getBytes(), outInput0.getBytes());
+ res = linePolygonIntersection(outInput1.getByteArray(), outInput0.getByteArray());
break;
case POLYGON:
int numOfPoints0 = AInt16SerializerDeserializer.getShort(
- outInput0.getBytes(),
+ outInput0.getByteArray(),
APolygonSerializerDeserializer.getNumberOfPointsOffset());
int numOfPoints1 = AInt16SerializerDeserializer.getShort(
- outInput1.getBytes(),
+ outInput1.getByteArray(),
APolygonSerializerDeserializer.getNumberOfPointsOffset());
if (numOfPoints0 < 3 || numOfPoints1 < 3) {
throw new AlgebricksException("Polygon must have at least 3 points.");
}
- getCounterClockWisePolygon(outInput0.getBytes(), pointsOffsets0,
+ getCounterClockWisePolygon(outInput0.getByteArray(), pointsOffsets0,
numOfPoints0);
- getCounterClockWisePolygon(outInput1.getBytes(), pointsOffsets1,
+ getCounterClockWisePolygon(outInput1.getByteArray(), pointsOffsets1,
numOfPoints1);
int nonSimplePolygonDetection0 = 2 * numOfPoints0;
int nonSimplePolygonDetection1 = 2 * numOfPoints1;
@@ -880,7 +880,7 @@
trianglesX1.reset();
trianglesY1.reset();
while (true) {
- middleVertex1 = triangulatePolygon(outInput1.getBytes(), numOfPoints1,
+ middleVertex1 = triangulatePolygon(outInput1.getByteArray(), numOfPoints1,
pointsOffsets1, trianglesX1, trianglesY1, numOfTriangles1,
nonSimplePolygonDetection1, middleVertex1);
@@ -896,7 +896,7 @@
trianglesX0.reset();
trianglesY0.reset();
while (true) {
- middleVertex0 = triangulatePolygon(outInput0.getBytes(), numOfPoints0,
+ middleVertex0 = triangulatePolygon(outInput0.getByteArray(), numOfPoints0,
pointsOffsets0, trianglesX0, trianglesY0, numOfTriangles0,
nonSimplePolygonDetection0, middleVertex0);
@@ -929,11 +929,11 @@
}
break;
case CIRCLE:
- res = polygonCircleIntersection(outInput0.getBytes(), outInput1.getBytes());
+ res = polygonCircleIntersection(outInput0.getByteArray(), outInput1.getByteArray());
break;
case RECTANGLE:
- res = rectanglePolygonIntersection(outInput1.getBytes(),
- outInput0.getBytes());
+ res = rectanglePolygonIntersection(outInput1.getByteArray(),
+ outInput0.getByteArray());
break;
case NULL:
res = false;
@@ -948,20 +948,20 @@
case CIRCLE:
switch (tag1) {
case POINT:
- res = pointInCircle(outInput1.getBytes(), outInput0.getBytes());
+ res = pointInCircle(outInput1.getByteArray(), outInput0.getByteArray());
break;
case LINE:
- res = lineCircleIntersection(outInput1.getBytes(), outInput0.getBytes());
+ res = lineCircleIntersection(outInput1.getByteArray(), outInput0.getByteArray());
break;
case POLYGON:
- res = polygonCircleIntersection(outInput1.getBytes(), outInput0.getBytes());
+ res = polygonCircleIntersection(outInput1.getByteArray(), outInput0.getByteArray());
break;
case CIRCLE:
- res = circleCircleIntersection(outInput0.getBytes(), outInput1.getBytes());
+ res = circleCircleIntersection(outInput0.getByteArray(), outInput1.getByteArray());
break;
case RECTANGLE:
- res = rectangleCircleIntersection(outInput1.getBytes(),
- outInput0.getBytes());
+ res = rectangleCircleIntersection(outInput1.getByteArray(),
+ outInput0.getByteArray());
break;
case NULL:
res = false;
@@ -976,22 +976,22 @@
case RECTANGLE:
switch (tag1) {
case POINT:
- res = pointInRectangle(outInput1.getBytes(), outInput0.getBytes());
+ res = pointInRectangle(outInput1.getByteArray(), outInput0.getByteArray());
break;
case LINE:
- res = lineRectangleIntersection(outInput1.getBytes(), outInput0.getBytes());
+ res = lineRectangleIntersection(outInput1.getByteArray(), outInput0.getByteArray());
break;
case POLYGON:
- res = rectanglePolygonIntersection(outInput0.getBytes(),
- outInput1.getBytes());
+ res = rectanglePolygonIntersection(outInput0.getByteArray(),
+ outInput1.getByteArray());
break;
case CIRCLE:
- res = rectangleCircleIntersection(outInput0.getBytes(),
- outInput1.getBytes());
+ res = rectangleCircleIntersection(outInput0.getByteArray(),
+ outInput1.getByteArray());
break;
case RECTANGLE:
- triangulateRectangle(outInput0.getBytes(), trianglesX0, trianglesY0);
- triangulateRectangle(outInput1.getBytes(), trianglesX1, trianglesY1);
+ triangulateRectangle(outInput0.getByteArray(), trianglesX0, trianglesY0);
+ triangulateRectangle(outInput1.getByteArray(), trianglesX1, trianglesY1);
boolean intersect = false;
// 2 triangles in a rectangle
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
index c2678b5..8f3ca50 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
@@ -49,14 +49,14 @@
public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
argOut.reset();
evalStart.evaluate(tuple);
- int start = IntegerSerializerDeserializer.getInt(argOut.getBytes(), 1) - 1;
+ int start = IntegerSerializerDeserializer.getInt(argOut.getByteArray(), 1) - 1;
argOut.reset();
evalLen.evaluate(tuple);
- int len = IntegerSerializerDeserializer.getInt(argOut.getBytes(), 1);
+ int len = IntegerSerializerDeserializer.getInt(argOut.getByteArray(), 1);
argOut.reset();
evalString.evaluate(tuple);
- byte[] bytes = argOut.getBytes();
+ byte[] bytes = argOut.getByteArray();
int utflen = UTF8StringPointable.getUTFLen(bytes, 1);
int sStart = 3;
int c = 0;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
index 1c1ca13..93ad6fb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
@@ -71,7 +71,7 @@
if (equals(condOut, caseOut)) {
argOut.reset();
evals[i + 1].evaluate(tuple);
- output.getDataOutput().write(argOut.getBytes(), argOut.getStartIndex(),
+ output.getDataOutput().write(argOut.getByteArray(), argOut.getStartOffset(),
argOut.getLength());
return;
}
@@ -79,7 +79,7 @@
// the default case
argOut.reset();
evals[n - 1].evaluate(tuple);
- output.getDataOutput().write(argOut.getBytes(), argOut.getStartIndex(), argOut.getLength());
+ output.getDataOutput().write(argOut.getByteArray(), argOut.getStartOffset(), argOut.getLength());
} catch (HyracksDataException hde) {
throw new AlgebricksException(hde);
} catch (IOException ioe) {
@@ -88,11 +88,11 @@
}
private boolean equals(ArrayBackedValueStorage out1, ArrayBackedValueStorage out2) {
- if (out1.getStartIndex() != out2.getStartIndex() || out1.getLength() != out2.getLength())
+ if (out1.getStartOffset() != out2.getStartOffset() || out1.getLength() != out2.getLength())
return false;
- byte[] data1 = out1.getBytes();
- byte[] data2 = out2.getBytes();
- for (int i = out1.getStartIndex(); i < out1.getLength(); i++) {
+ byte[] data1 = out1.getByteArray();
+ byte[] data2 = out2.getByteArray();
+ for (int i = out1.getStartOffset(); i < out1.getLength(); i++) {
if (data1[i] != data2[i]) {
return false;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java
index 65be0bd..03a5ddc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java
@@ -72,7 +72,7 @@
try {
out1.reset();
eval1.evaluate(tuple);
- byte[] dateArray = out1.getBytes();
+ byte[] dateArray = out1.getByteArray();
if (dateArray[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
index 0fa62aa..efff2cd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
@@ -366,7 +366,7 @@
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
- IEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getBytes(),
+ IEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
abvs.getLength()));
IEvaluatorFactory evalFactory = new FieldAccessByIndexEvalFactory(recordEvalFactory,
fldIndexEvalFactory, recType);
@@ -392,7 +392,7 @@
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
- IEvaluatorFactory dimensionEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs1.getBytes(),
+ IEvaluatorFactory dimensionEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs1.getByteArray(),
abvs1.getLength()));
for (int i = 0; i < numOfFields; i++) {
@@ -404,7 +404,7 @@
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
- IEvaluatorFactory coordinateEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs2.getBytes(),
+ IEvaluatorFactory coordinateEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs2.getByteArray(),
abvs2.getLength()));
evalFactories[i] = new CreateMBREvalFactory(evalFactory, dimensionEvalFactory, coordinateEvalFactory);
@@ -431,7 +431,7 @@
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
- IEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getBytes(),
+ IEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
abvs.getLength()));
IEvaluatorFactory evalFactory = new FieldAccessByIndexEvalFactory(recordEvalFactory,
fldIndexEvalFactory, recType);
@@ -569,7 +569,7 @@
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
- return new ConstantEvalFactory(Arrays.copyOf(abvs.getBytes(), abvs.getLength()));
+ return new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(), abvs.getLength()));
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
index 46d1ba3..43556f2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
@@ -25,8 +25,8 @@
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ALineSerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APoint3DSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APolygonSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
@@ -793,11 +793,11 @@
token = nextToken();
this.admFromLexerStream(token, fieldType, fieldValueBuffer.getDataOutput(), false);
if (openRecordField) {
- if (fieldValueBuffer.getBytes()[0] != ATypeTag.NULL.serialize())
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize())
recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
} else if (recType.getFieldTypes()[fieldId].getTypeTag() == ATypeTag.UNION) {
if (NonTaggedFormatUtil.isOptionalField((AUnionType) recType.getFieldTypes()[fieldId])) {
- if (fieldValueBuffer.getBytes()[0] != ATypeTag.NULL.serialize()) {
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize()) {
recBuilder.addField(fieldId, fieldValueBuffer);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
index 3b52315..573eb78 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
@@ -468,14 +468,14 @@
this.admFromLexerStream(token, fieldType,
fieldValueBuffer.getDataOutput(), false);
if (openRecordField) {
- if (fieldValueBuffer.getBytes()[0] != ATypeTag.NULL
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL
.serialize())
recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
} else if (recType.getFieldTypes()[fieldId].getTypeTag() == ATypeTag.UNION) {
if (NonTaggedFormatUtil
.isOptionalField((AUnionType) recType
.getFieldTypes()[fieldId])) {
- if (fieldValueBuffer.getBytes()[0] != ATypeTag.NULL
+ if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL
.serialize()) {
recBuilder.addField(fieldId, fieldValueBuffer);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AFlatValuePointable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AFlatValuePointable.java
new file mode 100644
index 0000000..b879d8c
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AFlatValuePointable.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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 edu.uci.ics.asterix.runtime.pointables;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.runtime.util.container.IElementFactory;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
+
+public class AFlatValuePointable extends AbstractVisitablePointable {
+
+ public static IElementFactory<IVisitablePointable, IAType> FACTORY = new IElementFactory<IVisitablePointable, IAType>() {
+ public AFlatValuePointable createElement(IAType type) {
+ return new AFlatValuePointable();
+ }
+ };
+
+ private AFlatValuePointable() {
+
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof IValueReference))
+ return false;
+ IValueReference ivf = (IValueReference) o;
+ byte[] odata = ivf.getByteArray();
+ int ostart = ivf.getStartOffset();
+ int olen = ivf.getLength();
+
+ byte[] data = getByteArray();
+ int start = getStartOffset();
+ int len = getLength();
+ if (len != olen)
+ return false;
+ for (int i = 0; i < len; i++) {
+ if (data[start + i] != odata[ostart + i])
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
+ return vistor.visit(this, tag);
+ }
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AListAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AListPointable.java
similarity index 68%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AListAccessor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AListPointable.java
index b3a5108..41669304 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AListAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AListPointable.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors;
+package edu.uci.ics.asterix.runtime.pointables;
import java.io.DataOutputStream;
import java.util.ArrayList;
@@ -26,17 +26,17 @@
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
-import edu.uci.ics.asterix.runtime.accessors.visitor.IBinaryAccessorVisitor;
-import edu.uci.ics.asterix.runtime.util.AccessorAllocator;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.runtime.util.PointableAllocator;
import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
import edu.uci.ics.asterix.runtime.util.container.IElementFactory;
-public class AListAccessor extends AbstractBinaryAccessor {
+public class AListPointable extends AbstractVisitablePointable {
- public static IElementFactory<IBinaryAccessor, IAType> FACTORY = new IElementFactory<IBinaryAccessor, IAType>() {
- public IBinaryAccessor createElement(IAType type) {
- return new AListAccessor((AbstractCollectionType) type);
+ public static IElementFactory<IVisitablePointable, IAType> FACTORY = new IElementFactory<IVisitablePointable, IAType>() {
+ public IVisitablePointable createElement(IAType type) {
+ return new AListPointable((AbstractCollectionType) type);
}
};
@@ -44,15 +44,15 @@
private ATypeTag itemTag;
private boolean typedItemList = false;
- private List<IBinaryAccessor> items = new ArrayList<IBinaryAccessor>();
- private List<IBinaryAccessor> itemTags = new ArrayList<IBinaryAccessor>();
- private AccessorAllocator allocator = new AccessorAllocator();
+ private final List<IVisitablePointable> items = new ArrayList<IVisitablePointable>();
+ private final List<IVisitablePointable> itemTags = new ArrayList<IVisitablePointable>();
+ private final PointableAllocator allocator = new PointableAllocator();
- private byte[] dataBuffer = new byte[32768];
- private ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
- private DataOutputStream dataDos = new DataOutputStream(dataBos);
+ private final byte[] dataBuffer = new byte[32768];
+ private final ResettableByteArrayOutputStream dataBos = new ResettableByteArrayOutputStream();
+ private final DataOutputStream dataDos = new DataOutputStream(dataBos);
- private AListAccessor(AbstractCollectionType inputType) {
+ private AListPointable(AbstractCollectionType inputType) {
if (inputType != null && inputType.getItemType() != null) {
itemType = inputType.getItemType();
if (itemType.getTypeTag() == ATypeTag.ANY) {
@@ -74,7 +74,7 @@
}
@Override
- public void reset(byte[] b, int s, int len) {
+ public void set(byte[] b, int s, int len) {
reset();
int numberOfitems = AInt32SerializerDeserializer.getInt(b, s + 6);
@@ -98,22 +98,22 @@
if (typedItemList) {
for (int i = 0; i < numberOfitems; i++) {
itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, false);
- IBinaryAccessor tag = allocator.allocateFieldType();
- IBinaryAccessor item = allocator.allocateFieldValue(itemType);
+ IVisitablePointable tag = allocator.allocateFieldType();
+ IVisitablePointable item = allocator.allocateFieldValue(itemType);
// set item type tag
int start = dataBos.size();
dataDos.writeByte(itemTag.serialize());
int end = dataBos.size();
- tag.reset(dataBuffer, start, end - start);
+ tag.set(dataBuffer, start, end - start);
itemTags.add(tag);
-
+
// set item value
start = dataBos.size();
dataDos.writeByte(itemTag.serialize());
dataDos.write(b, itemOffset, itemLength);
end = dataBos.size();
- item.reset(dataBuffer, start, end - start);
+ item.set(dataBuffer, start, end - start);
itemOffset += itemLength;
items.add(item);
}
@@ -121,18 +121,18 @@
for (int i = 0; i < numberOfitems; i++) {
itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[itemOffset]);
itemLength = NonTaggedFormatUtil.getFieldValueLength(b, itemOffset, itemTag, true) + 1;
- IBinaryAccessor tag = allocator.allocateFieldType();
- IBinaryAccessor item = allocator.allocateFieldValue(itemType);
+ IVisitablePointable tag = allocator.allocateFieldType();
+ IVisitablePointable item = allocator.allocateFieldValue(itemType);
// set item type tag
int start = dataBos.size();
dataDos.writeByte(itemTag.serialize());
int end = dataBos.size();
- tag.reset(dataBuffer, start, end - start);
+ tag.set(dataBuffer, start, end - start);
itemTags.add(tag);
// open part field already include the type tag
- item.reset(b, itemOffset, itemLength);
+ item.set(b, itemOffset, itemLength);
itemOffset += itemLength;
items.add(item);
}
@@ -143,15 +143,15 @@
}
@Override
- public <R, T> R accept(IBinaryAccessorVisitor<R, T> vistor, T tag) throws AsterixException {
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
return vistor.visit(this, tag);
}
- public List<IBinaryAccessor> getItems() {
+ public List<IVisitablePointable> getItems() {
return items;
}
- public List<IBinaryAccessor> getItemTags() {
+ public List<IVisitablePointable> getItemTags() {
return itemTags;
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/ARecordAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/ARecordPointable.java
similarity index 79%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/ARecordAccessor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/ARecordPointable.java
index 55cea26..72023e2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/ARecordAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/ARecordPointable.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors;
+package edu.uci.ics.asterix.runtime.pointables;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -29,28 +29,28 @@
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
-import edu.uci.ics.asterix.runtime.accessors.visitor.IBinaryAccessorVisitor;
-import edu.uci.ics.asterix.runtime.util.AccessorAllocator;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.runtime.util.PointableAllocator;
import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
import edu.uci.ics.asterix.runtime.util.container.IElementFactory;
import edu.uci.ics.hyracks.api.dataflow.value.INullWriter;
-public class ARecordAccessor extends AbstractBinaryAccessor {
+public class ARecordPointable extends AbstractVisitablePointable {
- public static IElementFactory<IBinaryAccessor, IAType> FACTORY = new IElementFactory<IBinaryAccessor, IAType>() {
- public IBinaryAccessor createElement(IAType type) {
- return new ARecordAccessor((ARecordType) type);
+ public static IElementFactory<IVisitablePointable, IAType> FACTORY = new IElementFactory<IVisitablePointable, IAType>() {
+ public IVisitablePointable createElement(IAType type) {
+ return new ARecordPointable((ARecordType) type);
}
};
// access results: field names, field types, and field values
- private List<IBinaryAccessor> fieldNames = new ArrayList<IBinaryAccessor>();
- private List<IBinaryAccessor> fieldTypeTags = new ArrayList<IBinaryAccessor>();
- private List<IBinaryAccessor> fieldValues = new ArrayList<IBinaryAccessor>();
+ private List<IVisitablePointable> fieldNames = new ArrayList<IVisitablePointable>();
+ private List<IVisitablePointable> fieldTypeTags = new ArrayList<IVisitablePointable>();
+ private List<IVisitablePointable> fieldValues = new ArrayList<IVisitablePointable>();
// accessor allocator
- AccessorAllocator allocator = new AccessorAllocator();
+ private PointableAllocator allocator = new PointableAllocator();
private byte[] typeBuffer = new byte[32768];
private ResettableByteArrayOutputStream typeBos = new ResettableByteArrayOutputStream();
@@ -67,9 +67,9 @@
private int offsetArrayOffset;
private int[] fieldOffsets;
private ATypeTag typeTag;
- private IBinaryAccessor nullReference = AFlatValueAccessor.FACTORY.createElement(null);
+ private IVisitablePointable nullReference = AFlatValuePointable.FACTORY.createElement(null);
- public ARecordAccessor(ARecordType inputType) {
+ public ARecordPointable(ARecordType inputType) {
this.inputRecType = inputType;
IAType[] fieldTypes = inputType.getFieldTypes();
String[] fieldNameStrs = inputType.getFieldNames();
@@ -92,8 +92,8 @@
int tagStart = typeBos.size();
typeDos.writeByte(ftypeTag.serialize());
int tagEnd = typeBos.size();
- IBinaryAccessor typeTagReference = AFlatValueAccessor.FACTORY.createElement(null);
- typeTagReference.reset(typeBuffer, tagStart, tagEnd - tagStart);
+ IVisitablePointable typeTagReference = AFlatValuePointable.FACTORY.createElement(null);
+ typeTagReference.set(typeBuffer, tagStart, tagEnd - tagStart);
fieldTypeTags.add(typeTagReference);
// add type name Reference (including a astring type tag)
@@ -101,8 +101,8 @@
typeDos.writeByte(ATypeTag.STRING.serialize());
typeDos.writeUTF(fieldNameStrs[i]);
int nameEnd = typeBos.size();
- IBinaryAccessor typeNameReference = AFlatValueAccessor.FACTORY.createElement(null);
- typeNameReference.reset(typeBuffer, nameStart, nameEnd - nameStart);
+ IVisitablePointable typeNameReference = AFlatValuePointable.FACTORY.createElement(null);
+ typeNameReference.set(typeBuffer, nameStart, nameEnd - nameStart);
fieldNames.add(typeNameReference);
}
@@ -111,7 +111,7 @@
INullWriter nullWriter = AqlNullWriterFactory.INSTANCE.createNullWriter();
nullWriter.writeNull(typeDos);
int nullFieldEnd = typeBos.size();
- nullReference.reset(typeBuffer, nullFieldStart, nullFieldEnd - nullFieldStart);
+ nullReference.set(typeBuffer, nullFieldStart, nullFieldEnd - nullFieldStart);
} catch (IOException e) {
throw new IllegalStateException(e);
}
@@ -133,10 +133,11 @@
fieldValues.clear();
}
- public void reset(byte[] b, int start, int len) {
+ @Override
+ public void set(byte[] b, int start, int len) {
// clear the previous states
reset();
- super.reset(b, start, len);
+ super.set(b, start, len);
boolean isExpanded = false;
int openPartOffset = 0;
@@ -206,8 +207,8 @@
dataDos.writeByte(typeTag.serialize());
dataDos.write(b, fieldOffsets[fieldNumber], fieldValueLength);
int fend = dataBos.size();
- IBinaryAccessor fieldValue = allocator.allocateFieldValue(fieldType);
- fieldValue.reset(dataBuffer, fstart, fend - fstart);
+ IVisitablePointable fieldValue = allocator.allocateFieldValue(fieldType);
+ fieldValue.set(dataBuffer, fstart, fend - fstart);
fieldValues.add(fieldValue);
}
}
@@ -223,14 +224,14 @@
dataDos.writeByte(ATypeTag.STRING.serialize());
dataDos.write(b, fieldOffset, fieldValueLength);
int fnend = dataBos.size();
- IBinaryAccessor fieldName = allocator.allocateFieldName();
- fieldName.reset(dataBuffer, fnstart, fnend - fnstart);
+ IVisitablePointable fieldName = allocator.allocateFieldName();
+ fieldName.set(dataBuffer, fnstart, fnend - fnstart);
fieldNames.add(fieldName);
fieldOffset += fieldValueLength;
// set the field type tag
- IBinaryAccessor fieldTypeTag = allocator.allocateFieldType();
- fieldTypeTag.reset(b, fieldOffset, 1);
+ IVisitablePointable fieldTypeTag = allocator.allocateFieldType();
+ fieldTypeTag.set(b, fieldOffset, 1);
fieldTypeTags.add(fieldTypeTag);
typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[fieldOffset]);
@@ -238,8 +239,8 @@
fieldValueLength = NonTaggedFormatUtil.getFieldValueLength(b, fieldOffset, typeTag, true) + 1;
// allocate
- IBinaryAccessor fieldValueAccessor = allocator.allocateFieldValue(typeTag);
- fieldValueAccessor.reset(b, fieldOffset, fieldValueLength);
+ IVisitablePointable fieldValueAccessor = allocator.allocateFieldValue(typeTag);
+ fieldValueAccessor.set(b, fieldOffset, fieldValueLength);
fieldValues.add(fieldValueAccessor);
fieldOffset += fieldValueLength;
}
@@ -249,20 +250,20 @@
}
}
- public List<IBinaryAccessor> getFieldNames() {
+ public List<IVisitablePointable> getFieldNames() {
return fieldNames;
}
- public List<IBinaryAccessor> getFieldTypeTags() {
+ public List<IVisitablePointable> getFieldTypeTags() {
return fieldTypeTags;
}
- public List<IBinaryAccessor> getFieldValues() {
+ public List<IVisitablePointable> getFieldValues() {
return fieldValues;
}
@Override
- public <R, T> R accept(IBinaryAccessorVisitor<R, T> vistor, T tag) throws AsterixException {
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException {
return vistor.visit(this, tag);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AbstractBinaryAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AbstractVisitablePointable.java
similarity index 64%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AbstractBinaryAccessor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AbstractVisitablePointable.java
index 3e027b8..47fd7e5 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/AbstractBinaryAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/AbstractVisitablePointable.java
@@ -13,18 +13,19 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors;
+package edu.uci.ics.asterix.runtime.pointables;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
-public abstract class AbstractBinaryAccessor implements IBinaryAccessor {
+public abstract class AbstractVisitablePointable implements IVisitablePointable {
private byte[] data;
private int start;
private int len;
@Override
- public byte[] getBytes() {
+ public byte[] getByteArray() {
return data;
}
@@ -34,15 +35,20 @@
}
@Override
- public int getStartIndex() {
+ public int getStartOffset() {
return start;
}
@Override
- public void reset(byte[] b, int start, int len) {
+ public void set(byte[] b, int start, int len) {
this.data = b;
this.start = start;
this.len = len;
}
+
+ @Override
+ public void set(IValueReference ivf) {
+ set(ivf.getByteArray(), ivf.getStartOffset(), ivf.getLength());
+ }
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/base/DefaultOpenFieldType.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/DefaultOpenFieldType.java
similarity index 97%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/base/DefaultOpenFieldType.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/DefaultOpenFieldType.java
index 9da464f..f1f54bc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/base/DefaultOpenFieldType.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/DefaultOpenFieldType.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors.base;
+package edu.uci.ics.asterix.runtime.pointables.base;
import edu.uci.ics.asterix.om.types.AOrderedListType;
import edu.uci.ics.asterix.om.types.ARecordType;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/base/IBinaryAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/IVisitablePointable.java
similarity index 62%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/base/IBinaryAccessor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/IVisitablePointable.java
index 37d8b80..b3c088b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/base/IBinaryAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/base/IVisitablePointable.java
@@ -13,15 +13,13 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors.base;
+package edu.uci.ics.asterix.runtime.pointables.base;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.runtime.accessors.visitor.IBinaryAccessorVisitor;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
+import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.hyracks.data.std.api.IPointable;
-public interface IBinaryAccessor extends IValueReference {
+public interface IVisitablePointable extends IPointable {
- public void reset(byte[] b, int start, int len);
-
- public <R, T> R accept(IBinaryAccessorVisitor<R, T> vistor, T tag) throws AsterixException;
+ public <R, T> R accept(IVisitablePointableVisitor<R, T> vistor, T tag) throws AsterixException;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/ACastVisitor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ACastVisitor.java
similarity index 62%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/ACastVisitor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ACastVisitor.java
index 54b0960..67ff67e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/ACastVisitor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ACastVisitor.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors.cast;
+package edu.uci.ics.asterix.runtime.pointables.cast;
import java.util.HashMap;
import java.util.Map;
@@ -22,20 +22,20 @@
import edu.uci.ics.asterix.om.types.ARecordType;
import edu.uci.ics.asterix.om.types.AbstractCollectionType;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.accessors.AFlatValueAccessor;
-import edu.uci.ics.asterix.runtime.accessors.AListAccessor;
-import edu.uci.ics.asterix.runtime.accessors.ARecordAccessor;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
-import edu.uci.ics.asterix.runtime.accessors.visitor.IBinaryAccessorVisitor;
+import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.runtime.pointables.AListPointable;
+import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.runtime.pointables.visitor.IVisitablePointableVisitor;
import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
-public class ACastVisitor implements IBinaryAccessorVisitor<Void, Triple<IBinaryAccessor, IAType, Boolean>> {
+public class ACastVisitor implements IVisitablePointableVisitor<Void, Triple<IVisitablePointable, IAType, Boolean>> {
- private Map<IBinaryAccessor, ARecordCaster> raccessorToCaster = new HashMap<IBinaryAccessor, ARecordCaster>();
- private Map<IBinaryAccessor, AListCaster> laccessorToCaster = new HashMap<IBinaryAccessor, AListCaster>();
+ private Map<IVisitablePointable, ARecordCaster> raccessorToCaster = new HashMap<IVisitablePointable, ARecordCaster>();
+ private Map<IVisitablePointable, AListCaster> laccessorToCaster = new HashMap<IVisitablePointable, AListCaster>();
@Override
- public Void visit(AListAccessor accessor, Triple<IBinaryAccessor, IAType, Boolean> arg) throws AsterixException {
+ public Void visit(AListPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg) throws AsterixException {
AListCaster caster = laccessorToCaster.get(accessor);
if (caster == null) {
caster = new AListCaster();
@@ -50,7 +50,7 @@
}
@Override
- public Void visit(ARecordAccessor accessor, Triple<IBinaryAccessor, IAType, Boolean> arg) throws AsterixException {
+ public Void visit(ARecordPointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg) throws AsterixException {
ARecordCaster caster = raccessorToCaster.get(accessor);
if (caster == null) {
caster = new ARecordCaster();
@@ -65,9 +65,9 @@
}
@Override
- public Void visit(AFlatValueAccessor accessor, Triple<IBinaryAccessor, IAType, Boolean> arg) {
+ public Void visit(AFlatValuePointable accessor, Triple<IVisitablePointable, IAType, Boolean> arg) {
// set the pointer for result
- arg.first.reset(accessor.getBytes(), accessor.getStartIndex(), accessor.getLength());
+ arg.first.set(accessor);
return null;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/AListCaster.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/AListCaster.java
similarity index 76%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/AListCaster.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/AListCaster.java
index aba06b5..e1bad50 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/AListCaster.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/AListCaster.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors.cast;
+package edu.uci.ics.asterix.runtime.pointables.cast;
import java.io.DataOutput;
import java.io.DataOutputStream;
@@ -29,18 +29,18 @@
import edu.uci.ics.asterix.om.types.AbstractCollectionType;
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.accessors.AFlatValueAccessor;
-import edu.uci.ics.asterix.runtime.accessors.AListAccessor;
-import edu.uci.ics.asterix.runtime.accessors.base.DefaultOpenFieldType;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
+import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.runtime.pointables.AListPointable;
+import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
class AListCaster {
private IAType reqItemType;
- private IBinaryAccessor itemTempReference = AFlatValueAccessor.FACTORY.createElement(null);
- private Triple<IBinaryAccessor, IAType, Boolean> itemVisitorArg = new Triple<IBinaryAccessor, IAType, Boolean>(
+ private IVisitablePointable itemTempReference = AFlatValuePointable.FACTORY.createElement(null);
+ private Triple<IVisitablePointable, IAType, Boolean> itemVisitorArg = new Triple<IVisitablePointable, IAType, Boolean>(
itemTempReference, null, null);
private UnorderedListBuilder unOrderedListBuilder = new UnorderedListBuilder();
@@ -54,7 +54,7 @@
}
- public void castList(AListAccessor listAccessor, IBinaryAccessor resultAccessor, AbstractCollectionType reqType,
+ public void castList(AListPointable listAccessor, IVisitablePointable resultAccessor, AbstractCollectionType reqType,
ACastVisitor visitor) throws IOException, AsterixException {
if (reqType.getTypeTag().equals(ATypeTag.UNORDEREDLIST)) {
unOrderedListBuilder.reset((AUnorderedListType) reqType);
@@ -64,15 +64,15 @@
}
dataBos.setByteArray(dataBuffer, 0);
- List<IBinaryAccessor> itemTags = listAccessor.getItemTags();
- List<IBinaryAccessor> items = listAccessor.getItems();
+ List<IVisitablePointable> itemTags = listAccessor.getItemTags();
+ List<IVisitablePointable> items = listAccessor.getItems();
int start = dataBos.size();
for (int i = 0; i < items.size(); i++) {
- IBinaryAccessor itemTypeTag = itemTags.get(i);
- IBinaryAccessor item = items.get(i);
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getBytes()[itemTypeTag
- .getStartIndex()]);
+ IVisitablePointable itemTypeTag = itemTags.get(i);
+ IVisitablePointable item = items.get(i);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
+ .getStartOffset()]);
if (reqItemType == null || reqItemType.getTypeTag().equals(ATypeTag.ANY)) {
itemVisitorArg.second = DefaultOpenFieldType.getDefaultOpenFieldType(typeTag);
item.accept(visitor, itemVisitorArg);
@@ -96,6 +96,6 @@
unOrderedListBuilder.write(dataDos, true);
}
int end = dataBos.size();
- resultAccessor.reset(dataBuffer, start, end - start);
+ resultAccessor.set(dataBuffer, start, end - start);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/ARecordCaster.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
similarity index 76%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/ARecordCaster.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
index a4efa58..e68cdf4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/accessors/cast/ARecordCaster.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-package edu.uci.ics.asterix.runtime.accessors.cast;
+package edu.uci.ics.asterix.runtime.pointables.cast;
import java.io.DataOutput;
import java.io.DataOutputStream;
@@ -30,17 +30,17 @@
import edu.uci.ics.asterix.om.types.EnumDeserializer;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
-import edu.uci.ics.asterix.runtime.accessors.AFlatValueAccessor;
-import edu.uci.ics.asterix.runtime.accessors.ARecordAccessor;
-import edu.uci.ics.asterix.runtime.accessors.base.DefaultOpenFieldType;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
+import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
+import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.runtime.util.ResettableByteArrayOutputStream;
import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
import edu.uci.ics.hyracks.api.dataflow.value.INullWriter;
import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IValueReference;
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IValueReference;
class ARecordCaster {
@@ -52,9 +52,9 @@
private boolean[] openFields;
private int[] fieldNamesSortedIndex;
- private List<IBinaryAccessor> reqFieldNames = new ArrayList<IBinaryAccessor>();
+ private List<IVisitablePointable> reqFieldNames = new ArrayList<IVisitablePointable>();
private int[] reqFieldNamesSortedIndex;
- private List<IBinaryAccessor> reqFieldTypeTags = new ArrayList<IBinaryAccessor>();
+ private List<IVisitablePointable> reqFieldTypeTags = new ArrayList<IVisitablePointable>();
private ARecordType cachedReqType = null;
private byte[] buffer = new byte[32768];
@@ -62,8 +62,8 @@
private DataOutputStream dos = new DataOutputStream(bos);
private RecordBuilder recBuilder = new RecordBuilder();
- private IBinaryAccessor nullReference = AFlatValueAccessor.FACTORY.createElement(null);
- private IBinaryAccessor nullTypeTag = AFlatValueAccessor.FACTORY.createElement(null);
+ private IVisitablePointable nullReference = AFlatValuePointable.FACTORY.createElement(null);
+ private IVisitablePointable nullTypeTag = AFlatValuePointable.FACTORY.createElement(null);
private int numInputFields = 0;
private IBinaryComparator fieldNameComparator = PointableBinaryComparatorFactory.of(UTF8StringPointable.FACTORY)
@@ -73,8 +73,8 @@
private ResettableByteArrayOutputStream outputBos = new ResettableByteArrayOutputStream();
private DataOutputStream outputDos = new DataOutputStream(outputBos);
- private IBinaryAccessor fieldTempReference = AFlatValueAccessor.FACTORY.createElement(null);
- private Triple<IBinaryAccessor, IAType, Boolean> nestedVisitorArg = new Triple<IBinaryAccessor, IAType, Boolean>(
+ private IVisitablePointable fieldTempReference = AFlatValuePointable.FACTORY.createElement(null);
+ private Triple<IVisitablePointable, IAType, Boolean> nestedVisitorArg = new Triple<IVisitablePointable, IAType, Boolean>(
fieldTempReference, null, null);
public ARecordCaster() {
@@ -84,21 +84,21 @@
INullWriter nullWriter = AqlNullWriterFactory.INSTANCE.createNullWriter();
nullWriter.writeNull(dos);
int end = bos.size();
- nullReference.reset(buffer, start, end - start);
+ nullReference.set(buffer, start, end - start);
start = bos.size();
dos.write(ATypeTag.NULL.serialize());
end = bos.size();
- nullTypeTag.reset(buffer, start, end);
+ nullTypeTag.set(buffer, start, end);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
- public void castRecord(ARecordAccessor recordAccessor, IBinaryAccessor resultAccessor, ARecordType reqType,
+ public void castRecord(ARecordPointable recordAccessor, IVisitablePointable resultAccessor, ARecordType reqType,
ACastVisitor visitor) throws IOException, AsterixException {
- List<IBinaryAccessor> fieldNames = recordAccessor.getFieldNames();
- List<IBinaryAccessor> fieldTypeTags = recordAccessor.getFieldTypeTags();
- List<IBinaryAccessor> fieldValues = recordAccessor.getFieldValues();
+ List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
+ List<IVisitablePointable> fieldTypeTags = recordAccessor.getFieldTypeTags();
+ List<IVisitablePointable> fieldValues = recordAccessor.getFieldValues();
numInputFields = fieldNames.size();
if (openFields == null || numInputFields > openFields.length) {
@@ -113,7 +113,7 @@
reset();
matchClosedPart(fieldNames, fieldTypeTags, fieldValues);
writeOutput(fieldNames, fieldTypeTags, fieldValues, outputDos, visitor);
- resultAccessor.reset(outputBuffer, 0, outputBos.size());
+ resultAccessor.set(outputBuffer, 0, outputBos.size());
}
private void reset() {
@@ -139,7 +139,7 @@
for (int i = 0; i < optionalFields.length; i++)
optionalFields[i] = false;
- bos.setByteArray(buffer, nullReference.getStartIndex() + nullReference.getLength());
+ bos.setByteArray(buffer, nullReference.getStartOffset() + nullReference.getLength());
for (int i = 0; i < numSchemaFields; i++) {
ATypeTag ftypeTag = fieldTypes[i].getTypeTag();
String fname = fieldNames[i];
@@ -155,8 +155,8 @@
int tagStart = bos.size();
dos.writeByte(ftypeTag.serialize());
int tagEnd = bos.size();
- IBinaryAccessor typeTagPointable = AFlatValueAccessor.FACTORY.createElement(null);
- typeTagPointable.reset(buffer, tagStart, tagEnd - tagStart);
+ IVisitablePointable typeTagPointable = AFlatValuePointable.FACTORY.createElement(null);
+ typeTagPointable.set(buffer, tagStart, tagEnd - tagStart);
reqFieldTypeTags.add(typeTagPointable);
// add type name pointable (including a string type tag)
@@ -164,8 +164,8 @@
dos.write(ATypeTag.STRING.serialize());
dos.writeUTF(fname);
int nameEnd = bos.size();
- IBinaryAccessor typeNamePointable = AFlatValueAccessor.FACTORY.createElement(null);
- typeNamePointable.reset(buffer, nameStart, nameEnd - nameStart);
+ IVisitablePointable typeNamePointable = AFlatValuePointable.FACTORY.createElement(null);
+ typeNamePointable.set(buffer, nameStart, nameEnd - nameStart);
reqFieldNames.add(typeNamePointable);
}
@@ -176,8 +176,8 @@
quickSort(reqFieldNamesSortedIndex, reqFieldNames, 0, reqFieldNamesSortedIndex.length - 1);
}
- private void matchClosedPart(List<IBinaryAccessor> fieldNames, List<IBinaryAccessor> fieldTypeTags,
- List<IBinaryAccessor> fieldValues) {
+ private void matchClosedPart(List<IVisitablePointable> fieldNames, List<IVisitablePointable> fieldTypeTags,
+ List<IVisitablePointable> fieldValues) {
// sort-merge based match
quickSort(fieldNamesSortedIndex, fieldNames, 0, numInputFields - 1);
int fnStart = 0;
@@ -187,8 +187,8 @@
int reqFnPos = reqFieldNamesSortedIndex[reqFnStart];
int c = compare(fieldNames.get(fnPos), reqFieldNames.get(reqFnPos));
if (c == 0) {
- IBinaryAccessor fieldTypeTag = fieldTypeTags.get(fnPos);
- IBinaryAccessor reqFieldTypeTag = reqFieldTypeTags.get(reqFnPos);
+ IVisitablePointable fieldTypeTag = fieldTypeTags.get(fnPos);
+ IVisitablePointable reqFieldTypeTag = reqFieldTypeTags.get(reqFnPos);
if (fieldTypeTag.equals(reqFieldTypeTag) || (
// match the null type of optional field
optionalFields[reqFnPos] && fieldTypeTag.equals(nullTypeTag))) {
@@ -222,8 +222,8 @@
}
}
- private void writeOutput(List<IBinaryAccessor> fieldNames, List<IBinaryAccessor> fieldTypeTags,
- List<IBinaryAccessor> fieldValues, DataOutput output, ACastVisitor visitor) throws IOException,
+ private void writeOutput(List<IVisitablePointable> fieldNames, List<IVisitablePointable> fieldTypeTags,
+ List<IVisitablePointable> fieldValues, DataOutput output, ACastVisitor visitor) throws IOException,
AsterixException {
// reset the states of the record builder
recBuilder.reset(cachedReqType);
@@ -232,7 +232,7 @@
// write the closed part
for (int i = 0; i < fieldPermutation.length; i++) {
int pos = fieldPermutation[i];
- IBinaryAccessor field;
+ IVisitablePointable field;
if (pos >= 0) {
field = fieldValues.get(pos);
} else {
@@ -254,12 +254,12 @@
// write the open part
for (int i = 0; i < numInputFields; i++) {
if (openFields[i]) {
- IBinaryAccessor name = fieldNames.get(i);
- IBinaryAccessor field = fieldValues.get(i);
- IBinaryAccessor fieldTypeTag = fieldTypeTags.get(i);
+ IVisitablePointable name = fieldNames.get(i);
+ IVisitablePointable field = fieldValues.get(i);
+ IVisitablePointable fieldTypeTag = fieldTypeTags.get(i);
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(fieldTypeTag.getBytes()[fieldTypeTag.getStartIndex()]);
+ .deserialize(fieldTypeTag.getByteArray()[fieldTypeTag.getStartOffset()]);
nestedVisitorArg.second = DefaultOpenFieldType.getDefaultOpenFieldType(typeTag);
field.accept(visitor, nestedVisitorArg);
recBuilder.addField(name, nestedVisitorArg.first);
@@ -268,7 +268,7 @@
recBuilder.write(output, true);
}
- private void quickSort(int[] index, List<IBinaryAccessor> names, int start, int end) {
+ private void quickSort(int[] index, List<IVisitablePointable> names, int start, int end) {
if (end <= start)
return;
int i = partition(index, names, start, end);
@@ -276,7 +276,7 @@
quickSort(index, names, i + 1, end);
}
- private int partition(int[] index, List<IBinaryAccessor> names, int left, int right) {
+ private int partition(int[] index, List<IVisitablePointable> names, int left, int right) {
int i = left - 1;
int j = right;
while (true) {
@@ -305,7 +305,7 @@
private int compare(IValueReference a, IValueReference b) {
// start+1 and len-1 due to the type tag
- return fieldNameComparator.compare(a.getBytes(), a.getStartIndex() + 1, a.getLength() - 1, b.getBytes(),
- b.getStartIndex() + 1, b.getLength() - 1);
+ return fieldNameComparator.compare(a.getByteArray(), a.getStartOffset() + 1, a.getLength() - 1,
+ b.getByteArray(), b.getStartOffset() + 1, b.getLength() - 1);
}
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/visitor/IVisitablePointableVisitor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/visitor/IVisitablePointableVisitor.java
new file mode 100644
index 0000000..3f99509
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/visitor/IVisitablePointableVisitor.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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 edu.uci.ics.asterix.runtime.pointables.visitor;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.runtime.pointables.AListPointable;
+import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
+
+public interface IVisitablePointableVisitor<R, T> {
+
+ public R visit(AListPointable accessor, T arg) throws AsterixException;
+
+ public R visit(ARecordPointable accessor, T arg) throws AsterixException;
+
+ public R visit(AFlatValuePointable accessor, T arg) throws AsterixException;
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
index d3b965f..9ca7596 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
@@ -65,10 +65,10 @@
public void init(IFrameTupleReference tuple) throws AlgebricksException {
inputVal.reset();
eval0.evaluate(tuple);
- current = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ current = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
inputVal.reset();
eval1.evaluate(tuple);
- max = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ max = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
}
@SuppressWarnings("unchecked")
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
index 6bf5420..d59d6c4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
@@ -87,7 +87,7 @@
try {
inputVal.reset();
argEval.evaluate(tuple);
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
if (serList[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
@@ -99,12 +99,12 @@
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
}
- serListTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getBytes()[0])
+ serListTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(inputVal.getByteArray()[0])
.serialize();
if (serListTag == SER_ORDEREDLIST_TYPE_TAG)
- numItems = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getBytes());
+ numItems = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
else
- numItems = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getBytes());
+ numItems = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray());
itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[1]);
if (itemTag == ATypeTag.ANY)
@@ -123,7 +123,7 @@
try {
if (pos < numItems) {
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
try {
if (serListTag == SER_ORDEREDLIST_TYPE_TAG) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
index a045344..6214d27 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
@@ -75,16 +75,16 @@
try {
inputVal.reset();
evalStart.evaluate(tuple);
- posStart = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ posStart = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
inputVal.reset();
evalLen.evaluate(tuple);
- numItems = IntegerSerializerDeserializer.getInt(inputVal.getBytes(), 1);
+ numItems = IntegerSerializerDeserializer.getInt(inputVal.getByteArray(), 1);
inputVal.reset();
evalList.evaluate(tuple);
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
if (serList[0] == SER_NULL_TYPE_TAG) {
nullSerde.serialize(ANull.NULL, out);
@@ -113,7 +113,7 @@
@Override
public boolean step() throws AlgebricksException {
if (posCrt < posStart + numItems && posCrt < numItemsMax) {
- byte[] serList = inputVal.getBytes();
+ byte[] serList = inputVal.getByteArray();
int itemLength = 0;
try {
int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, posCrt);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/AccessorAllocator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/PointableAllocator.java
similarity index 65%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/AccessorAllocator.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/PointableAllocator.java
index dde5ff6..fe0499a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/AccessorAllocator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/PointableAllocator.java
@@ -17,32 +17,32 @@
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.runtime.accessors.AFlatValueAccessor;
-import edu.uci.ics.asterix.runtime.accessors.AListAccessor;
-import edu.uci.ics.asterix.runtime.accessors.ARecordAccessor;
-import edu.uci.ics.asterix.runtime.accessors.base.DefaultOpenFieldType;
-import edu.uci.ics.asterix.runtime.accessors.base.IBinaryAccessor;
+import edu.uci.ics.asterix.runtime.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.runtime.pointables.AListPointable;
+import edu.uci.ics.asterix.runtime.pointables.ARecordPointable;
+import edu.uci.ics.asterix.runtime.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.runtime.pointables.base.IVisitablePointable;
import edu.uci.ics.asterix.runtime.util.container.IElementAllocator;
import edu.uci.ics.asterix.runtime.util.container.ListElementAllocator;
-public class AccessorAllocator {
+public class PointableAllocator {
- private IElementAllocator<IBinaryAccessor, IAType> flatArtifactAllocator = new ListElementAllocator<IBinaryAccessor, IAType>(
- AFlatValueAccessor.FACTORY);
- private IElementAllocator<IBinaryAccessor, IAType> nestedRecValueAllocator = new ListElementAllocator<IBinaryAccessor, IAType>(
- ARecordAccessor.FACTORY);
- private IElementAllocator<IBinaryAccessor, IAType> nestedListValueAllocator = new ListElementAllocator<IBinaryAccessor, IAType>(
- AListAccessor.FACTORY);
+ private IElementAllocator<IVisitablePointable, IAType> flatArtifactAllocator = new ListElementAllocator<IVisitablePointable, IAType>(
+ AFlatValuePointable.FACTORY);
+ private IElementAllocator<IVisitablePointable, IAType> nestedRecValueAllocator = new ListElementAllocator<IVisitablePointable, IAType>(
+ ARecordPointable.FACTORY);
+ private IElementAllocator<IVisitablePointable, IAType> nestedListValueAllocator = new ListElementAllocator<IVisitablePointable, IAType>(
+ AListPointable.FACTORY);
- public IBinaryAccessor allocateFieldName() {
+ public IVisitablePointable allocateFieldName() {
return flatArtifactAllocator.allocate(null);
}
- public IBinaryAccessor allocateFieldType() {
+ public IVisitablePointable allocateFieldType() {
return flatArtifactAllocator.allocate(null);
}
- public IBinaryAccessor allocateFieldValue(IAType type) {
+ public IVisitablePointable allocateFieldValue(IAType type) {
if(type == null)
return flatArtifactAllocator.allocate(null);
else if (type.getTypeTag().equals(ATypeTag.RECORD))
@@ -53,7 +53,7 @@
return flatArtifactAllocator.allocate(null);
}
- public IBinaryAccessor allocateFieldValue(ATypeTag typeTag) {
+ public IVisitablePointable allocateFieldValue(ATypeTag typeTag) {
if(typeTag == null)
return flatArtifactAllocator.allocate(null);
else if (typeTag.equals(ATypeTag.RECORD))
@@ -66,7 +66,7 @@
return flatArtifactAllocator.allocate(null);
}
- public IBinaryAccessor allocateNestedListValue(IAType type) {
+ public IVisitablePointable allocateNestedListValue(IAType type) {
return nestedListValueAllocator.allocate(type);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementAllocator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementAllocator.java
index 8d17cb7..b99f379 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementAllocator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementAllocator.java
@@ -15,6 +15,9 @@
package edu.uci.ics.asterix.runtime.util.container;
+/**
+ * A reusable object pool interface
+ */
public interface IElementAllocator<E, T> {
public E allocate(T arg);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementFactory.java
index 4698c25..293720e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/IElementFactory.java
@@ -15,7 +15,15 @@
package edu.uci.ics.asterix.runtime.util.container;
+/**
+ * A factory interface to create elements
+ */
public interface IElementFactory<E, T> {
+ /**
+ * create an element of type E
+ * @param arg of type T
+ * @return an E element
+ */
public E createElement(T arg);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListElementAllocator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListElementAllocator.java
index 447b740..d4ae0a4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListElementAllocator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/container/ListElementAllocator.java
@@ -18,6 +18,12 @@
import java.util.ArrayList;
import java.util.List;
+/**
+ * ListElementAllocator<E, T> is an element-reusable list or a element pool in other words, however
+ * elements in the list should be exactly the same class, this is forced by IElementFactory<E, T> factory
+ * as a parameter to the constructor once a ListElementAllocator is constructed, it can only store
+ * objects of the same class
+ */
public class ListElementAllocator<E, T> implements IElementAllocator<E, T> {
private IElementFactory<E, T> factory;
@@ -28,6 +34,7 @@
this.factory = factory;
}
+ @Override
public E allocate(T arg) {
cursor++;
if (cursor < pool.size()) {
@@ -39,6 +46,7 @@
}
}
+ @Override
public void reset() {
cursor = -1;
}