private void stageDirTest(String stageDirConfigStr, String stageDirName, boolean isLocal) throws IOException {
String scratchDirStr = System.getProperty("test.tmp.dir") + File.separator +
stageDirName;
System.setProperty(stageDirConfigStr, scratchDirStr);
ThriftCLIService service = new EmbeddedThriftBinaryCLIService();
ThriftCLIServiceClient client = new ThriftCLIServiceClient(service);
final Path scratchDir = new Path(scratchDirStr);
Configuration conf = new Configuration();
FileSystem fs = scratchDir.getFileSystem(conf);
if (isLocal) {
fs = FileSystem.getLocal(conf);