Package io.tiledb.java.api
Class SubArray
- java.lang.Object
-
- io.tiledb.java.api.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 void
addLabelRange(java.lang.String name, java.lang.Object start, java.lang.Object end, java.lang.Object stride)
Adds a 1D range along a subarray for a dimension label, which is in the form (start, end, stride).void
addLabelRangeVar(java.lang.String name, java.lang.String start, long startSize, java.lang.String end, long endSize)
Adds a 1D variable-sized range for a dimension label along a subarray, which is in the form (start, end).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()
java.lang.String
getLabelName(long dimIndex)
Gets the name of the dimension label for label ranges set on this dimension of the subarray.Pair<java.lang.Object,java.lang.Object>
getLabelRange(java.lang.String name, long rangeIndex)
Retrieves a specific label range of the subarray from the ranges set for the given dimension label name.long
getLabelRangeNum(java.lang.String name)
Retrieves the number of label ranges set for the subarray for the dimension label with the given name.Pair<java.lang.String,java.lang.String>
getLabelRangeVar(java.lang.String name, long rangeIdx)
Retrieves a specific range of the subarray for a variable-length dimension label at the given namePair<java.lang.Long,java.lang.Long>
getLabelRangeVarSize(java.lang.String name, long rangeIdx)
Retrieves a range's start and end size for a given variable-length dimension label with the given dimension label name and at the given range index.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, long 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, long 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.boolean
hasLabelRanges(long index)
Checks whether the subarray has label ranges set on the requested dimension.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.
-
-
-
Constructor Detail
-
SubArray
public SubArray(Context ctx, Array array) throws TileDBError
- Throws:
TileDBError
-
-
Method Detail
-
getSubArrayp
public SWIGTYPE_p_tiledb_subarray_t getSubArrayp()
Getter for subArray pointer.- Returns:
- the subarray pointer
-
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 tostart
- The range startend
- The range endstride
- 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 indexstart
- The range startcount
- 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 tostart
- The range startend
- The range endstride
- 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 tostart
- The range startend
- 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 tostart
- The range startend
- 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 fromrangeIdx
- 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 fromrangeIdx
- 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, long 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, long 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
-
getLabelRange
public Pair<java.lang.Object,java.lang.Object> getLabelRange(java.lang.String name, long rangeIndex) throws TileDBError
Retrieves a specific label range of the subarray from the ranges set for the given dimension label name.- Parameters:
name
- The name of the dimension label to retrieve the range from.rangeIndex
- The index of the range to retrieve.- Returns:
- a pair of objects as the range
- Throws:
TileDBError
-
getLabelName
public java.lang.String getLabelName(long dimIndex) throws TileDBError
Gets the name of the dimension label for label ranges set on this dimension of the subarray.- Parameters:
dimIndex
- The dimension index the label ranges are set on.- Returns:
- The label name
- Throws:
TileDBError
-
addLabelRange
public void addLabelRange(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 for a dimension label, which is in the form (start, end, stride). The datatype of the range components must be the same as the datatype of label.- Parameters:
name
- The name of the dimension label to add the range to.start
- The range start.end
- The range end.stride
- The range stride.The stride is currently unsupported. Use 0/NULL/nullptr as the stride argument.
- Throws:
TileDBError
-
getLabelRangeNum
public long getLabelRangeNum(java.lang.String name) throws TileDBError
Retrieves the number of label ranges set for the subarray for the dimension label with the given name.- Parameters:
name
- The name of the dimension label whose range number to retrieve.- Returns:
- The number of ranges
- Throws:
TileDBError
-
addLabelRangeVar
public void addLabelRangeVar(java.lang.String name, java.lang.String start, long startSize, java.lang.String end, long endSize) throws TileDBError
Adds a 1D variable-sized range for a dimension label along a subarray, which is in the form (start, end). Applicable only to variable-sized dimension labels.- Parameters:
name
- The name of the dimension label to add the range to.start
- The range start.startSize
- The size of the range start in bytes.end
- The range end.endSize
- The size of the range end in bytes.- Throws:
TileDBError
-
getLabelRangeVar
public Pair<java.lang.String,java.lang.String> getLabelRangeVar(java.lang.String name, long rangeIdx) throws TileDBError
Retrieves a specific range of the subarray for a variable-length dimension label at the given name- Parameters:
name
- The name of the dimension to retrieve the range from.rangeIdx
- The index of the range to retrieve.- Returns:
- The var range as a Pair of Strings
- Throws:
TileDBError
-
getLabelRangeVarSize
public Pair<java.lang.Long,java.lang.Long> getLabelRangeVarSize(java.lang.String name, long rangeIdx) throws TileDBError
Retrieves a range's start and end size for a given variable-length dimension label with the given dimension label name and at the given range index.- Parameters:
name
- The name of the dimension label to retrieve the range from.rangeIdx
- The index of the range to retrieve.- Returns:
- The sizes as a pair of Longs
- Throws:
TileDBError
-
hasLabelRanges
public boolean hasLabelRanges(long index) throws TileDBError
Checks whether the subarray has label ranges set on the requested dimension.- Parameters:
index
- The index of the dimension to check for label ranges.- Returns:
- True if the subarray has label ranges
- Throws:
TileDBError
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-