@Override public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException { result.set(buf); } };
@Override public void finish(IPointable result) throws AlgebricksException { if (count == 0) { XDMConstants.setEmptySequence(result); } else { result.set(abvs); } }
@Override public void finish(IPointable result) { if (empty) { PointableHelper.setNull(result); } else { result.set(outputVal); } }
@Override protected void finishNull(IPointable result) throws IOException { resultStorage.getDataOutput().writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG); result.set(resultStorage); }
@Override public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { if (l1 == 0 && l2 != 0) return -1; if (l1 != 0 && l2 == 0) return 1; p.set(b1, s1, l1); return ((IComparable) p).compareTo(b2, s2, l2); } };
@Override public void finish(IPointable result) throws AlgebricksException { try { abvs.reset(); dOut.write(ValueTag.XS_INTEGER_TAG); dOut.writeLong(count); result.set(abvs); } catch (Exception e) { throw new AlgebricksException(e); } }
private void writeResult(IPointable resultPointable) throws IOException { dataOutput.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG); dataOutput.write(resultStrPtr.getByteArray(), 0, resultStrPtr.getLength()); resultPointable.set(resultStorage); } }
@SuppressWarnings("unchecked") protected void serialize(IAObject result, ISerializerDeserializer serde, IPointable resultPointable) throws HyracksDataException { try { serde.serialize(result, dataOutput); resultPointable.set(resultStorage); } catch (IOException e) { throw HyracksDataException.create(e); } } }
@SuppressWarnings("unchecked") @Override protected void process(UTF8StringPointable first, UTF8StringPointable second, UTF8StringPointable thrid, IPointable result) throws HyracksDataException { ABoolean res = compute(first, second, thrid) ? ABoolean.TRUE : ABoolean.FALSE; boolSerde.serialize(res, dout); result.set(resultStorage); }
@Override protected void processInt8(byte arg, IPointable resultPointable) throws HyracksDataException { if (arg >= 0) { resultPointable.set(argPtr); return; } aInt8.setValue((byte) (0 - arg)); serialize(aInt8, int8Serde, resultPointable); }
@Override public void process(UTF8StringPointable leftPtr, UTF8StringPointable rightPtr, IPointable result) throws IOException { resultValue.setValue(compute(leftPtr, rightPtr)); intSerde.serialize(resultValue, dataOutput); result.set(resultStorage); }
@Override public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException { result.set(tuple.getFieldData(fieldIndex), tuple.getFieldStart(fieldIndex), tuple.getFieldLength(fieldIndex)); } };
public void getString(int idx, IPointable string) { int nEntries = getDictionaryEntryCount(); if (idx < 0 || idx >= nEntries) { throw new IllegalArgumentException(idx + " not within [0, " + nEntries + ")"); } int dataAreaStart = getDictionaryDataAreaStartOffset(); int idxSlotValue = idx == 0 ? 0 : IntegerPointable.getInteger(bytes, getDictionaryIndexPointerArrayOffset() + (idx - 1) * IDX_PTR_SLOT_SIZE); int strLen = UTF8StringPointable.getUTFLength(bytes, dataAreaStart + idxSlotValue); string.set(bytes, dataAreaStart + idxSlotValue, strLen + 2); }
public void nextDouble(IPointable resultPointable) throws HyracksDataException { aDouble.setValue(random.nextDouble()); resultStorage.reset(); doubleSerde.serialize(aDouble, dataOutput); resultPointable.set(resultStorage); } }
@SuppressWarnings("unchecked") private void generateFieldsPointables() throws HyracksDataException { for (int i = 0; i < fieldPath.size(); i++) { ArrayBackedValueStorage storage = new ArrayBackedValueStorage(); DataOutput out = storage.getDataOutput(); AString as = new AString(fieldPath.get(i)); SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(as.getType()).serialize(as, out); fieldPointables[i] = new VoidPointable(); fieldPointables[i].set(storage); } }
@Override public void finish(IPointable resultPointable) throws HyracksDataException { resultStorage.reset(); try { result.setValue(cnt); int64Serde.serialize(result, resultStorage.getDataOutput()); } catch (IOException e) { throw HyracksDataException.create(e); } resultPointable.set(resultStorage); }
@Override public void finish(IPointable resultPointable) throws HyracksDataException { resultStorage.reset(); try { geometrySerde.serialize(new AGeometry(geometry), resultStorage.getDataOutput()); } catch (IOException e) { throw HyracksDataException.create(e); } resultPointable.set(resultStorage); }
protected void setNodeToResult(IPointable result) throws IOException { nodeAbvs.reset(); nstb.reset(nodeAbvs); nstb.setChildNode(ntp, itemTvp); nstb.finish(); result.set(nodeAbvs.getByteArray(), nodeAbvs.getStartOffset(), nodeAbvs.getLength()); }
protected void setNodeToResult(TaggedValuePointable tvpItem, IPointable result) throws IOException { nodeAbvs.reset(); nstb.reset(nodeAbvs); nstb.setChildNode(ntp, tvpItem); nstb.finish(); result.set(nodeAbvs.getByteArray(), nodeAbvs.getStartOffset(), nodeAbvs.getLength()); } }
@Override public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException { eval1.evaluate(tuple, p); int v1 = IntegerPointable.getInteger(p.getByteArray(), p.getStartOffset()); eval2.evaluate(tuple, p); int v2 = IntegerPointable.getInteger(p.getByteArray(), p.getStartOffset()); BooleanPointable.setBoolean(rBytes, 0, v1 > v2); result.set(rBytes, 0, 1); } };