Package edu.uci.ics.hyracks.data.std.util

Examples of edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage.reset()


        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                TaggedValuePointable tvp1 = args[0];
                try {
                    abvs.reset();
                    switch (tvp1.getTag()) {
                        case ValueTag.XS_STRING_TAG:
                            tvp1.getValue(tp.utf8sp);
                            castToDouble.convertString(tp.utf8sp, dOut);
                            break;
View Full Code Here


                    }

                    result.set(abvs);
                } catch (SystemException e) {
                    try {
                        abvs.reset();
                        dOut.write(ValueTag.XS_DOUBLE_TAG);
                        dOut.writeDouble(Double.NaN);
                        result.set(abvs);
                    } catch (IOException e1) {
                        throw new SystemException(ErrorCode.SYSE0001, e);
View Full Code Here

        return new AbstractTaggedValueArgumentAggregateEvaluator(args) {
            @Override
            public void init() throws AlgebricksException {
                abvs.reset();
                slots.clear();
                dataArea.reset();
            }

            @Override
            public void finish(IPointable result) throws AlgebricksException {
                if (slots.getSize() != 1) {
View Full Code Here

                try {
                    int localNodeId = FunctionHelper.getLocalNodeId(tvp1);
                    if (localNodeId == -1) {
                        XDMConstants.setEmptySequence(result);
                    } else {
                        abvs.reset();
                        dOut.write(ValueTag.XS_INT_TAG);
                        dOut.writeInt(localNodeId);
                        result.set(abvs);
                    }
                } catch (Exception e) {
View Full Code Here

                    if (tvp2.getTag() == ValueTag.XS_UNTYPED_ATOMIC_TAG) {
                        // Only need to change tag since the storage is the same for untyped atomic and string.
                        tvp2.getByteArray()[0] = ValueTag.XS_STRING_TAG;
                        tvp2new = tvp2;
                    } else if (FunctionHelper.isDerivedFromInteger(tvp2.getTag())) {
                        abvsInteger2.reset();
                        FunctionHelper.getIntegerPointable(tvp2, dOutInteger2);
                        tvp2new.set(abvsInteger2.getByteArray(), abvsInteger2.getStartOffset(),
                                LongPointable.TYPE_TRAITS.getFixedLength() + 1);
                    } else {
                        tvp2new = tvp2;
View Full Code Here

                }

                value = convertDuration(YMDuration, DTDuration);

                try {
                    abvsInner.reset();
                    switch (getReturnTag()) {
                        case ValueTag.XS_INTEGER_TAG:
                            dOutInner.write(ValueTag.XS_INTEGER_TAG);
                            dOutInner.writeLong(value);
                            break;
View Full Code Here

                    if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(longp);

                    abvs.reset();
                    sb.reset(abvs);
                    TaggedValuePointable tvp1 = args[0];
                    if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                        tvp1.getValue(seq);
                        int seqLen = seq.getEntryCount();
View Full Code Here

                    if (localNodeId == -1) {
                        XDMConstants.setEmptySequence(result);
                    } else {
                        tvp1.getValue(ntp);

                        abvs.reset();
                        dOut.write(ValueTag.XS_LONG_TAG);
                        dOut.writeInt(ntp.getRootNodeId());
                        dOut.writeInt(localNodeId);
                        result.set(abvs);
                    }
View Full Code Here

            AbstractCastToOperation aOp = new CastToStringOperation();
            int castToTag = 0;

            @Override
            protected void evaluate(TaggedValuePointable tvp, IPointable result) throws SystemException {
                abvs.reset();
                int tid = tvp.getTag();
                if (castToTag == -1 || castToTag == 0) {
                    // The promote type is not supported. No change.
                    result.set(tvp);
                    return;
View Full Code Here

                    if (start > end) {
                        XDMConstants.setEmptySequence(result);
                        return;
                    } else {
                        for (long j = start; j <= end; ++j) {
                            abvsInner.reset();
                            dOutInner.write(ValueTag.XS_INTEGER_TAG);
                            dOutInner.writeLong(j);
                            sb.addItem(abvsInner);
                        }
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.