forked from microsoft/Mobius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configuration.cs
85 lines (74 loc) · 1.92 KB
/
Configuration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Spark.CSharp.Configuration;
using Microsoft.Spark.CSharp.Core;
using Microsoft.Spark.CSharp.Interop;
namespace Microsoft.Spark.CSharp.Samples
{
internal class Configuration
{
private string samplesCategory = SampleAttribute.CATEGORY_DEFAULT;
public string SparkLocalDirectoryOverride
{
get;
set;
}
public string SampleDataLocation
{
get;
set;
}
public string SamplesToRun
{
get;
set;
}
public string SamplesCategory
{
get
{
return samplesCategory;
}
set
{
samplesCategory = value;
}
}
public bool IsValidationEnabled
{
get;
set;
}
public bool IsDryrun
{
get;
set;
}
public string CheckpointDir
{
get;
set;
}
public string GetInputDataPath(string fileName)
{
if (SampleDataLocation.ToLower().StartsWith("hdfs://") || SampleDataLocation.ToLower().StartsWith("webhdfs://"))
{
var clusterPath = SampleDataLocation + "/" + fileName;
SparkCLRSamples.Logger.LogInfo("Cluster path " + clusterPath);
return clusterPath;
}
else
{
return new Uri(Path.Combine(SampleDataLocation, fileName)).ToString();
}
}
}
}