scan
(table)
| 241 | |
| 242 | |
| 243 | def scan(table): |
| 244 | """ scan """ |
| 245 | print("\nscan") |
| 246 | from TeraSdk import ScanDescriptor |
| 247 | scan_desc = ScanDescriptor("") |
| 248 | scan_desc.SetBufferSize(1024 * 1024) # 1MB |
| 249 | try: |
| 250 | stream = table.Scan(scan_desc) |
| 251 | except TeraSdkException as e: |
| 252 | print(e.reason) |
| 253 | return |
| 254 | |
| 255 | while not stream.Done(): |
| 256 | row = stream.RowName() |
| 257 | column = stream.ColumnName() |
| 258 | timestamp = str(stream.Timestamp()) |
| 259 | val = stream.Value() |
| 260 | print row + ":" + column + ":" + timestamp + ":" + val |
| 261 | stream.Next() |
| 262 | scan_desc.Destroy() |
| 263 | stream.Destroy() |
| 264 | |
| 265 | |
| 266 | if __name__ == '__main__': |
no test coverage detected