Package io.tiledb.java.api
Class Group
- java.lang.Object
-
- io.tiledb.java.api.Group
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Group extends java.lang.Object implements java.lang.AutoCloseable
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMember(java.lang.String uri, boolean relative, java.lang.String name)Add a member to a group.voidclose()Close resourcesstatic voidcreate(Context ctx, java.lang.String uri)Creates a new group.voiddeleteMetadata(java.lang.String key)It deletes a metadata key-value item from an open group.voiddumpStr(java.lang.String string, boolean flag)Dump a string representation of a groupConfiggetConfig()Gets the group config.protected ContextgetCtx()Gets the Context.protected SWIGTYPE_p_tiledb_group_tgetGroupp()Gets group pointer.longgetMemberCount()Get the count of members in a group.java.lang.StringgetMemberNameByIndex(java.math.BigInteger index)Get the name of a member of a group by index and details of groupjava.lang.StringgetMemberURIByIndex(java.math.BigInteger index)Get the URI of a member of a group by index and details of groupjava.lang.StringgetMemberURIByName(java.lang.String name)Get the URI of a member of a group by nameNativeArraygetMetadata(java.lang.String key, Datatype nativeType)It gets a metadata key-value item from an open group.Pair<java.lang.String,NativeArray>getMetadataFromIndex(java.math.BigInteger index)Gets a metadata item from an open group using an index.java.math.BigIntegergetMetadataNum()Gets the number of metadata items in an open group.java.lang.StringgetUri()Returns the URI of the groupjava.lang.BooleanhasMetadataKey(java.lang.String key)Checks if the key is present in the group metadata.booleanisOpen()Check if the group is open.voidputMetadata(java.lang.String key, NativeArray value)* It puts a metadata key-value item to an open group.voidremoveMember(java.lang.String uri)Remove a member from a group.voidreopen(Context ctx, QueryType queryType)Reopens a TileDB group (the group must be already open).voidsetConfig(Config config)Sets the group config.
-
-
-
Constructor Detail
-
Group
public Group(Context ctx, java.lang.String uri, QueryType queryType) throws TileDBError
- Throws:
TileDBError
-
-
Method Detail
-
getGroupp
protected SWIGTYPE_p_tiledb_group_t getGroupp()
Gets group pointer.- Returns:
- the group pointer
-
getCtx
protected Context getCtx()
Gets the Context.- Returns:
- the context
-
setConfig
public void setConfig(Config config) throws TileDBError
Sets the group config.- Parameters:
config- the configuration to set.- Throws:
TileDBError
-
deleteMetadata
public void deleteMetadata(java.lang.String key) throws TileDBErrorIt deletes a metadata key-value item from an open group. The group must be opened in WRITE mode, otherwise the function will error out.- Parameters:
key- the key to delete.- Throws:
TileDBError
-
getMetadata
public NativeArray getMetadata(java.lang.String key, Datatype nativeType) throws TileDBError
It gets a metadata key-value item from an open group. The group must be opened in READ mode, otherwise the function will error out.- Parameters:
key- the keynativeType- the datatype of the value.- Returns:
- Throws:
TileDBError
-
getConfig
public Config getConfig() throws TileDBError
Gets the group config.- Returns:
- the group config.
- Throws:
TileDBError
-
getMetadataNum
public java.math.BigInteger getMetadataNum() throws TileDBErrorGets the number of metadata items in an open group. The array must be opened in READ mode, otherwise the function will error out.- Returns:
- the number of metadata items
- Throws:
TileDBError- A TileDB exception
-
getMemberCount
public long getMemberCount() throws TileDBErrorGet the count of members in a group.- Returns:
- the number of members in a group.
- Throws:
TileDBError
-
getMemberURIByIndex
public java.lang.String getMemberURIByIndex(java.math.BigInteger index) throws TileDBErrorGet the URI of a member of a group by index and details of group- Parameters:
index- the index of the member.- Returns:
- the corresponding member in the group.
- Throws:
TileDBError
-
getMemberURIByName
public java.lang.String getMemberURIByName(java.lang.String name) throws TileDBErrorGet the URI of a member of a group by name- Parameters:
name- the name of the member- Returns:
- the URI of the member with the given name
- Throws:
TileDBError
-
getMemberNameByIndex
public java.lang.String getMemberNameByIndex(java.math.BigInteger index) throws TileDBErrorGet the name of a member of a group by index and details of group- Parameters:
index- the index of the member.- Returns:
- the corresponding member in the group.
- Throws:
TileDBError
-
addMember
public void addMember(java.lang.String uri, boolean relative, java.lang.String name) throws TileDBErrorAdd a member to a group.- Parameters:
uri- The uri of the member to add.relative- is the URI relative to the group.name- name of member, The caller takes ownership of the c-string. NULL if name was not set- Throws:
TileDBError
-
removeMember
public void removeMember(java.lang.String uri) throws TileDBErrorRemove a member from a group.- Parameters:
uri- The URI of the member to remove.- Throws:
TileDBError
-
dumpStr
public void dumpStr(java.lang.String string, boolean flag) throws TileDBErrorDump a string representation of a group- Parameters:
string- The string.flag- is recursive.- Throws:
TileDBError
-
getMetadataFromIndex
public Pair<java.lang.String,NativeArray> getMetadataFromIndex(java.math.BigInteger index) throws TileDBError
Gets a metadata item from an open group using an index. The array must be opened in READ mode, otherwise the function will error out.- Parameters:
index- index to retrieve metadata from- Returns:
- a pair, key and the metadata
- Throws:
TileDBError- A TileDB exception
-
hasMetadataKey
public java.lang.Boolean hasMetadataKey(java.lang.String key) throws TileDBErrorChecks if the key is present in the group metadata. The array must be opened in READ mode, otherwise the function will error out.- Parameters:
key- a key to retrieve from the metadata key-value- Returns:
- true if the key is present in the metadata, false if it is not
- Throws:
TileDBError- A TileDB exception
-
isOpen
public boolean isOpen() throws TileDBErrorCheck if the group is open.- Returns:
- True if the group is open.
- Throws:
TileDBError
-
putMetadata
public void putMetadata(java.lang.String key, NativeArray value) throws TileDBError* It puts a metadata key-value item to an open group. The group must * be opened in WRITE mode, otherwise the function will error out.- Parameters:
key- The key of the metadata item to be added.value- The metadata value.- Throws:
TileDBError
-
close
public void close()
Close resources- Specified by:
closein interfacejava.lang.AutoCloseable
-
getUri
public java.lang.String getUri() throws TileDBErrorReturns the URI of the group- Returns:
- The URI of the group.
- Throws:
TileDBError- A TileDB exception
-
reopen
public void reopen(Context ctx, QueryType queryType) throws TileDBError
Reopens a TileDB group (the group must be already open). This is useful when the group got updated after it got opened or when the user wants to reopen with a different queryType.- Parameters:
queryType- the queryType that will be used when the group opens.- Throws:
TileDBError
-
create
public static void create(Context ctx, java.lang.String uri) throws TileDBError
Creates a new group. A Group is a logical grouping of TileDB objects on the storage system with the sample path prefix.- Parameters:
ctx- The TileDB context.uri- The group URI.- Throws:
TileDBError- A TileDB exception
-
-