HBase Thrift 接口函数

来源:互联网 发布:太阳帝国知乎 编辑:程序博客网 时间:2024/05/29 11:41

参考文献

hbase源码系列(十四)Compact和Split

最重要的:class Client(Iface)

1.def enableTable(self, tableName)

2.def disableTable(self, tableName)

3.def isTableEnabled(self, tableName)

4.def compact(self, tableNameOrRegionName)

Compaction主要起到如下几个作用:

1)合并文件

2)清除删除、过期、多余版本的数据

3)提高读写数据的效率

5.majorCompact(self, tableNameOrRegionName)

Major操作是对Region下的HStore下的所有StoreFile执行合并操作,最终的结果是整理合并出一个文件。

6.getTableNames(self)

得到数据表名

7.getColumnDescriptors(self, tableName)

得到数据表的列描述(有几个列等等)

8.getTableRegions(self, tableName)

9.createTable(tableName,columnFamilies)

10.deleteTable(self, tableName)

11.get(self, tableName, row, column, attributes)

得到一条记录,attributes是得到的属性

12.getVer(self, tableName, row, column, numVersions, attributes)

得到特定table,row,column的特定的version的数目

13.getVerTs(self, tableName, row, column,timestamp, numVersions, attributes)

只有小于或等于特定timestamp的记录会被返回

14.getRow(self, tableName, row, attributes)

15.getRowWithColumns(self, tableName, row, columns, attributes)

得到特定的列

16.getRowTs(self, tableName, row, timestamp, attributes)

得到特定时间的table中的row

17.getRowWithColumnsTs(self, tableName, row, columns, timestamp, attributes)

18.getRows(self, tableName, rows, attributes)

19.getRowsWithColumns(self, tableName, rows, columns, attributes)

20.getRowsTs(self, tableName, rows, timestamp, attributes)

21.getRowsWithColumnsTs(self, tableName, rows, columns, timestamp, attributes)

mutate

22.mutateRow(self, tableName, row, mutations, attributes)

更新或删除数据

23.mutateRowTs(self, tableName, row, mutations, timestamp, attributes)

24.mutateRows(self, tableName, rowBatches, attributes)

25.mutateRowsTs(self, tableName, rowBatches, timestamp, attributes)

26.atomicIncrement(self, tableName, row, column, value)

原子方式增加指定的列值。返回一个递增后的值。

27.deleteAll(self, tableName, row, column, attributes)

删除与给定的row和column匹配的所有单元。

28.deleteAllTs(self, tableName, row, column, timestamp, attributes)

增加条件:删除timestamp 大于等于给定的timestamp值

29.deleteAllRow(self, tableName, row, attributes)

完全删除row

30.increment(self, increment)

31.incrementRows(self, increment)

32.deleteAllRowTs(self, tableName, row, timestamp, attributes)

scan

33.scannerOpenWithScan(self, tableName, scan, attributes)

34.sdannerOpen(self, tableName, startRow, columns, attributes)

35.scannerOpenWithStop(self, tableName, startRow, stopRow, columns,attributes)

36.scannerOpenWithPrefix(self, tableName, startAndPrefix, columns, attributes)

37.scannerOpenTs(self, tableName, startRow, columns, timestamp, attributes)

38.scannerOpenWithStopTs(self, tableName, startRow, stopRow, columns, timestamp, attributes)

39.scannerGet(self, id)

40.scannerGetList(self, id, nbRows)

41.scannerClose(self, id)

42.getRowOrBefore(self, tableName, row, family)

取出特定的row之前的row

43.getRegionInfo(self, row)

44.append(self, append)

45.checkAndPut(self, tableName, row, column, value, mput, attributes)

0 0