Home > other >  Python content is not implemented, process pool for bosses to look at
Python content is not implemented, process pool for bosses to look at

Time:10-06

I wrote one for the list all HBASE table, and then obtain that batch is submitted to the thread pool and then perform the delete operation, do not know why the function is not implemented, process pool for bosses see

` ` `
The import happybase
The import time
The from multiprocessing import Pool
The import tkinter

The class hbase_drop_table () :
Def tkinter_table (self) :
The window=tkinter. Tk ()
Window. The title (" delete HBASE table ")
Window. Geometry (" 600 x400 ")
Self. Test_read=tkinter. Text (window, width=20, height=1)
Self. Test_read. Place (x=10, y=10)
Button_ok=tkinter. Button (window, text="confirm", the command=self. Drop_table)
Button_ok. Place (x=10, y=40)
Window. The mainloop ()
Def pool_drop_table (self, table_name) : # this paragraph no execution, the print output nothing inside
Print (" drop - the table name: "+ table_name)
Self. Conn. Delete_table (table_name, disable=True)
Def drop_table (self) :
Hbase_ip=self. Test_read. Get (0.0, tkinter. END.) replace (" \ n ", "")
Self. Conn=happybase. Connection (hbase_ip, port=9090)
Table_name_list=self. Conn. Tables ()
The pool=pool (10)
For I in table_name_list:
Print (I)
Pool. Apply_async (self pool_drop_table, args=(i.d ecode (' utf-8)))
The pool. The close ()
The pool. The join ()
Print (" end ")

If __name__=="__main__ ':
HDT=hbase_drop_table ()
HDT. Tkinter_table ()
` ` `

Results:
B 'BEHAVIOR_HISTORY'
B 'BEHAVIOR_MATCHED'
B 'CUSTOM_LIST_HISTORY'
B 'CUSTOM_LIST_HISTORY_EN'
B 'CUSTOM_LIST_MATCHED'
B 'CUSTOM_LIST_MATCHED_EN'
B 'CUSTOM_LIST_NOMATCHED'
B 'DATA_CONTACT'
B 'DATA_MAPPING'
B 'STATISTIC_ENCRYPTION_STR'
B 'behavior_probe'
B 'data_expire_so_default_tenant_contact'
B 'data_track_so_default_tenant_contact'
B 'pagePv_probe'
The end of the
Libpng warning: iCCP: cHRM the chunk does not match sRGB
Libpng warning: iCCP: cHRM the chunk does not match sRGB

The Process finished with exit code 0

  • Related