You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by ju...@apache.org on 2015/04/20 23:23:33 UTC

incubator-reef git commit: [REEF-253] Mark unused code paths in the C# Driver with [Obsolete]

Repository: incubator-reef
Updated Branches:
  refs/heads/master b1296922d -> ac380af06


[REEF-253]  Mark unused code paths in the C# Driver with [Obsolete]

JIRA: REEF-253. (https://issues.apache.org/jira/browse/REEF-253)

This Closes  #153

Author:    Yingda Chen <yd...@gmail.com>


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

Branch: refs/heads/master
Commit: ac380af06f0faeb89e050355a2f116fa8c1bce18
Parents: b129692
Author: Yingda Chen <yd...@gmail.com>
Authored: Sun Apr 19 18:55:54 2015 -0700
Committer: Julia Wang <jw...@yahoo.com>
Committed: Mon Apr 20 14:13:51 2015 -0700

----------------------------------------------------------------------
 .../Api/IResourceLaunchHandler.cs               |  1 +
 .../Api/IResourceReleaseHandler.cs              |  3 ++-
 .../Api/IResourceRequestHandler.cs              |  3 ++-
 .../ClientJobStatusHandler.cs                   |  1 +
 .../EvaluatorHeartBeatSanityChecker.cs          |  1 +
 lang/cs/Org.Apache.REEF.Driver/ClientManager.cs |  1 +
 .../Context/EvaluatorContext.cs                 |  1 +
 .../Contract/IBridgeContract.cs                 |  3 +++
 lang/cs/Org.Apache.REEF.Driver/DriverManager.cs |  1 +
 .../DriverRuntimeConfiguration.cs               |  2 ++
 .../DriverRuntimeConfigurationOptions.cs        |  2 ++
 .../Org.Apache.REEF.Driver/EvaluatorManager.cs  |  3 ++-
 .../Task/RunningTaskImpl.cs                     | 20 ++++----------------
 13 files changed, 23 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Common/Api/IResourceLaunchHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Api/IResourceLaunchHandler.cs b/lang/cs/Org.Apache.REEF.Common/Api/IResourceLaunchHandler.cs
index f2fcd22..53c0b8b 100644
--- a/lang/cs/Org.Apache.REEF.Common/Api/IResourceLaunchHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IResourceLaunchHandler.cs
@@ -22,6 +22,7 @@ using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 
 namespace Org.Apache.REEF.Common.Api
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public interface IResourceLaunchHandler : IObserver<ResourceLaunchProto>
     {
     }

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Common/Api/IResourceReleaseHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Api/IResourceReleaseHandler.cs b/lang/cs/Org.Apache.REEF.Common/Api/IResourceReleaseHandler.cs
index b02cc3d..6712634 100644
--- a/lang/cs/Org.Apache.REEF.Common/Api/IResourceReleaseHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IResourceReleaseHandler.cs
@@ -22,7 +22,8 @@ using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 
 namespace Org.Apache.REEF.Common.Api
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public interface IResourceReleaseHandler : IObserver<ResourceReleaseProto>
     {
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Common/Api/IResourceRequestHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Api/IResourceRequestHandler.cs b/lang/cs/Org.Apache.REEF.Common/Api/IResourceRequestHandler.cs
index 5038858..4668f7a 100644
--- a/lang/cs/Org.Apache.REEF.Common/Api/IResourceRequestHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IResourceRequestHandler.cs
@@ -22,7 +22,8 @@ using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 
 namespace Org.Apache.REEF.Common.Api
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public interface IResourceRequestHandler : IObserver<ResourceRequestProto>
     {
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs b/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs
index 2dea0d0..05e4669 100644
--- a/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs
@@ -27,6 +27,7 @@ using Org.Apache.REEF.Wake.Time.Event;
 
 namespace Org.Apache.REEF.Common
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class ClientJobStatusHandler : IJobMessageObserver, IObserver<StartTime>
     {
         private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClientJobStatusHandler));

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Common/EvaluatorHeartBeatSanityChecker.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/EvaluatorHeartBeatSanityChecker.cs b/lang/cs/Org.Apache.REEF.Common/EvaluatorHeartBeatSanityChecker.cs
index 8653959..c8dea3b 100644
--- a/lang/cs/Org.Apache.REEF.Common/EvaluatorHeartBeatSanityChecker.cs
+++ b/lang/cs/Org.Apache.REEF.Common/EvaluatorHeartBeatSanityChecker.cs
@@ -24,6 +24,7 @@ using Org.Apache.REEF.Utilities.Logging;
 
 namespace Org.Apache.REEF.Common
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class EvaluatorHeartBeatSanityChecker
     {
         private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorHeartBeatSanityChecker));

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs b/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs
index a00c261..09f4e21 100644
--- a/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs
@@ -23,6 +23,7 @@ using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 // TODO
 namespace Org.Apache.REEF.Driver
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class ClientManager : IObserver<JobControlProto>
     {
         public void OnNext(JobControlProto value)

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/Context/EvaluatorContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/EvaluatorContext.cs b/lang/cs/Org.Apache.REEF.Driver/Context/EvaluatorContext.cs
index b16021c..32009de 100644
--- a/lang/cs/Org.Apache.REEF.Driver/Context/EvaluatorContext.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/EvaluatorContext.cs
@@ -29,6 +29,7 @@ using Org.Apache.REEF.Utilities.Logging;
 
 namespace Org.Apache.REEF.Driver.Context
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class EvaluatorContext : IActiveContext
     {
         private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorContext));

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/Contract/IBridgeContract.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Contract/IBridgeContract.cs b/lang/cs/Org.Apache.REEF.Driver/Contract/IBridgeContract.cs
index 2c08d0b..1d96e4d 100644
--- a/lang/cs/Org.Apache.REEF.Driver/Contract/IBridgeContract.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/Contract/IBridgeContract.cs
@@ -17,8 +17,11 @@
  * under the License.
  */
 
+using System;
+
 namespace Org.Apache.REEF.Driver.Contract
 {
+    [Obsolete("Tmp code never used")]
     public interface IBridgeContract
     {
         string InstanceId { get; set; }

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs b/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs
index ab416fc..a3b53ed 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs
@@ -38,6 +38,7 @@ using Org.Apache.REEF.Wake.Time.Runtime.Event;
 
 namespace Org.Apache.REEF.Driver
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class DriverManager : 
         IEvaluatorRequestor, 
         IObserver<RuntimeStatusProto>, 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs b/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs
index 641476f..9d7f8ad 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs
@@ -17,6 +17,7 @@
  * under the License.
  */
 
+using System;
 using Org.Apache.REEF.Common;
 using Org.Apache.REEF.Common.Catalog;
 using Org.Apache.REEF.Tang.Formats;
@@ -24,6 +25,7 @@ using Org.Apache.REEF.Tang.Util;
 
 namespace Org.Apache.REEF.Driver
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class DriverRuntimeConfiguration : ConfigurationModuleBuilder
     {
         public static ConfigurationModule ConfigurationModule

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfigurationOptions.cs
index 085e573..9ba1820 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfigurationOptions.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfigurationOptions.cs
@@ -17,11 +17,13 @@
  * under the License.
  */
 
+using System;
 using Org.Apache.REEF.Common;
 using Org.Apache.REEF.Tang.Annotations;
 
 namespace Org.Apache.REEF.Driver
 {
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class DriverRuntimeConfigurationOptions
     {
         [NamedParameter(documentation: "Job message handler (see ClientJobStatusHandler)")]

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs b/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs
index f3284e8..e28373d 100644
--- a/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs
@@ -55,6 +55,7 @@ namespace Org.Apache.REEF.Driver
     /// A (push-based) EventHandler channel is established EvaluatorManager -> EvaluatorRuntime.
     /// The EvaluatorManager uses this to forward Driver messages, launch Tasks, and initiate control information (e.g., shutdown, suspend).
     /// </summary>
+    [Obsolete("Driver core logic no longer needed in.NET")]
     public class EvaluatorManager : IDisposable, IIdentifiable
     {
         private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorManager));
@@ -567,7 +568,7 @@ namespace Org.Apache.REEF.Driver
             if (taskState == State.INIT)
             {
                 EvaluatorContext evaluatorContext = GetEvaluatorContext(contextId);
-                _runningTask = new RunningTaskImpl(this, taskId, evaluatorContext);
+                _runningTask = new RunningTaskImpl(taskId, evaluatorContext);
                 // this.dispatcher.onNext(RunningTask.class, this.runningTask);
             }
             else if (taskState == State.SUSPEND)

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/ac380af0/lang/cs/Org.Apache.REEF.Driver/Task/RunningTaskImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Task/RunningTaskImpl.cs b/lang/cs/Org.Apache.REEF.Driver/Task/RunningTaskImpl.cs
index 7486727..056c188 100644
--- a/lang/cs/Org.Apache.REEF.Driver/Task/RunningTaskImpl.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/RunningTaskImpl.cs
@@ -17,6 +17,7 @@
  * under the License.
  */
 
+using System;
 using System.Globalization;
 using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 using Org.Apache.REEF.Driver.Context;
@@ -24,21 +25,18 @@ using Org.Apache.REEF.Utilities.Logging;
 
 namespace Org.Apache.REEF.Driver.Task
 {
-   public class RunningTaskImpl : IRunningTask
+    [Obsolete("Driver core logic no longer needed in.NET")]
+    public class RunningTaskImpl : IRunningTask
    {
        private static readonly Logger LOGGER = Logger.GetLogger(typeof(RunningTaskImpl));
        
        private readonly string _id;
 
-       private readonly EvaluatorManager _evaluatorManager;
-
        private readonly EvaluatorContext _evaluatorContext;
 
-       public RunningTaskImpl(EvaluatorManager evaluatorManager, string taskId, EvaluatorContext evaluatorContext)
+       public RunningTaskImpl(string taskId, EvaluatorContext evaluatorContext)
        {
-           LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "INIT: TaskRuntime id [{0}] on evaluator id [{1}]", taskId, evaluatorManager.Id));
            _id = taskId;
-           _evaluatorManager = evaluatorManager;
            _evaluatorContext = evaluatorContext;
        }
 
@@ -68,44 +66,34 @@ namespace Org.Apache.REEF.Driver.Task
 
        public void Dispose()
        {
-           LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "DISPOSE: TaskRuntime id [{0}] on evaluator id [{1}]", _id, _evaluatorManager.Id));
            ContextControlProto contextControlProto = new ContextControlProto();
            contextControlProto.stop_task = new StopTaskProto();
-           _evaluatorManager.Handle(contextControlProto);
        }
 
        public void Dispose(byte[] message)
        {
-           LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "DISPOSE: TaskRuntime id [{0}] on evaluator id [{1}] with message", _id, _evaluatorManager.Id));
            ContextControlProto contextControlProto = new ContextControlProto();
            contextControlProto.stop_task = new StopTaskProto();
            contextControlProto.task_message = message;
-           _evaluatorManager.Handle(contextControlProto);
        }
 
        public void OnNext(byte[] message)
        {
-           LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "MESSAGE: TaskRuntime id [{0}] on evaluator id [{1}]", _id, _evaluatorManager.Id));
            ContextControlProto contextControlProto = new ContextControlProto();
            contextControlProto.task_message = message;
-           _evaluatorManager.Handle(contextControlProto);
        }
 
        public void Suspend(byte[] message)
        {
-           LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "SUSPEND: TaskRuntime id [{0}] on evaluator id [{1}] with message", _id, _evaluatorManager.Id));
            ContextControlProto contextControlProto = new ContextControlProto();
            contextControlProto.suspend_task = new SuspendTaskProto();
            contextControlProto.task_message = message;
-           _evaluatorManager.Handle(contextControlProto);
        }
 
        public void Suspend()
        {
-           LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "SUSPEND: TaskRuntime id [{0}] on evaluator id [{1}]", _id, _evaluatorManager.Id));
            ContextControlProto contextControlProto = new ContextControlProto();
            contextControlProto.suspend_task = new SuspendTaskProto();
-           _evaluatorManager.Handle(contextControlProto);
        }
 
        public override string ToString()