Esempio n. 1
0
  def execute_bql(stmt):
    req = SenseiRequest(stmt)
    store = my_client.store_map.get(req.index)
    if not store:
      print "Store %s does not exist!" % req.index
      return

    client = SenseiClient(store["broker_host"], store["broker_port"])
    if req.stmt_type == "select":
      res = client.doQuery(req)
      res.display(req.get_columns(), 1000)
    elif req.stmt_type == "desc":
      sysinfo = client.getSystemInfo()
      sysinfo.display()
    else:
      print "Wrong command: %s" % stmt
Esempio n. 2
0
 def exe_sql(stmt, client):
   # test(stmt)
   req = SenseiRequest(stmt)
   res = client.doQuery(req)
   res.display(req.get_columns(), 1000)