Class Group

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Group
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Constructor Summary

      Constructors 
      Constructor Description
      Group​(Context ctx, java.lang.String uri, QueryType queryType)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addMember​(java.lang.String uri, boolean relative, java.lang.String name)
      Add a member to a group.
      void close()
      Close resources
      void consolidateMetadata​(Config config)
      Consolidates the group metadata into a single group metadata file.
      static void create​(Context ctx, java.lang.String uri)
      Creates a new group.
      void delete​(short recursive)
      Deletes written data from an open group.
      void deleteMetadata​(java.lang.String key)
      It deletes a metadata key-value item from an open group.
      void dumpStr​(java.lang.String string, boolean flag)
      Dump a string representation of a group
      Config getConfig()
      Gets the group config.
      protected Context getCtx()
      Gets the Context.
      protected SWIGTYPE_p_tiledb_group_handle_t getGroupp()
      Gets group pointer.
      boolean getIsRelativeURIByName​(java.lang.String name)
      Get a member of a group by name and relative characteristic of that name
      java.lang.String getMemberByIndexV2​(java.math.BigInteger index)
      Get the URI of a member of a group by index and details of group
      java.lang.String getMemberByNameV2​(java.lang.String name)
      Get the URI of a member of a group by name
      long getMemberCount()
      Get the count of members in a group.
      java.lang.String getMemberURIByIndex​(java.math.BigInteger index)
      Deprecated.
      java.lang.String getMemberURIByName​(java.lang.String name)
      Deprecated.
      NativeArray getMetadata​(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.BigInteger getMetadataNum()
      Gets the number of metadata items in an open group.
      QueryType getQueryType()
      Returns the query type
      java.lang.String getUri()
      Returns the URI of the group
      java.lang.Boolean hasMetadataKey​(java.lang.String key)
      Checks if the key is present in the group metadata.
      boolean isOpen()
      Check if the group is open.
      void putMetadata​(java.lang.String key, NativeArray value)
      * It puts a metadata key-value item to an open group.
      void removeMember​(java.lang.String nameOrUri)
      Remove a member from a group.
      void reopen​(Context ctx, QueryType queryType)
      Reopens a TileDB group (the group must be already open).
      void setConfig​(Config config)
      Sets the group config.
      void vacuumMetadata​(Config config)
      Cleans up the group metadata Note that this will coarsen the granularity of time traveling (see docs for more information).
      • Methods inherited from class java.lang.Object

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

      • 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
      • getQueryType

        public QueryType getQueryType()
        Returns the query type
        Returns:
        The query type
      • deleteMetadata

        public void deleteMetadata​(java.lang.String key)
                            throws TileDBError
        It 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 key
        nativeType - the datatype of the value.
        Returns:
        Throws:
        TileDBError
      • getMetadataNum

        public java.math.BigInteger getMetadataNum()
                                            throws TileDBError
        Gets 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 TileDBError
        Get the count of members in a group.
        Returns:
        the number of members in a group.
        Throws:
        TileDBError
      • getMemberByIndexV2

        public java.lang.String getMemberByIndexV2​(java.math.BigInteger index)
                                            throws TileDBError
        Get 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
      • getMemberByNameV2

        public java.lang.String getMemberByNameV2​(java.lang.String name)
                                           throws TileDBError
        Get 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
      • getMemberURIByName

        @Deprecated
        public java.lang.String getMemberURIByName​(java.lang.String name)
                                            throws TileDBError
        Deprecated.
        Throws:
        TileDBError
      • getMemberURIByIndex

        @Deprecated
        public java.lang.String getMemberURIByIndex​(java.math.BigInteger index)
                                             throws TileDBError
        Deprecated.
        Throws:
        TileDBError
      • addMember

        public void addMember​(java.lang.String uri,
                              boolean relative,
                              java.lang.String name)
                       throws TileDBError
        Add 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 nameOrUri)
                          throws TileDBError
        Remove a member from a group.
        Parameters:
        nameOrUri - The name or URI of the member to remove
        Throws:
        TileDBError
      • dumpStr

        public void dumpStr​(java.lang.String string,
                            boolean flag)
                     throws TileDBError
        Dump 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 TileDBError
        Checks 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 TileDBError
        Check 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
      • getIsRelativeURIByName

        public boolean getIsRelativeURIByName​(java.lang.String name)
                                       throws TileDBError
        Get a member of a group by name and relative characteristic of that name
        Parameters:
        name - name of member to fetch
        Returns:
        True if relative
        Throws:
        TileDBError
      • vacuumMetadata

        public void vacuumMetadata​(Config config)
                            throws TileDBError
        Cleans up the group metadata Note that this will coarsen the granularity of time traveling (see docs for more information).
        Parameters:
        config - Configuration parameters for the vacuuming. (`null` means default, which will use the config from `ctx`).
        Throws:
        TileDBError
      • consolidateMetadata

        public void consolidateMetadata​(Config config)
                                 throws TileDBError
        Consolidates the group metadata into a single group metadata file.
        Parameters:
        config - Configuration parameters for the vacuuming. (`null` means default, which will use the config from `ctx`).
        Throws:
        TileDBError
      • close

        public void close()
        Close resources
        Specified by:
        close in interface java.lang.AutoCloseable
      • getUri

        public java.lang.String getUri()
                                throws TileDBError
        Returns 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
      • delete

        public void delete​(short recursive)
                    throws TileDBError
        Deletes written data from an open group. The group must be opened in MODIFY_EXCLUSIVE mode, otherwise the function will error out.
        Parameters:
        recursive - 1 if all data inside the group is to be deleted
        Throws:
        TileDBError