import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

import happybase
plt.rcParams[‘font.sans-serif’]=[‘SimHei’]
plt.rcParams[‘axes.unicode_minus’]=False

def connectHBase():
# 创建和hbase的连接
connection = happybase.Connection(‘192.168.160.131’)
# 获取hbase中的所有表
print(connection.tables())
# 关闭连接
connection.close()

def scanQuery():
# 创建和hbase的连接
connection = happybase.Connection(‘192.168.160.131’)
# 通过connection找到user表 获得table对象
table = connection.table(‘result_time’)

x_kpi_time=np.zeros((20))
y_kpi_time = np.zeros((20))
i=0
for key, value in table.scan():line_time=str(key).split('\'')line_times_temp=str(value).split(':')line_times=str(line_times_temp[1]).strip('\'')# print(value)x_kpi_time[i]=line_time[1]y_kpi_time[i] = line_timesi = i + 1
print(y_kpi_time)
print(x_kpi_time)plt.show()
# 关闭连接
connection.close()

def getQuery(a):
connection = happybase.Connection(‘192.168.160.131’)
# 通过connection找到user表 获得table对象
table = connection.table(‘result_time’)
# result = table.row(‘2021012203’)
result = table.row(str(a))
print(result)
# 关闭连接
connection.close()

def main():
connectHBase()
scanQuery()
getQuery(2021012203)

if name == “main”:
main()

happyhbase相关推荐

  1. HBase-shell及happyhbase

    HappyBase操作HBase 启动HBase thrift server : hbase-daemon.sh start thrift 安装happy base pip install happy ...

  2. 转载:Build.VERSION.SDK_INT = Build.VERSION_CODES.HONEYCOMB

    原创 Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB 2016-06-12 09:44:44 fei900724 阅读数 5077 ...

最新文章

  1. CentOS升级Python2到Python3
  2. P1801 黑匣子_NOI导刊2010提高(06)
  3. CSS中隐藏内容的3种方法及属性值
  4. OAuth2.0的四种授权方式
  5. 20、磁贴和磁贴通知(tile)(上)
  6. 前端学习(1363):学生档案信息管理5
  7. C++中两个常用的控制语句格式的函数(width和precision函数)
  8. Ubuntu下基本的命令总结
  9. python怎么把数据存在本地_将Python中的数据存储到系统本地的简单方法
  10. CodeForces 521D nice贪心
  11. apache网站访问需要密码设置步骤总结
  12. Javaweb尚硅谷网上书城项目
  13. Google Earth Engine(GEE)——哨兵数据中隐藏的秘密(卫星影像拍到的如来神掌)
  14. Axure RP 9 培训讲解---高级免费课程
  15. iOS开发之YYKit丰富的组件,如:YYText
  16. CPU卡指令文件读取算法
  17. 繁星闪烁 ,芳华似锦,走自己的路
  18. php平均值函数怎么用,表格平均值公式的使用方法
  19. linux去除重复字符,Linux去除重复项命令uniq
  20. Android开发者选项 介绍

热门文章

  1. 2018年10月1日起,养老建筑设计须依照此标准
  2. 用vue写一套销客多电商分销后台系统
  3. terminate called after throwing an instance of ‘std::runtime_error‘
  4. ubuntu 运行QQ轻聊版7.9
  5. 【BERT蒸馏】DistilBERT、Distil-LSTM、TinyBERT、FastBERT(论文+代码)
  6. zootracer使用说明——一款视频物体追踪软件,获取运动物体在屏幕坐标系的运动轨迹
  7. Git实战之git客户端上传文件到github
  8. oci连接mysql_Oracle Call Interface (OCI)
  9. 大数据Kudu(七):Kudu分区策略
  10. UEFI查找PCI设备