This commit is contained in:
tawan 2015-11-11 17:20:01 +08:00
Родитель 2cc82bcc04 ce87d34f8e
Коммит 14351c0617
2 изменённых файлов: 5 добавлений и 9 удалений

Просмотреть файл

@ -24,9 +24,9 @@ namespace Microsoft.Spark.CSharp.Samples
static void Main(string[] args) static void Main(string[] args)
{ {
ProcessArugments(args);
LoggerServiceFactory.SetLoggerService(Log4NetLoggerService.Instance); //this is optional - DefaultLoggerService will be used if not set LoggerServiceFactory.SetLoggerService(Log4NetLoggerService.Instance); //this is optional - DefaultLoggerService will be used if not set
Logger = LoggerServiceFactory.GetLogger(typeof(SparkCLRSamples)); Logger = LoggerServiceFactory.GetLogger(typeof(SparkCLRSamples));
ProcessArugments(args);
SparkContext = CreateSparkContext(); SparkContext = CreateSparkContext();
SparkContext.SetCheckpointDir(Path.GetTempPath()); SparkContext.SetCheckpointDir(Path.GetTempPath());
RunSamples(); RunSamples();

Просмотреть файл

@ -35,25 +35,21 @@ object CSharpRunner {
var otherArgs: Array[String] = null var otherArgs: Array[String] = null
if (!runInDebugMode) { if (!runInDebugMode) {
if(args(0).toLowerCase().endsWith(".zip")) { if(args(0).toLowerCase().endsWith(".zip")) {
println("Unzipping driver!") println("Unzipping driver!")
CSharpSparkUtils.unzip(new File(args(0)), new File(args(0)).getParentFile) CSharpSparkUtils.unzip(new File(args(0)), new File(args(0)).getParentFile)
csharpExecutable = PythonRunner.formatPath(args(1)) //reusing windows-specific formatting in PythonRunner csharpExecutable = PythonRunner.formatPath(args(1)) //reusing windows-specific formatting in PythonRunner
otherArgs = args.slice(2, args.length) otherArgs = args.slice(2, args.length)
} else if(new File(args(0)).isDirectory) {
}else if(new File(args(0)).isDirectory){
// In local mode, there will no zip file generated if given a directory, skip uncompression in this case // In local mode, there will no zip file generated if given a directory, skip uncompression in this case
csharpExecutable = PythonRunner.formatPath(args(1)) //reusing windows-specific formatting in PythonRunner csharpExecutable = PythonRunner.formatPath(args(1)) //reusing windows-specific formatting in PythonRunner
otherArgs = args.slice(2, args.length) otherArgs = args.slice(2, args.length)
} else {
}else {
csharpExecutable = PythonRunner.formatPath(args(0)) csharpExecutable = PythonRunner.formatPath(args(0))
otherArgs = args.slice(1, args.length) otherArgs = args.slice(1, args.length)
} }
} else {
otherArgs = args.slice(1, args.length)
} }
var processParameters = new java.util.ArrayList[String]() var processParameters = new java.util.ArrayList[String]()