Class SubArray

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class SubArray
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SubArray addPointRanges​(int dimIdx, java.lang.Object start, java.math.BigInteger count)
      Adds point ranges to the given dimension index of the subarray Effectively `add_range(x_i, x_i)` for `count` points in the target array, but set in bulk to amortize expensive steps.
      SubArray addRange​(int dimIdx, java.lang.Object start, java.lang.Object end, java.lang.Object stride)
      Adds a 1D range along a subarray dimension index, which is in the form (start, end, stride).
      SubArray addRangeByName​(java.lang.String name, java.lang.Object start, java.lang.Object end, java.lang.Object stride)
      Adds a 1D range along a subarray dimension index, which is in the form (start, end, stride).
      SubArray addRangeVar​(int dimIdx, java.lang.String start, java.lang.String end)
      Adds a 1D string range along a subarray dimension index, in the form (start, end).
      SubArray addRangeVarByName​(java.lang.String name, java.lang.String start, java.lang.String end)
      Adds a 1D string range along a subarray dimension index, in the form (start, end).
      void close()  
      Pair<java.lang.Object,​java.lang.Object> getRange​(int dimIdx, long rangeIdx)
      Retrieves a specific range of the subarray along a given dimension.
      Pair<java.lang.Object,​java.lang.Object> getRangeFromName​(java.lang.String name, long rangeIdx)
      Retrieves a specific range of the subarray along a given dimension.
      long getRangeNum​(int dimIdx)
      Retrieves the number of ranges for a given dimension index.
      long getRangeNumFromName​(java.lang.String name)
      Retrieves the number of ranges for a given dimension index.
      Pair<java.lang.String,​java.lang.String> getRangeVar​(int dimIdx, java.math.BigInteger rangeIdx)
      Retrieves a range's start and end size for a given variable-length dimension index at a given range index.
      Pair<java.lang.String,​java.lang.String> getRangeVarByName​(java.lang.String name, java.math.BigInteger rangeIdx)
      Retrieves a range's start and end size for a given variable-length dimension index at a given range index.
      Pair<java.lang.Long,​java.lang.Long> getRangeVarSize​(int dimIdx, java.math.BigInteger rangeIdx)
      Retrieves a range for a given variable length string dimension index and range id.
      Pair<java.lang.Long,​java.lang.Long> getRangeVarSizeByName​(java.lang.String name, java.math.BigInteger rangeIdx)
      Retrieves a range for a given variable length string dimension index and range id.
      SWIGTYPE_p_tiledb_subarray_t getSubArrayp()
      Getter for subArray pointer.
      void setCoalesceRanges​(boolean flag)
      Sets coalesce_ranges flag, intended for use by CAPI, to alloc matching default coalesce-ranges=true semantics of internal class constructor, but giving capi clients ability to turn off if desired.
      void setConfig​(Config config)
      Set the query config.
      SubArray setSubarray​(NativeArray subarray)
      Sets a subarray, defined in the order dimensions were added.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setConfig

        public void setConfig​(Config config)
                       throws TileDBError
        Set the query config.

        Setting configuration with this function overrides the following Query-level parameters only:

        - `sm.memory_budget` - `sm.memory_budget_var` - `sm.sub_partitioner_memory_budget` - `sm.var_offsets.mode` - `sm.var_offsets.extra_element` - `sm.var_offsets.bitsize` - `sm.check_coord_dups` - `sm.check_coord_oob` - `sm.check_global_order` - `sm.dedup_coords`

        Parameters:
        config - The input configuration
        Throws:
        TileDBError
      • addRange

        public SubArray addRange​(int dimIdx,
                                 java.lang.Object start,
                                 java.lang.Object end,
                                 java.lang.Object stride)
                          throws TileDBError
        Adds a 1D range along a subarray dimension index, which is in the form (start, end, stride). The datatype of the range components must be the same as the type of the domain of the array in the query.
        Parameters:
        dimIdx - The index of the dimension to add the range to
        start - The range start
        end - The range end
        stride - The range stride
        Returns:
        This subArray

        Note: The stride is currently unsupported. Use 0/NULL/nullptr as the stride argument.

        Throws:
        TileDBError - A TileDB exception
      • addPointRanges

        public SubArray addPointRanges​(int dimIdx,
                                       java.lang.Object start,
                                       java.math.BigInteger count)
                                throws TileDBError
        Adds point ranges to the given dimension index of the subarray Effectively `add_range(x_i, x_i)` for `count` points in the target array, but set in bulk to amortize expensive steps.
        Parameters:
        dimIdx - The dimension index
        start - The range start
        count - Number of ranges to add
        Returns:
        This query
        Throws:
        TileDBError - A TileDB exception
      • addRangeByName

        public SubArray addRangeByName​(java.lang.String name,
                                       java.lang.Object start,
                                       java.lang.Object end,
                                       java.lang.Object stride)
                                throws TileDBError
        Adds a 1D range along a subarray dimension index, which is in the form (start, end, stride). The datatype of the range components must be the same as the type of the domain of the array in the query.
        Parameters:
        name - The name of the dimension to add the range to
        start - The range start
        end - The range end
        stride - The range stride
        Returns:
        This subArray

        Note: The stride is currently unsupported. Use 0/NULL/nullptr as the stride argument.

        Throws:
        TileDBError - A TileDB exception
      • addRangeVar

        public SubArray addRangeVar​(int dimIdx,
                                    java.lang.String start,
                                    java.lang.String end)
                             throws TileDBError
        Adds a 1D string range along a subarray dimension index, in the form (start, end). Applicable only to variable-sized dimensions
        Parameters:
        dimIdx - The index of the dimension to add the range to
        start - The range start
        end - The range end
        Returns:
        This query
        Throws:
        TileDBError - A TileDB exception
      • addRangeVarByName

        public SubArray addRangeVarByName​(java.lang.String name,
                                          java.lang.String start,
                                          java.lang.String end)
                                   throws TileDBError
        Adds a 1D string range along a subarray dimension index, in the form (start, end). Applicable only to variable-sized dimensions
        Parameters:
        name - The name of the dimension to add the range to
        start - The range start
        end - The range end
        Returns:
        This query
        Throws:
        TileDBError - A TileDB exception
      • getRangeNum

        public long getRangeNum​(int dimIdx)
                         throws TileDBError
        Retrieves the number of ranges for a given dimension index.
        Parameters:
        dimIdx - The index of the dimension whose range number to retrieve
        Returns:
        The number of ranges of the dimension
        Throws:
        TileDBError - A TileDB exception
      • getRangeNumFromName

        public long getRangeNumFromName​(java.lang.String name)
                                 throws TileDBError
        Retrieves the number of ranges for a given dimension index.
        Parameters:
        name - The name of the dimension whose range number to retrieve
        Returns:
        The number of ranges of the dimension
        Throws:
        TileDBError - A TileDB exception
      • getRange

        public Pair<java.lang.Object,​java.lang.Object> getRange​(int dimIdx,
                                                                      long rangeIdx)
                                                               throws TileDBError
        Retrieves a specific range of the subarray along a given dimension.
        Parameters:
        dimIdx - The index of the dimension to retrieve the range from
        rangeIdx - The index of the range to retrieve
        Returns:
        Pair of (start, end) of the range.
        Throws:
        TileDBError - A TileDB exception
      • getRangeFromName

        public Pair<java.lang.Object,​java.lang.Object> getRangeFromName​(java.lang.String name,
                                                                              long rangeIdx)
                                                                       throws TileDBError
        Retrieves a specific range of the subarray along a given dimension.
        Parameters:
        name - The name of the dimension to retrieve the range from
        rangeIdx - The index of the range to retrieve
        Returns:
        Pair of (start, end) of the range.
        Throws:
        TileDBError - A TileDB exception
      • getRangeVarSize

        public Pair<java.lang.Long,​java.lang.Long> getRangeVarSize​(int dimIdx,
                                                                         java.math.BigInteger rangeIdx)
                                                                  throws TileDBError
        Retrieves a range for a given variable length string dimension index and range id.
        Parameters:
        dimIdx - The index of the dimension to get the range from
        Returns:
        This subArray
        Throws:
        TileDBError - A TileDB exception
      • getRangeVarSizeByName

        public Pair<java.lang.Long,​java.lang.Long> getRangeVarSizeByName​(java.lang.String name,
                                                                               java.math.BigInteger rangeIdx)
                                                                        throws TileDBError
        Retrieves a range for a given variable length string dimension index and range id.
        Parameters:
        name - The index of the dimension to get the range from
        Returns:
        This subArray
        Throws:
        TileDBError - A TileDB exception
      • getRangeVar

        public Pair<java.lang.String,​java.lang.String> getRangeVar​(int dimIdx,
                                                                         java.math.BigInteger rangeIdx)
                                                                  throws TileDBError
        Retrieves a range's start and end size for a given variable-length dimension index at a given range index.
        Parameters:
        dimIdx - The index of the dimension to get the range from
        Returns:
        This query
        Throws:
        TileDBError - A TileDB exception
      • getRangeVarByName

        public Pair<java.lang.String,​java.lang.String> getRangeVarByName​(java.lang.String name,
                                                                               java.math.BigInteger rangeIdx)
                                                                        throws TileDBError
        Retrieves a range's start and end size for a given variable-length dimension index at a given range index.
        Parameters:
        name - The index of the dimension to get the range from
        Returns:
        This query
        Throws:
        TileDBError - A TileDB exception
      • setCoalesceRanges

        public void setCoalesceRanges​(boolean flag)
                               throws TileDBError
        Sets coalesce_ranges flag, intended for use by CAPI, to alloc matching default coalesce-ranges=true semantics of internal class constructor, but giving capi clients ability to turn off if desired.
        Parameters:
        flag - boolean input flag
        Throws:
        TileDBError
      • setSubarray

        public SubArray setSubarray​(NativeArray subarray)
                             throws TileDBError
        Sets a subarray, defined in the order dimensions were added. Coordinates are inclusive.
        Parameters:
        subarray - The targeted subarray.
        Throws:
        TileDBError - A TileDB exception
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception