diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config
new file mode 100644
index 0000000..67f8ea0
--- /dev/null
+++ b/.nuget/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe
new file mode 100644
index 0000000..c41a0d0
Binary files /dev/null and b/.nuget/NuGet.exe differ
diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets
new file mode 100644
index 0000000..3f8c37b
--- /dev/null
+++ b/.nuget/NuGet.targets
@@ -0,0 +1,144 @@
+
+
+
+ $(MSBuildProjectDirectory)\..\
+
+
+ false
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
+
+
+
+
+ $(SolutionDir).nuget
+
+
+
+ $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config
+ $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config
+
+
+
+ $(MSBuildProjectDirectory)\packages.config
+ $(PackagesProjectConfig)
+
+
+
+
+ $(NuGetToolsPath)\NuGet.exe
+ @(PackageSource)
+
+ "$(NuGetExePath)"
+ mono --runtime=v4.0.30319 "$(NuGetExePath)"
+
+ $(TargetDir.Trim('\\'))
+
+ -RequireConsent
+ -NonInteractive
+
+ "$(SolutionDir) "
+ "$(SolutionDir)"
+
+
+ $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
+ $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
+
+
+
+ RestorePackages;
+ $(BuildDependsOn);
+
+
+
+
+ $(BuildDependsOn);
+ BuildPackage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AzureExamples/App.config b/AzureExamples/App.config
index 8e15646..5d79355 100644
--- a/AzureExamples/App.config
+++ b/AzureExamples/App.config
@@ -1,6 +1,30 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AzureExamples/Azure/ConnectedComponents.cs b/AzureExamples/Azure/ConnectedComponents.cs
index 2254bd7..8641a1b 100644
--- a/AzureExamples/Azure/ConnectedComponents.cs
+++ b/AzureExamples/Azure/ConnectedComponents.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/AzureExamples/Azure/GraphGenerator.cs b/AzureExamples/Azure/GraphGenerator.cs
index 2ad4cad..20ce3d0 100644
--- a/AzureExamples/Azure/GraphGenerator.cs
+++ b/AzureExamples/Azure/GraphGenerator.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/AzureExamples/Azure/Repartition.cs b/AzureExamples/Azure/Repartition.cs
index c3742ad..2b6224a 100644
--- a/AzureExamples/Azure/Repartition.cs
+++ b/AzureExamples/Azure/Repartition.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/AzureExamples/AzureExamples.csproj b/AzureExamples/AzureExamples.csproj
index 2e8b09c..b821c5c 100644
--- a/AzureExamples/AzureExamples.csproj
+++ b/AzureExamples/AzureExamples.csproj
@@ -1,5 +1,5 @@

-
+
Debug
@@ -11,6 +11,8 @@
AzureExamples
v4.5
512
+ ..\
+ true
AnyCPU
@@ -31,31 +33,55 @@
prompt
4
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
-
- ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll
-
-
- ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll
+
+ False
+ ..\packages\Microsoft.Data.Edm.5.6.2\lib\net40\Microsoft.Data.Edm.dll
-
- ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
+
+ False
+ ..\packages\Microsoft.Data.OData.5.6.2\lib\net40\Microsoft.Data.OData.dll
-
+
False
- ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll
+ ..\packages\Microsoft.Data.Services.Client.5.6.2\lib\net40\Microsoft.Data.Services.Client.dll
-
+
+ ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
+
+
False
- ..\packages\WindowsAzure.Storage.3.1.0.1\lib\net40\Microsoft.WindowsAzure.Storage.dll
+ ..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
-
- ..\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll
+
+ False
+ ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll
-
- ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll
+
+ False
+ ..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll
@@ -64,6 +90,9 @@
+
+ Properties\SharedAssemblyInfo.cs
+
@@ -94,6 +123,13 @@
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
-
\ No newline at end of file
diff --git a/ClusterSubmission/AzureSubmission/Microsoft.Research.Naiad.Cluster.Azure.nuspec b/ClusterSubmission/AzureSubmission/Microsoft.Research.Naiad.Cluster.Azure.nuspec
deleted file mode 100644
index dfd18b4..0000000
--- a/ClusterSubmission/AzureSubmission/Microsoft.Research.Naiad.Cluster.Azure.nuspec
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
- Microsoft.Research.Naiad.Cluster.Azure
- 0.4.1-beta
- Naiad - Azure submission tool
- naiadquestions@microsoft.com
- naiadquestions@microsoft.com,Microsoft
- http://www.apache.org/licenses/LICENSE-2.0.html
- http://research.microsoft.com/naiad/
- true
-
- Launcher for submitting Naiad programs to a Windows Azure HDInsight cluster.
-
- Microsoft Corporation
- en-US
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ClusterSubmission/AzureSubmission/Program.cs b/ClusterSubmission/AzureSubmission/Program.cs
deleted file mode 100644
index ff0d3da..0000000
--- a/ClusterSubmission/AzureSubmission/Program.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Naiad ver. 0.4
- * Copyright (c) Microsoft Corporation
- * All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
- * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
- * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
- *
- * See the Apache Version 2.0 License for specific language governing
- * permissions and limitations under the License.
- */
-
-using Microsoft.Research.Naiad.Util;
-using Microsoft.Research.Peloponnese.ClusterUtils;
-using Microsoft.Research.Peloponnese.Storage;
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-
-namespace Microsoft.Research.Naiad.Cluster.Azure
-{
- class Program
- {
- private static Flag ShowHelp = Flags.Define("-h,--help", typeof(bool));
-
- private static Flag NumHosts = Flags.Define("-n,--numprocs", 2);
-
- private static Flag AzureSubscriptionId = Flags.Define("--subscriptionid", typeof(string));
- private static Flag AzureClusterName = Flags.Define("--clustername", typeof(string));
- private static Flag AzureCertificateThumbprint = Flags.Define("--certthumbprint", typeof(string));
- private static Flag AzureStorageAccountName = Flags.Define("--storageaccount", typeof(string));
- private static Flag AzureStorageAccountKey = Flags.Define("--storagekey", typeof(string));
- private static Flag AzureStorageContainerName = Flags.Define("--container", typeof(string));
-
- private const string Usage = @"Usage: AzureSubmission [Azure options] NaiadExecutable.exe [Naiad options]
-
-Runs the given Naiad executable on an HDInsight cluster.
-
-(N.B. For convenience, each option can be set in the App.config for this program,
- using the long form option name.)
-
-Options:
- -n,--numhosts Number of Naiad processes (default = 2)
-
-Azure options:
- --subscriptionid Azure subscription ID (default = taken from Powershell settings)
- --clustername HDInsight cluster name (default = cluster if a single cluster is registered to all subscriptions)
- --storageaccount Azure storage account name for staging resources (default = cluster default storage account)
- --storagekey Azure storage account key for staging resources (default = cluster default storage acount key)
- --container Azure storage blob container name for staging resources (default = ""staging"")";
-
- static int Run(string[] args)
- {
-
- Flags.Parse(ConfigurationManager.AppSettings);
-
- args = Flags.Parse(args);
-
- if (ShowHelp.BooleanValue || args.Length == 0)
- {
- Console.Error.WriteLine(Usage);
- return 0;
- }
-
- if (!File.Exists(args[0]))
- {
- Console.Error.WriteLine("Error: Naiad program {0} does not exist.", args[0]);
- Console.Error.WriteLine(Usage);
- return -1;
- }
-
- AzureSubscriptions subscriptionManagement = new AzureSubscriptions();
-
- if (AzureSubscriptionId.IsSet && AzureCertificateThumbprint.IsSet)
- {
- subscriptionManagement.AddSubscription(AzureSubscriptionId.StringValue, AzureCertificateThumbprint.StringValue);
- }
-
- string clusterName = null;
- if (AzureClusterName.IsSet)
- {
- clusterName = AzureClusterName.StringValue;
-
- if (AzureStorageAccountName.IsSet && AzureStorageAccountKey.IsSet)
- {
- subscriptionManagement.SetClusterAccountAsync(clusterName, AzureStorageAccountName.StringValue, AzureStorageAccountKey.StringValue).Wait();
- }
- }
- else
- {
- IEnumerable clusters = subscriptionManagement.GetClusters();
- if (clusters.Count() == 1)
- {
- clusterName = clusters.Single().Name;
- }
- else
- {
- Console.Error.WriteLine("Error: Cluster name must be specified unless there is a single configured cluster in default and supplied subscriptions");
- Console.Error.WriteLine(Usage);
- return -1;
- }
- }
-
- AzureCluster cluster;
- try
- {
- cluster = subscriptionManagement.GetClusterAsync(clusterName).Result;
- }
- catch (Exception)
- {
- Console.Error.WriteLine("Error: Failed to find cluster " + clusterName + " in default or supplied subscriptions");
- Console.Error.WriteLine(Usage);
- return -1;
- }
- if (cluster == null)
- {
- Console.Error.WriteLine("Error: Failed to find cluster {0} in default or supplied subscriptions", clusterName);
- Console.Error.WriteLine(Usage);
- return -1;
- }
-
- string containerName = "staging";
- if (AzureStorageContainerName.IsSet)
- {
- containerName = AzureStorageContainerName.StringValue;
- }
-
- // The args are augmented with an additional setting containing the Azure connection string.
- args = args.Concat(new string[] { "--addsetting", "Microsoft.Research.Naiad.Cluster.Azure.DefaultConnectionString", string.Format("\"DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}\"", cluster.StorageAccount.Split('.').First(), cluster.StorageKey) }).ToArray();
-
- Console.Error.WriteLine("Submitting job with args: {0}", string.Join(" ", args));
-
- AzureDfsClient azureDfs = new AzureDfsClient(cluster.StorageAccount, cluster.StorageKey, containerName);
- AzureYarnClient azureYarn = new AzureYarnClient(subscriptionManagement, azureDfs, ConfigHelpers.GetPPMHome(null), clusterName);
- AzureYarnSubmission submission = new AzureYarnSubmission(azureDfs, azureYarn, NumHosts, args);
-
- submission.Submit();
- return submission.Join();
- }
-
- static void Main(string[] args)
- {
- try
- {
- int exitCode = Run(args);
- Console.WriteLine("Application return exit code " + exitCode);
- }
- catch (Exception e)
- {
- Console.WriteLine("Exception " + e.Message + "\n" + e.ToString());
- }
- }
- }
-
-}
diff --git a/ClusterSubmission/AzureSubmission/Properties/AssemblyInfo.cs b/ClusterSubmission/AzureSubmission/Properties/AssemblyInfo.cs
deleted file mode 100644
index 9927bcb..0000000
--- a/ClusterSubmission/AzureSubmission/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Naiad ver. 0.4
- * Copyright (c) Microsoft Corporation
- * All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
- * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
- * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
- *
- * See the Apache Version 2.0 License for specific language governing
- * permissions and limitations under the License.
- */
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("NaiadAzureSubmission")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NaiadAzureSubmission")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("fc1e2dbe-bddf-4550-9834-71e9784b5f30")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.1")]
-[assembly: AssemblyFileVersion("0.4.1")]
diff --git a/ClusterSubmission/AzureSubmission/packages.config b/ClusterSubmission/AzureSubmission/packages.config
deleted file mode 100644
index 8fe539e..0000000
--- a/ClusterSubmission/AzureSubmission/packages.config
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/ClusterSubmission.sln b/ClusterSubmission/ClusterSubmission.sln
index 739cf94..f8aab64 100644
--- a/ClusterSubmission/ClusterSubmission.sln
+++ b/ClusterSubmission/ClusterSubmission.sln
@@ -1,84 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.30110.0
+VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaiadPeloponneseSupport", "NaiadPeloponneseSupport\NaiadPeloponneseSupport.csproj", "{271F7100-7AA3-4379-9C58-23618B73A5DD}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureSubmission", "AzureSubmission\AzureSubmission.csproj", "{1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalSubmission", "LocalSubmission\LocalSubmission.csproj", "{BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YarnSubmission", "YarnSubmission\YarnSubmission.csproj", "{3A289ADE-2782-47D3-B682-C03115332646}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget common files", "Nuget common files", "{B867D391-330A-4D87-9C81-8FA4D9EE05F8}"
ProjectSection(SolutionItems) = preProject
ConfigFile.targets = ConfigFile.targets
InstallConfigFile.ps1 = InstallConfigFile.ps1
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyLister", "DependencyLister\DependencyLister.csproj", "{4B1A2CC2-1798-472C-954B-9C808B2C0748}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunNaiad", "RunNaiad\RunNaiad.csproj", "{47D22F4A-8B47-4829-A896-E5318ECA4CC2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x64 = Debug|x64
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {271F7100-7AA3-4379-9C58-23618B73A5DD}.Debug|Any CPU.ActiveCfg = Debug|x64
- {271F7100-7AA3-4379-9C58-23618B73A5DD}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {271F7100-7AA3-4379-9C58-23618B73A5DD}.Debug|Mixed Platforms.Build.0 = Debug|x64
{271F7100-7AA3-4379-9C58-23618B73A5DD}.Debug|x64.ActiveCfg = Debug|x64
{271F7100-7AA3-4379-9C58-23618B73A5DD}.Debug|x64.Build.0 = Debug|x64
- {271F7100-7AA3-4379-9C58-23618B73A5DD}.Release|Any CPU.ActiveCfg = Release|x64
- {271F7100-7AA3-4379-9C58-23618B73A5DD}.Release|Mixed Platforms.ActiveCfg = Release|x64
- {271F7100-7AA3-4379-9C58-23618B73A5DD}.Release|Mixed Platforms.Build.0 = Release|x64
{271F7100-7AA3-4379-9C58-23618B73A5DD}.Release|x64.ActiveCfg = Release|x64
{271F7100-7AA3-4379-9C58-23618B73A5DD}.Release|x64.Build.0 = Release|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Debug|Any CPU.ActiveCfg = Debug|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Debug|x64.ActiveCfg = Debug|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Debug|x64.Build.0 = Debug|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Release|Any CPU.ActiveCfg = Release|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Release|Mixed Platforms.ActiveCfg = Release|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Release|Mixed Platforms.Build.0 = Release|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Release|x64.ActiveCfg = Release|x64
- {1A0E23B8-BF34-4DD2-A22D-BB2470B29D7D}.Release|x64.Build.0 = Release|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Debug|Any CPU.ActiveCfg = Debug|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Debug|x64.ActiveCfg = Debug|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Debug|x64.Build.0 = Debug|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Release|Any CPU.ActiveCfg = Release|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Release|Mixed Platforms.ActiveCfg = Release|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Release|Mixed Platforms.Build.0 = Release|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Release|x64.ActiveCfg = Release|x64
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}.Release|x64.Build.0 = Release|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Debug|Any CPU.ActiveCfg = Debug|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Debug|Mixed Platforms.Build.0 = Debug|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Debug|x64.ActiveCfg = Debug|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Debug|x64.Build.0 = Debug|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Release|Any CPU.ActiveCfg = Release|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Release|Mixed Platforms.ActiveCfg = Release|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Release|Mixed Platforms.Build.0 = Release|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Release|x64.ActiveCfg = Release|x64
- {3A289ADE-2782-47D3-B682-C03115332646}.Release|x64.Build.0 = Release|x64
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Release|Any CPU.Build.0 = Release|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {4B1A2CC2-1798-472C-954B-9C808B2C0748}.Release|x64.ActiveCfg = Release|Any CPU
+ {47D22F4A-8B47-4829-A896-E5318ECA4CC2}.Debug|x64.ActiveCfg = Debug|x64
+ {47D22F4A-8B47-4829-A896-E5318ECA4CC2}.Debug|x64.Build.0 = Debug|x64
+ {47D22F4A-8B47-4829-A896-E5318ECA4CC2}.Release|x64.ActiveCfg = Release|x64
+ {47D22F4A-8B47-4829-A896-E5318ECA4CC2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/ClusterSubmission/DependencyLister/App.config b/ClusterSubmission/DependencyLister/App.config
deleted file mode 100644
index 8e15646..0000000
--- a/ClusterSubmission/DependencyLister/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/DependencyLister/Program.cs b/ClusterSubmission/DependencyLister/Program.cs
deleted file mode 100644
index a5a7a1b..0000000
--- a/ClusterSubmission/DependencyLister/Program.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Naiad ver. 0.4
- * Copyright (c) Microsoft Corporation
- * All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
- * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
- * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
- *
- * See the Apache Version 2.0 License for specific language governing
- * permissions and limitations under the License.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.Research.Naiad.Cluster.DependencyLister
-{
- public class Lister : MarshalByRefObject
- {
- private static string[] FrameworkAssemblyNames = { "System", "System.Core", "mscorlib", "System.Xml" };
-
- ///
- /// Returns the non-framework assemblies on which a given assembly depends.
- ///
- /// The initial assembly
- /// A set of non-framework assemblies on which the given assembly depends
- private static HashSet Dependencies(Assembly source)
- {
- HashSet visited = new HashSet();
- Queue assemblyQueue = new Queue();
- assemblyQueue.Enqueue(source);
- visited.Add(source);
-
- while (assemblyQueue.Count > 0)
- {
- Assembly currentAssembly = assemblyQueue.Dequeue();
-
- foreach (AssemblyName name in currentAssembly.GetReferencedAssemblies())
- {
- Assembly referencedAssembly = Assembly.Load(name);
- if (!visited.Contains(referencedAssembly) && !FrameworkAssemblyNames.Contains(name.Name) && !(name.Name.StartsWith("System")))
- {
- visited.Add(referencedAssembly);
- assemblyQueue.Enqueue(referencedAssembly);
- }
- }
- }
- return visited;
- }
-
- ///
- /// Returns the locations of non-framework assemblies on which the assembly with the given filename depends.
- ///
- /// The filename of the assembly
- /// An array of filenames for non-framework assemblies on which the given assembly depends
- public string[] ListDependencies(string assemblyFilename)
- {
- Assembly assembly = Assembly.LoadFrom(assemblyFilename);
- return Lister.Dependencies(assembly).Select(x => x.Location).ToArray();
- }
- }
-}
diff --git a/ClusterSubmission/DependencyLister/Properties/AssemblyInfo.cs b/ClusterSubmission/DependencyLister/Properties/AssemblyInfo.cs
deleted file mode 100644
index eef22f8..0000000
--- a/ClusterSubmission/DependencyLister/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Naiad ver. 0.4
- * Copyright (c) Microsoft Corporation
- * All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
- * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
- * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
- *
- * See the Apache Version 2.0 License for specific language governing
- * permissions and limitations under the License.
- */
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Microsoft.Research.Naiad.Cluster.DependencyLister")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("DependencyLister")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("d4a52515-7a5f-4653-80a5-ee390e482006")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.1")]
-[assembly: AssemblyFileVersion("0.4.1")]
diff --git a/ClusterSubmission/LocalSubmission/App.config b/ClusterSubmission/LocalSubmission/App.config
deleted file mode 100644
index 794423a..0000000
--- a/ClusterSubmission/LocalSubmission/App.config
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/LocalSubmission/LocalSubmission.csproj b/ClusterSubmission/LocalSubmission/LocalSubmission.csproj
deleted file mode 100644
index 03fd112..0000000
--- a/ClusterSubmission/LocalSubmission/LocalSubmission.csproj
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
-
- Debug
- AnyCPU
- {BFDBEC5D-4768-4F4A-BD50-16815B6BFEE4}
- Exe
- Properties
- Microsoft.Research.Naiad.Cluster.Local
- LocalSubmission
- v4.5
- 512
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- bin\x64\Release\
- TRACE
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
-
- False
- ..\packages\Microsoft.Data.Edm.5.6.1\lib\net40\Microsoft.Data.Edm.dll
-
-
- False
- ..\packages\Microsoft.Data.OData.5.6.1\lib\net40\Microsoft.Data.OData.dll
-
-
- False
- ..\packages\Microsoft.Data.Services.Client.5.6.1\lib\net40\Microsoft.Data.Services.Client.dll
-
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.Hadoop.Client.dll
-
-
- False
- ..\packages\Microsoft.Research.Peloponnese.0.7.5-beta\lib\net45\Microsoft.Research.Peloponnese.HadoopBridge.dll
-
-
- False
- ..\packages\Microsoft.Research.Peloponnese.0.7.5-beta\lib\net45\Microsoft.Research.Peloponnese.Utils.dll
-
-
- False
- ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
-
-
- False
- ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll
-
-
- False
- ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\net45\Microsoft.WindowsAzure.Common.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll
-
-
- ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.1.2.0\lib\net40\Microsoft.WindowsAzure.Management.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.dll
-
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll
-
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.Storage.1.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll
-
-
- False
- ..\packages\WindowsAzure.Storage.4.0.1\lib\net40\Microsoft.WindowsAzure.Storage.dll
-
-
- False
- ..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll
-
-
-
-
-
-
-
-
- False
- ..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll
-
-
- False
- ..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll
-
-
-
- False
- ..\packages\System.Spatial.5.6.1\lib\net40\System.Spatial.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
-
-
-
-
- {271f7100-7aa3-4379-9c58-23618b73a5dd}
- NaiadPeloponneseSupport
-
-
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/LocalSubmission/Program.cs b/ClusterSubmission/LocalSubmission/Program.cs
deleted file mode 100644
index 5eb3c80..0000000
--- a/ClusterSubmission/LocalSubmission/Program.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Naiad ver. 0.4
- * Copyright (c) Microsoft Corporation
- * All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
- * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
- * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
- *
- * See the Apache Version 2.0 License for specific language governing
- * permissions and limitations under the License.
- */
-
-using Microsoft.Research.Naiad.Util;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.Research.Naiad.Cluster.Local
-{
- class Program
- {
- private static Flag ShowHelp = Flags.Define("-h,--help", typeof(bool));
-
- private static Flag NumHosts = Flags.Define("-n,--numhosts", 2);
- private static Flag NumThreads = Flags.Define("-t,--threads", 8);
- private static Flag LocalJobDirectory = Flags.Define("-l,--localdir", "LocalJobs");
-
- private const string Usage = @"Usage: LocalSubmission [ptions] NaiadExecutable.exe [Naiad options]
-
-Runs the given Naiad executable in multiple processes on the local machine.
-
-(N.B. For convenience, each option can be set in the App.config for this program,
- using the long form option name.)
-
-Options:
- -n,--numhosts Number of Naiad processes (default = 2)
- -t,--threads Number of worker threads per Naiad process (default = 8)
- -l,--localdir Local job working directory (default = '%PWD%\LocalJobs')";
-
- static int Run(string[] args)
- {
- Flags.Parse(System.Configuration.ConfigurationManager.AppSettings);
-
- args = Flags.Parse(args);
-
- if (ShowHelp.BooleanValue)
- {
- Console.Error.WriteLine(Usage);
- return 0;
- }
-
- LocalSubmission submission = new LocalSubmission(NumHosts, args, LocalJobDirectory);
- submission.Submit();
- return submission.Join();
- }
-
- static void Main(string[] args)
- {
- try
- {
- int exitCode = Run(args);
- Console.WriteLine("Application return exit code " + exitCode);
- }
- catch (Exception e)
- {
- Console.WriteLine("Exception " + e.Message + "\n" + e.ToString());
- }
- }
- }
-
-}
diff --git a/ClusterSubmission/LocalSubmission/packages.config b/ClusterSubmission/LocalSubmission/packages.config
deleted file mode 100644
index 8fe539e..0000000
--- a/ClusterSubmission/LocalSubmission/packages.config
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/NaiadPeloponneseSupport/App.config b/ClusterSubmission/NaiadPeloponneseSupport/App.config
index c5e4df0..cd42d28 100644
--- a/ClusterSubmission/NaiadPeloponneseSupport/App.config
+++ b/ClusterSubmission/NaiadPeloponneseSupport/App.config
@@ -1,7 +1,7 @@
-
+
-
+
@@ -9,44 +9,100 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/ClusterSubmission/NaiadPeloponneseSupport/ClusterSubmission.cs b/ClusterSubmission/NaiadPeloponneseSupport/ClusterSubmission.cs
index d5a00cc..76a614f 100644
--- a/ClusterSubmission/NaiadPeloponneseSupport/ClusterSubmission.cs
+++ b/ClusterSubmission/NaiadPeloponneseSupport/ClusterSubmission.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -28,24 +28,20 @@
using System.Xml;
using System.Xml.Linq;
-using Microsoft.Research.Peloponnese.Storage;
using Microsoft.Research.Peloponnese.ClusterUtils;
namespace Microsoft.Research.Naiad.Cluster
{
public class ClusterSubmission : PPMSubmission
{
- private readonly IDfsClient dfsClient;
private readonly ClusterClient clusterClient;
- private readonly string exeDirectory;
private readonly XDocument launcherConfig;
private static string[] FrameworkAssemblyNames = { "System", "System.Core", "mscorlib", "System.Xml" };
private ClusterJob clusterJob;
- protected ClusterSubmission(IDfsClient dfs, ClusterClient cluster, int numberOfProcesses, string[] args)
+ protected ClusterSubmission(ClusterClient cluster, Uri stagingRoot, string queueName, int amMemoryInMB, int numberOfProcesses, int workerMemoryInMB, string[] args)
{
- this.dfsClient = dfs;
this.clusterClient = cluster;
string commandLine;
@@ -55,106 +51,69 @@ protected ClusterSubmission(IDfsClient dfs, ClusterClient cluster, int numberOfP
string ppmHome = ConfigHelpers.GetPPMHome(null);
string exePath = args[0];
- this.exeDirectory = Path.GetDirectoryName(exePath);
- string jobStaging = dfs.Combine("staging", Environment.UserName, "naiadJob");
+ this.clusterClient.DfsClient.EnsureDirectory(stagingRoot, true);
- XElement ppmResources = ConfigHelpers.MakePeloponneseResourceGroup(this.dfsClient, ppmHome);
- XElement frameworkResources;
- XElement jobResources;
- MakeJobResourceGroups(exePath, jobStaging, out frameworkResources, out jobResources);
+ Uri jobStaging = this.clusterClient.DfsClient.Combine(stagingRoot, Environment.UserName, "naiadJob");
- XElement[] workerResources = { ppmResources, frameworkResources, jobResources };
+ XElement ppmWorkerResources = ConfigHelpers.MakePeloponneseWorkerResourceGroup(this.clusterClient.DfsClient, stagingRoot, ppmHome);
+ XElement[] workerResources = { ppmWorkerResources };
+ workerResources = workerResources.Concat(MakeJobResourceGroups(exePath, stagingRoot, jobStaging)).ToArray();
- XDocument config = Helpers.MakePeloponneseConfig(numberOfProcesses, "yarn", commandLine, commandLineArgs, false, workerResources);
+ XElement ppmResources = ConfigHelpers.MakePeloponneseResourceGroup(this.clusterClient.DfsClient, stagingRoot, ppmHome);
+ XDocument config = Helpers.MakePeloponneseConfig(numberOfProcesses, workerMemoryInMB, "yarn", commandLine, commandLineArgs, false, workerResources);
string configName = "config.xml";
- XElement configResources = ConfigHelpers.MakeConfigResourceGroup(this.dfsClient, jobStaging, config, configName);
+ XElement configResources = ConfigHelpers.MakeConfigResourceGroup(
+ this.clusterClient.DfsClient, jobStaging, config, configName);
XElement[] launcherResources = { ppmResources, configResources };
- this.launcherConfig = ConfigHelpers.MakeLauncherConfig("Naiad: " + commandLine, configName, launcherResources, this.clusterClient.JobDirectoryTemplate.Replace("_BASELOCATION_", "naiad-jobs"));
+ this.launcherConfig = ConfigHelpers.MakeLauncherConfig(
+ "Naiad: " + commandLine, configName, queueName, amMemoryInMB, launcherResources,
+ this.clusterClient.JobDirectoryTemplate.AbsoluteUri.Replace("_BASELOCATION_", "naiad-jobs"));
}
- private Assembly DependencyResolveEventHandler(object sender, ResolveEventArgs args)
+ public void Dispose()
{
- string leafName = args.Name.Substring(0, args.Name.IndexOf(","));
- string assemblyPath = Path.Combine(this.exeDirectory, leafName);
+ this.clusterClient.Dispose();
+ }
- string dll = assemblyPath + ".dll";
- if (File.Exists(dll))
+ private XElement[] MakeJobResourceGroups(string exeName, Uri stagingRoot, Uri jobStaging)
+ {
+ if (exeName.ToLower().StartsWith("hdfs://"))
{
- return Assembly.LoadFrom(dll);
+ Uri exeDirectory = new Uri(exeName.Substring(0, exeName.LastIndexOf('/')));
+ return new XElement[] { ConfigHelpers.MakeRemoteResourceGroup(this.clusterClient.DfsClient, exeDirectory, false) };
}
-
- string exe = assemblyPath + ".exe";
- if (File.Exists(exe))
+ else
{
- return Assembly.LoadFrom(exe);
- }
-
- throw new ApplicationException("Can't find assembly " + args.ToString());
- }
-
- ///
- /// Returns the locations of non-framework assemblies on which the assembly with the given filename depends.
- ///
- /// The filename of the assembly
- /// An array of filenames for non-framework assemblies on which the given assembly depends
- private string[] Dependencies(string assemblyFilename)
- {
- Assembly assembly = Assembly.LoadFrom(assemblyFilename);
- AppDomain.CurrentDomain. AssemblyResolve += new ResolveEventHandler(DependencyResolveEventHandler);
- return GetDependenciesInternal(assembly).ToArray();
- }
+ IEnumerable dependencies = Microsoft.Research.Peloponnese.Shared.DependencyLister.Lister.ListDependencies(exeName);
- public static IEnumerable GetDependenciesInternal(Assembly source)
- {
- AppDomainSetup setup = new AppDomainSetup();
- setup.ApplicationBase = Path.GetDirectoryName(source.Location);
+ if (File.Exists(exeName + ".config"))
+ {
+ dependencies = dependencies.Concat(new[] { exeName + ".config" }).ToArray();
+ }
- AppDomain dependencyDomain = AppDomain.CreateDomain("DependencyLister", null, setup);
+ IEnumerable peloponneseDependencies = dependencies.Where(x => Path.GetFileName(x).StartsWith("Microsoft.Research.Peloponnese"));
+ XElement peloponneseGroup = ConfigHelpers.MakeResourceGroup(this.clusterClient.DfsClient, this.clusterClient.DfsClient.Combine(stagingRoot, "peloponnese"), true, peloponneseDependencies);
- DependencyLister.Lister lister = (DependencyLister.Lister) dependencyDomain.CreateInstanceFromAndUnwrap(typeof(Microsoft.Research.Naiad.Cluster.DependencyLister.Lister).Assembly.Location, "Microsoft.Research.Naiad.Cluster.DependencyLister.Lister");
-
- List ret = lister.ListDependencies(source.Location).ToList();
+ IEnumerable naiadDependencies = dependencies.Where(x => Path.GetFileName(x).StartsWith("Microsoft.Research.Naiad"));
+ XElement naiadGroup = ConfigHelpers.MakeResourceGroup(this.clusterClient.DfsClient, this.clusterClient.DfsClient.Combine(stagingRoot, "naiad"), true, naiadDependencies);
- AppDomain.Unload(dependencyDomain);
-
- return ret;
- }
+ IEnumerable jobDependencies = dependencies.Where(x => !Path.GetFileName(x).StartsWith("Microsoft.Research.Naiad") && !Path.GetFileName(x).StartsWith("Microsoft.Research.Peloponnese"));
+ XElement jobGroup = ConfigHelpers.MakeResourceGroup(this.clusterClient.DfsClient, jobStaging, false, jobDependencies);
- private void MakeJobResourceGroups(string exeName, string jobStaging, out XElement frameworkGroup, out XElement jobGroup)
- {
- string[] naiadComponentsArray =
- {
- "Naiad.dll",
- "Naiad.pdb"
- };
- HashSet naiadComponents = new HashSet();
- foreach (string c in naiadComponentsArray)
- {
- naiadComponents.Add(c);
+ return new XElement[] { peloponneseGroup, naiadGroup, jobGroup };
}
-
- string[] dependencies = Dependencies(exeName);
-
- if (File.Exists(exeName + ".config"))
- {
- dependencies = dependencies.Concat(new[] { exeName + ".config" }).ToArray();
- }
-
- IEnumerable frameworkDependencies = dependencies.Where(x => naiadComponents.Contains(Path.GetFileName(x)));
- frameworkGroup = ConfigHelpers.MakeResourceGroup(dfsClient, dfsClient.Combine("staging", "naiad"), true, frameworkDependencies);
-
- IEnumerable jobDependencies = dependencies.Where(x => !naiadComponents.Contains(Path.GetFileName(x)));
- jobGroup = ConfigHelpers.MakeResourceGroup(dfsClient, jobStaging, false, jobDependencies);
}
public void Submit()
{
- this.clusterJob = this.clusterClient.Submit(this.launcherConfig, this.clusterClient.JobDirectoryTemplate.Replace("_BASELOCATION_", "naiad-jobs"));
+ this.clusterJob = this.clusterClient.Submit(
+ this.launcherConfig,
+ new Uri(this.clusterClient.JobDirectoryTemplate.AbsoluteUri.Replace("_BASELOCATION_", "naiad-jobs")));
}
public int Join()
@@ -171,6 +130,7 @@ public int Join()
return 1;
}
}
- }
+ public ClusterJob ClusterJob { get { return this.clusterJob; } }
+ }
}
diff --git a/ClusterSubmission/NaiadPeloponneseSupport/Flags.cs b/ClusterSubmission/NaiadPeloponneseSupport/Flags.cs
index 2e0f79d..dd4161e 100644
--- a/ClusterSubmission/NaiadPeloponneseSupport/Flags.cs
+++ b/ClusterSubmission/NaiadPeloponneseSupport/Flags.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -318,6 +318,7 @@ public static String[] Parse(String[] args)
{
value = args[idx++];
}
+ //Console.WriteLine(name);
flag.Parse(value);
}
}
diff --git a/ClusterSubmission/NaiadPeloponneseSupport/Microsoft.Research.Naiad.Cluster.nuspec b/ClusterSubmission/NaiadPeloponneseSupport/Microsoft.Research.Naiad.Cluster.nuspec
deleted file mode 100644
index b249c94..0000000
--- a/ClusterSubmission/NaiadPeloponneseSupport/Microsoft.Research.Naiad.Cluster.nuspec
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- Microsoft.Research.Naiad.Cluster
- 0.4.1-beta
- Naiad - Cluster Support
- naiadquestions@microsoft.com
- naiadquestions@microsoft.com,Microsoft
- http://www.apache.org/licenses/LICENSE-2.0.html
- http://research.microsoft.com/naiad/
- true
-
- Support for running Naiad programs using Peloponnese.
-
- Microsoft Corporation
- en-US
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ClusterSubmission/NaiadPeloponneseSupport/NaiadPeloponneseSupport.csproj b/ClusterSubmission/NaiadPeloponneseSupport/NaiadPeloponneseSupport.csproj
index 5a4b8c8..892e1c4 100644
--- a/ClusterSubmission/NaiadPeloponneseSupport/NaiadPeloponneseSupport.csproj
+++ b/ClusterSubmission/NaiadPeloponneseSupport/NaiadPeloponneseSupport.csproj
@@ -1,6 +1,11 @@

