HBASE-16125 RegionMover uses hardcoded, Unix-style tmp folder - breaks Windows (Vladimir Rodionov)

This commit is contained in:
tedyu 2016-07-01 10:03:45 -07:00
parent a345aa8707
commit 2aa8cdc989
1 changed files with 2 additions and 2 deletions

View File

@ -428,7 +428,7 @@ end
def getFilename(options, targetServer, port) def getFilename(options, targetServer, port)
filename = options[:file] filename = options[:file]
if not filename if not filename
filename = "/tmp/" + ENV['USER'] + targetServer + ":" + port filename = File.join(Dir.tmpdir(), ENV['USER'] + targetServer + "_" + port.to_s)
end end
return filename return filename
end end
@ -441,7 +441,7 @@ optparse = OptionParser.new do |opts|
opts.separator 'Load or unload regions by moving one at a time' opts.separator 'Load or unload regions by moving one at a time'
options[:file] = nil options[:file] = nil
options[:maxthreads] = 1 options[:maxthreads] = 1
opts.on('-f', '--filename=FILE', 'File to save regions list into unloading, or read from loading; default /tmp/<hostname:port>') do |file| opts.on('-f', '--filename=FILE', 'File to save regions list into unloading, or read from loading; default /USER_TMP_DIR/<hostname:port>') do |file|
options[:file] = file options[:file] = file
end end
opts.on('-h', '--help', 'Display usage information') do opts.on('-h', '--help', 'Display usage information') do