[REEF-1058] Enable StyleCop.CSharp.LayoutRules and fix violations This enables the following rules: * CurlyBracketsForMultiLineStatementsMustNotShareLine * StatementMustNotBeOnSingleLine * ElementMustNotBeOnSingleLine * CurlyBracketsMustNotBeOmitted * AllAccessorsMustBeMultiLineOrSingleLine * OpeningCurlyBracketsMustNotBeFollowedByBlankLine * ElementDocumentationHeadersMustNotBeFollowedByBlankLine * CodeMustNotContainMultipleBlankLinesInARow * ClosingCurlyBracketsMustNotBePrecededByBlankLine * OpeningCurlyBracketsMustNotBePrecededByBlankLine * ChainedStatementBlocksMustNotBePrecededByBlankLine * WhileDoFooterMustNotBePrecededByBlankLine * SingleLineCommentsMustNotBeFollowedByBlankLine * ElementDocumentationHeaderMustBePrecededByBlankLine * SingleLineCommentMustBePrecededByBlankLine * CodeMustNotContainBlankLinesAtStartOfFile * CodeMustNotContainBlankLinesAtEndOfFile
JIRA: [REEF-1058](https://issues.apache.org/jira/browse/REEF-1058) Pull request: This closes #722 Project: http://git-wip-us.apache.org/repos/asf/reef/repo Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/9cdd62d9 Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/9cdd62d9 Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/9cdd62d9 Branch: refs/heads/master Commit: 9cdd62d993f383ec8b30e0ebab03d67160ef65b5 Parents: b1a555e Author: Mariia Mykhailova <[email protected]> Authored: Thu Dec 10 16:11:35 2015 -0800 Committer: Dongjoon Hyun <[email protected]> Committed: Fri Dec 11 16:44:09 2015 +0900 ---------------------------------------------------------------------- .../JobResourceUploaderTests.cs | 1 - .../API/IJobSubmission.cs | 1 - .../Org.Apache.REEF.Client/API/JobSubmission.cs | 5 +- .../API/JobSubmissionBuilder.cs | 2 - .../Common/DriverFolderPreparationHelper.cs | 2 - .../Common/JobSubmissionResult.cs | 5 +- .../YARN/RESTClient/DataModel/Acls.cs | 1 - .../DataModel/ApplicationFinalState.cs | 2 +- .../RESTClient/DataModel/ApplicationState.cs | 2 +- .../YARN/RESTClient/DataModel/Commands.cs | 1 - .../YARN/RESTClient/DataModel/LocalResources.cs | 1 - .../YARN/RESTClient/YarnClient.cs | 1 - .../YARN/WindowsYarnJobCommandProvider.cs | 1 - .../YARN/YARNREEFClient.cs | 1 - .../Avro/AvroHttpSerializer.cs | 2 +- .../Files/REEFFileNames.cs | 5 +- .../Runtime/Evaluator/Context/ContextManager.cs | 3 +- .../Runtime/Evaluator/Context/ContextRuntime.cs | 3 + .../Runtime/Evaluator/Task/TaskRuntime.cs | 5 +- .../Runtime/Evaluator/Task/TaskStatus.cs | 1 + .../Evaluator/Utils/EvaluatorConfigurations.cs | 1 + .../Runtime/MachineStatus.cs | 5 +- .../Services/ServiceConfiguration.cs | 3 +- .../Bridge/BridgeConfigurationProvider.cs | 1 + .../Bridge/ClrSystemHandlerWrapper.cs | 1 - .../Bridge/DriverBridge.cs | 5 +- .../Bridge/Events/AllocatedEvaluator.cs | 1 - .../Bridge/Events/FailedEvaluator.cs | 1 + .../Evaluator/EvaluatorDescriptorImpl.cs | 1 + .../Evaluator/EvaluatorException.cs | 3 +- .../EvaluatorConfigurationsTests.cs | 1 - lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs | 2 +- .../HelloFailedEvaluatorHandler.cs | 1 - .../HelloREEF.cs | 1 + .../DriverRestart/HelloRestartDriver.cs | 2 +- .../MachineLearning/KMeans/DataVector.cs | 4 +- .../KMeans/KMeansDriverHandlers.cs | 1 + .../MachineLearning/KMeans/KMeansSlaveTask.cs | 1 + lang/cs/Org.Apache.REEF.IMRU.Examples/Run.cs | 1 - .../API/IMRUJobDefinition.cs | 4 +- .../API/IMRUJobDefinitionBuilder.cs | 1 - .../API/PerMapConfigGeneratorSet.cs | 38 ++-- .../InProcess/MapFunctions.cs | 2 +- .../Driver/ContextAndServiceConfiguration.cs | 1 - .../OnREEF/Driver/IMRUDriver.cs | 7 +- .../OnREEF/Parameters/CoresForUpdateTask.cs | 38 ++-- .../OnREEF/Parameters/CoresPerMapper.cs | 38 ++-- .../OnREEF/Parameters/MemoryForUpdateTask.cs | 38 ++-- .../OnREEF/Parameters/MemoryPerMapper.cs | 38 ++-- ...apInputPipelineDataConverterConfiguration.cs | 38 ++-- ...pOutputPipelineDataConverterConfiguration.cs | 38 ++-- .../Parameters/SerializedReduceConfiguration.cs | 38 ++-- .../Parameters/SerializedUpdateConfiguration.cs | 38 ++-- .../Properties/AssemblyInfo.cs | 1 + .../HadoopFileInputPartitionTest.cs | 5 +- .../HadoopFileSystemTest.cs | 1 - lang/cs/Org.Apache.REEF.IO.TestClient/Run.cs | 7 +- .../TestAzureBlockBlobFileSystemE2E.cs | 2 - .../TestFilePartitionInputDataSet.cs | 8 +- .../TestHadoopFileSystem.cs | 5 + .../TestLocalFileSystem.cs | 2 - .../AzureBlob/AzureBlockBlobFileSystem.cs | 3 +- .../AzureBlob/AzureCloudBlobClient.cs | 5 +- .../FileSystem/Hadoop/HDFSCommandRunner.cs | 1 + .../Properties/AssemblyInfo.cs | 2 + .../BroadcastReduceDriver.cs | 1 - .../BroadcastReduceDriverAndTasks/MasterTask.cs | 2 + .../BroadcastReduceDriverAndTasks/SlaveTask.cs | 1 + .../PipelinedSlaveTask.cs | 1 + .../GroupCommunicationTreeTopologyTests.cs | 1 - .../StreamingNetworkServiceTests.cs | 1 + .../Group/Driver/IGroupCommDriver.cs | 1 - .../Driver/Impl/CommunicationGroupDriver.cs | 1 - .../Group/Driver/Impl/GroupCommDriver.cs | 1 - .../Group/Operators/IOperatorSpec.cs | 2 +- .../Operators/Impl/BroadcastOperatorSpec.cs | 1 + .../Group/Operators/Impl/BroadcastReceiver.cs | 3 +- .../Group/Operators/Impl/ReduceOperatorSpec.cs | 3 +- .../Group/Operators/Impl/ReduceReceiver.cs | 3 +- .../Group/Pipelining/IPipelineDataConverter.cs | 3 +- .../Impl/DefaultPipelineDataConverter.cs | 2 - .../Impl/CommunicationGroupNetworkObserver.cs | 1 - .../Group/Task/Impl/NodeStruct.cs | 1 - .../Group/Task/Impl/OperatorTopology.cs | 1 - .../Group/Topology/TaskNode.cs | 3 +- .../Org.Apache.REEF.Tang.Examples/CheckChild.cs | 4 +- .../ForksInjectorInConstructor.cs | 2 +- .../SimpleConstructors.cs | 1 - .../TestClasses.cs | 5 +- lang/cs/Org.Apache.REEF.Tang.Examples/Timer.cs | 4 +- .../TweetExample.cs | 8 +- .../ClassHierarchy/TestClassHierarchy.cs | 12 +- .../ClassHierarchy/TestParameterParser.cs | 24 ++- .../Configuration/TestConfiguration.cs | 1 - .../SmokeTest/RootImplementation.cs | 6 +- .../Tang/TestLegacyConstructors.cs | 2 +- .../Org.Apache.REEF.Tang.Tests/Tang/TestTang.cs | 175 +++++++++++++------ .../Annotations/DefaultImplementation.cs | 1 - .../Org.Apache.REEF.Tang/Annotations/Inject.cs | 3 +- .../cs/Org.Apache.REEF.Tang/Annotations/Name.cs | 3 +- .../Formats/ConfigurationFile.cs | 3 - .../Formats/ConfigurationModuleBuilder.cs | 2 +- .../ClassHierarchy/AbstractNode.cs | 28 ++- .../ClassHierarchy/AvroClassHierarchy.cs | 1 - .../ClassHierarchy/ClassHierarchyImpl.cs | 14 +- .../ClassHierarchy/ClassNodeImpl.cs | 1 - .../ClassHierarchy/ConstructorArgImpl.cs | 1 - .../ClassHierarchy/ConstructorDefImpl.cs | 6 +- .../ClassHierarchy/NodeFactory.cs | 9 +- .../ClassHierarchy/PackageNodeImpl.cs | 3 +- .../ClassHierarchy/ParameterParser.cs | 1 - .../Configuration/ConfigurationBuilderImpl.cs | 25 +-- .../Configuration/CsConfigurationBuilderImpl.cs | 19 +- .../InjectionPlan/Constructor.cs | 4 +- .../InjectionPlan/InjectionFuture.cs | 7 +- .../InjectionPlan/InjectionPlan.cs | 4 +- .../InjectionPlan/InjectorImpl.cs | 21 +-- .../Implementations/InjectionPlan/Subplan.cs | 1 - .../Interface/ICsClassHierarchy.cs | 2 - .../Interface/IExternalConstructor.cs | 4 +- .../Protobuf/ProtocolBufferClassHierarchy.cs | 4 +- .../Protobuf/ProtocolBufferInjectionPlan.cs | 2 - .../Types/IConstructorArg.cs | 2 +- .../Org.Apache.REEF.Tang/Types/IPackageNode.cs | 5 +- .../Org.Apache.REEF.Tang/Util/AssemblyLoader.cs | 2 + .../Util/ReflectionUtilities.cs | 11 +- .../Org.Apache.REEF.Tang/Util/SetValuedKey.cs | 5 +- .../StreamingTransportTest.cs | 2 - .../Org.Apache.REEF.Wake.Tests/TransportTest.cs | 3 - .../Examples/P2p/Pull2Push.cs | 1 + .../Org.Apache.REEF.Wake/Remote/IDataReader.cs | 1 - .../Remote/IRemoteManagerFactory.cs | 1 - .../Remote/Impl/StreamingTransportServer.cs | 1 - .../Remote/TcpPortProvider.cs | 1 - .../LimitedConcurrencyLevelTaskScheduler.cs | 5 +- lang/cs/Settings.StyleCop | 34 ++-- 136 files changed, 551 insertions(+), 449 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client.Tests/JobResourceUploaderTests.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client.Tests/JobResourceUploaderTests.cs b/lang/cs/Org.Apache.REEF.Client.Tests/JobResourceUploaderTests.cs index 3479842..25b6fbf 100644 --- a/lang/cs/Org.Apache.REEF.Client.Tests/JobResourceUploaderTests.cs +++ b/lang/cs/Org.Apache.REEF.Client.Tests/JobResourceUploaderTests.cs @@ -101,7 +101,6 @@ namespace Org.Apache.REEF.Client.Tests private class TestContext { - public readonly IJobSubmissionDirectoryProvider JobSubmissionDirectoryProvider = Substitute.For<IJobSubmissionDirectoryProvider>(); public readonly IResourceArchiveFileGenerator ResourceArchiveFileGenerator = http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/API/IJobSubmission.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/API/IJobSubmission.cs b/lang/cs/Org.Apache.REEF.Client/API/IJobSubmission.cs index 55aad55..1255ac8 100644 --- a/lang/cs/Org.Apache.REEF.Client/API/IJobSubmission.cs +++ b/lang/cs/Org.Apache.REEF.Client/API/IJobSubmission.cs @@ -67,6 +67,5 @@ namespace Org.Apache.REEF.Client.API /// Can be used to redirect assembly versions /// </summary> string DriverConfigurationFileContents { get; } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/API/JobSubmission.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/API/JobSubmission.cs b/lang/cs/Org.Apache.REEF.Client/API/JobSubmission.cs index 7c522d8..05aa3c0 100644 --- a/lang/cs/Org.Apache.REEF.Client/API/JobSubmission.cs +++ b/lang/cs/Org.Apache.REEF.Client/API/JobSubmission.cs @@ -95,7 +95,8 @@ namespace Org.Apache.REEF.Client.API /// <summary> /// The Job's identifier /// </summary> - string IJobSubmission.JobIdentifier { + string IJobSubmission.JobIdentifier + { get { return _jobIdentifier; } } @@ -107,7 +108,5 @@ namespace Org.Apache.REEF.Client.API { get { return _driverConfigurationFileContents; } } - - } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/API/JobSubmissionBuilder.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/API/JobSubmissionBuilder.cs b/lang/cs/Org.Apache.REEF.Client/API/JobSubmissionBuilder.cs index c681206..131fddb 100644 --- a/lang/cs/Org.Apache.REEF.Client/API/JobSubmissionBuilder.cs +++ b/lang/cs/Org.Apache.REEF.Client/API/JobSubmissionBuilder.cs @@ -41,7 +41,6 @@ namespace Org.Apache.REEF.Client.API _configurationProviders = configurationProviders; } - /// <summary> /// Add a file to be made available in all containers. /// </summary> @@ -153,7 +152,6 @@ namespace Org.Apache.REEF.Client.API return this; } - /// <summary> /// Finds the path to the assembly the given Type was loaded from. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs b/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs index 93aa752..03a63da 100644 --- a/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs +++ b/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs @@ -17,7 +17,6 @@ * under the License. */ - using System; using System.IO; using System.Linq; @@ -172,7 +171,6 @@ namespace Org.Apache.REEF.Client.Common /// <param name="filePath"></param> /// <returns></returns> private static Boolean IsAssemblyToCopy(string filePath) - { var fileName = Path.GetFileName(filePath); if (string.IsNullOrWhiteSpace(fileName)) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/Common/JobSubmissionResult.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/Common/JobSubmissionResult.cs b/lang/cs/Org.Apache.REEF.Client/Common/JobSubmissionResult.cs index 114d0cd..28bf877 100644 --- a/lang/cs/Org.Apache.REEF.Client/Common/JobSubmissionResult.cs +++ b/lang/cs/Org.Apache.REEF.Client/Common/JobSubmissionResult.cs @@ -65,7 +65,9 @@ namespace Org.Apache.REEF.Client.Common /// <summary> /// Returns http end point of the web server running in the driver /// </summary> - public string DriverUrl { get { return _driverUrl; } + public string DriverUrl + { + get { return _driverUrl; } } /// <summary> @@ -307,7 +309,6 @@ namespace Org.Apache.REEF.Client.Common { resultKind = UrlResultKind.GotAppIdUrl; } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Acls.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Acls.cs b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Acls.cs index 59ce123..8bdcaed 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Acls.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Acls.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json.Converters; // ReSharper disable InconsistentNaming; Name kept in sync with YARN // API documentation - namespace Org.Apache.REEF.Client.YARN.RestClient.DataModel { /// <summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationFinalState.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationFinalState.cs b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationFinalState.cs index 8a49c9e..e09991f 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationFinalState.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationFinalState.cs @@ -22,7 +22,7 @@ namespace Org.Apache.REEF.Client.YARN.RestClient.DataModel /// <see cref="!:http://hadoop.apache.org/docs/r2.6.0/hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html"> /// Hadoop RM REST API </see> documentation. /// </summary> - // valid values are members of the YarnApplicationState enum + /// valid values are members of the YarnApplicationState enum public enum FinalState { UNDEFINED, http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationState.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationState.cs b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationState.cs index bf05585..82449cb 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationState.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/ApplicationState.cs @@ -22,7 +22,7 @@ namespace Org.Apache.REEF.Client.YARN.RestClient.DataModel /// <see cref="!:http://hadoop.apache.org/docs/r2.6.0/hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html"> /// Hadoop RM REST API </see> documentation. /// </summary> - // valid values are members of the YarnApplicationState enum + /// valid values are members of the YarnApplicationState enum internal enum State { NEW, http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Commands.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Commands.cs b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Commands.cs index f6d9c44..c47b8bc 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Commands.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/Commands.cs @@ -15,7 +15,6 @@ // specific language governing permissions and limitations // under the License. - using Newtonsoft.Json; namespace Org.Apache.REEF.Client.YARN.RestClient.DataModel http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/LocalResources.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/LocalResources.cs b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/LocalResources.cs index ed3a677..fc15a81 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/LocalResources.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/DataModel/LocalResources.cs @@ -20,7 +20,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; // ReSharper disable InconsistentNaming; Name replicates YARN REST API - namespace Org.Apache.REEF.Client.YARN.RestClient.DataModel { /// <summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/YarnClient.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/YarnClient.cs b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/YarnClient.cs index 32930dc..030fc37 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/YarnClient.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/RESTClient/YarnClient.cs @@ -128,7 +128,6 @@ namespace Org.Apache.REEF.Client.Yarn.RestClient return request; } - private async Task<T> GenerateUrlAndExecuteRequestAsync<T>(IRestRequest request, CancellationToken cancellationToken) where T : new() http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/WindowsYarnJobCommandProvider.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/WindowsYarnJobCommandProvider.cs b/lang/cs/Org.Apache.REEF.Client/YARN/WindowsYarnJobCommandProvider.cs index 5900504..c7d280d 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/WindowsYarnJobCommandProvider.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/WindowsYarnJobCommandProvider.cs @@ -46,7 +46,6 @@ namespace Org.Apache.REEF.Client.YARN private readonly int _driverMaxMemoryAllocationPoolSizeMB; private readonly int _driverMaxPermSizeMB; - [Inject] private WindowsYarnJobCommandProvider( [Parameter(typeof(EnableDebugLogging))] bool enableDebugLogging, http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Client/YARN/YARNREEFClient.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Client/YARN/YARNREEFClient.cs b/lang/cs/Org.Apache.REEF.Client/YARN/YARNREEFClient.cs index 760b303..fbfaa87 100644 --- a/lang/cs/Org.Apache.REEF.Client/YARN/YARNREEFClient.cs +++ b/lang/cs/Org.Apache.REEF.Client/YARN/YARNREEFClient.cs @@ -125,7 +125,6 @@ namespace Org.Apache.REEF.Client.Yarn // TODO: Remove this when we have a generalized way to pass config to java var paramInjector = TangFactory.GetTang().NewInjector(jobSubmission.DriverConfigurations.ToArray()); - var avroJobSubmissionParameters = new AvroJobSubmissionParameters { jobId = jobSubmission.JobIdentifier, http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpSerializer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpSerializer.cs b/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpSerializer.cs index 1812002..c643096 100644 --- a/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpSerializer.cs +++ b/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpSerializer.cs @@ -28,7 +28,7 @@ namespace Org.Apache.REEF.Common.Avro /// <summary> /// Class AvroHttpSerializer. Provides methods to serialize and deserialize HttpRequest /// </summary> - // TODO[REEF-842] Act on the obsoletes + //// TODO[REEF-842] Act on the obsoletes public class AvroHttpSerializer { public static AvroHttpRequest FromBytes(byte[] serializedBytes) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Files/REEFFileNames.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Files/REEFFileNames.cs b/lang/cs/Org.Apache.REEF.Common/Files/REEFFileNames.cs index d8f5126..7b5c87a 100644 --- a/lang/cs/Org.Apache.REEF.Common/Files/REEFFileNames.cs +++ b/lang/cs/Org.Apache.REEF.Common/Files/REEFFileNames.cs @@ -278,7 +278,10 @@ namespace Org.Apache.REEF.Common.Files /// </summary> /// <returns>File name that contains the dfs path for the DriverHttpEndpoint</returns> [Unstable("0.13", "Working in progress for what to return after submit")] - public string DriverHttpEndpoint { get { return DRIVER_HTTP_ENDPOINT_FILE_NAME; } } + public string DriverHttpEndpoint + { + get { return DRIVER_HTTP_ENDPOINT_FILE_NAME; } + } private static readonly string GLOBAL_FOLDER_PATH = Path.Combine(REEF_BASE_FOLDER, GLOBAL_FOLDER); private static readonly string LOCAL_FOLDER_PATH = Path.Combine(REEF_BASE_FOLDER, LOCAL_FOLDER); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextManager.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextManager.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextManager.cs index b054d30..13f1235 100644 --- a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextManager.cs +++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextManager.cs @@ -102,6 +102,7 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context { LOGGER.Log(Level.Info, "AddContext"); AddContext(controlMessage.add_context); + // support submitContextAndTask() if (controlMessage.start_task != null) { @@ -313,7 +314,7 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context // does not matter if null. _topContext = _topContext.ParentContext.Value; } - // System.gc(); // TODO: garbage collect? + //// System.gc(); // TODO: garbage collect? } /// <summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextRuntime.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextRuntime.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextRuntime.cs index 750f6ba..37f541a 100644 --- a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextRuntime.cs +++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextRuntime.cs @@ -33,8 +33,10 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context internal sealed class ContextRuntime { private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextRuntime)); + // Context-local injector. This contains information that will not be available in child injectors. private readonly IInjector _contextInjector; + // Service injector. State in this injector moves to child injectors. private readonly IInjector _serviceInjector; @@ -87,6 +89,7 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); } + // Trigger the context start events on contextInjector. _contextLifeCycle.Start(); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskRuntime.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskRuntime.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskRuntime.cs index a60841f..81b1b06 100644 --- a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskRuntime.cs +++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskRuntime.cs @@ -55,6 +55,7 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task catch (Exception e) { Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, "Cannot inject task message source with error: " + e.StackTrace, Logger); + // do not rethrow since this is benign } try @@ -253,13 +254,13 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task public void OnNext(ICloseEvent value) { Logger.Log(Level.Info, "TaskRuntime::OnNext(ICloseEvent value)"); - // TODO: send a heartbeat + //// TODO: send a heartbeat } public void OnNext(ISuspendEvent value) { Logger.Log(Level.Info, "TaskRuntime::OnNext(ISuspendEvent value)"); - // TODO: send a heartbeat + //// TODO: send a heartbeat } public void OnNext(IDriverMessage value) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStatus.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStatus.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStatus.cs index 844e3ef..507219b 100644 --- a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStatus.cs +++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStatus.cs @@ -116,6 +116,7 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task try { _taskLifeCycle.Start(); + // Need to send an INIT heartbeat to the driver prompting it to create an RunningTask event. LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Sending task INIT heartbeat")); Heartbeat(); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/EvaluatorConfigurations.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/EvaluatorConfigurations.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/EvaluatorConfigurations.cs index 8f60042..01c6a96 100644 --- a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/EvaluatorConfigurations.cs +++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/EvaluatorConfigurations.cs @@ -138,6 +138,7 @@ namespace Org.Apache.REEF.Common.Runtime.Evaluator.Utils return _rootContextConfiguration; } } + /// <summary> /// The ContextConfiguration for the root context. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Runtime/MachineStatus.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/MachineStatus.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/MachineStatus.cs index c687372..87721b9 100644 --- a/lang/cs/Org.Apache.REEF.Common/Runtime/MachineStatus.cs +++ b/lang/cs/Org.Apache.REEF.Common/Runtime/MachineStatus.cs @@ -124,9 +124,10 @@ namespace Org.Apache.REEF.Common.Runtime } catch (Exception e) { - _checkStatus = false; // It only takes one exception to switch the cheking off for good. + _checkStatus = false; // It only takes one exception to switch the checking off for good. Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, "Cannot obtain machine status due to error", Logger.GetLogger(typeof(MachineStatus))); - // we do not want to crash the evealuator just because we cannot get the information. + + // we do not want to crash the evaluator just because we cannot get the information. info = "Cannot obtain machine status due to error " + e.Message; } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Common/Services/ServiceConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Services/ServiceConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/Services/ServiceConfiguration.cs index 1dcb3ea..02c3c61 100644 --- a/lang/cs/Org.Apache.REEF.Common/Services/ServiceConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.Common/Services/ServiceConfiguration.cs @@ -86,5 +86,4 @@ namespace Org.Apache.REEF.Common.Services class ServicesSet : Name<ISet<IService>> { } -} - +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeConfigurationProvider.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeConfigurationProvider.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeConfigurationProvider.cs index d68d150..cae5281 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeConfigurationProvider.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeConfigurationProvider.cs @@ -91,6 +91,7 @@ namespace Org.Apache.REEF.Driver.Bridge "). Loading only the one found in the legacy location."); return legacyBridgeConfigurationPath; } + // If we reached this, we weren't able to find the configuration file. var message = "Unable to find brigde configuration. Paths checked: ['" + newBridgeConfigurationPath + "', '" + http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandlerWrapper.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandlerWrapper.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandlerWrapper.cs index b020728..70f05c6 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandlerWrapper.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandlerWrapper.cs @@ -174,7 +174,6 @@ namespace Org.Apache.REEF.Driver.Bridge } catch (Exception ex) { - LOGGER.Log(Level.Info, "Caught exception: " + ex.Message + ex.StackTrace); Exceptions.CaughtAndThrow(ex, Level.Warning, LOGGER); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs index 35db431..bbae302 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs @@ -378,6 +378,9 @@ namespace Org.Apache.REEF.Driver.Bridge } } - internal ISet<IConfigurationProvider> ConfigurationProviders { get { return _configurationProviders; } } + internal ISet<IConfigurationProvider> ConfigurationProviders + { + get { return _configurationProviders; } + } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/AllocatedEvaluator.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/AllocatedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/AllocatedEvaluator.cs index 5968734..5e42bc5 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/AllocatedEvaluator.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/AllocatedEvaluator.cs @@ -79,7 +79,6 @@ namespace Org.Apache.REEF.Driver.Bridge.Events ContextConfiguration.ConfigurationModule.Set(ContextConfiguration.Identifier, "RootContext_" + this.Id) .Build(); SubmitContextAndTask(contextConfiguration, taskConfiguration); - } public void SubmitContext(IConfiguration contextConfiguration) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedEvaluator.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedEvaluator.cs index 2f4a7f2..b235970 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedEvaluator.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedEvaluator.cs @@ -64,6 +64,7 @@ namespace Org.Apache.REEF.Driver.Bridge.Events { get { return new List<IFailedContext>(0); } } + // TODO[REEF-769]: Implement public Optional<IFailedTask> FailedTask { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorDescriptorImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorDescriptorImpl.cs index 07dfb17..543dd9c 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorDescriptorImpl.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorDescriptorImpl.cs @@ -159,6 +159,7 @@ namespace Org.Apache.REEF.Driver.Evaluator } return EquivalentMemory(other); + // we don't care about rack now; // && string.Equals(_rack, other.Rack, StringComparison.OrdinalIgnoreCase); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorException.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorException.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorException.cs index 7c57a44..fbd7d8b 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorException.cs +++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorException.cs @@ -23,7 +23,8 @@ using Org.Apache.REEF.Utilities; namespace Org.Apache.REEF.Driver.Evaluator { - // Public only such that it can be used in the bridge. + //// Public only such that it can be used in the bridge. + /// <summary> /// </summary> public sealed class EvaluatorException : Exception, IIdentifiable http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs b/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs index 9ff7bf1..be2c0f8 100644 --- a/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs +++ b/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs @@ -43,7 +43,6 @@ namespace Org.Apache.REEF.Evaluator.Tests private const string RemoteIdPrefix = "socket://"; private const string AppIdForTest = "REEF_LOCAL_RUNTIME"; - [TestMethod, Priority(0), TestCategory("Unit")] public void TestEvaluatorConfigurations() { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs b/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs index f504e77..4a60be4 100644 --- a/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs +++ b/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs @@ -197,7 +197,6 @@ namespace Org.Apache.REEF.Evaluator "Evaluator heartbeat max retry set to be " + heartbeatMaxRetry + " times."); } - /// <summary> /// Instantiates the root injector of the Evaluator. /// </summary> @@ -267,6 +266,7 @@ namespace Org.Apache.REEF.Evaluator catch (Exception e) { Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, logger); + // custom trace listener not set properly, use empty set customTraceListeners = new HashSet<TraceListener>(); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloFailedEvaluatorHandler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloFailedEvaluatorHandler.cs b/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloFailedEvaluatorHandler.cs index d0a781e..e5defcc 100644 --- a/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloFailedEvaluatorHandler.cs +++ b/lang/cs/Org.Apache.REEF.Examples.AllHandlers/HelloFailedEvaluatorHandler.cs @@ -53,7 +53,6 @@ namespace Org.Apache.REEF.Examples.AllHandlers var newRequest = _evaluatorRequestor.NewBuilder().SetNumber(1).SetMegabytes(512).SetRackName("somerack").Build(); _evaluatorRequestor.Submit(newRequest); - } else { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Examples.HelloREEF/HelloREEF.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples.HelloREEF/HelloREEF.cs b/lang/cs/Org.Apache.REEF.Examples.HelloREEF/HelloREEF.cs index f759005..caa6897 100644 --- a/lang/cs/Org.Apache.REEF.Examples.HelloREEF/HelloREEF.cs +++ b/lang/cs/Org.Apache.REEF.Examples.HelloREEF/HelloREEF.cs @@ -58,6 +58,7 @@ namespace Org.Apache.REEF.Examples.HelloREEF .Set(DriverConfiguration.OnEvaluatorAllocated, GenericType<HelloDriver>.Class) .Set(DriverConfiguration.OnDriverStarted, GenericType<HelloDriver>.Class) .Build(); + // The JobSubmission contains the Driver configuration as well as the files needed on the Driver. var helloJobSubmission = _jobSubmissionBuilderFactory.GetJobSubmissionBuilder() .AddDriverConfiguration(helloDriverConfiguration) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Examples/DriverRestart/HelloRestartDriver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples/DriverRestart/HelloRestartDriver.cs b/lang/cs/Org.Apache.REEF.Examples/DriverRestart/HelloRestartDriver.cs index 16fa0d3..c99f1e1 100644 --- a/lang/cs/Org.Apache.REEF.Examples/DriverRestart/HelloRestartDriver.cs +++ b/lang/cs/Org.Apache.REEF.Examples/DriverRestart/HelloRestartDriver.cs @@ -145,7 +145,6 @@ namespace Org.Apache.REEF.Examples.DriverRestart Logger.Log(Level.Info, "{0} running task with ID [{1}] from evaluator with ID [{2}]", _evaluators[evaluatorId], value.Id, evaluatorId); - if (_evaluators[evaluatorId] == EvaluatorState.Expected) { value.Send(Encoding.UTF8.GetBytes("Hello from driver!")); @@ -156,6 +155,7 @@ namespace Org.Apache.REEF.Examples.DriverRestart _evaluators[evaluatorId] = EvaluatorState.NewRunning; var newRunningCount = CountState(EvaluatorState.NewRunning); + // Kill itself in order for the driver to restart it. if (!_isRestart && newRunningCount == NumberOfTasksToSubmit) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/DataVector.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/DataVector.cs b/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/DataVector.cs index fb6a16e..ad906df 100644 --- a/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/DataVector.cs +++ b/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/DataVector.cs @@ -92,9 +92,11 @@ namespace Org.Apache.REEF.Examples.MachineLearning.KMeans public static List<DataVector> ShuffleDataAndGetInitialCentriods(string originalDataFile, int partitionsNum, int clustersNum, string executionDirectory) { List<DataVector> data = DataPartitionCache.ReadDataFile(originalDataFile); - // shuffle, not truely random, but sufficient for our purpose + + // shuffle, not truly random, but sufficient for our purpose data = data.OrderBy(a => Guid.NewGuid()).ToList(); string dataDirectory = Path.Combine(executionDirectory, Constants.DataDirectory); + // clean things up first if (Directory.Exists(dataDirectory)) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansDriverHandlers.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansDriverHandlers.cs b/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansDriverHandlers.cs index 99934e2..2064d32 100644 --- a/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansDriverHandlers.cs +++ b/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansDriverHandlers.cs @@ -175,6 +175,7 @@ namespace Org.Apache.REEF.Examples.MachineLearning.KMeans else { string slaveTaskId = Constants.SlaveTaskIdPrefix + activeContext.Id; + // Configure Slave Task taskConfiguration = TaskConfiguration.ConfigurationModule .Set(TaskConfiguration.Identifier, Constants.SlaveTaskIdPrefix + activeContext.Id) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansSlaveTask.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansSlaveTask.cs b/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansSlaveTask.cs index 6e037fe..c660f7c 100644 --- a/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansSlaveTask.cs +++ b/lang/cs/Org.Apache.REEF.Examples/MachineLearning/KMeans/KMeansSlaveTask.cs @@ -66,6 +66,7 @@ namespace Org.Apache.REEF.Examples.MachineLearning.KMeans break; } Centroids centroids = _dataBroadcastReceiver.Receive(); + // we compute the loss here before data is relabled, this does not reflect the latest clustering result at the end of current iteration, // but it will save another round of group communications in each iteration _logger.Log(Level.Info, "Received centroids from master: " + centroids); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU.Examples/Run.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU.Examples/Run.cs b/lang/cs/Org.Apache.REEF.IMRU.Examples/Run.cs index baec036..b7a6123 100644 --- a/lang/cs/Org.Apache.REEF.IMRU.Examples/Run.cs +++ b/lang/cs/Org.Apache.REEF.IMRU.Examples/Run.cs @@ -177,7 +177,6 @@ namespace Org.Apache.REEF.IMRU.Examples default: Logger.Log(Level.Info, "wrong test name"); return; - } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinition.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinition.cs b/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinition.cs index bccc7b2..854904f 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinition.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinition.cs @@ -187,7 +187,8 @@ namespace Org.Apache.REEF.IMRU.API /// TODO: automatically from IPartitionedDataset. However, right now /// TODO: GroupComm. instantiated in IMRUDriver needs this parameter /// TODO: in constructor. This will be removed once we remove it from GroupComm. - internal int NumberOfMappers { + internal int NumberOfMappers + { get { return _numberOfMappers; } } @@ -207,7 +208,6 @@ namespace Org.Apache.REEF.IMRU.API get { return _updateTaskMemory; } } - /// <summary> /// Cores for each mapper /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinitionBuilder.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinitionBuilder.cs b/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinitionBuilder.cs index 018a8fd..a0d9640 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinitionBuilder.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/API/IMRUJobDefinitionBuilder.cs @@ -271,7 +271,6 @@ namespace Org.Apache.REEF.IMRU.API return this; } - /// <summary> /// Instantiate the IMRUJobDefinition. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/API/PerMapConfigGeneratorSet.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/API/PerMapConfigGeneratorSet.cs b/lang/cs/Org.Apache.REEF.IMRU/API/PerMapConfigGeneratorSet.cs index a7ba86c..8fad2c7 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/API/PerMapConfigGeneratorSet.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/API/PerMapConfigGeneratorSet.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using System.Collections.Generic; using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/InProcess/MapFunctions.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/InProcess/MapFunctions.cs b/lang/cs/Org.Apache.REEF.IMRU/InProcess/MapFunctions.cs index f54efb3..a00f2dd 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/InProcess/MapFunctions.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/InProcess/MapFunctions.cs @@ -27,7 +27,7 @@ namespace Org.Apache.REEF.IMRU.InProcess /// </summary> /// <typeparam name="TMapInput"></typeparam> /// <typeparam name="TMapOutput"></typeparam> - // This is needed as Tang doesn't support BindVolatile into a Set. + /// This is needed as Tang doesn't support BindVolatile into a Set. internal sealed class MapFunctions<TMapInput, TMapOutput> { private readonly ISet<IMapFunction<TMapInput, TMapOutput>> _mappers; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/ContextAndServiceConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/ContextAndServiceConfiguration.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/ContextAndServiceConfiguration.cs index e280f72..5e0f7fd 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/ContextAndServiceConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/ContextAndServiceConfiguration.cs @@ -41,6 +41,5 @@ namespace Org.Apache.REEF.IMRU.OnREEF.Driver Context = context; Service = service; } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/IMRUDriver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/IMRUDriver.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/IMRUDriver.cs index 9eb91cf..f4478c4 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/IMRUDriver.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/IMRUDriver.cs @@ -130,7 +130,7 @@ namespace Org.Apache.REEF.IMRU.OnREEF.Driver public void OnNext(IDriverStarted value) { RequestUpdateEvaluator(); - // TODO[REEF-598]: Set a timeout for this request to be satisfied. If it is not within that time, exit the Driver. + //// TODO[REEF-598]: Set a timeout for this request to be satisfied. If it is not within that time, exit the Driver. } /// <summary> @@ -244,7 +244,10 @@ namespace Org.Apache.REEF.IMRU.OnREEF.Driver { _completedTasks.Add(completedTask); - if (_completedTasks.Count != _dataSet.Count + 1) return; + if (_completedTasks.Count != _dataSet.Count + 1) + { + return; + } foreach (var task in _completedTasks) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresForUpdateTask.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresForUpdateTask.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresForUpdateTask.cs index 7439cc1..274121e 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresForUpdateTask.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresForUpdateTask.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresPerMapper.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresPerMapper.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresPerMapper.cs index fcd47e4..5de1414 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresPerMapper.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/CoresPerMapper.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryForUpdateTask.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryForUpdateTask.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryForUpdateTask.cs index 8bee0f7..e31906e 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryForUpdateTask.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryForUpdateTask.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryPerMapper.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryPerMapper.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryPerMapper.cs index 2403db4..2e3dfe0 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryPerMapper.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/MemoryPerMapper.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapInputPipelineDataConverterConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapInputPipelineDataConverterConfiguration.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapInputPipelineDataConverterConfiguration.cs index d6917f4..39d8324 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapInputPipelineDataConverterConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapInputPipelineDataConverterConfiguration.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapOutputPipelineDataConverterConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapOutputPipelineDataConverterConfiguration.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapOutputPipelineDataConverterConfiguration.cs index 0a4ea68..6f52c64 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapOutputPipelineDataConverterConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedMapOutputPipelineDataConverterConfiguration.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedReduceConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedReduceConfiguration.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedReduceConfiguration.cs index f1e9b1c..2dd9698 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedReduceConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedReduceConfiguration.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedUpdateConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedUpdateConfiguration.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedUpdateConfiguration.cs index 103fdc8..a09f62a 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedUpdateConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/Parameters/SerializedUpdateConfiguration.cs @@ -1,23 +1,21 @@ -#region LICENSE - -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#endregion +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ using Org.Apache.REEF.Tang.Annotations; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IMRU/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IMRU/Properties/AssemblyInfo.cs b/lang/cs/Org.Apache.REEF.IMRU/Properties/AssemblyInfo.cs index 1dee24f..bbf6a7c 100644 --- a/lang/cs/Org.Apache.REEF.IMRU/Properties/AssemblyInfo.cs +++ b/lang/cs/Org.Apache.REEF.IMRU/Properties/AssemblyInfo.cs @@ -32,6 +32,7 @@ using System.Runtime.InteropServices; [assembly: Guid("138891df-d331-4a5e-8514-775611c06f6c")] [assembly: AssemblyVersion("0.14.0.0")] [assembly: AssemblyFileVersion("0.14.0.0")] + // Allow the tests project access to `internal` APIs [assembly: InternalsVisibleTo("Org.Apache.REEF.IMRU.Tests, publickey=" + "00240000048000009400000006020000002400005253413100040000010001005df3e621d886a9" + http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileInputPartitionTest.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileInputPartitionTest.cs b/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileInputPartitionTest.cs index 6189562..c5316fa 100644 --- a/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileInputPartitionTest.cs +++ b/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileInputPartitionTest.cs @@ -116,7 +116,9 @@ namespace Org.Apache.REEF.IO.TestClient using (var s = File.Create(filePath)) { foreach (var b in bytes) + { s.WriteByte(b); + } } } @@ -139,7 +141,8 @@ namespace Org.Apache.REEF.IO.TestClient { [Inject] private ByteSerializer() - { } + { + } /// <summary> /// Read bytes from all the files in the file folder and return one by one http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileSystemTest.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileSystemTest.cs b/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileSystemTest.cs index 5c5277c..9ecfa13 100644 --- a/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileSystemTest.cs +++ b/lang/cs/Org.Apache.REEF.IO.TestClient/HadoopFileSystemTest.cs @@ -59,7 +59,6 @@ namespace Org.Apache.REEF.IO.TestClient var remoteUri = GetTempUri(); Logger.Log(Level.Info, string.Format(CultureInfo.CurrentCulture, "remoteUri {0}: ", remoteUri.AbsolutePath)); - _fileSystem.CopyFromLocal(localFile, remoteUri); Logger.Log(Level.Info, string.Format(CultureInfo.CurrentCulture, "File CopyFromLocal {0}: ", remoteUri)); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.TestClient/Run.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.TestClient/Run.cs b/lang/cs/Org.Apache.REEF.IO.TestClient/Run.cs index d0811f4..f9704a8 100644 --- a/lang/cs/Org.Apache.REEF.IO.TestClient/Run.cs +++ b/lang/cs/Org.Apache.REEF.IO.TestClient/Run.cs @@ -22,7 +22,8 @@ using Org.Apache.REEF.Utilities.Logging; namespace Org.Apache.REEF.IO.TestClient { - // TODO[JIRA REEF-815]: once move to Nunit, tose test should be moved to Test project + //// TODO[JIRA REEF-815]: once move to Nunit, tose test should be moved to Test project + /// <summary> /// This purpose of this test is to run tests in Yarn envionment /// @@ -68,6 +69,8 @@ namespace Org.Apache.REEF.IO.TestClient public class AssertFailedException : Exception { - public AssertFailedException(string message) : base(message) { } + public AssertFailedException(string message) : base(message) + { + } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureBlockBlobFileSystemE2E.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureBlockBlobFileSystemE2E.cs b/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureBlockBlobFileSystemE2E.cs index ece4cd6..30617c2 100644 --- a/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureBlockBlobFileSystemE2E.cs +++ b/lang/cs/Org.Apache.REEF.IO.Tests/TestAzureBlockBlobFileSystemE2E.cs @@ -156,8 +156,6 @@ namespace Org.Apache.REEF.IO.Tests } } - - [TestMethod] public void TestDeleteDirectoryAtContainerE2E() { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.Tests/TestFilePartitionInputDataSet.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.Tests/TestFilePartitionInputDataSet.cs b/lang/cs/Org.Apache.REEF.IO.Tests/TestFilePartitionInputDataSet.cs index 88058a7..df80e6d 100644 --- a/lang/cs/Org.Apache.REEF.IO.Tests/TestFilePartitionInputDataSet.cs +++ b/lang/cs/Org.Apache.REEF.IO.Tests/TestFilePartitionInputDataSet.cs @@ -232,7 +232,9 @@ namespace Org.Apache.REEF.IO.Tests using (var s = File.Create(filePath)) { foreach (var b in bytes) + { s.WriteByte(b); + } } } @@ -261,7 +263,8 @@ namespace Org.Apache.REEF.IO.Tests { [Inject] public ByteSerializer() - { } + { + } /// <summary> /// Enumerate all the files in the file foder and return each byte read @@ -303,7 +306,8 @@ namespace Org.Apache.REEF.IO.Tests { [Inject] private RowSerializer() - { } + { + } /// <summary> /// read all the files in the fileFolder cand return byte read one by one http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.Tests/TestHadoopFileSystem.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.Tests/TestHadoopFileSystem.cs b/lang/cs/Org.Apache.REEF.IO.Tests/TestHadoopFileSystem.cs index a03e9f1..f83960f 100644 --- a/lang/cs/Org.Apache.REEF.IO.Tests/TestHadoopFileSystem.cs +++ b/lang/cs/Org.Apache.REEF.IO.Tests/TestHadoopFileSystem.cs @@ -104,13 +104,16 @@ namespace Org.Apache.REEF.IO.Tests // Make a directory var remoteDirectory = GetTempUri(); _fileSystem.CreateDirectory(remoteDirectory); + // Check that it is empty Assert.AreEqual(message: "The directory should be empty.", expected: 0, actual: _fileSystem.GetChildren(remoteDirectory).Count()); + // Upload some localfile there var localTempFile = FileSystemTestUtilities.MakeLocalTempFile(); var remoteUri = new Uri(remoteDirectory, Path.GetFileName(localTempFile)); _fileSystem.CopyFromLocal(localTempFile, remoteUri); + // Check that it is on the listing var uriInResult = _fileSystem.GetChildren(remoteUri).First(); Assert.AreEqual(remoteUri, uriInResult); @@ -124,9 +127,11 @@ namespace Org.Apache.REEF.IO.Tests // Delete the file _fileSystem.Delete(remoteUri); + // Check that the folder is empty again Assert.AreEqual(message: "The directory should be empty.", expected: 0, actual: _fileSystem.GetChildren(remoteDirectory).Count()); + // Delete the folder _fileSystem.DeleteDirectory(remoteDirectory); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO.Tests/TestLocalFileSystem.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO.Tests/TestLocalFileSystem.cs b/lang/cs/Org.Apache.REEF.IO.Tests/TestLocalFileSystem.cs index 7dcbbe5..b009567 100644 --- a/lang/cs/Org.Apache.REEF.IO.Tests/TestLocalFileSystem.cs +++ b/lang/cs/Org.Apache.REEF.IO.Tests/TestLocalFileSystem.cs @@ -25,7 +25,6 @@ using Org.Apache.REEF.Tang.Implementations.Tang; namespace Org.Apache.REEF.IO.Tests { - /// <summary> /// Tests for Org.Apache.REEF.IO.FileSystem.Local.LocalFileSystem /// </summary> @@ -40,7 +39,6 @@ namespace Org.Apache.REEF.IO.Tests { var fs = GetFileSystem(); - // Create a temp file var tempFilePath = Path.Combine(Path.GetTempPath(), TempFileName); var tempFileUri = new Uri(tempFilePath); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureBlockBlobFileSystem.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureBlockBlobFileSystem.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureBlockBlobFileSystem.cs index 20e75a8..05267b6 100644 --- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureBlockBlobFileSystem.cs +++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureBlockBlobFileSystem.cs @@ -174,7 +174,8 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureBlob } blobContinuationToken = listing.ContinuationToken; - } while (blobContinuationToken != null); + } + while (blobContinuationToken != null); } /// <summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureCloudBlobClient.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureCloudBlobClient.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureCloudBlobClient.cs index 797f44c..ab92bf3 100644 --- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureCloudBlobClient.cs +++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureBlob/AzureCloudBlobClient.cs @@ -32,7 +32,10 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureBlob { private readonly CloudBlobClient _client; - public StorageCredentials Credentials { get { return _client.Credentials; } } + public StorageCredentials Credentials + { + get { return _client.Credentials; } + } [Inject] private AzureCloudBlobClient([Parameter(typeof(AzureStorageConnectionString))] string connectionString, http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO/FileSystem/Hadoop/HDFSCommandRunner.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/Hadoop/HDFSCommandRunner.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/Hadoop/HDFSCommandRunner.cs index 7a10a8a..f0d1f97 100644 --- a/lang/cs/Org.Apache.REEF.IO/FileSystem/Hadoop/HDFSCommandRunner.cs +++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/Hadoop/HDFSCommandRunner.cs @@ -221,6 +221,7 @@ namespace Org.Apache.REEF.IO.FileSystem.Hadoop errList.Add(e.Data.Trim()); } }; + // Start it process.Start(); process.BeginErrorReadLine(); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.IO/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO/Properties/AssemblyInfo.cs b/lang/cs/Org.Apache.REEF.IO/Properties/AssemblyInfo.cs index 9edf44f..96f6167 100644 --- a/lang/cs/Org.Apache.REEF.IO/Properties/AssemblyInfo.cs +++ b/lang/cs/Org.Apache.REEF.IO/Properties/AssemblyInfo.cs @@ -33,6 +33,7 @@ using System.Runtime.InteropServices; [assembly: Guid("58c49df4-8dc0-4f58-9a7e-a341d33e40ee")] [assembly: AssemblyVersion("0.14.0.0")] [assembly: AssemblyFileVersion("0.14.0.0")] + // Allow the tests project access to `internal` APIs [assembly: InternalsVisibleTo("Org.Apache.REEF.IO.Tests, publickey=" + "00240000048000009400000006020000002400005253413100040000010001005df3e621d886a9" + @@ -44,6 +45,7 @@ using System.Runtime.InteropServices; "9c03469d0f93a9f5d45aa2c883f50cd158759e93673f759ec4657fd84cc79d2db38ef1a2d914cc" + "b7c717846a897e11dd22eb260a7ce2da2dccf0263ea63e2b3f7dac24f28882aa568ef544341d17" + "618392a1095f4049ad079d4f4f0b429bb535699155fd6a7652ec7d6c1f1ba2b560f11ef3a86b5945d288cf")] + // Allow NSubstitute to create proxy implementations [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=002400000480000" + "0940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a36" + http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/BroadcastReduceDriver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/BroadcastReduceDriver.cs b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/BroadcastReduceDriver.cs index 9220834..fbb4787 100644 --- a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/BroadcastReduceDriver.cs +++ b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/BroadcastReduceDriver.cs @@ -86,7 +86,6 @@ namespace Org.Apache.REEF.Network.Examples.GroupCommunication.BroadcastReduceDri portRange.ToString(CultureInfo.InvariantCulture)) .Build(); - _codecConfig = StreamingCodecConfiguration<int>.Conf .Set(StreamingCodecConfiguration<int>.Codec, GenericType<IntStreamingCodec>.Class) .Build(); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/MasterTask.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/MasterTask.cs b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/MasterTask.cs index 3172265..7ec6609 100644 --- a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/MasterTask.cs +++ b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/MasterTask.cs @@ -70,11 +70,13 @@ namespace Org.Apache.REEF.Network.Examples.GroupCommunication.BroadcastReduceDri } broadcastTime.Start(); + // Each slave task calculates the nth triangle number _broadcastSender.Send(i); broadcastTime.Stop(); reduceTime.Start(); + // Sum up all of the calculated triangle numbers int sum = _sumReducer.Reduce(); reduceTime.Stop(); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/SlaveTask.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/SlaveTask.cs b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/SlaveTask.cs index 11f8630..a0d225c 100644 --- a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/SlaveTask.cs +++ b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/BroadcastReduceDriverAndTasks/SlaveTask.cs @@ -59,6 +59,7 @@ namespace Org.Apache.REEF.Network.Examples.GroupCommunication.BroadcastReduceDri for (int i = 0; i < _numIterations; i++) { broadcastTime.Start(); + // Receive n from Master Task int n = _broadcastReceiver.Receive(); broadcastTime.Stop();
