View gist:b23c4d4fe76da5b00ae3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import os | |
import time | |
import commands | |
import redis | |
class RedisServer(threading.Thread): | |
def __init__(self, binary = 'redis-server', port = 7777): | |
threading.Thread.__init__(self) | |
self.binary = binary |
View gist:03f43b6789f14e1fe878
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import os | |
import time | |
import commands | |
import redis | |
class RedisServer(threading.Thread): | |
def __init__(self, binary = 'redis-server', port = 7777): | |
threading.Thread.__init__(self) | |
self.binary = binary |
View gist:11279924
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#3. Pre-Splitting | |
# export_size > 64K(records) and no data in dest collection | |
chunksize = self.args.chunksize # default 64K items (for 64MBytes chunksize) | |
maxshardkey = self.args.maxshardkey | |
if not(self.pre_src_count > chunksize and self.pre_to_count == 0): | |
logging.info('we will not pre-split !') | |
return | |
logging.info('we will pre-split by chunksize: %d, maxshardkey is: %d' % (chunksize, maxshardkey)) |
View gist:3296652
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import logging | |
import pybcs | |
#设置日志级别 | |
pybcs.init_logging(logging.INFO) | |
AK = os.environ['AK'] #请改为你的AK |