public boolean isSet() { return !vector.getAccessor().isNull(idx()); }
public NullableVarCharWriterImpl(NullableVarCharVector vector, AbstractFieldWriter parent) { super(parent); this.mutator = vector.getMutator(); this.vector = vector; }
@Override public int getValueCapacity() { return vector.getValueCapacity(); }
public void fromNotNullable(VarCharVector srce) { clear(); final int valueCount = srce.getAccessor().getValueCount(); // Create a new bits vector, all values non-null fillBitsVector(getBitsVector(), valueCount); // Swap the data portion getValuesVector().exchange(srce); lastSet = valueCount; setValueCount(valueCount); } }
@Override public void clear() { vector.clear(); }
VarCharVector values = vector.getValuesVector(); vectorMemoryUsage.bitsBytesCapacity = vector.getBitsValueCapacity(); vectorMemoryUsage.offsetsByteCapacity = values.getOffsetVector().getValueCapacity() * INT_VALUE_WIDTH; vectorMemoryUsage.dataByteCapacity = values.getByteCapacity();
private void validateNullableVector(String name, NullableVector vector) { // Can't validate at this time because the bits vector is in each // generated subtype. // Validate a VarChar vector because it is common. if (vector instanceof NullableVarCharVector) { @SuppressWarnings("resource") VarCharVector values = ((NullableVarCharVector) vector).getValuesVector(); validateVarCharVector(name + "-values", values, rowCount); } }
@Override public void allocateNew() { if(!allocateNewSafe()){ throw new OutOfMemoryException("Failure while allocating buffer."); } }
@Override public void close() { vector.close(); }
@Override public void allocate() { vector.allocateNew(); }
public TransferImpl(MaterializedField field, BufferAllocator allocator){ to = new NullableVarCharVector(field, allocator); }
public void fromNotNullable(VarCharVector srce) { clear(); final int valueCount = srce.getAccessor().getValueCount(); // Create a new bits vector, all values non-null fillBitsVector(getBitsVector(), valueCount); // Swap the data portion getValuesVector().exchange(srce); lastSet = valueCount; setValueCount(valueCount); } }
public void transferTo(NullableVarCharVector target){ bits.transferTo(target.bits); values.transferTo(target.values); target.mutator.lastSet = mutator.lastSet; clear(); }
@Override public void allocateNew() { if(!allocateNewSafe()){ throw new OutOfMemoryException("Failure while allocating buffer."); } }
@Override public void close() { vector.close(); }
@Override public void allocate() { vector.allocateNew(); }
public TransferImpl(MaterializedField field, BufferAllocator allocator){ to = new NullableVarCharVector(field, allocator); }
@Override public void toNullable(ValueVector nullableVector) { NullableVarCharVector dest = (NullableVarCharVector) nullableVector; dest.getMutator().fromNotNullable(this); }