@Override public void clear() { if (!releasable) { return; } for (T x : vectors) { x.clear(); } }
void releaseOutputBuffer() { if (vvOut != null) { // all transfers done this.vvOut.clear(); } // reset for the next batch this.numReadersOfOutput = 0; }
@Override public void clear() { vector.clear(); }
/** * Since this OutputMutator is passed by TextRecordReader to get the header out * the mutator might not get cleaned up elsewhere. TextRecordReader will call * this method to clear any allocations */ @Override public void close() { for (final ValueVector v : fieldVectorMap.values()) { v.clear(); } fieldVectorMap.clear(); }
private void clearVectors() { for (VectorWrapper<?> vw : outgoing) { final ValueVector v = vw.getValueVector(); v.clear(); } }
private void clearVectors() { for (VectorWrapper<?> vw : outgoing) { final ValueVector v = vw.getValueVector(); v.clear(); } }
@Override public void clear() { for (final ValueVector v : getChildren()) { v.clear(); } valueCount = 0; }
public void clear() { valueVec.clear(); pageReader.clear(); }
/** * Since this OutputMutator is passed by TextRecordReader to get the header out * the mutator might not get cleaned up elsewhere. TextRecordReader will call * this method to clear any allocations */ public void close() { logger.debug("closing mutator"); for (final ValueVector v : fieldVectorMap.values()) { v.clear(); } fieldVectorMap.clear(); container.clear(); bufferManager.close(); } }
@Override public ArrowBuf[] getBuffers(boolean clear) { final List<ArrowBuf> buffers = new ArrayList<>(); for (final ValueVector vector : vectors.values()) { for (final ArrowBuf buf : vector.getBuffers(false)) { buffers.add(buf); if (clear) { buf.retain(1); } } if (clear) { vector.clear(); } } return buffers.toArray(new ArrowBuf[buffers.size()]); }
@Override public <T extends ValueVector> T addField(Field field, Class<T> clazz) throws SchemaChangeException { // Check if the field exists. final ValueVector v = fieldVectorMap.get(field.getName().toLowerCase()); if (v == null || !clazz.isAssignableFrom(v.getClass())) { // Field does not exist--add it to the map and the output container. ValueVector newVector = TypeHelper.getNewVector(field, context.getAllocator(), callBack); if (!clazz.isAssignableFrom(newVector.getClass())) { throw new SchemaChangeException( String.format( "The class that was provided, %s, does not correspond to the " + "expected vector type of %s.", clazz.getSimpleName(), newVector.getClass().getSimpleName())); } final ValueVector old = fieldVectorMap.put(field.getName().toLowerCase(), newVector); if (old != null) { old.clear(); outgoing.remove(old); } outgoing.add(newVector); return clazz.cast(newVector); } return clazz.cast(v); }
public static WritableBatch getBatchNoHV(int recordCount, Iterable<ValueVector> vectors, boolean isSV2) { List<ArrowBuf> buffers = Lists.newArrayList(); List<SerializedField> metadata = Lists.newArrayList(); for (ValueVector vv : vectors) { metadata.add(TypeHelper.getMetadata(vv)); // don't try to get the buffers if we don't have any records. It is possible the buffers are dead buffers. if (recordCount == 0) { vv.clear(); continue; } for (ArrowBuf b : vv.getBuffers(true)) { buffers.add(b); } // remove vv access to buffers. vv.clear(); } RecordBatchDef batchDef = RecordBatchDef.newBuilder().addAllField(metadata).setRecordCount(recordCount) .setCarriesTwoByteSelectionVector(isSV2).build(); WritableBatch b = new WritableBatch(batchDef, buffers); return b; }
return clazz.cast(existing); } else if (nullFilled(existing)) { existing.clear(); create = true;
void evaluateProjector(int recordsToConsume, Stopwatch javaWatch, Stopwatch gandivaWatch) throws Exception { try { allocateNew(recordsToConsume); gandivaWatch.start(); nativeProjectEvaluator.evaluate(recordsToConsume); gandivaWatch.stop(); javaWatch.start(); javaProjector.projectRecords(recordsToConsume); javaWatch.stop(); setValueCount(recordsToConsume); transferOut(); } catch (Exception e) { // release memory allocated in case of an exception for(ValueVector vv : allocationVectors) { vv.clear(); } for(ComplexWriter writer : complexWriters) { writer.clear(); } throw e; } finally { markSplitOutputAsRead(); } }
private int load(ArrowBuf buf, int bufOffset, final SerializedField child, ValueVector vector) { if (child.getValueCount() == 0) { vector.clear(); } else { TypeHelper.load(vector, child, buf.slice(bufOffset, child.getBufferLength())); } bufOffset += child.getBufferLength(); return bufOffset; }
private void cleanupHyperValueIterators(Collection<HyperVectorValueIterator> hyperBatches) { for (HyperVectorValueIterator hvi : hyperBatches) { for (ValueVector vv : hvi.getHyperVector().getValueVectors()) { vv.clear(); } } }
v.clear(); v.allocateNew();