Skip to content

Commit

Permalink
bug fixes based on mrs/gp testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wwcohen committed Dec 1, 2015
1 parent 76edc06 commit 75acdf1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 126 deletions.
8 changes: 4 additions & 4 deletions gpextras.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ def simpleMapCommands(self,task,gp,mapCom,src,dst):
def simpleMapReduceCommands(self,task,gp,mapCom,reduceCom,src,dst):
"""A map-reduce job with one input."""
p = task.reduceParallel(gp)
return [ "%s --input %s --output %s --mapper '%s' --numReduceTasks %d --reducer '%s'" \
% (self.mrsCommand,src,dst,mapCom,p,reduceCom) ]
return [ "%s --input %s --output %s --numReduceTasks %d --mapper '%s' --reducer '%s'" \
% (self.mrsCommand,src,dst,p,mapCom,reduceCom) ]

def joinCommands(self,task,gp,mapComs,reduceCom,srcs,midpoint,dst):
"""A map-reduce job with several inputs."""
p = task.reduceParallel(gp)
def midi(i): return midpoint + '-' + str(i)
def mid(i): return midpoint + '-' + str(i)
subplan = []
for i in range(len(srcs)):
subplan.append("%s --input %s --output %s --mapper '%s'" \
% (self.mrsCommand,srcs[i],mid(i),mapComs[i]))
allMidpoints = ",".join([mid(i) for i in range(len(srcs))])
subplan.append("%s --inputs %s --output %s --mapper cat --numReduceTasks %d --reducer '%s'" \
subplan.append("%s --inputs %s --output %s --numReduceTasks %d --mapper cat --reducer '%s'" \
% (self.mrsCommand,allMidpoints,dst,p,reduceCom))
return subplan
7 changes: 5 additions & 2 deletions mrs_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,12 @@ def setupFiles(indirList,outdir,numReduceTasks):
single output, it will also be a file.
"""
#clear space/make directory for output, if necessary
if os.path.exists(outdir):
if os.path.exists(outdir):
logging.warn('removing %s' % (outdir))
shutil.rmtree(outdir)
if os.path.isdir(outdir):
shutil.rmtree(outdir)
else:
os.remove(outdir)

indirs = []
infiles = []
Expand Down
2 changes: 1 addition & 1 deletion mrs_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ASYNC = 0

#
clean:
rm -rf tmp/* parallel-events.txt
rm -rf tmp tmp.txt sharded parallel-events.txt server.log test test2 gpig_views

backup:
cp ../mrs_gp_v4.py ../backup/`date "+%H:%M:%S"`-mrs_gp_v4.py
Expand Down
79 changes: 0 additions & 79 deletions mrs_test/Makefile.stress

This file was deleted.

20 changes: 0 additions & 20 deletions mrs_test/test/small.txt

This file was deleted.

20 changes: 0 additions & 20 deletions mrs_test/test2/small.txt

This file was deleted.

0 comments on commit 75acdf1

Please sign in to comment.