Skip to content

Commit

Permalink
Update HBase client (#516)
Browse files Browse the repository at this point in the history
* Modify how to access the client

* Replace client calls

* Remove unused module

* Update client calls

* Missing imports

* Replace java.utils.Treemap by python dict

* REplace client calss

* Remove unused imports

* Remove unused imports

* Fix missing import

* Fix paths

* Fix confition

* Update portal

* Trial for cutouts

* de-callbackized

* Enable retriveing cutout data in callback

* New version of the client to enable physical repository on disk

* Fix typo

* Fix typo in tablename

* Fix typo
  • Loading branch information
JulienPeloton authored Nov 6, 2023
1 parent 396018e commit 575a276
Show file tree
Hide file tree
Showing 12 changed files with 370 additions and 261 deletions.
89 changes: 15 additions & 74 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
# Copyright 2021-2023 AstroLab Software
# Author: Julien Peloton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import dash
import dash_bootstrap_components as dbc
from dash.long_callback import DiskcacheLongCallbackManager

import jpype
import jpype.imports
from jpype import JImplements, JOverride, JImplementationFor
# import jpype

import yaml
import diskcache
Expand Down Expand Up @@ -47,74 +59,3 @@
server = app.server

app.config.suppress_callback_exceptions = True

if not jpype.isJVMStarted():
jarpath = "-Djava.class.path=bin/FinkBrowser.exe.jar"
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", jarpath, convertStrings=True)

jpype.attachThreadToJVM()

import com.Lomikel.HBaser
from com.astrolabsoftware.FinkBrowser.Utils import Init

Init.init()

client = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
client.connect(args['tablename'], args['SCHEMAVER'])
client.setLimit(nlimit)

clientT = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientT.connect(args['tablename'] + ".jd", args['SCHEMAVER'])
clientT.setLimit(nlimit)

clientP128 = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientP128.connect(args['tablename'] + ".pixel128", args['SCHEMAVER'])
clientP128.setLimit(nlimit)

clientS = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientS.connect(args['tablename'] + ".class", args['SCHEMAVER'])
clientS.setLimit(nlimit)

clientU = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientU.connect(args['tablename'] + ".upper", args['SCHEMAVER'])
clientU.setLimit(nlimit)

clientUV = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientUV.connect(args['tablename'] + ".uppervalid", args['SCHEMAVER'])
clientUV.setLimit(nlimit)

clientSSO = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientSSO.connect(args['tablename'] + ".ssnamenr", args['SCHEMAVER'])
clientSSO.setLimit(nlimit)

clientTRCK = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientTRCK.connect(args['tablename'] + ".tracklet", args['SCHEMAVER'])
clientTRCK.setLimit(nlimit)

clientTNS = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientTNS.connect(args['tablename'] + ".tns", args['SCHEMAVER'])
clientTNS.setLimit(nlimit)

clientStats = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientStats.connect('statistics_class', args['SCHEMAVER'])
clientStats.setLimit(nlimit)

clientSSOCAND = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientSSOCAND.connect(args['tablename'] + ".sso_cand", args['SCHEMAVER'])
clientSSOCAND.setLimit(nlimit)

clientSSOORB = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientSSOORB.connect(args['tablename'] + ".orb_cand", args['SCHEMAVER'])
clientSSOORB.setLimit(nlimit)

clientANOMALY = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientANOMALY.connect(args['tablename'] + ".anomaly", args['SCHEMAVER'])
clientANOMALY.setLimit(nlimit)

clientTNSRESOL = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientTNSRESOL.connect(args['tablename'] + ".tns_resolver", args['SCHEMAVER'])
clientTNSRESOL.setLimit(nlimit)

clientMeta = com.Lomikel.HBaser.HBaseClient(args['HBASEIP'], args['ZOOPORT']);
clientMeta.connect(args['tablename'] + ".metadata", 'schema')
clientMeta.setLimit(nlimit)
Loading

0 comments on commit 575a276

Please sign in to comment.