Class FinkHBaseClient


  • public class FinkHBaseClient
    extends HBaseSQLClient
    FinkHBaseClient handles connectionto HBase table with specific Fink functionality. It expects the main table with schema and two schemaless aux tables:
    • *.jd table with key = jd.alert and one column i:objectId.
    • *.pixel table with key = pixel_jd and columns i:objectId,i:dec,i:ra
    Author:
    J.Hrivnac
    • Method Detail

      • search

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> search​(java.lang.String jdStart,
                                                                                                                   java.lang.String jdStop,
                                                                                                                   boolean reversed,
                                                                                                                   java.lang.String filter,
                                                                                                                   boolean ifkey,
                                                                                                                   boolean iftime)
        Get alerts between two Julian dates (inclusive).
        Parameters:
        jdStart - The starting Julian date (including day franction).
        jdStop - The stopping Julian date (including day franction).
        reversed - Wheter results should be reversly ordered. true implies that results limits will be counted backwards.
        filter - The names of required values as family:column,.... It can be null.
        ifkey - Whether give also entries keys.
        iftime - Whether give also entries timestamps.
        Returns:
        The Map of Maps of results as key-&t;{family:column->value}.
      • search

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> search​(double ra,
                                                                                                                   double dec,
                                                                                                                   double delta,
                                                                                                                   java.lang.String filter,
                                                                                                                   boolean ifkey,
                                                                                                                   boolean iftime)
        Get alerts within a spacial cone (inclusive).
        Parameters:
        ra - The central value of ra (in deg).
        dec - The central value of dec (in deg).
        delta - The maximal angular distance from the central direction (in deg).
        filter - The names of required values as family:column,.... It can be null.
        ifkey - Whether give also entries keys.
        iftime - Whether give also entries timestamps.
        Returns:
        The Map of Maps of results as key-&t;{family:column->value}.
      • jd2keys

        public java.util.Map<java.lang.String,​java.lang.String> jd2keys​(java.lang.String jd,
                                                                              boolean reversed)
        Give all objectIds corresponding to specified Julian Date. It uses *.jd table.
        Parameters:
        jd - The Julian Data (with day fraction).
        reversed - Wheter results should be reversly ordered. true implies that results limits will be counted backwards.
        Returns:
        The Map of corresponding keys of the main table, in the format expected for the scan methods.
      • jd2keys

        public java.util.Map<java.lang.String,​java.lang.String> jd2keys​(java.lang.String jdStart,
                                                                              java.lang.String jdStop,
                                                                              boolean reversed)
        Give all objectIds between two specified Julian Dates (inclusive). It uses *.jd table.
        Parameters:
        jdStart - The start Julian Data (with day fraction), evaluated as literal prefix scan.
        jdStart - The stop Julian Data (with day fraction), evaluated as literal prefix scan.
        reversed - Wheter results should be reversly ordered. true implies that results limits will be counted backwards.
        Returns:
        The Map of corresponding keys of the main table, in the format expected for the scan methods.
      • radec2keys

        public java.util.Map<java.lang.String,​java.lang.String> radec2keys​(double ra,
                                                                                 double dec,
                                                                                 double delta)
        Give all objectIds within a spacial cone. It uses *.pixel table.
        Parameters:
        ra - The central value of ra/lon (in deg).
        dec - The central value of dec/lat (in deg).
        delta - The maximal angular distance from the central direction (in deg).
        Returns:
        The Map of corresponding keys of the main table, in the format expected for the scan methods.
      • timeline

        public java.util.Set<Pair<java.lang.String,​java.lang.String>> timeline​(java.lang.String columnName,
                                                                                     java.lang.String search)
        Give the timeline for the column. It makes use of the Julian Date alert time instead of HBase timestamp.
        Overrides:
        timeline in class HBaseClient
        Parameters:
        columnName - The name of the column.
        search - The search terms as family:column:value,.... Key can be searched with family:column = key:key "pseudo-name". Comparator can be chosen as family:column:value:comparator among exact,prefix,substring,regex. The default for key is prefix, the default for columns is substring. It can be null. All searches are executed as prefix searches.
        Returns:
        The Set of Pairs of JulianDate-value.
      • latests

        public java.util.Set<java.lang.String> latests​(java.lang.String columnName,
                                                       java.lang.String prefixValue,
                                                       long minutes,
                                                       boolean getValues)
        Give all recent values of the column. It makes use of the Julian Date alert time instead of HBase timestamp. Results are ordered by the Julian Date alert time, so evetual limits on results number will be apllied backwards in Julian date time.
        Overrides:
        latests in class HBaseClient
        Parameters:
        columnName - The name of the column.
        prefixValue - The column value prefix to search for.
        minutes - How far into the past it should search.
        getValues - Whether to get column values or row keys.
        Returns:
        The Set of different values of that column.
      • createPixelTable

        public void createPixelTable​(java.lang.String keyPrefixSearch)
                              throws LomikelException,
                                     java.io.IOException
        Create aux pixel map hash table.
        Parameters:
        keyPrefixSearch - The prefix search of row key.
        Throws:
        LomikelException - If anything goes wrong.
        LomikelException - If anything goes wrong.
        java.io.IOException
      • createJDTable

        public void createJDTable​(java.lang.String keyPrefixSearch)
                           throws LomikelException,
                                  java.io.IOException
        Create aux jd map hash table.
        Parameters:
        keyPrefixSearch - The prefix search of row key.
        Throws:
        java.io.IOException - If anything goes wrong.
        LomikelException - If anything goes wrong.
      • assembleCurves

        public void assembleCurves​(HBaseClient sourceClient,
                                   java.lang.String objectIds,
                                   java.lang.String columns,
                                   java.lang.String schemaName)
        Assemble curves of variable columns from another table as multi-versioned columns of the current table. All previous lightcurves for selected objectIds are deleted.
        Parameters:
        sourceClient - The HBaseClient of the source table. It should be already opened and connected with appropriate schema.
        objectIds - The comma-separated list of objectIds to extract.
        columns - The comma-separated list of columns (incl. families) to extract.
        schemaName - The name of the schema to be created in the new table. The columns in the new table will belong to the c family and will have the type of double.
      • assembleLightCurves

        public void assembleLightCurves​(HBaseClient sourceClient,
                                        java.lang.String objectIds)
        Assemble lightcurves from another table as multi-versioned columns of the current table. All previous lightcurves for selected objectIds are deleted. The colums schema is embedded in this class sourcecode.
        Parameters:
        sourceClient - The HBaseClient of the source table. It should be already opened and connected with appropriate schema.
        objectIds - The comma-separated list of objectIds to extract.