java dataset collector fix

This commit is contained in:
fixminer
2020-04-09 13:08:05 +02:00
parent 753db4075a
commit 37763b2a63
8 changed files with 178 additions and 99 deletions
Binary file not shown.
+20 -4
View File
@@ -97,6 +97,7 @@ def setEnv(args):
os.environ["DATA_PATH"] = cfg['fixminer']['datapath']
os.environ["PROJECT_TYPE"] = cfg['fixminer']['projectType']
os.environ["PROJECT_LIST"] = cfg['fixminer']['projectList']
os.environ["REDIS_PORT"] = str(cfg['fixminer']['portDumps'])
# import yaml
#
@@ -177,7 +178,22 @@ def getRun():
# def shellCallTemplate(cmd,enc='utf-8'):
# process = subprocess.Popen(cmd,
# stdout=subprocess.PIPE,stderr=PIPE, shell=True,encoding=enc,
# universal_newlines=True)
#
# while True:
# output = process.stdout.readline()
# print(output.strip())
# # Do something else
# return_code = process.poll()
# if return_code is not None:
# print('RETURN CODE', return_code)
# # Process has finished, read rest of the output
# for output in process.stdout.readlines():
# print(output.strip())
# break
def shellCallTemplate(cmd,enc='utf-8'):
try:
@@ -510,9 +526,9 @@ def get_class_weights(y):
return {cls: round(float(majority)/float(count), 2) for cls, count in counter.items()}
def stopDB(dbDir,portInner,dbName):
cmd = "bash " + dbDir + "/" + "stopServer.sh " + " " + portInner;
def stopDB(dbDir,portInner):
# cmd = "bash " + dbDir + "/" + "stopServer.sh " + " " + portInner;
cmd = "redis-cli -p " + portInner + " shutdown save"
o, e = shellGitCheckout(cmd)
logging.info(o)