Repository: reef
Updated Branches:
  refs/heads/master bf5caab94 -> f5ae65982


[REEF-1306] Remove OnDriverReconnect from parameter in DriverConfiguration

JIRA:
  [REEF-1306](https://issues.apache.org/jira/browse/REEF-1306)

Pull Request:
  This closes #1017


Project: http://git-wip-us.apache.org/repos/asf/reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/f5ae6598
Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/f5ae6598
Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/f5ae6598

Branch: refs/heads/master
Commit: f5ae6598256c71feda750de5ac5d116e4dba67e7
Parents: bf5caab
Author: Andrew Chung <[email protected]>
Authored: Fri May 27 17:08:53 2016 -0700
Committer: Markus Weimer <[email protected]>
Committed: Tue May 31 09:34:29 2016 -0700

----------------------------------------------------------------------
 .../DefaultYarnClusterHttpDriverConnection.cs   |  1 -
 .../DynamicDriverReconnConfigProvider.cs        | 55 --------------------
 .../Org.Apache.REEF.Common.csproj               |  1 -
 .../Bridge/DriverBridge.cs                      | 31 +----------
 .../DriverConfiguration.cs                      | 11 ----
 .../AllHandlers.cs                              |  4 +-
 .../DriverRestart.cs                            |  3 +-
 7 files changed, 6 insertions(+), 100 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnClusterHttpDriverConnection.cs
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnClusterHttpDriverConnection.cs
 
b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnClusterHttpDriverConnection.cs
index aacb957..6ae2b72 100644
--- 
a/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnClusterHttpDriverConnection.cs
+++ 
b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnClusterHttpDriverConnection.cs
@@ -17,7 +17,6 @@
 
 using System;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Utilities;
 
 namespace Org.Apache.REEF.Common.Evaluator
 {

http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverConnectionConfigurationProviders/DynamicDriverReconnConfigProvider.cs
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverConnectionConfigurationProviders/DynamicDriverReconnConfigProvider.cs
 
b/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverConnectionConfigurationProviders/DynamicDriverReconnConfigProvider.cs
deleted file mode 100644
index aa745ae..0000000
--- 
a/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverConnectionConfigurationProviders/DynamicDriverReconnConfigProvider.cs
+++ /dev/null
@@ -1,55 +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 Org.Apache.REEF.Tang.Implementations.Tang;
-using Org.Apache.REEF.Tang.Interface;
-
-namespace 
Org.Apache.REEF.Common.Evaluator.DriverConnectionConfigurationProviders
-{
-    /// <summary>
-    /// A helper <see cref="IDriverReconnConfigProvider"/> that binds <see 
cref="IDriverConnection"/>
-    /// dynamically. This is used such that a <see 
cref="IDriverReconnConfigProvider"/> can
-    /// be used to provide the type of <see cref="IDriverConnection"/> to the 
Evaluator if the user only
-    /// binds the deprecated <see cref="IDriverConnection"/> optional 
implementation, instead of the
-    /// new <see cref="IDriverReconnConfigProvider"/> implementation.
-    /// TODO[JIRA REEF-1306]: Remove.
-    /// </summary>
-    internal sealed class DynamicDriverReconnConfigProvider : 
IDriverReconnConfigProvider
-    {
-        private readonly Type _driverReconnectionType;
-
-        internal DynamicDriverReconnConfigProvider(Type type)
-        {
-            _driverReconnectionType = type;
-            if (!typeof(IDriverConnection).IsAssignableFrom(type))
-            {
-                throw new ArgumentException("The type must be a subclass of 
IDriverConnection.");
-            }
-        }
-
-        /// <summary>
-        /// A configuration where the type of <see cref="IDriverConnection"/> 
is bound dynamically.
-        /// </summary>
-        public IConfiguration GetConfiguration()
-        {
-            return TangFactory.GetTang().NewConfigurationBuilder()
-                .BindImplementation(typeof(IDriverConnection), 
_driverReconnectionType)
-                .Build();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj 
b/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
index b48e0e2..6a64571 100644
--- a/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
+++ b/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
@@ -92,7 +92,6 @@ under the License.
     <Compile Include="Evaluator\DefaultLocalHttpDriverConnection.cs" />
     <Compile Include="Evaluator\DefaultYarnClusterHttpDriverConnection.cs" />
     <Compile Include="Evaluator\DefaultYarnOneBoxHttpDriverConnection.cs" />
-    <Compile 
Include="Evaluator\DriverConnectionConfigurationProviders\DynamicDriverReconnConfigProvider.cs"
 />
     <Compile 
Include="Evaluator\DriverConnectionConfigurationProviders\LocalHttpDriverReconnConfigProvider.cs"
 />
     <Compile 
Include="Evaluator\DriverConnectionConfigurationProviders\YarnOneBoxHttpDriverReconnConfigProvider.cs"
 />
     <Compile Include="Evaluator\DriverInformation.cs" />

http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/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 263c926..dd30462 100644
--- a/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs
@@ -188,11 +188,7 @@ namespace Org.Apache.REEF.Driver.Bridge
             _driverRestartFailedEvaluatorHandlers = 
driverRestartFailedEvaluatorHandlers;
             _httpServerHandler = httpServerHandler;
 
-            // TODO[JIRA REEF-1306]: Remove after it is bound directly into 
EvaluatorConfigurationProviders.
-            _configurationProviders = new 
HashSet<IConfigurationProvider>(configurationProviders)
-            {
-                GetDriverReconnectionProvider(driverReconnConfigProvider, 
driverConnection)
-            };
+            _configurationProviders = new 
HashSet<IConfigurationProvider>(configurationProviders) { 
driverReconnConfigProvider };
 
             _progressProvider = progressProvider;
             
@@ -216,31 +212,6 @@ namespace Org.Apache.REEF.Driver.Bridge
             _driverRestartFailedEvaluatorSubscriber = new 
ClrSystemHandler<IFailedEvaluator>();
         }
 
-        private static IDriverReconnConfigProvider 
GetDriverReconnectionProvider(
-            IDriverReconnConfigProvider driverReconnConfigProvider,
-            IDriverConnection driverConnection)
-        {
-            // If not the default, this means that the user has bound the 
newer configuration. Return it.
-            if (!(driverReconnConfigProvider is 
DefaultDriverReconnConfigProvider))
-            {
-                return driverReconnConfigProvider;
-            }
-
-            // If not default, this means that the user has bound the old 
configuration.
-            // Use the dynamic configuration provider in that case.
-            if (!(driverConnection is MissingDriverConnection))
-            {
-                return new 
DynamicDriverReconnConfigProvider(driverConnection.GetType());
-            }
-
-            // This is done as a stop gap for deprecation because we cannot 
bind an implementation 
-            // of IDriverConnection to the driver CLRBridgeConfiguration if it 
is already bound
-            // by the user, since the driver configuration and Evaluator 
configuration will be combined
-            // at the Evaluator. We thus need to return the 
DriverReconnectionConfigurationProvider
-            // that does not bind IDriverConnection such that a TANG conflict 
does not occur.
-            return 
TangFactory.GetTang().NewInjector().GetInstance<DefaultDriverReconnConfigProvider>();
-        }
-
         public BridgeHandlerManager Subscribe()
         {
             var bridgeHandlerManager = new BridgeHandlerManager();

http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/lang/cs/Org.Apache.REEF.Driver/DriverConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/DriverConfiguration.cs 
b/lang/cs/Org.Apache.REEF.Driver/DriverConfiguration.cs
index 62af84c..169ea96 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverConfiguration.cs
@@ -18,7 +18,6 @@
 using System;
 using System.Diagnostics;
 using Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.Evaluator;
 using Org.Apache.REEF.Common.Evaluator.DriverConnectionConfigurationProviders;
 using Org.Apache.REEF.Common.Evaluator.Parameters;
 using Org.Apache.REEF.Driver.Bridge;
@@ -172,13 +171,6 @@ namespace Org.Apache.REEF.Driver
             new OptionalParameter<TraceListener>();
 
         /// <summary>
-        /// The implemenation for (attempting to) re-establish connection to 
driver
-        /// TODO[JIRA REEF-1306]: Remove.
-        /// </summary>
-        [Obsolete("Deprecated in 0.15, will be removed. Please use 
DriverReconnectionConfigurationProvider instead.")]
-        public static readonly OptionalImpl<IDriverConnection> 
OnDriverReconnect = new OptionalImpl<IDriverConnection>();
-
-        /// <summary>
         /// The configuration provider for driver reconnection.
         /// </summary>
         public static readonly OptionalImpl<IDriverReconnConfigProvider> 
DriverReconnectionConfigurationProvider =
@@ -203,7 +195,6 @@ namespace Org.Apache.REEF.Driver
                         OnDriverStarted)
                     
.BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartedHandlers>.Class,
                         OnDriverRestarted)
-                    .BindImplementation(GenericType<IDriverConnection>.Class, 
OnDriverReconnect)
                     
.BindSetEntry(GenericType<DriverBridgeConfigurationOptions.AllocatedEvaluatorHandlers>.Class,
                         OnEvaluatorAllocated)
                     
.BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ActiveContextHandlers>.Class,
@@ -243,8 +234,6 @@ namespace Org.Apache.REEF.Driver
                         DriverRestartEvaluatorRecoverySeconds)
                     .BindSetEntry<EvaluatorConfigurationProviders, 
EvaluatorLogLevelProvider, IConfigurationProvider>(
                         GenericType<EvaluatorConfigurationProviders>.Class, 
GenericType<EvaluatorLogLevelProvider>.Class)
-
-                    // TODO[JIRA REEF-1306]: Bind 
DriverReconnectionConfigurationProvider into EvaluatorConfigurationProviders.
                     
.BindImplementation(GenericType<IDriverReconnConfigProvider>.Class, 
DriverReconnectionConfigurationProvider)
                     .BindImplementation(GenericType<IProgressProvider>.Class, 
ProgressProvider)
                     .Build();

http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/lang/cs/Org.Apache.REEF.Examples.AllHandlers/AllHandlers.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples.AllHandlers/AllHandlers.cs 
b/lang/cs/Org.Apache.REEF.Examples.AllHandlers/AllHandlers.cs
index d3c5d0a..1fb6923 100644
--- a/lang/cs/Org.Apache.REEF.Examples.AllHandlers/AllHandlers.cs
+++ b/lang/cs/Org.Apache.REEF.Examples.AllHandlers/AllHandlers.cs
@@ -22,6 +22,7 @@ using Org.Apache.REEF.Client.Common;
 using Org.Apache.REEF.Client.Local;
 using Org.Apache.REEF.Client.Yarn;
 using Org.Apache.REEF.Common.Evaluator;
+using Org.Apache.REEF.Common.Evaluator.DriverConnectionConfigurationProviders;
 using Org.Apache.REEF.Driver;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Defaults;
@@ -66,7 +67,8 @@ namespace Org.Apache.REEF.Examples.AllHandlers
                 .Set(DriverConfiguration.CustomTraceListeners, 
GenericType<DefaultCustomTraceListener>.Class)
                 .Set(DriverConfiguration.CustomTraceLevel, 
Level.Info.ToString())
                 .Set(DriverConfiguration.OnDriverRestarted, 
GenericType<HelloRestartHandler>.Class)
-                .Set(DriverConfiguration.OnDriverReconnect, 
GenericType<DefaultLocalHttpDriverConnection>.Class)
+                
.Set(DriverConfiguration.DriverReconnectionConfigurationProvider, 
+                    GenericType<LocalHttpDriverReconnConfigProvider>.Class)
                 .Set(DriverConfiguration.OnDriverRestartContextActive, 
GenericType<HelloDriverRestartActiveContextHandler>.Class)
                 .Set(DriverConfiguration.OnDriverRestartTaskRunning, 
GenericType<HelloDriverRestartRunningTaskHandler>.Class)
                 .Build();

http://git-wip-us.apache.org/repos/asf/reef/blob/f5ae6598/lang/cs/Org.Apache.REEF.Examples.DriverRestart/DriverRestart.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples.DriverRestart/DriverRestart.cs 
b/lang/cs/Org.Apache.REEF.Examples.DriverRestart/DriverRestart.cs
index 9aca5df..fb27128 100644
--- a/lang/cs/Org.Apache.REEF.Examples.DriverRestart/DriverRestart.cs
+++ b/lang/cs/Org.Apache.REEF.Examples.DriverRestart/DriverRestart.cs
@@ -63,7 +63,8 @@ namespace Org.Apache.REEF.Examples.DriverRestart
                 .Set(DriverConfiguration.OnEvaluatorAllocated, 
GenericType<HelloRestartDriver>.Class)
                 .Set(DriverConfiguration.OnEvaluatorFailed, 
GenericType<HelloRestartDriver>.Class)
                 .Set(DriverConfiguration.OnDriverRestartEvaluatorFailed, 
GenericType<HelloRestartDriver>.Class)
-                .Set(DriverConfiguration.OnDriverReconnect, 
GenericType<DefaultYarnClusterHttpDriverConnection>.Class)
+                
.Set(DriverConfiguration.DriverReconnectionConfigurationProvider, 
+                    
GenericType<YarnClusterHttpDriverReconnConfigProvider>.Class)
                 
.Set(DriverConfiguration.DriverRestartEvaluatorRecoverySeconds, (5 * 
60).ToString())
                 .Build();
 

Reply via email to