private final boolean matchOneOfTypes(long fieldId, StructType... assoc) { boolean ok = false; StructType fieldType = Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId); int i=assoc.length; while (--i>=0) { if (assoc[i]==fieldType) { ok = true; } } return ok; }
private final boolean matchOneOfTypes(long fieldId, StructType... assoc) { boolean ok = false; StructType fieldType = Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId); int i=assoc.length; while (--i>=0) { if (assoc[i]==fieldType) { ok = true; } } return ok; }
private final boolean matchOneOfTypes(long fieldId, StructType... assoc) { boolean ok = false; StructType fieldType = Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId); int i=assoc.length; while (--i>=0) { if (assoc[i]==fieldType) { ok = true; } } return ok; }
/** * Writes text to specified field in pipe * @param fieldId field to write to * @return channelWriter */ public Appendable writeText(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Text); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); return channelWriter; }
/** * Writes blob to specified field in pipe * @param fieldId field association showing where to write * @return channelWriter */ public ChannelWriter writeBlob(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Blob); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); return channelWriter; }
public void writeShortNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
public void writeShortNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes long null to specified field in pipe * @param fieldId field to write to */ public void writeLongNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Long); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes null boolean to specified field in pipe * @param fieldId field to write to */ public void writeBooleanNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Boolean); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeBooleanNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
public void writeShortNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes short to specified field in pipe * @param value short to be written * @param fieldId field to be written to */ public void writeShort(short value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedShort(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes float to specified field in pipe * @param value float to be written * @param fieldId field to be written to */ public void writeFloat(float value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Float); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeFloat(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes short to specified field in pipe * @param value short to be written * @param fieldId field to be written to */ public void writeShort(short value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Short); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedShort(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes float to specified field in pipe * @param value float to be written * @param fieldId field to be written to */ public void writeFloat(float value, long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Float); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeFloat(value); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes null boolean to specified field in pipe * @param fieldId field to write to */ public void writeBooleanNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Boolean); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writeBooleanNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes long null to specified field in pipe * @param fieldId field to write to */ public void writeLongNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Long); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }
/** * Writes int null to specified field in pipe * @param fieldId field to write to */ public void writeIntNull(long fieldId) { assert(Pipe.structRegistry(channelWriter.backingPipe).fieldType(fieldId) == StructType.Integer); DataOutputBlobWriter.commitBackData(channelWriter, StructRegistry.extractStructId(fieldId)); DataOutputBlobWriter.setIntBackData( channelWriter, channelWriter.position(), StructRegistry.extractFieldPosition(fieldId)); channelWriter.writePackedNull(); assert confirmDataDoesNotWriteOverIndex(fieldId) : "Data has written over index data"; }