-
+
+
+
+
+
+
Debug
@@ -12,6 +17,7 @@
Microsoft.Research.Naiad.Cluster
v4.5
512
+ f8cc83fc
true
@@ -37,29 +43,23 @@
-
+
False
- ..\packages\Microsoft.Data.Edm.5.6.1\lib\net40\Microsoft.Data.Edm.dll
+ ..\packages\Microsoft.Data.Edm.5.6.2\lib\net40\Microsoft.Data.Edm.dll
-
+
False
- ..\packages\Microsoft.Data.OData.5.6.1\lib\net40\Microsoft.Data.OData.dll
+ ..\packages\Microsoft.Data.OData.5.6.2\lib\net40\Microsoft.Data.OData.dll
-
+
False
- ..\packages\Microsoft.Data.Services.Client.5.6.1\lib\net40\Microsoft.Data.Services.Client.dll
+ ..\packages\Microsoft.Data.Services.Client.5.6.2\lib\net40\Microsoft.Data.Services.Client.dll
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.Hadoop.Client.dll
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.Hadoop.Client.dll
-
- False
- ..\packages\Microsoft.Research.Peloponnese.0.7.5-beta\lib\net45\Microsoft.Research.Peloponnese.HadoopBridge.dll
-
-
- False
- ..\packages\Microsoft.Research.Peloponnese.0.7.5-beta\lib\net45\Microsoft.Research.Peloponnese.Utils.dll
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.HDInsight.Net.Http.Formatting.dll
False
@@ -73,61 +73,51 @@
False
..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
-
- False
- ..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\net45\Microsoft.WindowsAzure.Common.dll
+
+ ..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll
-
- False
- ..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll
+
+ ..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll
..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.1.2.0\lib\net40\Microsoft.WindowsAzure.Management.dll
+
+ ..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.3.2.1\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.dll
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.dll
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.Storage.1.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll
+
+ ..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll
-
+
False
- ..\packages\WindowsAzure.Storage.4.0.1\lib\net40\Microsoft.WindowsAzure.Storage.dll
+ ..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
False
- ..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll
+ ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll
-
+
False
- ..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll
+ ..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll
-
+
False
- ..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll
+ ..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll
-
+
False
- ..\packages\System.Spatial.5.6.1\lib\net40\System.Spatial.dll
+ ..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll
@@ -145,31 +135,34 @@
Designer
-
- Designer
-
-
-
- {4b1a2cc2-1798-472c-954b-9c808b2c0748}
- DependencyLister
-
-
-
-
-
-
-
This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/ClusterSubmission/RunNaiad/Program.cs b/ClusterSubmission/RunNaiad/Program.cs
new file mode 100644
index 0000000..c73ce89
--- /dev/null
+++ b/ClusterSubmission/RunNaiad/Program.cs
@@ -0,0 +1,497 @@
+/*
+ * Naiad ver. 0.5
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
+ * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
+ * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache Version 2.0 License for specific language governing
+ * permissions and limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Microsoft.Research.Peloponnese.Shared;
+using Microsoft.Research.Peloponnese.Hdfs;
+using Microsoft.Research.Peloponnese.WebHdfs;
+using Microsoft.Research.Peloponnese.Azure;
+using Microsoft.Research.Peloponnese.ClusterUtils;
+using Microsoft.Research.Naiad.Util;
+
+namespace Microsoft.Research.Naiad.Cluster.Submission
+{
+ public class Program
+ {
+ private enum ExecutionType
+ {
+ Local,
+ Yarn,
+ Azure
+ };
+
+ private static Flag ShowHelp = Flags.Define("-h,--help", typeof(bool));
+
+ private static Flag ForceLocal = Flags.Define("--local", typeof(bool));
+ private static Flag ForceAzure = Flags.Define("--azure", typeof(bool));
+ private static Flag ForceYarn = Flags.Define("--yarn", typeof(bool));
+
+ private static Flag NumHosts = Flags.Define("-n,--numhosts", 2);
+ private static Flag PeloponneseHome = Flags.Define("-p,--peloponnesehome", typeof(string));
+
+ private static Flag RMHostAndPort = Flags.Define("-r,--rmhost", typeof(string));
+ private static Flag NameNodeAndPort = Flags.Define("-nn,--namenode", typeof(string));
+ private static Flag YarnJobQueue = Flags.Define("-yq,--yarnqueue", typeof(string));
+ private static Flag YarnAMMemory = Flags.Define("-amm,--ammemorymb", typeof(int));
+ private static Flag YarnWorkerMemory = Flags.Define("-wm,--workermemorymb", typeof(int));
+ private static Flag WebHdfsPort = Flags.Define("-w,--webhdfsport", typeof(int));
+ private static Flag LauncherHostAndPort = Flags.Define("-l,--launcher", typeof(string));
+ private static Flag LogsDumpFile = Flags.Define("-f,--fetch", typeof(string));
+
+ private static Flag AzureSubscriptionId = Flags.Define("--subscriptionid", typeof(string));
+ private static Flag AzureClusterName = Flags.Define("-c,--clustername", typeof(string));
+ private static Flag AzureCertificateThumbprint = Flags.Define("--certthumbprint", typeof(string));
+ private static Flag AzureStorageAccountName = Flags.Define("--storageaccount", typeof(string));
+ private static Flag AzureStorageAccountKey = Flags.Define("--storagekey", typeof(string));
+ private static Flag AzureStorageContainerName = Flags.Define("--container", typeof(string));
+
+ private static Flag LocalJobDirectory = Flags.Define("-ld,--localdir", typeof(string));
+
+ private const string Usage = @"Usage: RunNaiad [Shared options] [[Azure options]|[Yarn options]|[Local options]] NaiadExecutable.exe [Naiad options]
+
+Runs the given Naiad executable on an Azure HDInsight or YARN cluster, or a set of local processes. If no Azure or Yarn
+options are specified, local execution is assumed.
+
+(N.B. For convenience, each option can be set in the App.config for this program,
+ using the long form option name.)
+
+Shared options:
+ -n,--numhosts Number of Naiad processes (default = 2)
+ -p,--peloponnesehome Location of Peloponnese binaries (defaults to directory of the running binary)
+
+Yarn options:
+ -r,--rmhost YARN cluster RM node hostname and optional port. Hostname is required, port defaults to 8088
+ -nn,--namenode YARN cluster namenode and optional port, defaults to rm hostname
+ -yq,--yarnqueue YARN cluster job queue, defaults to cluster's default queue
+ -amm,--ammemorymb YARN container memory requested for AM (coordinator). Default is cluster's maximum container size
+ -wm,--workermemorymb YARN container memory requested for workers (Naiad processes). Default is cluster's maximum container size
+ -w,--webhdfsport Optional YARN namenode webhdfs port, defaults to 50070. If provided, RunNaiad will use
+ WebHdfs to upload resources. Otherwise, Java and YARN must be installed on the client computer.
+ -l,--launcher yarnlauncher hostname and optional port. If provided, RunNaiad will launch the job via the launcher
+ process. Otherwise, Java and YARN must be installed on the client computer.
+ -f,--fetch filename. fetch the job logs after the job finishes. yarn.cmd must be in the path for this to work.
+
+Azure options:
+ --c,clustername HDInsight cluster name (required)
+ --subscriptionid Azure subscription ID (default = taken from Powershell settings)
+ --certthumbprint Azure certificate thumbprint (required if and only if subscription ID is provided)
+ --storageaccount Azure storage account name for staging resources (default = cluster default storage account)
+ --storagekey Azure storage account key for staging resources (default = cluster default storage account key)
+ --container Azure storage blob container name for staging resources (default = ""staging"")
+
+Local options:
+ -ld,--localdir Local job working directory (default = '%PWD%\LocalJobs')";
+
+ private static void GetHostAndPort(string input, string defaultHost, int defaultPort, out string host, out int port)
+ {
+ if (input == null)
+ {
+ host = defaultHost;
+ port = defaultPort;
+ }
+ else
+ {
+ string[] parts = input.Split(':');
+ host = parts[0].Trim();
+ if (parts.Length == 2)
+ {
+ if (Int32.TryParse(parts[1], out port))
+ {
+ }
+ else
+ {
+ throw new ApplicationException("Bad port specifier: " + input);
+ }
+ }
+ else if (parts.Length > 2)
+ {
+ throw new ApplicationException("Bad host:port specifier: " + input);
+ }
+ else
+ {
+ port = defaultPort;
+ }
+ }
+ }
+
+ private static void FetchLogs(string dumpFile, string applicationId)
+ {
+ ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
+ startInfo.Arguments = "/c yarn.cmd logs -applicationId " + applicationId + " -appOwner " + Environment.UserName;
+ startInfo.RedirectStandardOutput = true;
+ startInfo.UseShellExecute = false;
+
+ Console.WriteLine("Fetch logs to '" + dumpFile + "' with command 'cmd.exe " + startInfo.Arguments + "'");
+
+ try
+ {
+ using (Stream dumpStream = new FileStream(dumpFile, FileMode.Create, FileAccess.Write, FileShare.ReadWrite))
+ {
+ Process process = new Process();
+ process.StartInfo = startInfo;
+ bool started = process.Start();
+ if (!started)
+ {
+ Console.Error.WriteLine("Failed to start fetch command");
+ return;
+ }
+
+ using (StreamReader reader = process.StandardOutput)
+ {
+ Task finishCopy = reader.BaseStream.CopyToAsync(dumpStream);
+
+ process.WaitForExit();
+
+ finishCopy.Wait();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Console.Error.WriteLine("Fetching logs got exception: " + e.ToString());
+ }
+ }
+
+ private static int RunNativeYarn(string[] args)
+ {
+ if (!RMHostAndPort.IsSet)
+ {
+ Console.Error.WriteLine("Error: Yarn cluster rm node hostname not set.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+
+ string rmHost;
+ int wsPort;
+ GetHostAndPort(RMHostAndPort.StringValue, null, 8088, out rmHost, out wsPort);
+
+ string nameNode;
+ int hdfsPort;
+ GetHostAndPort(NameNodeAndPort.IsSet ? NameNodeAndPort.StringValue : null, rmHost, -1, out nameNode, out hdfsPort);
+
+ string queueName = null;
+ if (YarnJobQueue.IsSet)
+ {
+ queueName = YarnJobQueue.StringValue;
+ }
+
+ int amMemoryMB = -1;
+ if (YarnAMMemory.IsSet)
+ {
+ amMemoryMB = YarnAMMemory.IntValue;
+ }
+
+ int workerMemoryMB = -1;
+ if (YarnWorkerMemory.IsSet)
+ {
+ workerMemoryMB = YarnWorkerMemory.IntValue;
+ }
+
+ string launcherNode;
+ int launcherPort;
+ GetHostAndPort(
+ LauncherHostAndPort.IsSet ? LauncherHostAndPort.StringValue : null, null, -1,
+ out launcherNode, out launcherPort);
+
+ DfsClient dfsClient;
+ if (WebHdfsPort.IsSet)
+ {
+ dfsClient = new WebHdfsClient(Environment.UserName, WebHdfsPort.IntValue);
+ }
+ else
+ {
+ dfsClient = new HdfsClient();
+ }
+
+ if (args[0].ToLower().StartsWith("hdfs://"))
+ {
+ if (!dfsClient.IsFileExists(new Uri(args[0])))
+ {
+ Console.Error.WriteLine("Error: Naiad program {0} does not exist.", args[0]);
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ }
+ else
+ {
+ if (!File.Exists(args[0]))
+ {
+ Console.Error.WriteLine("Error: Naiad program {0} does not exist.", args[0]);
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ }
+
+ UriBuilder builder = new UriBuilder();
+ builder.Scheme = "hdfs";
+ builder.Host = nameNode;
+ builder.Port = hdfsPort;
+ Uri jobRoot = dfsClient.Combine(builder.Uri, "user", Environment.UserName);
+ Uri stagingRoot = dfsClient.Combine(builder.Uri, "tmp", "staging");
+
+ NativeYarnSubmission submission;
+
+ if (launcherNode == null)
+ {
+ submission = new NativeYarnSubmission(rmHost, wsPort, dfsClient, queueName, stagingRoot, jobRoot, PeloponneseHome, amMemoryMB, NumHosts, workerMemoryMB, args);
+ }
+ else
+ {
+ submission = new NativeYarnSubmission(rmHost, wsPort, dfsClient, queueName, stagingRoot, jobRoot, launcherNode, launcherPort, amMemoryMB, NumHosts, workerMemoryMB, args);
+ }
+
+ submission.Submit();
+
+ Console.WriteLine("Waiting for application to complete");
+
+ int ret = submission.Join();
+
+ if (LogsDumpFile.IsSet)
+ {
+ FetchLogs(LogsDumpFile.StringValue, submission.ClusterJob.Id);
+ }
+
+ submission.Dispose();
+
+ return ret;
+ }
+
+ private static int RunHDInsight(string[] args)
+ {
+ if (!File.Exists(args[0]))
+ {
+ Console.Error.WriteLine("Error: Naiad program {0} does not exist.", args[0]);
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+
+ AzureSubscriptions subscriptionManagement = new AzureSubscriptions();
+
+ if (AzureSubscriptionId.IsSet && AzureCertificateThumbprint.IsSet)
+ {
+ subscriptionManagement.AddSubscription(AzureSubscriptionId.StringValue, AzureCertificateThumbprint.StringValue);
+ }
+
+ string clusterName = null;
+ if (AzureClusterName.IsSet)
+ {
+ clusterName = AzureClusterName.StringValue;
+
+ if (AzureStorageAccountName.IsSet && AzureStorageAccountKey.IsSet)
+ {
+ subscriptionManagement.SetClusterAccountAsync(clusterName, AzureStorageAccountName.StringValue, AzureStorageAccountKey.StringValue).Wait();
+ }
+ }
+ else
+ {
+ IEnumerable clusters = subscriptionManagement.GetClusters();
+ if (clusters.Count() == 1)
+ {
+ clusterName = clusters.Single().Name;
+ }
+ else
+ {
+ Console.Error.WriteLine("Error: Cluster name must be specified unless there is a single configured cluster in default and supplied subscriptions");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ }
+
+ AzureCluster cluster;
+ try
+ {
+ cluster = subscriptionManagement.GetClusterAsync(clusterName).Result;
+ }
+ catch (Exception)
+ {
+ Console.Error.WriteLine("Error: Failed to find cluster " + clusterName + " in default or supplied subscriptions");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ if (cluster == null)
+ {
+ Console.Error.WriteLine("Error: Failed to find cluster {0} in default or supplied subscriptions", clusterName);
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+
+ string containerName = "staging";
+ if (AzureStorageContainerName.IsSet)
+ {
+ containerName = AzureStorageContainerName.StringValue;
+ }
+
+ // The args are augmented with an additional setting containing the Azure connection string.
+ args = args.Concat(new string[] { "--addsetting", "Microsoft.Research.Naiad.Cluster.Azure.DefaultConnectionString", string.Format("\"DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}\"", cluster.StorageAccount.Split('.').First(), cluster.StorageKey) }).ToArray();
+
+ Console.Error.WriteLine("Submitting job with args: {0}", string.Join(" ", args));
+
+ AzureDfsClient azureDfs = new AzureDfsClient(cluster.StorageAccount, cluster.StorageKey, containerName);
+ Uri baseUri = Utils.ToAzureUri(cluster.StorageAccount, containerName, "", null, cluster.StorageKey);
+ AzureYarnClient azureYarn = new AzureYarnClient(subscriptionManagement, azureDfs, baseUri, ConfigHelpers.GetPPMHome(null), clusterName);
+ AzureYarnSubmission submission = new AzureYarnSubmission(azureYarn, baseUri, NumHosts, args);
+
+ submission.Submit();
+ return submission.Join();
+ }
+
+ private static int RunLocal(string[] args)
+ {
+ if (!File.Exists(args[0]))
+ {
+ Console.Error.WriteLine("Error: Naiad program {0} does not exist.", args[0]);
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+
+ if (!LocalJobDirectory.IsSet)
+ {
+ LocalJobDirectory.Parse("LocalJobs");
+ }
+ LocalSubmission submission = new LocalSubmission(NumHosts, args, LocalJobDirectory);
+ submission.Submit();
+ return submission.Join();
+ }
+
+ public static int Run(string[] args)
+ {
+ if (Environment.GetEnvironmentVariable("PELOPONNESE_HOME") != null)
+ {
+ PeloponneseHome.Parse(Environment.GetEnvironmentVariable("PELOPONNESE_HOME"));
+ }
+ else
+ {
+ string exeName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
+ PeloponneseHome.Parse(Path.GetDirectoryName(exeName));
+ }
+
+ Flags.Parse(ConfigurationManager.AppSettings);
+
+ args = Flags.Parse(args);
+
+ if (ShowHelp.BooleanValue)
+ {
+ Console.Error.WriteLine(Usage);
+ return 0;
+ }
+
+ if (args.Length < 1)
+ {
+ Console.Error.WriteLine("Error: No Naiad program specified.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+
+ bool isLocal = ForceLocal.IsSet;
+ bool isNativeYarn = ForceYarn.IsSet;
+ bool isAzureHDInsight = ForceAzure.IsSet;
+
+ // first find out if we forced an execution type with an explicit argument
+ if (isLocal)
+ {
+ if (isNativeYarn)
+ {
+ Console.Error.WriteLine("Can't force both Yarn and Local execution.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ if (isAzureHDInsight)
+ {
+ Console.Error.WriteLine("Can't force both Azure and Local execution.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ }
+ else if (isNativeYarn)
+ {
+ if (isAzureHDInsight)
+ {
+ Console.Error.WriteLine("Can't force both Azure and Yarn execution.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ }
+ else if (!isAzureHDInsight)
+ {
+ // there's no explicit argument to force execution type, so guess based on which arguments are set
+ isLocal =
+ (LocalJobDirectory.IsSet);
+ isNativeYarn =
+ (RMHostAndPort.IsSet || NameNodeAndPort.IsSet || YarnJobQueue.IsSet || YarnAMMemory.IsSet || YarnWorkerMemory.IsSet ||
+ WebHdfsPort.IsSet || LauncherHostAndPort.IsSet || LogsDumpFile.IsSet);
+ isAzureHDInsight =
+ (AzureSubscriptionId.IsSet || AzureClusterName.IsSet || AzureCertificateThumbprint.IsSet ||
+ AzureStorageAccountName.IsSet || AzureStorageAccountKey.IsSet || AzureStorageContainerName.IsSet);
+ }
+
+ if (isNativeYarn)
+ {
+ if (isAzureHDInsight)
+ {
+ Console.Error.WriteLine("Can't specify Yarn and Azure options.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ if (isLocal)
+ {
+ Console.Error.WriteLine("Can't specify Yarn and local options.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ return RunNativeYarn(args);
+ }
+ else if (isAzureHDInsight)
+ {
+ if (isLocal)
+ {
+ Console.Error.WriteLine("Can't specify Azure and local options.");
+ Console.Error.WriteLine(Usage);
+ return 1;
+ }
+ return RunHDInsight(args);
+ }
+ else
+ {
+ return RunLocal(args);
+ }
+ }
+
+ public static void Main(string[] args)
+ {
+ try
+ {
+ int exitCode = Run(args);
+ Console.WriteLine("Application return exit code " + exitCode);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception " + e.Message + "\n" + e.ToString());
+ }
+ }
+ }
+}
diff --git a/ClusterSubmission/YarnSubmission/Properties/AssemblyInfo.cs b/ClusterSubmission/RunNaiad/Properties/AssemblyInfo.cs
similarity index 84%
rename from ClusterSubmission/YarnSubmission/Properties/AssemblyInfo.cs
rename to ClusterSubmission/RunNaiad/Properties/AssemblyInfo.cs
index 19dfbb5..d0b3e80 100644
--- a/ClusterSubmission/YarnSubmission/Properties/AssemblyInfo.cs
+++ b/ClusterSubmission/RunNaiad/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -17,7 +17,6 @@
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*/
-
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -25,12 +24,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("YarnSubmission")]
+[assembly: AssemblyTitle("RunNaiad")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("YarnSubmission")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
+[assembly: AssemblyProduct("RunNaiad")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -40,7 +39,7 @@
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("1f0eb873-2b1d-43c0-b001-256149e0c68c")]
+[assembly: Guid("9bc369a3-3588-49fc-9ef1-f325702c8175")]
// Version information for an assembly consists of the following four values:
//
@@ -52,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.1")]
-[assembly: AssemblyFileVersion("0.4.1")]
+[assembly: AssemblyVersion("0.5.0.0")]
+[assembly: AssemblyFileVersion("0.5.0.0")]
diff --git a/ClusterSubmission/RunNaiad/RunNaiad.csproj b/ClusterSubmission/RunNaiad/RunNaiad.csproj
new file mode 100644
index 0000000..05890b8
--- /dev/null
+++ b/ClusterSubmission/RunNaiad/RunNaiad.csproj
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+ Debug
+ AnyCPU
+ {47D22F4A-8B47-4829-A896-E5318ECA4CC2}
+ Exe
+ Properties
+ RunNaiad
+ RunNaiad
+ v4.5
+ 512
+ 55665545
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+
+ False
+ ..\packages\Microsoft.Data.Edm.5.6.2\lib\net40\Microsoft.Data.Edm.dll
+
+
+ False
+ ..\packages\Microsoft.Data.OData.5.6.2\lib\net40\Microsoft.Data.OData.dll
+
+
+ False
+ ..\packages\Microsoft.Data.Services.Client.5.6.2\lib\net40\Microsoft.Data.Services.Client.dll
+
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.Hadoop.Client.dll
+
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.HDInsight.Net.Http.Formatting.dll
+
+
+ False
+ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
+
+
+ False
+ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll
+
+
+ False
+ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
+
+
+ ..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll
+
+
+ ..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll
+
+
+ ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
+
+
+ ..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.3.2.1\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.dll
+
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll
+
+
+ ..\packages\Microsoft.Hadoop.Client.1.3.2.1\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll
+
+
+ ..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll
+
+
+ False
+ ..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
+
+
+ False
+ ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+ False
+ ..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll
+
+
+ False
+ ..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll
+
+
+
+ False
+ ..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {271f7100-7aa3-4379-9c58-23618b73a5dd}
+ NaiadPeloponneseSupport
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ClusterSubmission/RunNaiad/YarnSubmission.cs b/ClusterSubmission/RunNaiad/YarnSubmission.cs
new file mode 100644
index 0000000..0ba1cfa
--- /dev/null
+++ b/ClusterSubmission/RunNaiad/YarnSubmission.cs
@@ -0,0 +1,68 @@
+/*
+ * Naiad ver. 0.5
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
+ * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
+ * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache Version 2.0 License for specific language governing
+ * permissions and limitations under the License.
+ */
+
+using Microsoft.Research.Peloponnese.Yarn;
+using Microsoft.Research.Peloponnese.Shared;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Microsoft.Research.Naiad.Cluster.Submission
+{
+ class NativeYarnSubmission : ClusterSubmission
+ {
+ public NativeYarnSubmission(
+ string rmNode, int wsPort, DfsClient dfsClient, string queueName, Uri stagingUri, Uri jobUri, string launcherNode, int launcherPort,
+ int amMemoryInMB, int numberOfProcesses, int workerMemoryInMB, string[] args)
+ : base(new NativeYarnClient(rmNode, wsPort, dfsClient, jobUri, launcherNode, launcherPort),
+ stagingUri, queueName, amMemoryInMB, numberOfProcesses, workerMemoryInMB, args)
+ {
+ }
+
+ public NativeYarnSubmission(
+ string rmNode, int wsPort, DfsClient dfsClient, string queueName, Uri stagingUri, Uri jobUri, string peloponneseDirectory,
+ int amMemoryInMB, int numberOfProcesses, int workerMemoryInMB, string[] args)
+ : base(
+ new NativeYarnClient(rmNode, wsPort, dfsClient, jobUri, LauncherJarFile(peloponneseDirectory), YarnDirectory()),
+ stagingUri, queueName, amMemoryInMB, numberOfProcesses, workerMemoryInMB, args)
+ {
+ }
+
+ private static string LauncherJarFile(string peloponneseDirectory)
+ {
+ return Path.Combine(peloponneseDirectory, "Microsoft.Research.Peloponnese.YarnLauncher.jar");
+ }
+
+ private static string YarnDirectory()
+ {
+ string yarnDirectory = Environment.GetEnvironmentVariable("HADOOP_COMMON_HOME");
+
+ if (yarnDirectory == null)
+ {
+ throw new ApplicationException("No HADOOP_COMMON_HOME defined");
+ }
+
+ return yarnDirectory;
+ }
+ }
+}
diff --git a/ClusterSubmission/RunNaiad/packages.config b/ClusterSubmission/RunNaiad/packages.config
new file mode 100644
index 0000000..47150e6
--- /dev/null
+++ b/ClusterSubmission/RunNaiad/packages.config
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ClusterSubmission/YarnSubmission/App.config b/ClusterSubmission/YarnSubmission/App.config
deleted file mode 100644
index 0b6d0f2..0000000
--- a/ClusterSubmission/YarnSubmission/App.config
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/YarnSubmission/Microsoft.Research.Naiad.Cluster.Yarn.nuspec b/ClusterSubmission/YarnSubmission/Microsoft.Research.Naiad.Cluster.Yarn.nuspec
deleted file mode 100644
index 8b30c9f..0000000
--- a/ClusterSubmission/YarnSubmission/Microsoft.Research.Naiad.Cluster.Yarn.nuspec
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- Microsoft.Research.Naiad.Cluster.Yarn
- 0.4.1-beta
- Naiad - YARN cluster submission tool
- naiadquestions@microsoft.com
- naiadquestions@microsoft.com,Microsoft
- http://www.apache.org/licenses/LICENSE-2.0.html
- http://research.microsoft.com/naiad/
- true
-
- Launcher for submitting Naiad programs to a Hadoop 2.0 (YARN) cluster.
-
- Microsoft Corporation
- en-US
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ClusterSubmission/YarnSubmission/Program.cs b/ClusterSubmission/YarnSubmission/Program.cs
deleted file mode 100644
index e311c48..0000000
--- a/ClusterSubmission/YarnSubmission/Program.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Naiad ver. 0.4
- * Copyright (c) Microsoft Corporation
- * All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
- * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
- * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
- *
- * See the Apache Version 2.0 License for specific language governing
- * permissions and limitations under the License.
- */
-
-using Microsoft.Research.Naiad.Util;
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.Research.Naiad.Cluster.NativeYarn
-{
- public class Program
- {
- private static Flag ShowHelp = Flags.Define("-h,--help", typeof(bool));
- private static Flag NumHosts = Flags.Define("-n,--numhosts", 2);
- private static Flag NumThreads = Flags.Define("-t,--threads", 8);
- private static Flag HeadNodeHostname = Flags.Define("-y,--yarncluster", typeof(string));
- private static Flag PeloponneseHome = Flags.Define("-p,--peloponnesehome", typeof(string));
-
- private const string Usage = @"Usage: NativeYarnSubmission [Azure options] NaiadExecutable.exe [Naiad options]
-
-Runs the given Naiad executable on an YARN cluster.
-
-(N.B. For convenience, each option can be set in the App.config for this program,
- using the long form option name.)
-
-Options:
- -n,--numhosts Number of Naiad processes (default = 2)
- -t,--threads Number of worker threads per Naiad process (default = 8)
- -p,--peloponnesehome Location of Peloponnese binaries (default = %PELOPONNESE_HOME%)
-
-Azure options:
- -y,--yarncluster YARN cluster head node hostname";
-
-
- public static int Run(string[] args)
- {
- if (Environment.GetEnvironmentVariable("PELOPONNESE_HOME") != null)
- PeloponneseHome.Parse(Environment.GetEnvironmentVariable("PELOPONNESE_HOME"));
-
- Flags.Parse(ConfigurationManager.AppSettings);
-
- args = Flags.Parse(args);
-
- if (ShowHelp.BooleanValue)
- {
- Console.Error.WriteLine(Usage);
- return 0;
- }
- if (!PeloponneseHome.IsSet)
- {
- Console.Error.WriteLine("Error: Peloponnese home directory not set.");
- Console.Error.WriteLine(Usage);
- return -1;
- }
- if (!HeadNodeHostname.IsSet)
- {
- Console.Error.WriteLine("Error: Yarn cluster head node hostname not set.");
- Console.Error.WriteLine(Usage);
- return -1;
- }
-
- NativeYarnSubmission submission = new NativeYarnSubmission(HeadNodeHostname.StringValue, 9000, 50070, NumHosts, args);
-
- submission.Submit();
- return submission.Join();
- }
-
- public static void Main(string[] args)
- {
- try
- {
- int exitCode = Run(args);
- Console.WriteLine("Application return exit code " + exitCode);
- }
- catch (Exception e)
- {
- Console.WriteLine("Exception " + e.Message + "\n" + e.ToString());
- }
- }
- }
-}
diff --git a/ClusterSubmission/YarnSubmission/YarnSubmission.csproj b/ClusterSubmission/YarnSubmission/YarnSubmission.csproj
deleted file mode 100644
index 25395d7..0000000
--- a/ClusterSubmission/YarnSubmission/YarnSubmission.csproj
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
-
- Debug
- AnyCPU
- {3A289ADE-2782-47D3-B682-C03115332646}
- Exe
- Properties
- Microsoft.Research.Naiad.Cluster.Yarn
- YarnSubmission
- v4.5
- 512
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- bin\x64\Release\
- TRACE
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
-
- False
- ..\packages\Microsoft.Data.Edm.5.6.1\lib\net40\Microsoft.Data.Edm.dll
-
-
- False
- ..\packages\Microsoft.Data.OData.5.6.1\lib\net40\Microsoft.Data.OData.dll
-
-
- False
- ..\packages\Microsoft.Data.Services.Client.5.6.1\lib\net40\Microsoft.Data.Services.Client.dll
-
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.Hadoop.Client.dll
-
-
- False
- ..\packages\Microsoft.Research.Peloponnese.0.7.5-beta\lib\net45\Microsoft.Research.Peloponnese.HadoopBridge.dll
-
-
- False
- ..\packages\Microsoft.Research.Peloponnese.0.7.5-beta\lib\net45\Microsoft.Research.Peloponnese.Utils.dll
-
-
- False
- ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
-
-
- False
- ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll
-
-
- False
- ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\net45\Microsoft.WindowsAzure.Common.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Common.1.1.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll
-
-
- ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.1.2.0\lib\net40\Microsoft.WindowsAzure.Management.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.dll
-
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll
-
-
- False
- ..\packages\Microsoft.Hadoop.Client.1.1.1.8\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll
-
-
- False
- ..\packages\Microsoft.WindowsAzure.Management.Storage.1.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll
-
-
- False
- ..\packages\WindowsAzure.Storage.4.0.1\lib\net40\Microsoft.WindowsAzure.Storage.dll
-
-
- False
- ..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll
-
-
-
-
-
-
-
- False
- ..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll
-
-
- False
- ..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll
-
-
-
- False
- ..\packages\System.Spatial.5.6.1\lib\net40\System.Spatial.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
- Designer
-
-
-
-
-
- {271f7100-7aa3-4379-9c58-23618b73a5dd}
- NaiadPeloponneseSupport
-
-
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ClusterSubmission/YarnSubmission/packages.config b/ClusterSubmission/YarnSubmission/packages.config
deleted file mode 100644
index 8fe539e..0000000
--- a/ClusterSubmission/YarnSubmission/packages.config
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/VersionHistory.aml b/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/VersionHistory.aml
index e094d45..0cc630b 100644
--- a/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/VersionHistory.aml
+++ b/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/VersionHistory.aml
@@ -11,6 +11,9 @@
Select a version below to see a description of its changes.
+
+
+
diff --git a/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/v0.5.aml b/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/v0.5.aml
new file mode 100644
index 0000000..cd011b6
--- /dev/null
+++ b/Documentation/NaiadDocumentation/NaiadDocumentation/Content/VersionHistory/v0.5.aml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+ An update release of Naiad, version 0.5 includes support for reading and writing Hdfs files using either the Java-based
+ protocol or REST-based WebHdfs, as well as bug fixes.
+
+
+
+
+
+ Version 0.5 was released on October 17th, 2014
+
+
+
+
+ Changes in This Release
+
+
+
+
+ Frameworks for reading and writing data in Hdfs.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Documentation/NaiadDocumentation/NaiadDocumentation/ContentLayout.content b/Documentation/NaiadDocumentation/NaiadDocumentation/ContentLayout.content
index 74303c3..69c91c1 100644
--- a/Documentation/NaiadDocumentation/NaiadDocumentation/ContentLayout.content
+++ b/Documentation/NaiadDocumentation/NaiadDocumentation/ContentLayout.content
@@ -7,11 +7,16 @@
-
+
+
+
+
+
+
diff --git a/Documentation/NaiadDocumentation/NaiadDocumentation/NaiadDocumentation.shfbproj b/Documentation/NaiadDocumentation/NaiadDocumentation/NaiadDocumentation.shfbproj
index 9820ec3..60ffacd 100644
--- a/Documentation/NaiadDocumentation/NaiadDocumentation/NaiadDocumentation.shfbproj
+++ b/Documentation/NaiadDocumentation/NaiadDocumentation/NaiadDocumentation.shfbproj
@@ -37,6 +37,14 @@
+
+
+
+
+
+
+
+
OnlyWarningsAndErrors
Website
@@ -88,6 +96,7 @@
+
diff --git a/Examples/App.config b/Examples/App.config
index 8225cae..6443066 100644
--- a/Examples/App.config
+++ b/Examples/App.config
@@ -1,24 +1,24 @@
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/Examples/DifferentialDataflow/ConnectedComponents.cs b/Examples/DifferentialDataflow/ConnectedComponents.cs
index a8d72ed..3785c45 100644
--- a/Examples/DifferentialDataflow/ConnectedComponents.cs
+++ b/Examples/DifferentialDataflow/ConnectedComponents.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/DifferentialDataflow/GraphColoring.cs b/Examples/DifferentialDataflow/GraphColoring.cs
index 97f84a1..f7a0870 100644
--- a/Examples/DifferentialDataflow/GraphColoring.cs
+++ b/Examples/DifferentialDataflow/GraphColoring.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/DifferentialDataflow/SearchIndex.cs b/Examples/DifferentialDataflow/SearchIndex.cs
index ed5967d..ea58bf4 100644
--- a/Examples/DifferentialDataflow/SearchIndex.cs
+++ b/Examples/DifferentialDataflow/SearchIndex.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/DifferentialDataflow/StronglyConnectedComponents.cs b/Examples/DifferentialDataflow/StronglyConnectedComponents.cs
index 0eb6ce5..beeee03 100644
--- a/Examples/DifferentialDataflow/StronglyConnectedComponents.cs
+++ b/Examples/DifferentialDataflow/StronglyConnectedComponents.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/DifferentialDataflow/WordCount.cs b/Examples/DifferentialDataflow/WordCount.cs
index 02659e7..18d7918 100644
--- a/Examples/DifferentialDataflow/WordCount.cs
+++ b/Examples/DifferentialDataflow/WordCount.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/Examples.csproj b/Examples/Examples.csproj
index f68c92d..0386abc 100644
--- a/Examples/Examples.csproj
+++ b/Examples/Examples.csproj
@@ -9,13 +9,14 @@
Properties
Examples
Examples
- v4.0
+ v4.5
512
SAK
SAK
SAK
SAK
- Client
+
+
AnyCPU
@@ -26,6 +27,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
@@ -36,6 +38,25 @@
prompt
4
false
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
@@ -48,6 +69,9 @@
+
+ Properties\SharedAssemblyInfo.cs
+
diff --git a/Examples/GraphLINQ/PageRank.cs b/Examples/GraphLINQ/PageRank.cs
index f255288..3627ade 100644
--- a/Examples/GraphLINQ/PageRank.cs
+++ b/Examples/GraphLINQ/PageRank.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/GraphLINQ/Reachability.cs b/Examples/GraphLINQ/Reachability.cs
index 6227c0c..78fca39 100644
--- a/Examples/GraphLINQ/Reachability.cs
+++ b/Examples/GraphLINQ/Reachability.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/Naiad/ConnectedComponents.cs b/Examples/Naiad/ConnectedComponents.cs
index 53f1fe6..7c54c6c 100644
--- a/Examples/Naiad/ConnectedComponents.cs
+++ b/Examples/Naiad/ConnectedComponents.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -307,9 +307,19 @@ public void Execute(string[] args)
var random = new Random(0);
var processes = computation.Configuration.Processes;
- var graphFragment = new Pair[edgeCount / processes];
- for (int i = 0; i < graphFragment.Length; i++)
- graphFragment[i] = new Pair(random.Next(nodeCount), random.Next(nodeCount));
+ var thisProcess = computation.Configuration.ProcessID;
+ var graphFragmentList = new List>();
+ for (int i = 0; i < edgeCount; i++)
+ {
+ // ensure we generate the same graph no matter how many processes there are
+ var edge = new Pair(random.Next(nodeCount), random.Next(nodeCount));
+ if ((i % processes) == thisProcess)
+ {
+ graphFragmentList.Add(edge);
+ }
+ }
+
+ var graphFragment = graphFragmentList.ToArray();
#endregion
@@ -319,7 +329,7 @@ public void Execute(string[] args)
// convert array of edges to single-epoch stream.
var edges = graphFragment.AsNaiadStream(computation)
- .Synchronize();
+ .Synchronize(x => true);
// symmetrize the graph by adding in transposed edges.
edges = edges.Select(x => new Pair(x.Second, x.First))
@@ -341,4 +351,4 @@ public string Help
get { return "Demonstrates an iterative dataflow computation, using streaming aggregation within the loop and a blocking aggregation outside the loop. Demonstrates how optional coordination can give good performance when not used and determinism when used."; }
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/Naiad/KeyValueLookup.cs b/Examples/Naiad/KeyValueLookup.cs
index 6dfeada..eeddfd2 100644
--- a/Examples/Naiad/KeyValueLookup.cs
+++ b/Examples/Naiad/KeyValueLookup.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/Naiad/Latency.cs b/Examples/Naiad/Latency.cs
index e4f59d0..451d265 100644
--- a/Examples/Naiad/Latency.cs
+++ b/Examples/Naiad/Latency.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -49,8 +49,8 @@ public override void OnNotify(IterationIn time)
public static Stream> MakeStage(Stream> ingress, Stream> feedbackOutput, int iterations)
{
var stage = new Stage>(ingress.Context, (i, s) => new Barrier(i, s, iterations), "Barrier");
- var initialInput = stage.NewInput(ingress, (message, vertex) => { }, null);
- var feedbackInput = stage.NewInput(feedbackOutput, (message, vertex) => { }, null);
+ stage.NewInput(ingress, (message, vertex) => { }, null);
+ stage.NewInput(feedbackOutput, (message, vertex) => { }, null);
return stage.NewOutput(vertex => vertex.Output);
}
diff --git a/Examples/Naiad/Throughput.cs b/Examples/Naiad/Throughput.cs
index bbc946e..d1e91e7 100644
--- a/Examples/Naiad/Throughput.cs
+++ b/Examples/Naiad/Throughput.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -35,7 +35,7 @@ namespace Microsoft.Research.Naiad.Examples.Throughput
{
public class ProducerVertex : Vertex
{
- private readonly VertexOutputBuffer output;
+ private readonly VertexOutputBuffer, Epoch> output;
private readonly int numberToSend;
@@ -43,24 +43,29 @@ public override void OnNotify(Epoch time)
{
var output = this.output.GetBufferForTime(new Epoch(0));
for (int i = 0; i < this.numberToSend; ++i)
- output.Send(this.VertexId);
+ output.Send(this.VertexId.PairWith(i));
}
private ProducerVertex(int id, Stage stage, int numberToSend)
: base(id, stage)
{
this.numberToSend = numberToSend;
- this.output = new VertexOutputBuffer(this);
+ this.output = new VertexOutputBuffer, Epoch>(this);
this.NotifyAt(new Epoch(0));
}
- public static Stream MakeStage(int numberToSend, int numberOfPartitions, Stream input)
+ public static Stream, Epoch> MakeStage(int numberToSend, int startProcess, int endProcess, int numberOfWorkers, Stream, Epoch> input)
{
- Placement placement = new Placement.Explicit(Enumerable.Range(0, numberOfPartitions).Select(x => new VertexLocation(x, 0, x)));
+ var locations = new List();
+ for (int i = 0; i < endProcess - startProcess; i++)
+ for (int j = 0; j < numberOfWorkers; j++)
+ locations.Add(new VertexLocation(locations.Count, i + startProcess, j));
+
+ Placement placement = new Placement.Explicit(locations);
Stage stage = Foundry.NewStage(placement, input.Context, (i, s) => new ProducerVertex(i, s, numberToSend), "Producer");
stage.NewInput(input, (v, m) => { }, null);
- Stream stream = stage.NewOutput(v => v.output);
+ Stream, Epoch> stream = stage.NewOutput(v => v.output);
return stream;
}
}
@@ -71,12 +76,12 @@ public class ConsumerVertex : Vertex
private readonly int numberToConsume;
private Stopwatch stopwatch = new Stopwatch();
- private void OnRecv(Message message)
+ private void OnRecv(Message, Epoch> message)
{
//Console.WriteLine("In OnRecv");
if (!stopwatch.IsRunning)
stopwatch.Start();
-
+
numReceived += message.length;
}
@@ -92,12 +97,23 @@ private ConsumerVertex(int id, Stage stage, int numberToConsume)
this.NotifyAt(new Epoch(0));
}
- public static Stage MakeStage(int numberToConsume, int numberOfPartitions, Stream stream)
+ public static Stage MakeStage(int numberToConsume, int startProcess, int endProcess, int numberOfWorkers, bool exchange, Stream, Epoch> stream)
{
- Placement placement = new Placement.Explicit(Enumerable.Range(0, numberOfPartitions).Select(x => new VertexLocation(x, 1, x)));
+ var locations = new List();
+ for (int i = 0; i < endProcess - startProcess; i++)
+ for (int j = 0; j < numberOfWorkers; j++)
+ locations.Add(new VertexLocation(locations.Count, i + startProcess, j));
+
+ Placement placement = new Placement.Explicit(locations);
Stage stage = Foundry.NewStage(placement, stream.Context, (i, s) => new ConsumerVertex(i, s, numberToConsume), "Consumer");
- stage.NewInput(stream, (m, v) => v.OnRecv(m), x => x);
+
+
+ if (exchange)
+ stage.NewInput(stream, (m, v) => v.OnRecv(m), x => x.Second);
+ else
+ stage.NewInput(stream, (m, v) => v.OnRecv(m), x => x.First);
+
return stage;
}
}
@@ -106,7 +122,7 @@ class Throughput : Example
{
public string Usage
{
- get { return "[records]"; }
+ get { return "records producers consumers [exchange]"; }
}
public void Execute(string[] args)
@@ -114,11 +130,15 @@ public void Execute(string[] args)
using (OneOffComputation computation = NewComputation.FromArgs(ref args))
{
int numToExchange = args.Length > 1 ? int.Parse(args[1]) : 1000000;
+ int producers = Int32.Parse(args[2]);
+ int consumers = Int32.Parse(args[3]);
+
+ var exchange = args.Length > 4 && args[4] == "exchange";
- Stream input = computation.NewInput(new ConstantDataSource(5));
+ var input = new Pair[] { }.AsNaiadStream(computation);
- Stream stream = ProducerVertex.MakeStage(numToExchange, computation.Configuration.WorkerCount, input);
- Stage consumer = ConsumerVertex.MakeStage(numToExchange, computation.Configuration.WorkerCount, stream);
+ Stream, Epoch> stream = ProducerVertex.MakeStage(numToExchange, 0, producers, computation.Configuration.WorkerCount, input);
+ Stage consumer = ConsumerVertex.MakeStage(numToExchange, computation.Configuration.Processes - consumers, computation.Configuration.Processes, computation.Configuration.WorkerCount, exchange, stream);
computation.Activate();
computation.Join();
diff --git a/Examples/Naiad/WordCount.cs b/Examples/Naiad/WordCount.cs
index 50f27f4..31b3284 100644
--- a/Examples/Naiad/WordCount.cs
+++ b/Examples/Naiad/WordCount.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -131,4 +131,4 @@ public string Help
get { return "Demonstrates interactive counting of words in lines of text.\nPerhaps the simplest example of a self-contained Naiad program."; }
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/Program.cs b/Examples/Program.cs
index 4d70264..8373925 100644
--- a/Examples/Program.cs
+++ b/Examples/Program.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Examples/Properties/AssemblyInfo.cs b/Examples/Properties/AssemblyInfo.cs
index 72b870b..5452515 100644
--- a/Examples/Properties/AssemblyInfo.cs
+++ b/Examples/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -26,31 +26,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Research.Naiad.Examples")]
-[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Microsoft.Research.Naiad.Examples")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("43490246-380e-41db-a6fd-90112b8b6189")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.2")]
-[assembly: AssemblyFileVersion("0.4.2")]
diff --git a/Frameworks/AzureSupport/AzureSupport.csproj b/Frameworks/AzureSupport/AzureSupport.csproj
index dccb4e7..bbf3361 100644
--- a/Frameworks/AzureSupport/AzureSupport.csproj
+++ b/Frameworks/AzureSupport/AzureSupport.csproj
@@ -1,5 +1,5 @@

-
+
Debug
@@ -9,9 +9,12 @@
Properties
Microsoft.Research.Naiad.AzureSupport
Microsoft.Research.Naiad.AzureSupport
- v4.0
+ v4.5
512
- Client
+
+
+ ..\..\
+ true
true
@@ -21,6 +24,7 @@
DEBUG;TRACE
prompt
4
+ false
pdbonly
@@ -30,46 +34,65 @@
prompt
4
bin\Release\Microsoft.Research.Naiad.AzureSupport.XML
+ false
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\x64\Release\
+ TRACE
+ bin\Release\Microsoft.Research.Naiad.AzureSupport.XML
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
-
+
False
- ..\..\packages\Microsoft.Data.Edm.5.6.1\lib\net40\Microsoft.Data.Edm.dll
+ ..\..\packages\Microsoft.Data.Edm.5.6.2\lib\net40\Microsoft.Data.Edm.dll
-
+
False
- ..\..\packages\Microsoft.Data.OData.5.6.1\lib\net40\Microsoft.Data.OData.dll
+ ..\..\packages\Microsoft.Data.OData.5.6.2\lib\net40\Microsoft.Data.OData.dll
-
+
False
- ..\..\packages\Microsoft.Data.Services.Client.5.6.1\lib\net40\Microsoft.Data.Services.Client.dll
+ ..\..\packages\Microsoft.Data.Services.Client.5.6.2\lib\net40\Microsoft.Data.Services.Client.dll
-
- False
- ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll
+
+ ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
-
+
False
- ..\..\packages\WindowsAzure.Storage.3.1.0.1\lib\net40\Microsoft.WindowsAzure.Storage.dll
+ ..\..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
False
- ..\..\packages\Newtonsoft.Json.6.0.2\lib\net40\Newtonsoft.Json.dll
+ ..\..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll
-
+
False
- ..\..\packages\Rx-Core.2.2.2\lib\net40\System.Reactive.Core.dll
+ ..\..\packages\Rx-Core.2.2.5\lib\net40\System.Reactive.Core.dll
-
+
False
- ..\..\packages\Rx-Interfaces.2.2.2\lib\net40\System.Reactive.Interfaces.dll
+ ..\..\packages\Rx-Interfaces.2.2.5\lib\net40\System.Reactive.Interfaces.dll
-
+
False
- ..\..\packages\System.Spatial.5.6.1\lib\net40\System.Spatial.dll
+ ..\..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll
@@ -78,6 +101,9 @@
+
+ Properties\SharedAssemblyInfo.cs
+
@@ -91,6 +117,10 @@
{bdc6546c-7ba0-472b-b260-0d596b6152e4}
Lindi
+
+ {0dca9543-ff9d-48d6-9748-a966dc39c35d}
+ Storage
+
@@ -98,6 +128,13 @@
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Frameworks/AzureSupport/Properties/AssemblyInfo.cs b/Frameworks/AzureSupport/Properties/AssemblyInfo.cs
index 86a5e33..8458a73 100644
--- a/Frameworks/AzureSupport/Properties/AssemblyInfo.cs
+++ b/Frameworks/AzureSupport/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -26,31 +26,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Research.Naiad.AzureSupport")]
-[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Microsoft.Research.Naiad.AzureSupport")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3d489523-573a-4d15-a7ef-ce273702c39d")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.2")]
-[assembly: AssemblyFileVersion("0.4.2")]
diff --git a/Frameworks/AzureSupport/Storage.cs b/Frameworks/AzureSupport/Storage.cs
index 3758f3c..bf442f9 100644
--- a/Frameworks/AzureSupport/Storage.cs
+++ b/Frameworks/AzureSupport/Storage.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -37,6 +37,8 @@
using Microsoft.Research.Naiad.Serialization;
using Microsoft.Research.Naiad.Input;
+using Microsoft.Research.Naiad.Frameworks.Storage;
+
namespace Microsoft.Research.Naiad.Frameworks.Azure
{
///
@@ -143,7 +145,7 @@ public static Stream ReadFromAzureBlobs(this Computatio
/// Naiad stream containing the records extracted from files in the Azure directory
public static Stream ReadBinaryFromAzureBlobs(this Computation manager, CloudBlobContainer container, string prefix)
{
- return manager.ReadFromAzureBlobs(container, prefix, stream => GetNaiadReaderEnumerable(stream, manager.Controller.SerializationFormat));
+ return manager.ReadFromAzureBlobs(container, prefix, stream => Utils.GetNaiadReaderEnumerable(stream));
}
///
@@ -188,37 +190,6 @@ public static Stream ReadFromAzureTable(this Computatio
return tables.AsNaiadStream(manager).SelectMany(x => x.ExecuteQuery(query));
}
- ///
- /// Enumerates lines of text from a stream
- ///
- /// source stream
- /// Each line of text in the source stream
- internal static IEnumerable ReadLines(this System.IO.Stream stream)
- {
- using (var reader = new System.IO.StreamReader(stream))
- {
- while (!reader.EndOfStream)
- yield return reader.ReadLine();
- }
- }
-
- ///
- /// Enumerates records from a stream in the Naiad serialization format.
- ///
- /// Type of record in the stream
- /// A stream containing records serialized in the Naiad messaging format
- /// code generator
- /// An enumeration of records in the stream
- internal static IEnumerable GetNaiadReaderEnumerable(System.IO.Stream stream, SerializationFormat codeGenerator)
- {
- NaiadReader reader = new NaiadReader(stream, codeGenerator);
- NaiadSerialization deserializer = codeGenerator.GetSerializer();
- TRecord nextElement;
- while (reader.TryRead(deserializer, out nextElement))
- yield return nextElement;
- }
-
-
#endregion
#region Azure file-writing extension methods
@@ -243,7 +214,7 @@ public static Subscription WriteToAzureBlobs(this Stream(this StreamSubscription corresponding to the Azure writer
public static Subscription WriteBinaryToAzureBlobs(this Stream source, CloudBlobContainer container, string format)
{
- return source.WriteToAzureBlobs(container, format, stream => GetNaiadWriterObserver(stream, source.ForStage.Computation.Controller.SerializationFormat));
- }
-
- ///
- /// Returns an record observer that writes records to the given stream in the Naiad message format.
- ///
- /// Type of records to be written
- /// Target I/O stream
- /// code generator
- /// A record observer that writes records to the given stream.
- internal static IObserver GetNaiadWriterObserver(System.IO.Stream stream, SerializationFormat codeGenerator)
- {
- NaiadWriter writer = new NaiadWriter(stream, codeGenerator);
- return Observer.Create(r =>
- {
- writer.Write(r);
- },
- () => writer.Dispose());
+ return source.WriteToAzureBlobs(container, format, stream => Utils.GetNaiadWriterObserver(stream, source.ForStage.Computation.Controller.SerializationFormat));
}
///
diff --git a/Frameworks/AzureSupport/app.config b/Frameworks/AzureSupport/app.config
index 131adf3..fc87146 100644
--- a/Frameworks/AzureSupport/app.config
+++ b/Frameworks/AzureSupport/app.config
@@ -4,20 +4,24 @@
-
+
-
+
-
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/Frameworks/AzureSupport/packages.config b/Frameworks/AzureSupport/packages.config
index 509d1e0..b1295d7 100644
--- a/Frameworks/AzureSupport/packages.config
+++ b/Frameworks/AzureSupport/packages.config
@@ -1,12 +1,12 @@

-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Frameworks/DifferentialDataflow/Collection.cs b/Frameworks/DifferentialDataflow/Collection.cs
index cc0b650..f522c3c 100644
--- a/Frameworks/DifferentialDataflow/Collection.cs
+++ b/Frameworks/DifferentialDataflow/Collection.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionInterfaces.cs b/Frameworks/DifferentialDataflow/CollectionInterfaces.cs
index ca4f922..a9f331c 100644
--- a/Frameworks/DifferentialDataflow/CollectionInterfaces.cs
+++ b/Frameworks/DifferentialDataflow/CollectionInterfaces.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -40,7 +40,7 @@ namespace Microsoft.Research.Naiad.Frameworks.DifferentialDataflow
/// The Differential Dataflow operators are defined in terms of objects, each of which wraps
/// a Naiad stream and allows it to be interpreted with multiset semantics.
///
- /// The class is the Differential Dataflow–specific wrapper for the Naiad
+ /// The class is the Differential Dataflow–specific wrapper for the Naiad
/// class.
///
///
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTrace.cs b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTrace.cs
index 06295ce..fb09990 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTrace.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTrace.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithAggregation.cs b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithAggregation.cs
index 04b58e7..e036c13 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithAggregation.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithAggregation.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithHeap.cs b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithHeap.cs
index 9ce155b..3769645 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithHeap.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithHeap.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithoutHeap.cs b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithoutHeap.cs
index 7dffd16..a843a24 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithoutHeap.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/CollectionTraceWithoutHeap.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/Heaps.cs b/Frameworks/DifferentialDataflow/CollectionTrace/Heaps.cs
index 30e206e..a770bc9 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/Heaps.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/Heaps.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/Increments.cs b/Frameworks/DifferentialDataflow/CollectionTrace/Increments.cs
index f8de2be..56daeb2 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/Increments.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/Increments.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CollectionTrace/OffsetLength.cs b/Frameworks/DifferentialDataflow/CollectionTrace/OffsetLength.cs
index ff7efba..c660f87 100644
--- a/Frameworks/DifferentialDataflow/CollectionTrace/OffsetLength.cs
+++ b/Frameworks/DifferentialDataflow/CollectionTrace/OffsetLength.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CommonNaiadables.cs b/Frameworks/DifferentialDataflow/CommonNaiadables.cs
index 6362b6e..cf81caf 100644
--- a/Frameworks/DifferentialDataflow/CommonNaiadables.cs
+++ b/Frameworks/DifferentialDataflow/CommonNaiadables.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/CoreGenerics.cs b/Frameworks/DifferentialDataflow/CoreGenerics.cs
index e1b4073..76e0f14 100644
--- a/Frameworks/DifferentialDataflow/CoreGenerics.cs
+++ b/Frameworks/DifferentialDataflow/CoreGenerics.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/DifferentialDataflow.csproj b/Frameworks/DifferentialDataflow/DifferentialDataflow.csproj
index d9232d7..71d74f5 100644
--- a/Frameworks/DifferentialDataflow/DifferentialDataflow.csproj
+++ b/Frameworks/DifferentialDataflow/DifferentialDataflow.csproj
@@ -9,9 +9,10 @@
Properties
Microsoft.Research.Naiad.Frameworks.DifferentialDataflow
Microsoft.Research.Naiad.DifferentialDataflow
- v4.0
+ v4.5
512
- Client
+
+
SAK
SAK
SAK
@@ -49,6 +50,27 @@
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ true
+ bin\Release\Microsoft.Research.Naiad.DifferentialDataflow.xml
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\x64\Release\
+ true
+ bin\Release\Microsoft.Research.Naiad.DifferentialDataflow.xml
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
@@ -59,6 +81,9 @@
+
+ Properties\SharedAssemblyInfo.cs
+
diff --git a/Frameworks/DifferentialDataflow/ExtensionMethods.cs b/Frameworks/DifferentialDataflow/ExtensionMethods.cs
index db48cc3..3b6f530 100644
--- a/Frameworks/DifferentialDataflow/ExtensionMethods.cs
+++ b/Frameworks/DifferentialDataflow/ExtensionMethods.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/InputCollection.cs b/Frameworks/DifferentialDataflow/InputCollection.cs
index 09b6a33..ef37a06 100644
--- a/Frameworks/DifferentialDataflow/InputCollection.cs
+++ b/Frameworks/DifferentialDataflow/InputCollection.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/KeyIndices.cs b/Frameworks/DifferentialDataflow/KeyIndices.cs
index ce7114f..ad0934c 100644
--- a/Frameworks/DifferentialDataflow/KeyIndices.cs
+++ b/Frameworks/DifferentialDataflow/KeyIndices.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/LatticeInternTable.cs b/Frameworks/DifferentialDataflow/LatticeInternTable.cs
index 1d62586..632941e 100644
--- a/Frameworks/DifferentialDataflow/LatticeInternTable.cs
+++ b/Frameworks/DifferentialDataflow/LatticeInternTable.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Microsoft.Research.Naiad.DifferentialDataflow.nuspec b/Frameworks/DifferentialDataflow/Microsoft.Research.Naiad.DifferentialDataflow.nuspec
index b480a22..02a2742 100644
--- a/Frameworks/DifferentialDataflow/Microsoft.Research.Naiad.DifferentialDataflow.nuspec
+++ b/Frameworks/DifferentialDataflow/Microsoft.Research.Naiad.DifferentialDataflow.nuspec
@@ -1,9 +1,9 @@
-
-
+
+
Microsoft.Research.Naiad.DifferentialDataflow
Naiad - Differential Dataflow framework
- 0.4.2-beta
+ 0.5.0-beta
naiadquestions@microsoft.com
naiadquestions@microsoft.com,Microsoft
http://www.apache.org/licenses/LICENSE-2.0.html
@@ -19,7 +19,8 @@
-
+
+
@@ -27,8 +28,11 @@
-
-
-
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Frameworks/DifferentialDataflow/NaiadList.cs b/Frameworks/DifferentialDataflow/NaiadList.cs
index 8442d2d..7348738 100644
--- a/Frameworks/DifferentialDataflow/NaiadList.cs
+++ b/Frameworks/DifferentialDataflow/NaiadList.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStateful.cs b/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStateful.cs
index 4d223f6..c26e2d0 100644
--- a/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStateful.cs
+++ b/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStateful.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStatefulIntKeyed.cs b/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStatefulIntKeyed.cs
index 9184c0d..7aeb76f 100644
--- a/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStatefulIntKeyed.cs
+++ b/Frameworks/DifferentialDataflow/OperatorImplementations/BinaryStatefulIntKeyed.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStateful.cs b/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStateful.cs
index 39cf684..07b8044 100644
--- a/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStateful.cs
+++ b/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStateful.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulIntKeyed.cs b/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulIntKeyed.cs
index 6d1b506..d408911 100644
--- a/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulIntKeyed.cs
+++ b/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulIntKeyed.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulWithAggregation.cs b/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulWithAggregation.cs
index eff9947..0874509 100644
--- a/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulWithAggregation.cs
+++ b/Frameworks/DifferentialDataflow/OperatorImplementations/UnaryStatefulWithAggregation.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Abs.cs b/Frameworks/DifferentialDataflow/Operators/Abs.cs
index aaa50b9..79f86f3 100644
--- a/Frameworks/DifferentialDataflow/Operators/Abs.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Abs.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/AdjustLattice.cs b/Frameworks/DifferentialDataflow/Operators/AdjustLattice.cs
index 7dcc8ba..b5b547b 100644
--- a/Frameworks/DifferentialDataflow/Operators/AdjustLattice.cs
+++ b/Frameworks/DifferentialDataflow/Operators/AdjustLattice.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Aggregate.cs b/Frameworks/DifferentialDataflow/Operators/Aggregate.cs
index 5739e60..dc3c8b0 100644
--- a/Frameworks/DifferentialDataflow/Operators/Aggregate.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Aggregate.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/CoGroupBy.cs b/Frameworks/DifferentialDataflow/Operators/CoGroupBy.cs
index b379d5c..a3cc78e 100644
--- a/Frameworks/DifferentialDataflow/Operators/CoGroupBy.cs
+++ b/Frameworks/DifferentialDataflow/Operators/CoGroupBy.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Concat.cs b/Frameworks/DifferentialDataflow/Operators/Concat.cs
index 6c63e32..dc25054 100644
--- a/Frameworks/DifferentialDataflow/Operators/Concat.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Concat.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Consolidate.cs b/Frameworks/DifferentialDataflow/Operators/Consolidate.cs
index f290643..78ffeb8 100644
--- a/Frameworks/DifferentialDataflow/Operators/Consolidate.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Consolidate.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Count.cs b/Frameworks/DifferentialDataflow/Operators/Count.cs
index 44f5a13..5bd1638 100644
--- a/Frameworks/DifferentialDataflow/Operators/Count.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Count.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Distinct.cs b/Frameworks/DifferentialDataflow/Operators/Distinct.cs
index 2c78fe8..15c39ae 100644
--- a/Frameworks/DifferentialDataflow/Operators/Distinct.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Distinct.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Except.cs b/Frameworks/DifferentialDataflow/Operators/Except.cs
index b6c3ab9..5b6b147 100644
--- a/Frameworks/DifferentialDataflow/Operators/Except.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Except.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/FixedPoint.cs b/Frameworks/DifferentialDataflow/Operators/FixedPoint.cs
index eac6ec9..6b030b4 100644
--- a/Frameworks/DifferentialDataflow/Operators/FixedPoint.cs
+++ b/Frameworks/DifferentialDataflow/Operators/FixedPoint.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/GroupBy.cs b/Frameworks/DifferentialDataflow/Operators/GroupBy.cs
index f2ed407..5ab8b3c 100644
--- a/Frameworks/DifferentialDataflow/Operators/GroupBy.cs
+++ b/Frameworks/DifferentialDataflow/Operators/GroupBy.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Intersect.cs b/Frameworks/DifferentialDataflow/Operators/Intersect.cs
index 5597614..e62a7ea 100644
--- a/Frameworks/DifferentialDataflow/Operators/Intersect.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Intersect.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Join.cs b/Frameworks/DifferentialDataflow/Operators/Join.cs
index f95bd82..b3aac7e 100644
--- a/Frameworks/DifferentialDataflow/Operators/Join.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Join.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Max.cs b/Frameworks/DifferentialDataflow/Operators/Max.cs
index a14123f..f608a7a 100644
--- a/Frameworks/DifferentialDataflow/Operators/Max.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Max.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Min.cs b/Frameworks/DifferentialDataflow/Operators/Min.cs
index 8ffcc1b..d16d031 100644
--- a/Frameworks/DifferentialDataflow/Operators/Min.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Min.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Monitor.cs b/Frameworks/DifferentialDataflow/Operators/Monitor.cs
index 4af217f..47ee6c0 100644
--- a/Frameworks/DifferentialDataflow/Operators/Monitor.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Monitor.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -82,4 +82,4 @@ public Monitor(int index, Stage collection, bool immutableInput, Action,T>>();
}
}
-}
\ No newline at end of file
+}
diff --git a/Frameworks/DifferentialDataflow/Operators/Prioritize.cs b/Frameworks/DifferentialDataflow/Operators/Prioritize.cs
index 78d7faa..9bf4f44 100644
--- a/Frameworks/DifferentialDataflow/Operators/Prioritize.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Prioritize.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Select.cs b/Frameworks/DifferentialDataflow/Operators/Select.cs
index a93fca3..4f9a177 100644
--- a/Frameworks/DifferentialDataflow/Operators/Select.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Select.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/SelectMany.cs b/Frameworks/DifferentialDataflow/Operators/SelectMany.cs
index 238c3f8..dd39db8 100644
--- a/Frameworks/DifferentialDataflow/Operators/SelectMany.cs
+++ b/Frameworks/DifferentialDataflow/Operators/SelectMany.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Sum.cs b/Frameworks/DifferentialDataflow/Operators/Sum.cs
index 4116da1..afbef4b 100644
--- a/Frameworks/DifferentialDataflow/Operators/Sum.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Sum.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/SymmetricDifference.cs b/Frameworks/DifferentialDataflow/Operators/SymmetricDifference.cs
index ba7a168..3cf9fa7 100644
--- a/Frameworks/DifferentialDataflow/Operators/SymmetricDifference.cs
+++ b/Frameworks/DifferentialDataflow/Operators/SymmetricDifference.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -38,4 +38,4 @@ protected override Int64 WeightFunction(Int64 weight1, Int64 weight2)
public SymmetricDifference(int index, Stage collection, bool input1Immutable, bool input2Immutable)
: base(index, collection, input1Immutable, input2Immutable) { }
}
-}
\ No newline at end of file
+}
diff --git a/Frameworks/DifferentialDataflow/Operators/Union.cs b/Frameworks/DifferentialDataflow/Operators/Union.cs
index b4428ce..86b102a 100644
--- a/Frameworks/DifferentialDataflow/Operators/Union.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Union.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Operators/Where.cs b/Frameworks/DifferentialDataflow/Operators/Where.cs
index 2d7691f..99c402b 100644
--- a/Frameworks/DifferentialDataflow/Operators/Where.cs
+++ b/Frameworks/DifferentialDataflow/Operators/Where.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/DifferentialDataflow/Properties/AssemblyInfo.cs b/Frameworks/DifferentialDataflow/Properties/AssemblyInfo.cs
index 7cae207..b750492 100644
--- a/Frameworks/DifferentialDataflow/Properties/AssemblyInfo.cs
+++ b/Frameworks/DifferentialDataflow/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -26,31 +26,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Research.Naiad.DifferentialDataflow")]
-[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Microsoft.Research.Naiad.DifferentialDataflow")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("da38e2f3-2364-4d1b-9ee6-8ee21485aebe")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.2")]
-[assembly: AssemblyFileVersion("0.4.2")]
diff --git a/Frameworks/DifferentialDataflow/Remoting.cs b/Frameworks/DifferentialDataflow/Remoting.cs
index 31c597a..a45f889 100644
--- a/Frameworks/DifferentialDataflow/Remoting.cs
+++ b/Frameworks/DifferentialDataflow/Remoting.cs
@@ -1,5 +1,5 @@
/*
- * Naiad ver. 0.4
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
diff --git a/Frameworks/GraphLINQ/GraphLINQ.cs b/Frameworks/GraphLINQ/GraphLINQ.cs
index b79880a..56c3a7c 100644
--- a/Frameworks/GraphLINQ/GraphLINQ.cs
+++ b/Frameworks/GraphLINQ/GraphLINQ.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -390,7 +390,7 @@ public static Stream, TTime> TransmitAlong(
if (edges == null) throw new ArgumentNullException("edges");
var compacted = edges.Compact(); // could be cached and retrieved as needed
- return compacted.NewBinaryStage(nodes, (i, v) => new GraphJoin(i, v, (x, y) => x.value), null, x => x.node.index, null, "TransmitAlong");
+ return compacted.NewBinaryStage(nodes, (i, s) => new GraphJoinVertex(i, s), null, x => x.node.index, null, "TransmitAlong");
}
@@ -417,7 +417,7 @@ public static Stream, TTime> TransmitAlong new GraphJoin(i, v, valueSelector), null, x => x.node.index, null, "TransmitAlong");
+ return compacted.NewBinaryStage(nodes, (i, v) => new GraphJoinVertex(i, v, valueSelector), null, x => x.node.index, null, "TransmitAlong");
}
///
@@ -485,7 +485,19 @@ public static Stream, TTime> NodeAggregate(
{
if (nodes == null) throw new ArgumentNullException("nodes");
if (combiner == null) throw new ArgumentNullException("combiner");
+
+#if true
+ var stage = Foundry.NewStage(nodes.Context, (i,s) => new NodeAggregatorVertex(i, s, combiner, nodes.ForStage.Placement.Count), "Aggregator");
+
+ Action[], int[], int> action = (data, dsts, len) => { for (int i = 0; i < len; i++) dsts[i] = data[i].node.index; };
+
+ var input1 = stage.NewInput(nodes, (message, vertex) => vertex.OnReceive(message), x => x.node.index, action);
+ var output = stage.NewOutput(vertex => vertex.Output, x => x.node.index);
+
+ return output;
+#else
return nodes.NewUnaryStage((i, v) => new NodeAggregatorVertex(i, v, combiner, nodes.ForStage.Placement.Count), x => x.node.index, x => x.node.index, "Aggregator");
+#endif
}
///
@@ -533,7 +545,43 @@ public static Stream, TTime> StateMachine new NodeUnaryStateMachine(i, v, transitionSelector, defaultState), x => x.node.index, x => x.node.index, "NodeStateMachine");
+
+ var stage = Foundry.NewStage(nodes.Context, (i, s) => new NodeUnaryStateMachine(i, s, transitionSelector, defaultState), "StateMachine");
+
+ Action[], int[], int> action = (data, dsts, len) => { for (int i = 0; i < len; i++) dsts[i] = data[i].node.index; };
+
+ var input1 = stage.NewInput(nodes, (message, vertex) => vertex.OnReceive(message), x => x.node.index, action);
+ var output = stage.NewOutput(vertex => vertex.Output, x => x.node.index);
+
+ return output;
+ }
+
+ ///
+ /// Given a stream of values associated with nodes, maintains a state machine for each node,
+ /// and produces a stream of new states on each transition, based on the given .
+ ///
+ /// The type of value associated with each node.
+ /// The type of state associated with each node.
+ /// The type of timestamp on each record.
+ /// The stream of nodes with values.
+ /// A function from current value and state, to new state.
+ /// The default state associated with a node.
+ /// The stream of changed states at each node.
+ public static Stream, TTime> StateMachine(this Stream, TTime> nodes, Func transitionSelector, TState defaultState)
+ where TTime : Time
+ where TState : IEquatable
+ {
+ if (nodes == null) throw new ArgumentNullException("nodes");
+ if (transitionSelector == null) throw new ArgumentNullException("transitionSelector");
+
+ var stage = Foundry.NewStage(nodes.Context, (i, s) => new NodeUnaryStateMachine(i, s, transitionSelector, defaultState), "StateMachine");
+
+ Action[], int[], int> action = (data, dsts, len) => { for (int i = 0; i < len; i++) dsts[i] = data[i].node.index; };
+
+ var input1 = stage.NewInput(nodes, (message, vertex) => vertex.OnReceive(message), x => x.node.index, action);
+ var output = stage.NewOutput(vertex => vertex.Output, x => x.node.index);
+
+ return output;
}
///
@@ -564,7 +612,7 @@ public static Stream, TTime> StateMachine
/// element type
- private struct Option
+ internal struct Option
{
public readonly TElement Value;
public readonly bool IsValid;
@@ -576,23 +624,10 @@ private struct Option
public Option(TElement value) { this.Value = value; this.IsValid = true; }
}
- ///
- /// Given a stream of values associated with nodes, maintains a state machine for each node,
- /// and produces a stream of new states on each transition, based on the given .
- ///
- /// The type of value associated with each node.
- /// The type of state associated with each node.
- /// The type of timestamp on each record.
- /// The stream of nodes with values.
- /// A function from current value and state, to new state.
- /// The stream of changed states at each node.
- public static Stream, TTime> StateMachine(this Stream, TTime> nodes, Func transitionSelector)
+ internal static Stream, TTime> FilterOptions(this Stream>, TTime> stream)
where TTime : Time
- where TState : IEquatable
{
- if (nodes == null) throw new ArgumentNullException("nodes");
- if (transitionSelector == null) throw new ArgumentNullException("transitionSelector");
- return nodes.StateMachine(transitionSelector, default(TState));
+ return stream.NewUnaryStage((i, s) => new FilterOptionsVertex(i, s), x => x.node.index, x => x.node.index, "FilterOptions");
}
///
@@ -604,19 +639,18 @@ public static Stream, TTime> StateMachineThe type of timestamp on each record.
/// The stream of nodes with values.
/// A function from current value and state, to new state.
- /// The default state associated with a node.
/// The stream of changed states at each node.
- public static Stream, TTime> StateMachine(this Stream, TTime> nodes, Func transitionSelector, TState defaultState)
+ public static Stream, TTime> StateMachine(this Stream, TTime> nodes, Func transitionSelector)
where TTime : Time
where TState : IEquatable
{
if (nodes == null) throw new ArgumentNullException("nodes");
if (transitionSelector == null) throw new ArgumentNullException("transitionSelector");
- return nodes.StateMachine((v, s) => { var n = transitionSelector(v, s); return n.PairWith(s.Equals(n) ? new Option() : new Option(n)); }, defaultState)
- .Where(x => x.value.IsValid)
- .Select(x => x.node.WithValue(x.value.Value));
+ return nodes.StateMachine(transitionSelector, default(TState));
}
+
+
///
/// Given a stream of values associated with nodes, maintains a state machine for each node,
/// and produces outputs on each transition, based on the given .
@@ -768,6 +802,8 @@ public override void OnNotify(TTime time)
public NodeAggregatorVertex(int index, Stage stage, Func aggregate, int parts)
: base(index, stage)
{
+ this.Entrancy = 5;
+
this.values = new Dictionary();
this.update = aggregate;
@@ -831,10 +867,10 @@ public override void OnReceive2(Message, TTime> message)
{
for (int i = 0; i < message.length; i++)
{
- var index = message.payload[i].node.index;
- if (index >= this.state.Length)
+ var localIndex = message.payload[i].node.index / this.parts;
+ if (localIndex >= this.state.Length)
{
- var newState = new TState[Math.Max(index + 1, 2 * this.state.Length)];
+ var newState = new TState[Math.Max(localIndex + 1, 2 * this.state.Length)];
for (int j = 0; j < this.state.Length; j++)
newState[j] = this.state[j];
@@ -845,7 +881,7 @@ public override void OnReceive2(Message, TTime> message)
this.state = newState;
}
- this.state[message.payload[i].node.index / this.parts] = message.payload[i].value;
+ this.state[localIndex] = message.payload[i].value;
}
}
@@ -940,8 +976,75 @@ public NodeUnaryStateMachine(int index, Stage vertex, Func : UnaryVertex, NodeWithValue, TTime>
+ where TTime : Time
+ where TState : IEquatable
+ {
+ private TState[] state;
+ private readonly Func transition;
+
+ private readonly int parts;
+ private readonly TState defaultState;
+
+ public override void OnReceive(Message, TTime> message)
+ {
+ var output = this.Output.GetBufferForTime(message.time);
+ for (int i = 0; i < message.length; i++)
+ {
+ var record = message.payload[i];
+ var localIndex = record.node.index / this.parts;
+
+ if (this.state.Length <= localIndex)
+ {
+ var newState = new TState[Math.Max(localIndex + 1, 2 * this.state.Length)];
+ for (int j = 0; j < this.state.Length; j++)
+ newState[j] = this.state[j];
+
+ for (int j = this.state.Length; j < newState.Length; j++)
+ newState[j] = defaultState;
+
+ this.state = newState;
+ }
+
+ var transitionResult = this.transition(record.value, this.state[localIndex]);
+
+ if (!this.state[localIndex].Equals(transitionResult))
+ {
+ this.state[localIndex] = transitionResult;
+ output.Send(record.node.WithValue(transitionResult));
+ }
+ }
+ }
+
+ public NodeUnaryStateMachine(int index, Stage vertex, Func transition, TState defaultState)
+ : base(index, vertex)
+ {
+ this.state = new TState[] { };
+
+ this.transition = transition;
+
+ this.parts = vertex.Placement.Count;
+ this.defaultState = defaultState;
+ }
+ }
+
+ internal class FilterOptionsVertex : UnaryVertex>, NodeWithValue, TTime>
+ where TTime : Time
+ {
+ public override void OnReceive(Message>, TTime> message)
+ {
+ var output = this.Output.GetBufferForTime(message.time);
+ for (int i = 0; i < message.length; i++)
+ if (message.payload[i].value.IsValid)
+ output.Send(message.payload[i].node.WithValue(message.payload[i].value.Value));
+ }
+
+ public FilterOptionsVertex(int index, Stage stage) : base(index, stage) { }
+ }
+
// vertex managing a CompactGraph fragment, processing corresponding values by applying a reducer.
- internal class GraphJoin : BinaryVertex, NodeWithValue, T>
+ internal class GraphJoinVertex : BinaryVertex, NodeWithValue, T>
where T : Time
{
private CompactGraph graph;
@@ -994,7 +1097,7 @@ public override void OnNotify(T time)
this.toProcess = new List>();
}
- public GraphJoin(int index, Stage vertex, Func, Node, TOutput> valueSelector)
+ public GraphJoinVertex(int index, Stage vertex, Func, Node, TOutput> valueSelector)
: base(index, vertex)
{
this.graph = new CompactGraph();
@@ -1005,6 +1108,68 @@ public GraphJoin(int index, Stage vertex, Func, Node, T
}
}
+ // vertex managing a CompactGraph fragment, processing corresponding values by applying a reducer.
+ internal class GraphJoinVertex : BinaryVertex, NodeWithValue, T>
+ where T : Time
+ {
+ private CompactGraph graph;
+
+ private List> toProcess;
+
+ public override void OnReceive1(Message message)
+ {
+ for (int i = 0; i < message.length; i++)
+ this.graph = message.payload[i];
+
+ this.NotifyAt(message.time);
+ }
+
+ public override void OnReceive2(Message, T> message)
+ {
+ if (this.graph.Nodes == null && message.length > 0)
+ {
+ for (int i = 0; i < message.length; i++)
+ this.toProcess.Add(message.payload[i]);
+ }
+ else
+ {
+ var output = this.Output.GetBufferForTime(message.time);
+ for (int i = 0; i < message.length; i++)
+ {
+ var record = message.payload[i];
+ var localName = record.node.index / this.Stage.Placement.Count;
+
+ if (localName + 1 < this.graph.Nodes.Length)
+ for (int j = this.graph.Nodes[localName]; j < this.graph.Nodes[localName + 1]; j++)
+ output.Send(this.graph.Edges[j].WithValue(record.value));
+ }
+ }
+ }
+
+ public override void OnNotify(T time)
+ {
+ var output = this.Output.GetBufferForTime(time);
+ foreach (var record in this.toProcess.AsEnumerable())
+ {
+ var localName = record.node.index / this.Stage.Placement.Count;
+ if (localName + 1 < this.graph.Nodes.Length)
+ for (int j = this.graph.Nodes[localName]; j < this.graph.Nodes[localName + 1]; j++)
+ output.Send(this.graph.Edges[j].WithValue(record.value));
+ }
+
+ this.toProcess = new List>();
+ }
+
+ public GraphJoinVertex(int index, Stage stage)
+ : base(index, stage)
+ {
+ this.graph = new CompactGraph();
+ this.toProcess = new List>();
+
+ this.Entrancy = 5;
+ }
+ }
+
// dense list of edge destinations and node offsets.
internal struct CompactGraph
{
@@ -1349,4 +1514,4 @@ public Stream, Epoch> FinalRenamings
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Frameworks/GraphLINQ/GraphLINQ.csproj b/Frameworks/GraphLINQ/GraphLINQ.csproj
index 4166ab0..5cb94ef 100644
--- a/Frameworks/GraphLINQ/GraphLINQ.csproj
+++ b/Frameworks/GraphLINQ/GraphLINQ.csproj
@@ -1,5 +1,5 @@

-
+
Debug
@@ -9,9 +9,10 @@
Properties
Microsoft.Research.Naiad.GraphLINQ
Microsoft.Research.Naiad.GraphLINQ
- v4.0
+ v4.5
512
- Client
+
+
true
@@ -21,6 +22,7 @@
DEBUG;TRACE
prompt
4
+ false
pdbonly
@@ -29,10 +31,31 @@
TRACE
prompt
4
+ false
bin\Release\Microsoft.Research.Naiad.GraphLINQ.xml
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ bin\Release\Microsoft.Research.Naiad.GraphLINQ.xml
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\x64\Release\
+ TRACE
+ bin\Release\Microsoft.Research.Naiad.GraphLINQ.xml
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
@@ -43,6 +66,9 @@
+
+ Properties\SharedAssemblyInfo.cs
+
diff --git a/Frameworks/GraphLINQ/Microsoft.Research.Naiad.GraphLINQ.nuspec b/Frameworks/GraphLINQ/Microsoft.Research.Naiad.GraphLINQ.nuspec
index 1d64780..b7d94b6 100644
--- a/Frameworks/GraphLINQ/Microsoft.Research.Naiad.GraphLINQ.nuspec
+++ b/Frameworks/GraphLINQ/Microsoft.Research.Naiad.GraphLINQ.nuspec
@@ -1,9 +1,9 @@
-
-
+
+
Microsoft.Research.Naiad.GraphLINQ
Naiad - GraphLINQ framework
- 0.4.2-beta
+ 0.5.0-beta
naiadquestions@microsoft.com
naiadquestions@microsoft.com,Microsoft
http://www.apache.org/licenses/LICENSE-2.0.html
@@ -19,7 +19,8 @@
-
+
+
@@ -27,8 +28,11 @@
-
-
-
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Frameworks/GraphLINQ/Properties/AssemblyInfo.cs b/Frameworks/GraphLINQ/Properties/AssemblyInfo.cs
index 664d3d6..86d2755 100644
--- a/Frameworks/GraphLINQ/Properties/AssemblyInfo.cs
+++ b/Frameworks/GraphLINQ/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
-/*
- * Naiad ver. 0.4
+/*
+ * Naiad ver. 0.5
* Copyright (c) Microsoft Corporation
* All rights reserved.
*
@@ -26,31 +26,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Research.Naiad.GraphLINQ")]
-[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Microsoft.Research.Naiad.GraphLINQ")]
-[assembly: AssemblyCopyright("Copyright © Microsoft Corporation. All rights reserved.")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("28c42104-7500-405f-842b-d25d5e4c5dda")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.2")]
-[assembly: AssemblyFileVersion("0.4.2")]
diff --git a/Frameworks/HdfsSupport/Hdfs.cs b/Frameworks/HdfsSupport/Hdfs.cs
new file mode 100644
index 0000000..4a3fa59
--- /dev/null
+++ b/Frameworks/HdfsSupport/Hdfs.cs
@@ -0,0 +1,386 @@
+/*
+ * Naiad ver. 0.5
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
+ * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR
+ * A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache Version 2.0 License for specific language governing
+ * permissions and limitations under the License.
+ */
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+
+using Microsoft.Research.Peloponnese.Hdfs;
+
+using Microsoft.Research.Naiad.Input;
+using Microsoft.Research.Naiad.Dataflow;
+using Microsoft.Research.Naiad.Frameworks.Lindi;
+using Microsoft.Research.Naiad.Frameworks.Storage;
+using Microsoft.Research.Naiad.Frameworks.Storage.Dfs;
+using Microsoft.Research.Naiad.Frameworks.WorkGenerator;
+using Microsoft.Research.Naiad.Serialization;
+
+namespace Microsoft.Research.Naiad.Frameworks.Hdfs
+{
+ ///
+ /// The Hdfs framework supports reading and writing Hdfs files using the Java-based native Hdfs protocol. It requires Java and
+ /// the Hdfs jar files to be installed locally, and will throw an exception if they are not installed. The environment JAVA_HOME
+ /// must be set to the location of the Java installation, and HADOOP_COMMON_HOME must be set to the location of the Hadoop jar files
+ /// including those for Hdfs
+ ///
+ class NamespaceDoc
+ {
+
+ }
+
+ #region extension methods
+ ///
+ /// extension methods for working with Java-protocol Hdfs files
+ ///
+ public static class ExtensionMethods
+ {
+ ///
+ /// Read a stream of path names (file or directory names) each of which corresponds to a collection of HDFS files
+ /// serialized as lines of text. Concatenate all the lines of the files to the output, in an unspecified order.
+ ///
+ /// time of the input and output records
+ /// stream of input paths
+ /// stream of text lines in the hdfs files
+ public static Stream FromHdfsText(this Stream input) where TTime : Time
+ {
+ return input.GenerateWork(
+ time => new DfsTextCoordinator(new HdfsClient()),
+ (workerIndex, time) => new DfsTextWorker(new HdfsClient(), 256));
+ }
+
+ ///
+ /// Read a collection of HDFS files serialized as lines of text. Concatenate all the lines of the files to the output,
+ /// in an unspecified order.
+ ///
+ /// Naiad computation
+ /// path of the file or directory to read
+ /// stream of text lines in the hdfs files
+ public static Stream ReadHdfsTextCollection(
+ this Computation manager, Uri fileOrDirectoryPath)
+ {
+ return new Uri[] { fileOrDirectoryPath }
+ .AsNaiadStream(manager)
+ // this distinct ensures that the same code can be run at every process without reading files multiple times
+ .Distinct()
+ .GenerateWork(
+ time => new DfsTextCoordinator(new HdfsClient()),
+ (workerIndex, time) => new DfsTextWorker(new HdfsClient(), 256));
+ }
+
+ ///
+ /// Read a stream of path names (file or directory names) each of which corresponds to a collection of HDFS files
+ /// serialized in a custom binary format. Concatenate all the records to the output, in an unspecified order.
+ ///
+ /// output record type
+ /// time of the input and output records
+ /// stream of input paths
+ /// custom deserializer function to convert a stream of bytes into a sequence of records
+ /// stream of records in the hdfs files
+ public static Stream FromHdfs(
+ this Stream input,
+ Func>> deserialize) where TTime : Time
+ {
+ return input.GenerateWork(
+ time => new DfsFileCoordinator(new HdfsClient()),
+ (workerIndex, time) => new DfsFileWorker(new HdfsClient(), deserialize));
+ }
+
+ ///
+ /// Read a collection of HDFS files serialized in a custom binary format. Concatenate all the records to the output,
+ /// in an unspecified order.
+ ///
+ /// output record type
+ /// Naiad computation
+ /// path of the file or directory to read
+ /// custom deserializer function to convert a stream of bytes into a sequence of records
+ /// stream of records in the hdfs files
+ public static Stream ReadHdfsCollection(
+ this Computation manager, Uri fileOrDirectoryPath,
+ Func>> deserialize)
+ {
+ return new Uri[] { fileOrDirectoryPath }
+ .AsNaiadStream(manager)
+ // this distinct ensures that the same code can be run at every process without reading files multiple times
+ .Distinct()
+ .GenerateWork(
+ time => new DfsFileCoordinator(new HdfsClient()),
+ (workerIndex, time) => new DfsFileWorker(new HdfsClient(), deserialize));
+ }
+
+ ///
+ /// Read a stream of path names (file or directory names) each of which corresponds to a collection of HDFS files
+ /// serialized in the default Naiad binary format. Concatenate all the records to the output, in an unspecified order.
+ ///
+ /// output record type
+ /// time of the input and output records
+ /// stream of input paths
+ /// stream of records in the hdfs files
+ public static Stream FromHdfsBinary(
+ this Stream input) where TTime : Time
+ {
+ return input.GenerateWork(
+ time => new DfsFileCoordinator(new HdfsClient()),
+ (workerIndex, time) =>
+ new DfsFileWorker(
+ new HdfsClient(),
+ stream => Utils.GetNaiadReaderBatchEnumerable(stream, 256)));
+ }
+
+ ///
+ /// Read a collection of HDFS files serialized in the default Naiad binary format. Concatenate all the records to the output,
+ /// in an unspecified order.
+ ///
+ /// output record type
+ /// Naiad computation
+ /// path of the file or directory to read
+ /// stream of records in the hdfs files
+ public static Stream ReadHdfsBinaryCollection(
+ this Computation manager, Uri fileOrDirectoryPath)
+ {
+ return new Uri[] { fileOrDirectoryPath }
+ .AsNaiadStream(manager)
+ // this distinct ensures that the same code can be run at every process without reading files multiple times
+ .Distinct()
+ .GenerateWork(
+ time => new DfsFileCoordinator(new HdfsClient()),
+ (workerIndex, time) =>
+ new DfsFileWorker(
+ new HdfsClient(),
+ stream => Utils.GetNaiadReaderBatchEnumerable(stream, 256)));
+ }
+
+ ///
+ /// general method to write a stream of records to a collection of HDFS files. The collection is active
+ /// throughout the computation and is closed when the computation terminates: it concatenates records from all
+ /// epochs in an undefined order
+ ///
+ /// type of the records to write
+ /// type of the serializer object
+ /// stream of records to write
+ /// function to generate a filename given a processId, threadId and sequence number
+ /// function to generate a serializer given a Stream to write to
+ /// function to serialize a batch of records given a serializer
+ /// buffer size to use in the serializer
+ /// hdfs block size to use, or -1 for the file system default value
+ /// file size to write before closing the file and opening another one
+ /// handle to wait on until the computation completes
+ public static Subscription WriteHdfsBinary(
+ this Stream source,
+ Func format,
+ Func writerFunction,
+ Action> serialize,
+ int bufferSize,
+ long blockSize,
+ long segmentThreshold) where TWriter : class, IDisposable, IFlushable
+ {
+ return source.WriteBySubscription(
+ format,
+ fileName => new HdfsClient().GetDfsStreamWriter(fileName, bufferSize, blockSize),
+ stream => writerFunction(stream),
+ serialize,
+ segmentThreshold);
+ }
+
+ ///
+ /// method to write a stream of records to a collection of HDFS files using the default Naiad binary serializer.
+ /// The collection is active throughout the computation and is closed when the computation terminates: it concatenates
+ /// records from all epochs in an undefined order
+ ///
+ /// type of the records to write
+ /// stream of records to write
+ /// webhdfs directory to write the partitioned data into
+ /// buffer size to use in the serializer
+ /// hdfs block size to use, or -1 for the file system default value
+ /// file size to write before closing the file and opening another one
+ /// handle to wait on until the computation completes
+ public static Subscription WriteHdfsBinary(
+ this Stream source,
+ Uri prefix,
+ int bufferSize = 1024*1024,
+ long blockSize = -1,
+ long segmentThreshold = 254 * 1024 * 1024)
+ {
+ // make sure we'll be able to write the partitioned data
+ HdfsClient client = new HdfsClient();
+ client.EnsureDirectory(prefix, false);
+
+ return source.WriteHdfsBinary(
+ (processId, threadId, segment) => Utils.DefaultPartFormat(prefix, processId, threadId, segment),
+ stream => new NaiadWriter(stream, source.ForStage.Computation.Controller.SerializationFormat, bufferSize),
+ (writer, arraySegment) =>
+ {
+ for (int i = 0; i < arraySegment.Count; i++)
+ {
+ writer.Write(arraySegment.Array[i]);
+ }
+ },
+ bufferSize, blockSize, segmentThreshold);
+ }
+
+ ///
+ /// general method to write a stream of records to a collection of HDFS files, partitioned by time as well as key.
+ /// Within a given time and part, records are written in an undefined order
+ ///
+ /// type of the records to write
+ /// type of the serializer object
+ /// type of the record time
+ /// stream of records to write
+ /// function to generate a filename given a processId, threadId, time and sequence number
+ /// function to generate a serializer given a Stream to write to
+ /// function to serialize a batch of records given a serializer
+ /// buffer size to use for the serializer
+ /// hdfs block size to use, or -1 for the file system default value
+ /// file size to write before closing the file and opening another one
+ /// stream of filenames written
+ public static Stream ToHdfsBinary(
+ this Stream source,
+ Func format,
+ Func writerFunction,
+ Action> serialize,
+ int bufferSize,
+ long blockSize,
+ long segmentThreshold)
+ where TWriter : class, IDisposable, IFlushable
+ where TTime : Time
+ {
+ return source.WriteByTime(
+ format,
+ () => new HdfsClient(),
+ (client, fileName) => client.GetDfsStreamWriter(fileName, bufferSize, blockSize),
+ stream => writerFunction(stream),
+ serialize,
+ segmentThreshold);
+ }
+
+ ///
+ /// method to write a stream of records to a collection of HDFS files using the default Naiad binary serializer,
+ /// partitioned by time as well as key. Within a given time and part, records are written in an undefined order
+ ///
+ /// type of the records to write
+ /// type of the record time
+ /// stream of records to write
+ /// webhdfs directory to write the partitioned data into
+ /// buffer size to use for the serializer
+ /// hdfs block size to use, or -1 for the file system default value
+ /// file size to write before closing the file and opening another one
+ /// stream of filenames written
+ public static Stream ToHdfsBinary