Class FinkHBaseClient
- java.lang.Object
-
- com.Lomikel.DB.Client<org.apache.hadoop.hbase.client.Table,HBaseSchema>
-
- com.Lomikel.HBaser.HBaseClient
-
- com.Lomikel.HBaser.HBaseSQLClient
-
- com.astrolabsoftware.FinkBrowser.HBaser.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 columni:objectId
. - *.pixel table with
key = pixel_jd
and columnsi:objectId,i:dec,i:ra
- Author:
- J.Hrivnac
- *.jd table with
-
-
Field Summary
Fields Modifier and Type Field Description private static HealpixNested
_hn
private static int
_NSIDE
private static java.lang.String[]
LIGHTCURVE_SCHEMA
private static org.apache.logging.log4j.Logger
log
Logging .
-
Constructor Summary
Constructors Constructor Description FinkHBaseClient()
Create on localhost.FinkHBaseClient(java.lang.String url)
Create.FinkHBaseClient(java.lang.String zookeepers, int clientPort)
Create.FinkHBaseClient(java.lang.String zookeepers, java.lang.String clientPort)
Create.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
assembleLightCurves(HBaseClient sourceClient, java.lang.String objectIds)
Assemble lightcurves from another table as multi-versioned columns of the current table.void
createJDTable(java.lang.String keyPrefixSearch)
Create aux jd map hash table.void
createPixelTable(java.lang.String keyPrefixSearch)
Create aux pixel map hash table.java.util.Map<java.lang.String,java.lang.String>
jd2keys(java.lang.String jd, boolean reversed)
Give all objectIds corresponding to specified Julian Date.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).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.java.util.Map<java.lang.String,java.lang.String>
radec2keys(double ra, double dec, double delta)
Give all objectIds within a spacial cone.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).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).private void
setFinkEvaluatorFunctions()
Setup the default sets of evaluation functions.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.-
Methods inherited from class com.Lomikel.HBaser.HBaseSQLClient
close, conn, scan, scan2SQL, simpleSchema, sqlTableCreationCommand, sqlTableName, sqlViewCreationCommand
-
Methods inherited from class com.Lomikel.HBaser.HBaseClient
addAlwaysColumns, addResult, addResult3D, clientPort, conf, connect, connect, connect, connect, create, dateFormat, delete, evaluator, isRangeScan, processResults, put, put, repository, resultScanner, scan, scan3D, search3D, search3D, searchLimit, setAlwaysColumns, setDateFormat, setEvaluation, setEvaluation, setProcessor, setRangeScan, setRepository, setSearchLimit, setSearchOperator, setup, table, zookeepers
-
Methods inherited from class com.Lomikel.DB.Client
finalize, isReversed, limit, registerVertexType, rename, representation, representations, results2CVS, results2DF, results2List, results2String, scan, scan, scan, scan3D, scan3D, scan3D, schema, setLimit, setReversed, setSchema, setTableName, tableName
-
-
-
-
Field Detail
-
LIGHTCURVE_SCHEMA
private static java.lang.String[] LIGHTCURVE_SCHEMA
-
_NSIDE
private static int _NSIDE
-
_hn
private static HealpixNested _hn
-
log
private static org.apache.logging.log4j.Logger log
Logging .
-
-
Constructor Detail
-
FinkHBaseClient
public FinkHBaseClient(java.lang.String zookeepers, java.lang.String clientPort) throws LomikelException
Create.- Parameters:
zookeepers
- The comma-separated list of zookeper ids.clientPort
- The client port.- Throws:
LomikelException
- If anything goes wrong.
-
FinkHBaseClient
public FinkHBaseClient(java.lang.String zookeepers, int clientPort) throws LomikelException
Create.- Parameters:
zookeepers
- The comma-separated list of zookeper ids.clientPort
- The client port.- Throws:
LomikelException
- If anything goes wrong.
-
FinkHBaseClient
public FinkHBaseClient(java.lang.String url) throws LomikelException
Create.- Parameters:
url
- The HBase url.- Throws:
LomikelException
- If anything goes wrong.
-
FinkHBaseClient
public FinkHBaseClient() throws LomikelException
Create on localhost.- Throws:
LomikelException
- If anything goes wrong.
-
-
Method Detail
-
setFinkEvaluatorFunctions
private void setFinkEvaluatorFunctions()
Setup the default sets of evaluation functions.
-
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
ofMap
s 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
ofMap
s 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 classHBaseClient
- 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
ofPair
s 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 classHBaseClient
- 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
- TheHBaseClient
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
- TheHBaseClient
of the source table. It should be already opened and connected with appropriate schema.objectIds
- The comma-separated list of objectIds to extract.
-
-