Class RecordsBatchBuffer<Reference>

    • Method Detail

      • scan

        public org.neo4j.gds.core.loading.RecordsBatchBuffer.ScanState scan​(StoreScanner.ScanCursor<Reference> cursor,
                                                                            boolean reserveNextBatch)
        Advances the underlying scan to the next batch of records and immediately consumes the batch into this RecordsBatchBuffer.
        There are two scenarios that can happen while consuming a batch of records from the kernel. If we read in fixed-size batches, these batches usually align with the buffer size and once we consumed the whole batch, the buffers can be flushed to the importer tasks. In the second scenario, we read from partitioned index scans which have varying sizes for partitions that might also exceed the size of the buffer. In that scenario, we need to flush the buffer before we advance to the next batch. The two scenarios are indicated by the returned ScanState.
        Parameters:
        cursor - A wrapper around a Cursor that allows us to consume the entity records using this buffer instance.
        reserveNextBatch - Indicates if the underlying kernel scan should advance the cursor to the next batch. This needs to be set to false, if the RecordsBatchBuffer has not read the complete batch yet, but had to be flushed before that.
        Returns:
        a ScanState that indicates if the consumer needs to be flushed and if another batch can be read from the underlying scan.
      • length

        public int length()
      • capacity

        public int capacity()
      • isFull

        public boolean isFull()
      • reset

        public void reset()
      • batch

        public long[] batch()