public void setValue(int v) { ((AMutableInt32) value).setValue(v); }
@Override public void reset() { ((AMutableInt32) value).setValue(0); }
@Override protected void processInt32(int arg, IPointable resultPointable) throws HyracksDataException { aInt32.setValue(-arg); serialize(aInt32, int32Serde, resultPointable); }
public void setMetadata(final int index, final int value) throws IOException { fieldValueBufferOutputs[index].writeByte(fieldTypeTags[index]); mutableInt.setValue(value); IDataParser.toBytes(mutableInt, fieldValueBuffers[index], int32Serde); }
@Override protected void reset(AMutableInt32 obj) { obj.setValue(0); }
@Override protected void processInt32(int arg, IPointable resultPointable) throws HyracksDataException { if (arg >= 0) { resultPointable.set(argPtr); return; } aInt32.setValue(0 - arg); serialize(aInt32, int32Serde, resultPointable); }
@SuppressWarnings("unchecked") @Override protected void process(UTF8StringPointable first, UTF8StringPointable second, UTF8StringPointable thrid, IPointable result) throws HyracksDataException { resultValue.setValue(compute(first, second, thrid)); intSerde.serialize(resultValue, dout); result.set(resultStorage); }
@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 reset(IIndexingDatasource reader) throws HyracksDataException { try { //TODO: Make this more generic. right now, it works because we only index hdfs files. @SuppressWarnings("unchecked") HDFSRecordReader<?, Writable> hdfsReader = (HDFSRecordReader<?, Writable>) reader; fileNumber.setValue(hdfsReader.getSnapshot().get(hdfsReader.getCurrentSplitIndex()).getFileNumber()); recordReader = hdfsReader.getReader(); offset.setValue(recordReader.getPos()); nextOffset = offset.getLongValue(); rowNumber.setValue(0); } catch (IOException e) { throw HyracksDataException.create(e); } }
public static void prevNonSpaceChar(AMutableCharArrayString Str, AMutableInt32 index) { int i = index.getIntegerValue(); while ((i >= 0) && (Character.isWhitespace(Str.charAt(i)))) { i--; } index.setValue(i); }
@Override public void reset(IIndexingDatasource dataSource) throws HyracksDataException { try { //TODO: Make it more generic since we can't assume it is always going to be HDFS records fileNumber.setValue(dataSource.getSnapshot().get(dataSource.getCurrentSplitIndex()).getFileNumber()); recordReader = dataSource.getReader(); offset.setValue(recordReader.getPos()); } catch (IOException e) { throw HyracksDataException.create(e); } }
public static void nextDigitChar(AMutableCharArrayString Str, AMutableInt32 index) { int len = Str.getLength(); int i = index.getIntegerValue(); while ((i < len) && (!Character.isDigit(Str.charAt(i)))) { i++; } index.setValue(i); }
public void getComponents(AMutableInt32 op, ExprTreeHolder e1, ExprTreeHolder e2, ExprTreeHolder e3) { op.setValue(opKind); e1.setInnerTree(child1); e2.setInnerTree(child2); e3.setInnerTree(child3); }
public ClassAd parseClassAd(String buffer, AMutableInt32 offset) throws IOException { currentSource = new StringLexerSource(buffer); ClassAd ad = parseClassAd((StringLexerSource) currentSource); offset.setValue(((StringLexerSource) currentSource).getCurrentLocation()); return ad; }
public static String readLine(char[] buffer, AMutableInt32 offset, int maxOffset) { int position = offset.getIntegerValue(); while (buffer[position] != '\n' && position < maxOffset) { position++; } if (offset.getIntegerValue() == position) { return null; } String line = String.valueOf(buffer, offset.getIntegerValue(), position - offset.getIntegerValue()); position++; offset.setValue(position); return line; }
public boolean parseClassAd(String buffer, ClassAd classad, AMutableInt32 offset) throws IOException { boolean success = false; StringLexerSource stringLexerSource = new StringLexerSource(buffer, offset.getIntegerValue()); success = parseClassAd(stringLexerSource, classad); offset.setValue(stringLexerSource.getCurrentLocation()); return success; }