Ejemplo n.º 1
0
 /**
  * Converts stream buffers to disk ranges.
  * @param streamBuffer - stream buffer
  * @return - total length of disk ranges
  */
 public static DiskRangeInfo createDiskRangeInfo(ColumnStreamData streamBuffer)
 {
     DiskRangeInfo diskRangeInfo = new DiskRangeInfo(streamBuffer.getIndexBaseOffset());
     long offset = streamBuffer.getIndexBaseOffset(); // See ctor comment.
     // TODO: we should get rid of this
     foreach (MemoryBuffer memoryBuffer in streamBuffer.getCacheBuffers())
     {
         ByteBuffer buffer = memoryBuffer.getByteBufferDup();
         diskRangeInfo.addDiskRange(new RecordReaderImpl.BufferChunk(buffer, offset));
         offset += buffer.remaining();
     }
     return diskRangeInfo;
 }
Ejemplo n.º 2
0
        /**
         * Create SettableUncompressedStream from stream buffer.
         *
         * @param streamName - stream name
         * @param fileId - file id
         * @param streamBuffer - stream buffer
         * @return - SettableUncompressedStream
         * @
         */
        public static SettableUncompressedStream createSettableUncompressedStream(string streamName,
                                                                                  long?fileId, ColumnStreamData streamBuffer)
        {
            if (streamBuffer == null)
            {
                return(null);
            }

            DiskRangeInfo diskRangeInfo = createDiskRangeInfo(streamBuffer);

            return(new SettableUncompressedStream(fileId, streamName, diskRangeInfo.getDiskRanges(),
                                                  diskRangeInfo.getTotalLength()));
        }
Ejemplo n.º 3
0
        /**
         * Converts stream buffers to disk ranges.
         * @param streamBuffer - stream buffer
         * @return - total length of disk ranges
         */
        public static DiskRangeInfo createDiskRangeInfo(ColumnStreamData streamBuffer)
        {
            DiskRangeInfo diskRangeInfo = new DiskRangeInfo(streamBuffer.getIndexBaseOffset());
            long          offset        = streamBuffer.getIndexBaseOffset(); // See ctor comment.

            // TODO: we should get rid of this
            foreach (MemoryBuffer memoryBuffer in streamBuffer.getCacheBuffers())
            {
                ByteBuffer buffer = memoryBuffer.getByteBufferDup();
                diskRangeInfo.addDiskRange(new RecordReaderImpl.BufferChunk(buffer, offset));
                offset += buffer.remaining();
            }
            return(diskRangeInfo);
        }
 public void setBuffers(DiskRangeInfo diskRangeInfo)
 {
     reset(diskRangeInfo.getDiskRanges(), diskRangeInfo.getTotalLength());
     setOffset(diskRangeInfo.getDiskRanges());
 }
 public void setBuffers(DiskRangeInfo diskRangeInfo)
 {
     reset(diskRangeInfo.getDiskRanges(), diskRangeInfo.getTotalLength());
     setOffset(diskRangeInfo.getDiskRanges());
 }