Class S3BlockSpiller

    • Constructor Detail

      • S3BlockSpiller

        public S3BlockSpiller​(com.amazonaws.services.s3.AmazonS3 amazonS3,
                              SpillConfig spillConfig,
                              BlockAllocator allocator,
                              org.apache.arrow.vector.types.pojo.Schema schema,
                              ConstraintEvaluator constraintEvaluator,
                              Map<String,​String> configOptions)
        Constructor which uses the default maxRowsPerCall.
        Parameters:
        amazonS3 - AmazonS3 client to use for writing to S3.
        spillConfig - The spill config for this instance. Includes things like encryption key, s3 path, etc...
        allocator - The BlockAllocator to use when creating blocks.
        schema - The schema for blocks that should be written.
        constraintEvaluator - The ConstraintEvaluator that should be used to constrain writes.
      • S3BlockSpiller

        public S3BlockSpiller​(com.amazonaws.services.s3.AmazonS3 amazonS3,
                              SpillConfig spillConfig,
                              BlockAllocator allocator,
                              org.apache.arrow.vector.types.pojo.Schema schema,
                              ConstraintEvaluator constraintEvaluator,
                              int maxRowsPerCall,
                              Map<String,​String> configOptions)
        Constructs a new S3BlockSpiller.
        Parameters:
        amazonS3 - AmazonS3 client to use for writing to S3.
        spillConfig - The spill config for this instance. Includes things like encryption key, s3 path, etc...
        allocator - The BlockAllocator to use when creating blocks.
        schema - The schema for blocks that should be written.
        constraintEvaluator - The ConstraintEvaluator that should be used to constrain writes.
        maxRowsPerCall - The max number of rows to allow callers to write in one call.
    • Method Detail

      • writeRows

        public void writeRows​(BlockWriter.RowWriter rowWriter)
        Used to write rows via the BlockWriter.
        Specified by:
        writeRows in interface BlockWriter
        Parameters:
        rowWriter - The RowWriter that the BlockWriter should use to write rows into the Block(s) it is managing.
        See Also:
        BlockSpiller
      • spilled

        public boolean spilled()
        Used to tell if any blocks were spilled or if the response can be inline.
        Specified by:
        spilled in interface BlockSpiller
        Returns:
        True is spill occurred, false otherwise.
      • getBlock

        public Block getBlock()
        If spilled() returns false this can be used to access the block.
        Specified by:
        getBlock in interface BlockSpiller
        Returns:
        Block to be inlined in the response.
      • getSpillLocations

        public List<SpillLocation> getSpillLocations()
        If spilled() returns true this can be used to access the spill locations of all blocks.
        Specified by:
        getSpillLocations in interface BlockSpiller
        Returns:
        List of spill locations.
      • read

        protected Block read​(S3SpillLocation spillLocation,
                             EncryptionKey key,
                             org.apache.arrow.vector.types.pojo.Schema schema)
        Reads a spilled block.
        Parameters:
        spillLocation - The location to read the spilled Block from.
        key - The encryption key to use when reading the spilled Block.
        schema - The Schema to use when deserializing the spilled Block.
        Returns:
        The Block stored at the spill location.