Repository: incubator-reef Updated Branches: refs/heads/master 803028bee -> 130859c29
[REEF 708] Delete (obsolete) DriverBridgeConfiguration The removes the obsolete and unused class `DriverBridgeConfiguration`. The file `DriverBridgeConfiguration.cs` contained additional classes which are now in their own files. Some of their methods should be made `private`, and appropriate `[Obsolete]` annotations have been added and JIRAs have been filled to be resolved after 0.13. JIRA: [REEF-708](https://issues.apache.org/jira/browse/REEF-708) Pull request: This closes #457 Author: Markus Weimer <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/130859c2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/130859c2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/130859c2 Branch: refs/heads/master Commit: 130859c29c2d59460b8fa30b328591b7411ad3e3 Parents: 803028b Author: Markus Weimer <[email protected]> Authored: Tue Sep 1 17:52:07 2015 -0700 Committer: Julia Wang <[email protected]> Committed: Wed Sep 2 00:35:10 2015 -0700 ---------------------------------------------------------------------- .../Bridge/CommandLineArguments.cs | 38 +++ .../Bridge/CustomTraceLevel.cs | 47 +++ .../Bridge/CustomTraceListeners.cs | 39 +++ .../Bridge/DriverBridgeConfiguration.cs | 296 ------------------- .../Org.Apache.REEF.Driver.csproj | 4 +- 5 files changed, 127 insertions(+), 297 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/130859c2/lang/cs/Org.Apache.REEF.Driver/Bridge/CommandLineArguments.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/CommandLineArguments.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/CommandLineArguments.cs new file mode 100644 index 0000000..cd3f082 --- /dev/null +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/CommandLineArguments.cs @@ -0,0 +1,38 @@ +// 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; +using System.Collections.Generic; +using Org.Apache.REEF.Tang.Annotations; + +namespace Org.Apache.REEF.Driver.Bridge +{ + // TODO[REEF-710] Act on the obsoletes + public sealed class CommandLineArguments + { + [Obsolete("This constructor will be made `private` after 0.13.")] + [Inject] + public CommandLineArguments( + [Parameter(typeof(DriverBridgeConfigurationOptions.ArgumentSets))] ISet<string> arguments) + { + Arguments = arguments; + } + + [Obsolete("The setter will be made `private` after 0.13.")] + public ISet<string> Arguments { get; set; } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/130859c2/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceLevel.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceLevel.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceLevel.cs new file mode 100644 index 0000000..dd0bc52 --- /dev/null +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceLevel.cs @@ -0,0 +1,47 @@ +// 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; +using System.Globalization; +using Org.Apache.REEF.Tang.Annotations; +using Org.Apache.REEF.Utilities.Logging; + +namespace Org.Apache.REEF.Driver.Bridge +{ + // TODO[REEF-709] Act on the obsoletes here. + public sealed class CustomTraceLevel + { + [Obsolete("This constructor will be made `private` after 0.13.")] + [Inject] + public CustomTraceLevel([Parameter(typeof(DriverBridgeConfigurationOptions.TraceLevel))] string traceLevel) + { + var level = Level.Verbose; + if (Enum.TryParse(traceLevel.ToString(CultureInfo.InvariantCulture), out level)) + { + Logger.SetCustomLevel(level); + } + else + { + Console.WriteLine("Cannot parse trace level" + traceLevel); + } + TraceLevel = level; + } + + [Obsolete("The setter will be made `private` after 0.13.")] + public Level TraceLevel { get; set; } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/130859c2/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceListeners.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceListeners.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceListeners.cs new file mode 100644 index 0000000..585f3e8 --- /dev/null +++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/CustomTraceListeners.cs @@ -0,0 +1,39 @@ +// 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; +using System.Collections.Generic; +using System.Diagnostics; +using Org.Apache.REEF.Tang.Annotations; + +namespace Org.Apache.REEF.Driver.Bridge +{ + // TODO[REEF-711] Act on the obsoletes. + public sealed class CustomTraceListeners + { + [Obsolete("This constructor will be made `private` after 0.13.")] + [Inject] + public CustomTraceListeners( + [Parameter(typeof(DriverBridgeConfigurationOptions.TraceListenersSet))] ISet<TraceListener> listeners) + { + Listeners = listeners; + } + + [Obsolete("The setter will be made `private` after 0.13.")] + public ISet<TraceListener> Listeners { get; set; } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/130859c2/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfiguration.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfiguration.cs deleted file mode 100644 index 4b0d6d1..0000000 --- a/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfiguration.cs +++ /dev/null @@ -1,296 +0,0 @@ -/** - * 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; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using Org.Apache.REEF.Common.Context; -using Org.Apache.REEF.Common.Evaluator; -using Org.Apache.REEF.Driver.Context; -using Org.Apache.REEF.Driver.Evaluator; -using Org.Apache.REEF.Driver.Task; -using Org.Apache.REEF.Tang.Annotations; -using Org.Apache.REEF.Tang.Formats; -using Org.Apache.REEF.Tang.Util; -using Org.Apache.REEF.Utilities.Logging; - -[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")] - -namespace Org.Apache.REEF.Driver.Bridge -{ - [Obsolete(message:"Obsolete since 0.12, will be removed in 0,.13. Use DriverConfiguration instead.", error:false)] - public class DriverBridgeConfiguration : ConfigurationModuleBuilder - { - /// <summary> - /// The event handler invoked right after the driver boots up. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - [Obsolete("Use OnDriverStart instead. Please see Jira REEF-336. Obsoleted v0.12 and will be removed v0.13", false)] - public static readonly OptionalImpl<IStartHandler> OnDriverStarted = new OptionalImpl<IStartHandler>(); - - /// <summary> - /// The event handler invoked when driver restarts - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IDriverRestarted>> OnDriverRestarted = new OptionalImpl<IObserver<IDriverRestarted>>(); - - /// <summary> - /// The event handler for requesting evaluator - /// </summary> - [Obsolete(@"Obsoleted at versioin 0.12 and will be removed at version 0.13. See https://issues.apache.org/jira/browse/REEF-168")] - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IEvaluatorRequestor>> OnEvaluatorRequested = new OptionalImpl<IObserver<IEvaluatorRequestor>>(); - - /// <summary> - /// Event handler for allocated evaluators. Defaults to returning the evaluator if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IAllocatedEvaluator>> OnEvaluatorAllocated = new OptionalImpl<IObserver<IAllocatedEvaluator>>(); - - /// <summary> - /// Event handler for completed evaluators. Defaults to logging if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<ICompletedEvaluator>> OnEvaluatorCompleted = new OptionalImpl<IObserver<ICompletedEvaluator>>(); - - /// <summary> - /// Event handler for failed evaluators. Defaults to job failure if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IFailedEvaluator>> OnEvaluatorFailed = new OptionalImpl<IObserver<IFailedEvaluator>>(); - - /// <summary> - /// Event handler for failed evaluators. Defaults to job failure if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IHttpHandler> OnHttpEvent = new OptionalImpl<IHttpHandler>(); - - /// <summary> - /// Event handler for task messages. Defaults to logging if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<ITaskMessage>> OnTaskMessage = new OptionalImpl<IObserver<ITaskMessage>>(); - - /// <summary> - /// Event handler for completed tasks. Defaults to closing the context the task ran on if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<ICompletedTask>> OnTaskCompleted = new OptionalImpl<IObserver<ICompletedTask>>(); - - /// <summary> - /// Event handler for failed tasks. Defaults to job failure if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IFailedTask>> OnTaskFailed = new OptionalImpl<IObserver<IFailedTask>>(); - - ///// <summary> - ///// Event handler for running tasks. Defaults to logging if not bound. - ///// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IRunningTask>> OnTaskRunning = new OptionalImpl<IObserver<IRunningTask>>(); - - ///// <summary> - ///// Event handler for running task received during driver restart. Defaults to logging if not bound. - ///// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IRunningTask>> OnDriverRestartTaskRunning = new OptionalImpl<IObserver<IRunningTask>>(); - - /// <summary> - /// Event handler for suspended tasks. Defaults to job failure if not bound. Rationale: many jobs don't support - /// task suspension. Hence, this parameter should be optional. The only sane default is to crash the job, then. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<ISuspendedTask>> OnTaskSuspended = new OptionalImpl<IObserver<ISuspendedTask>>(); - - /// <summary> - /// Event handler for active context. Defaults to closing the context if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IActiveContext>> OnContextActive = new OptionalImpl<IObserver<IActiveContext>>(); - - /// <summary> - /// Event handler for active context received during driver restart. Defaults to closing the context if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IActiveContext>> OnDriverRestartContextActive = new OptionalImpl<IObserver<IActiveContext>>(); - - /// <summary> - /// Event handler for closed context. Defaults to logging if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IClosedContext>> OnContextClosed = new OptionalImpl<IObserver<IClosedContext>>(); - - /// <summary> - /// Event handler for closed context. Defaults to job failure if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IFailedContext>> OnContextFailed = new OptionalImpl<IObserver<IFailedContext>>(); - - /// <summary> - /// Event handler for context messages. Defaults to logging if not bound. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IContextMessage>> OnContextMessage = new OptionalImpl<IObserver<IContextMessage>>(); - - /// <summary> - /// Additional set of string arguments that can be pssed to handlers through client - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalParameter<string> CommandLineArguments = new OptionalParameter<string>(); - - /// <summary> - /// The trace level of the TraceListner - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalParameter<string> CustomTraceLevel = new OptionalParameter<string>(); - - /// <summary> - /// Additional set of trace listners provided by client - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalParameter<TraceListener> CustomTraceListeners = new OptionalParameter<TraceListener>(); - - /// <summary> - /// The implemenation for (attempting to) re-establish connection to driver - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IDriverConnection> OnDriverReconnect = new OptionalImpl<IDriverConnection>(); - - ///// <summary> - ///// Event handler for driver restart completed event received during driver restart. Defaults to logging if not bound. - ///// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IDriverRestartCompleted>> OnDriverRestartCompleted = new OptionalImpl<IObserver<IDriverRestartCompleted>>(); - - ///// <summary> - ///// Event handler for driver restart failed evaluator event received during driver restart. Defaults to job failure if not bound. - ///// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalImpl<IObserver<IFailedEvaluator>> OnDriverRestartEvaluatorFailed = new OptionalImpl<IObserver<IFailedEvaluator>>(); - - /// <summary> - /// Evaluator recovery timeout in seconds for driver restart. If value is greater than 0, restart is enabled. The default value is -1. - /// </summary> - [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] - public static readonly OptionalParameter<int> DriverRestartEvaluatorRecoverySeconds = new OptionalParameter<int>(); - - // This is currently not needed in Bridge/Driver model - ///// <summary> - ///// The event handler invoked right before the driver shuts down. Defaults to ignore. - ///// </summary> - //public static readonly OptionalImpl<IObserver<StopTime>> OnDriverStop = new OptionalImpl<IObserver<StopTime>>(); - - // Client handlers only needed when client interactions are expeceted. Not enabled for now. - ///// <summary> - ///// Event handler for client messages. Defaults to logging if not bound. - ///// </summary> - //public static readonly OptionalImpl<IObserver<byte[]>> OnClientMessage = new OptionalImpl<IObserver<byte[]>>(); - - // Client handlers only needed when client interactions are expeceted. Not enabled for now. - ///// <summary> - ///// Event handler for close messages sent by the client. Defaults to job failure if not bound. - ///// Note: in java the type is void, but IObserver does not take void as a type - ///// </summary> - //public static readonly OptionalImpl<IObserver<byte[]>> OnClientClosed = new OptionalImpl<IObserver<byte[]>>(); - - // Client handlers only needed when client interactions are expeceted. Not enabled for now. - ///// <summary> - ///// Event handler for close messages sent by the client. Defaults to job failure if not bound. - ///// </summary> - //public static readonly OptionalImpl<IObserver<byte[]>> OnClientClosedMessage = new OptionalImpl<IObserver<byte[]>>(); - - public static ConfigurationModule ConfigurationModule - { - get - { - return new DriverBridgeConfiguration() - .BindImplementation(GenericType<IStartHandler>.Class, OnDriverStarted) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartedHandlers>.Class, OnDriverRestarted) - .BindImplementation(GenericType<IDriverConnection>.Class, OnDriverReconnect) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.EvaluatorRequestHandlers>.Class, OnEvaluatorRequested) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.AllocatedEvaluatorHandlers>.Class, OnEvaluatorAllocated) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ActiveContextHandlers>.Class, OnContextActive) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.TaskMessageHandlers>.Class, OnTaskMessage) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.FailedTaskHandlers>.Class, OnTaskFailed) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.RunningTaskHandlers>.Class, OnTaskRunning) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.SuspendedTaskHandlers>.Class, OnTaskSuspended) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.FailedEvaluatorHandlers>.Class, OnEvaluatorFailed) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.CompletedEvaluatorHandlers>.Class, OnEvaluatorCompleted) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.CompletedTaskHandlers>.Class, OnTaskCompleted) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ClosedContextHandlers>.Class, OnContextClosed) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.FailedContextHandlers>.Class, OnContextFailed) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ContextMessageHandlers>.Class, OnContextMessage) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ArgumentSets>.Class, CommandLineArguments) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.HttpEventHandlers>.Class, OnHttpEvent) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.TraceListenersSet>.Class, CustomTraceListeners) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartActiveContextHandlers>.Class, OnDriverRestartContextActive) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartRunningTaskHandlers>.Class, OnDriverRestartTaskRunning) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartCompletedHandlers>.Class, OnDriverRestartCompleted) - .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartFailedEvaluatorHandlers>.Class, OnDriverRestartEvaluatorFailed) - .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.TraceLevel>.Class, CustomTraceLevel) - .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.DriverRestartEvaluatorRecoverySeconds>.Class, DriverRestartEvaluatorRecoverySeconds) - .Build(); - } - } - } - - public class CommandLineArguments - { - [Inject] - public CommandLineArguments([Parameter(typeof(DriverBridgeConfigurationOptions.ArgumentSets))] ISet<string> arguments) - { - Arguments = arguments; - } - - public ISet<string> Arguments { get; set; } - } - - public class CustomTraceListeners - { - [Inject] - public CustomTraceListeners([Parameter(typeof(DriverBridgeConfigurationOptions.TraceListenersSet))] ISet<TraceListener> listeners) - { - Listeners = listeners; - } - - public ISet<TraceListener> Listeners { get; set; } - } - - public class CustomTraceLevel - { - [Inject] - public CustomTraceLevel([Parameter(typeof(DriverBridgeConfigurationOptions.TraceLevel))] string traceLevel) - { - Level level = Level.Verbose; - if (Enum.TryParse(traceLevel.ToString(CultureInfo.InvariantCulture), out level)) - { - Logger.SetCustomLevel(level); - } - else - { - Console.WriteLine("Cannot parse trace level" + traceLevel); - } - TraceLevel = level; - } - - public Level TraceLevel { get; set; } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/130859c2/lang/cs/Org.Apache.REEF.Driver/Org.Apache.REEF.Driver.csproj ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Driver/Org.Apache.REEF.Driver.csproj b/lang/cs/Org.Apache.REEF.Driver/Org.Apache.REEF.Driver.csproj index f04eb8f..b38ae72 100644 --- a/lang/cs/Org.Apache.REEF.Driver/Org.Apache.REEF.Driver.csproj +++ b/lang/cs/Org.Apache.REEF.Driver/Org.Apache.REEF.Driver.csproj @@ -59,8 +59,10 @@ under the License. <Compile Include="Bridge\ClrHandlerHelper.cs" /> <Compile Include="Bridge\ClrSystemHandler.cs" /> <Compile Include="Bridge\ClrSystemHandlerWrapper.cs" /> + <Compile Include="Bridge\CommandLineArguments.cs" /> + <Compile Include="Bridge\CustomTraceLevel.cs" /> + <Compile Include="Bridge\CustomTraceListeners.cs" /> <Compile Include="Bridge\DriverBridge.cs" /> - <Compile Include="Bridge\DriverBridgeConfiguration.cs" /> <Compile Include="Bridge\DriverBridgeConfigurationOptions.cs" /> <Compile Include="Bridge\Events\ActiveContext.cs" /> <Compile Include="Bridge\Events\AllocatedEvaluator.cs" />
