def migrate_meter_table(conn, table):
 meter_table = conn.table(table)
 meter_filter = "RowFilter(=, 'regexstring:[\\w\\._-]*_\\d{19}_\\w*')"
 gen = meter_table.scan(filter=meter_filter)
 for (row, data) in gen:
  parts = row.rsplit('_', 2)
  new_row = hbase_utils.prepare_key(*parts)
  meter_table.put(new_row, data)
  meter_table.delete(row)

def migrate_meter_table ( conn , table ) : meter_table = conn . table ( table ) meter_filter = "RowFilter(=, 'regexstring:[\\w\\._-]*_\\d{19}_\\w*')" gen = meter_table . scan ( filter = meter_filter ) for ( row , data ) in gen : parts = row . rsplit ( '_' , 2 ) new_row = hbase_utils . prepare_key ( * parts ) meter_table . put ( new_row , data ) meter_table . delete ( row )
migrate table meter in hbase .