同步get一个cell的值 Args: rowkey(string): Rowkey的值 cf(string): ColumnFamily名 qu(string): Qualifier名 snapshot(long): 快照,不关心的用户设置为0即可 Returns: (string) cell的值 Raises: TeraSdkException: 读操作失败
(self, rowkey, cf, qu, snapshot=0)
| 537 | lib.tera_table_apply_reader_batch(self.table, reader_array, num) |
| 538 | |
| 539 | def Get(self, rowkey, cf, qu, snapshot=0): |
| 540 | """ 同步get一个cell的值 |
| 541 | |
| 542 | Args: |
| 543 | rowkey(string): Rowkey的值 |
| 544 | cf(string): ColumnFamily名 |
| 545 | qu(string): Qualifier名 |
| 546 | snapshot(long): 快照,不关心的用户设置为0即可 |
| 547 | Returns: |
| 548 | (string) cell的值 |
| 549 | Raises: |
| 550 | TeraSdkException: 读操作失败 |
| 551 | """ |
| 552 | err = c_char_p() |
| 553 | value = POINTER(c_ubyte)() |
| 554 | vallen = c_uint64() |
| 555 | result = lib.tera_table_get( |
| 556 | self.table, rowkey, c_uint64(len(rowkey)), cf, |
| 557 | qu, c_uint64(len(qu)), byref(value), byref(vallen), byref(err), |
| 558 | c_uint64(snapshot) |
| 559 | ) |
| 560 | if not result: |
| 561 | raise TeraSdkException("get record failed:" + err.value) |
| 562 | return copy_string_to_user(value, long(vallen.value)) |
| 563 | |
| 564 | def GetInt64(self, rowkey, cf, qu, snapshot): |
| 565 | """ 类同Get()接口,区别是将cell的内容作为int64计数器返回 |
no test coverage detected