You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by tm...@apache.org on 2015/02/10 21:10:39 UTC

[01/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Repository: incubator-reef
Updated Branches:
  refs/heads/master 02c0ad592 -> 7edb8570e


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs
index 3bab994..647faec 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs
@@ -35,81 +35,81 @@ namespace Org.Apache.REEF.Tang.Protobuf
     {
         private static readonly Logger LOGGER = Logger.GetLogger(typeof(ProtocolBufferInjectionPlan));
 
-        private static InjectionPlanProto.InjectionPlan NewConstructor(string fullName, List<InjectionPlanProto.InjectionPlan> plans) 
+        private static Org.Apache.REEF.Tang.Protobuf.InjectionPlan NewConstructor(string fullName, List<Org.Apache.REEF.Tang.Protobuf.InjectionPlan> plans) 
         {
-            InjectionPlanProto.Constructor cconstr = new InjectionPlanProto.Constructor();
-            foreach (InjectionPlanProto.InjectionPlan p in plans)
+            Org.Apache.REEF.Tang.Protobuf.Constructor cconstr = new Org.Apache.REEF.Tang.Protobuf.Constructor();
+            foreach (Org.Apache.REEF.Tang.Protobuf.InjectionPlan p in plans)
             {
                 cconstr.args.Add(p);
             }
 
-            InjectionPlanProto.InjectionPlan plan = new InjectionPlanProto.InjectionPlan();
+            Org.Apache.REEF.Tang.Protobuf.InjectionPlan plan = new Org.Apache.REEF.Tang.Protobuf.InjectionPlan();
             plan.name = fullName;
             plan.constructor = cconstr;
             return plan;
         }
 
-        private static InjectionPlanProto.InjectionPlan NewSubplan(string fullName, int selectedPlan, List<InjectionPlanProto.InjectionPlan> plans) 
+        private static Org.Apache.REEF.Tang.Protobuf.InjectionPlan NewSubplan(string fullName, int selectedPlan, List<Org.Apache.REEF.Tang.Protobuf.InjectionPlan> plans) 
         {
-            InjectionPlanProto.Subplan subPlan = new InjectionPlanProto.Subplan();
+            Org.Apache.REEF.Tang.Protobuf.Subplan subPlan = new Org.Apache.REEF.Tang.Protobuf.Subplan();
 
             subPlan.selected_plan = selectedPlan;
-            foreach (InjectionPlanProto.InjectionPlan p in plans)
+            foreach (Org.Apache.REEF.Tang.Protobuf.InjectionPlan p in plans)
             {
                 subPlan.plans.Add(p);
             }
 
-            InjectionPlanProto.InjectionPlan plan = new InjectionPlanProto.InjectionPlan();
+            Org.Apache.REEF.Tang.Protobuf.InjectionPlan plan = new Org.Apache.REEF.Tang.Protobuf.InjectionPlan();
             plan.name = fullName;
             plan.subplan = subPlan;
             return plan;
         }
 
-        private static InjectionPlanProto.InjectionPlan NewInstance(string fullName, string value)
+        private static Org.Apache.REEF.Tang.Protobuf.InjectionPlan NewInstance(string fullName, string value)
         {
-            InjectionPlanProto.Instance instance = new InjectionPlanProto.Instance();
+            Org.Apache.REEF.Tang.Protobuf.Instance instance = new Org.Apache.REEF.Tang.Protobuf.Instance();
             instance.value = value;
 
-            InjectionPlanProto.InjectionPlan plan = new InjectionPlanProto.InjectionPlan();
+            Org.Apache.REEF.Tang.Protobuf.InjectionPlan plan = new Org.Apache.REEF.Tang.Protobuf.InjectionPlan();
             plan.name = fullName;
             plan.instance = instance;
             return plan;
 
         }
 
-        public static void Serialize(string fileName, InjectionPlan ip)
+        public static void Serialize(string fileName, Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan ip)
         {
-            InjectionPlanProto.InjectionPlan plan = Serialize(ip);
+            Org.Apache.REEF.Tang.Protobuf.InjectionPlan plan = Serialize(ip);
 
             using (var file = File.Create(fileName))
             {
-                Serializer.Serialize<InjectionPlanProto.InjectionPlan>(file, plan);
+                Serializer.Serialize<Org.Apache.REEF.Tang.Protobuf.InjectionPlan>(file, plan);
             }
         }
 
-        public static InjectionPlanProto.InjectionPlan Serialize(InjectionPlan ip) 
+        public static Org.Apache.REEF.Tang.Protobuf.InjectionPlan Serialize(Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan ip) 
         {
-            if (ip is Constructor) 
+            if (ip is Org.Apache.REEF.Tang.Implementations.InjectionPlan.Constructor) 
             {
-                Constructor cons = (Constructor) ip;
-                InjectionPlan[] args = cons.GetArgs();
-                InjectionPlanProto.InjectionPlan[] protoArgs = new InjectionPlanProto.InjectionPlan[args.Length];
+                Org.Apache.REEF.Tang.Implementations.InjectionPlan.Constructor cons = (Org.Apache.REEF.Tang.Implementations.InjectionPlan.Constructor) ip;
+                Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan[] args = cons.GetArgs();
+                Org.Apache.REEF.Tang.Protobuf.InjectionPlan[] protoArgs = new Org.Apache.REEF.Tang.Protobuf.InjectionPlan[args.Length];
                 for (int i = 0; i < args.Length; i++) 
                 {
                     protoArgs[i] = Serialize(args[i]);
                 }
-                return NewConstructor(ip.GetNode().GetFullName(), protoArgs.ToList<InjectionPlanProto.InjectionPlan>());
+                return NewConstructor(ip.GetNode().GetFullName(), protoArgs.ToList<Org.Apache.REEF.Tang.Protobuf.InjectionPlan>());
             } 
-            if (ip is Subplan) 
+            if (ip is Org.Apache.REEF.Tang.Implementations.InjectionPlan.Subplan) 
             {
-                Subplan sp = (Subplan) ip;
-                InjectionPlan[] args = sp.GetPlans();
-                InjectionPlanProto.InjectionPlan[] subPlans = new InjectionPlanProto.InjectionPlan[args.Length];
+                Org.Apache.REEF.Tang.Implementations.InjectionPlan.Subplan sp = (Org.Apache.REEF.Tang.Implementations.InjectionPlan.Subplan) ip;
+                Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan[] args = sp.GetPlans();
+                Org.Apache.REEF.Tang.Protobuf.InjectionPlan[] subPlans = new Org.Apache.REEF.Tang.Protobuf.InjectionPlan[args.Length];
                 for (int i = 0; i < args.Length; i++) 
                 {
                     subPlans[i] = Serialize(args[i]);
                 }
-                return NewSubplan(ip.GetNode().GetFullName(), sp.GetSelectedIndex(), subPlans.ToList<InjectionPlanProto.InjectionPlan>());
+                return NewSubplan(ip.GetNode().GetFullName(), sp.GetSelectedIndex(), subPlans.ToList<Org.Apache.REEF.Tang.Protobuf.InjectionPlan>());
 
             } 
             if (ip is CsInstance) 
@@ -122,27 +122,27 @@ namespace Org.Apache.REEF.Tang.Protobuf
             return null;
         }
 
-        public static InjectionPlan DeSerialize(string fileName, IClassHierarchy ch)
+        public static Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan DeSerialize(string fileName, IClassHierarchy ch)
         {
-            InjectionPlanProto.InjectionPlan protoPlan;
+            Org.Apache.REEF.Tang.Protobuf.InjectionPlan protoPlan;
 
             using (var file = File.OpenRead(fileName))
             {
-                protoPlan = Serializer.Deserialize<InjectionPlanProto.InjectionPlan>(file);
+                protoPlan = Serializer.Deserialize<Org.Apache.REEF.Tang.Protobuf.InjectionPlan>(file);
             }
 
             return Deserialize(ch, protoPlan);
         }
 
-        public static InjectionPlan Deserialize(IClassHierarchy ch, InjectionPlanProto.InjectionPlan ip) 
+        public static Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan Deserialize(IClassHierarchy ch, Org.Apache.REEF.Tang.Protobuf.InjectionPlan ip) 
         {
             string fullName = ip.name;
             if (ip.constructor != null) 
             {
-                InjectionPlanProto.Constructor cons = ip.constructor;
+                Org.Apache.REEF.Tang.Protobuf.Constructor cons = ip.constructor;
                 IClassNode cn = (IClassNode) ch.GetNode(fullName);
 
-                InjectionPlanProto.InjectionPlan[] protoBufArgs = cons.args.ToArray();
+                Org.Apache.REEF.Tang.Protobuf.InjectionPlan[] protoBufArgs = cons.args.ToArray();
 
                 IClassNode[] cnArgs = new IClassNode[protoBufArgs.Length];
 
@@ -160,34 +160,34 @@ namespace Org.Apache.REEF.Tang.Protobuf
                     }
                 }
 
-                InjectionPlan[] ipArgs = new InjectionPlan[protoBufArgs.Length];
+                Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan[] ipArgs = new Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan[protoBufArgs.Length];
 
                 for (int i = 0; i < protoBufArgs.Length; i++) 
                 {
-                    ipArgs[i] = (InjectionPlan) Deserialize(ch, protoBufArgs[i]);
+                    ipArgs[i] = (Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan)Deserialize(ch, protoBufArgs[i]);
                 }
 
                 IConstructorDef constructor = cn.GetConstructorDef(cnArgs);
-                return new Constructor(cn, constructor, ipArgs);
+                return new Org.Apache.REEF.Tang.Implementations.InjectionPlan.Constructor(cn, constructor, ipArgs);
             }
             if (ip.instance != null) 
             {
-                InjectionPlanProto.Instance ins = ip.instance;
+                Org.Apache.REEF.Tang.Protobuf.Instance ins = ip.instance;
                 object instance = Parse(ip.name, ins.value);
                 return new CsInstance(ch.GetNode(ip.name), instance);
             } 
             if (ip.subplan != null) 
             {
-                InjectionPlanProto.Subplan subplan = ip.subplan;
-                InjectionPlanProto.InjectionPlan[] protoBufPlans = subplan.plans.ToArray();
-          
-                InjectionPlan[] subPlans = new InjectionPlan[protoBufPlans.Length];
+                Org.Apache.REEF.Tang.Protobuf.Subplan subplan = ip.subplan;
+                Org.Apache.REEF.Tang.Protobuf.InjectionPlan[] protoBufPlans = subplan.plans.ToArray();
+
+                Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan[] subPlans = new Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan[protoBufPlans.Length];
                 for (int i = 0; i < protoBufPlans.Length; i++) 
                 {
-                    subPlans[i] = (InjectionPlan) Deserialize(ch, protoBufPlans[i]);
+                    subPlans[i] = (Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan)Deserialize(ch, protoBufPlans[i]);
                 }
                 INode n = ch.GetNode(fullName);
-                return new Subplan(n, subPlans);
+                return new Org.Apache.REEF.Tang.Implementations.InjectionPlan.Subplan(n, subPlans);
             } 
             Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new IllegalStateException("Encountered unknown type of InjectionPlan: " + ip), LOGGER);
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Protobuf/class_hierarchy.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Protobuf/class_hierarchy.cs b/lang/cs/Org.Apache.REEF.Tang/Protobuf/class_hierarchy.cs
index 62ffa08..adf9982 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Protobuf/class_hierarchy.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Protobuf/class_hierarchy.cs
@@ -27,7 +27,7 @@
 //------------------------------------------------------------------------------
 
 // Generated from: class_hierarchy.proto
-namespace ClassHierarchyProto
+namespace Org.Apache.REEF.Tang.Protobuf
 {
   [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Node")]
   public partial class Node : global::ProtoBuf.IExtensible

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Protobuf/injection_plan.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Protobuf/injection_plan.cs b/lang/cs/Org.Apache.REEF.Tang/Protobuf/injection_plan.cs
index d7a30dc..3fa879e 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Protobuf/injection_plan.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Protobuf/injection_plan.cs
@@ -27,7 +27,7 @@
 //------------------------------------------------------------------------------
 
 // Generated from: injection_plan.proto
-namespace InjectionPlanProto
+namespace Org.Apache.REEF.Tang.Protobuf
 {
     [global::System.Serializable, global::ProtoBuf.ProtoContract(Name = @"InjectionPlan")]
     public partial class InjectionPlan : global::ProtoBuf.IExtensible

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorConfigurationsTests.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorConfigurationsTests.cs b/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorConfigurationsTests.cs
index c6ed210..32d1fd9 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorConfigurationsTests.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorConfigurationsTests.cs
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Utils;
 
 namespace Org.Apache.REEF.Tests.Evaluator
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorTests.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorTests.cs b/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorTests.cs
index c315d4b..7256765 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorTests.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Evaluator/EvaluatorTests.cs
@@ -19,14 +19,15 @@
 
 using Org.Apache.REEF.Common.Avro;
 using Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using System;
 using System.IO;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.ShellTask;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 
 namespace Org.Apache.REEF.Tests.Evaluator

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Functional/Driver/DriverTestStartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Functional/Driver/DriverTestStartHandler.cs b/lang/cs/Org.Apache.REEF.Tests/Functional/Driver/DriverTestStartHandler.cs
index b3f64dd..c5f6ecd 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Functional/Driver/DriverTestStartHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Functional/Driver/DriverTestStartHandler.cs
@@ -18,7 +18,7 @@
  */
 
 using Org.Apache.REEF.Driver;
-using Org.Apache.REEF.Driver.bridge;
+using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Wake.Time;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageDriver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageDriver.cs b/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageDriver.cs
index 24141fb..a08712b 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageDriver.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageDriver.cs
@@ -20,6 +20,7 @@
 using System;
 using System.Collections.Generic;
 using System.Globalization;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Driver;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Context;
@@ -28,10 +29,10 @@ using Org.Apache.REEF.Driver.Task;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Diagnostics;
 using Org.Apache.REEF.Utilities.Logging;
+using IRunningTask = Org.Apache.REEF.Driver.Task.IRunningTask;
 
 namespace Org.Apache.REEF.Tests.Functional.Messaging
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageTask.cs b/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageTask.cs
index 0c55983..fb460a5 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageTask.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Functional/Messaging/MessageTask.cs
@@ -20,10 +20,10 @@
 using System;
 using System.Globalization;
 using System.Threading;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Common.Tasks.Events;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Tasks.Events;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Diagnostics;
 using Org.Apache.REEF.Utilities.Logging;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Functional/ReefFunctionalTest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Functional/ReefFunctionalTest.cs b/lang/cs/Org.Apache.REEF.Tests/Functional/ReefFunctionalTest.cs
index deef323..2fe444b 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Functional/ReefFunctionalTest.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Functional/ReefFunctionalTest.cs
@@ -29,7 +29,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
 using Microsoft.WindowsAzure.Storage;
 using Microsoft.WindowsAzure.Storage.Blob;
 using Org.Apache.REEF.Driver;
-using Org.Apache.REEF.Driver.bridge;
+using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Logging;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Network/NameServerTests.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Network/NameServerTests.cs b/lang/cs/Org.Apache.REEF.Tests/Network/NameServerTests.cs
index d6e64f8..927dfa7 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Network/NameServerTests.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Network/NameServerTests.cs
@@ -22,7 +22,7 @@ using System.Collections.Generic;
 using System.Net;
 using System.Threading;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Implementations.Tang;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/Network/NetworkServiceTests.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Network/NetworkServiceTests.cs b/lang/cs/Org.Apache.REEF.Tests/Network/NetworkServiceTests.cs
index 9b94ee3..2926cf7 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Network/NetworkServiceTests.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Network/NetworkServiceTests.cs
@@ -23,7 +23,7 @@ using System.Globalization;
 using System.Linq;
 using System.Net;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming;
 using Org.Apache.REEF.Network.NetworkService;
 using Org.Apache.REEF.Tang.Annotations;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tests/bin/reef-bridge-0.11.0-incubating-SNAPSHOT-shaded.jar
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/bin/reef-bridge-0.11.0-incubating-SNAPSHOT-shaded.jar b/lang/cs/Org.Apache.REEF.Tests/bin/reef-bridge-0.11.0-incubating-SNAPSHOT-shaded.jar
index 437d140..788b14f 100644
Binary files a/lang/cs/Org.Apache.REEF.Tests/bin/reef-bridge-0.11.0-incubating-SNAPSHOT-shaded.jar and b/lang/cs/Org.Apache.REEF.Tests/bin/reef-bridge-0.11.0-incubating-SNAPSHOT-shaded.jar differ

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake.Tests/ClockTest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake.Tests/ClockTest.cs b/lang/cs/Org.Apache.REEF.Wake.Tests/ClockTest.cs
index 3af063f..c894c00 100644
--- a/lang/cs/Org.Apache.REEF.Wake.Tests/ClockTest.cs
+++ b/lang/cs/Org.Apache.REEF.Wake.Tests/ClockTest.cs
@@ -27,6 +27,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 using Org.Apache.REEF.Tang.Util;
 using Org.Apache.REEF.Wake.Time;
+using Org.Apache.REEF.Wake.Time.Event;
 using Org.Apache.REEF.Wake.Time.Runtime;
 using Org.Apache.REEF.Wake.Time.Runtime.Event;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/IEventSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/IEventSource.cs b/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/IEventSource.cs
new file mode 100644
index 0000000..51f3c48
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/IEventSource.cs
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Wake.Examples.P2p
+{
+    /// <summary>
+    /// The pull side of the interface: Clients implement this and register it with
+    /// the PullToPush class.
+    /// </summary>
+    /// <typeparam name="T">The event type</typeparam>
+    public interface IEventSource<T>
+    {
+        /// <summary>
+        /// Gets the next event
+        /// </summary>
+        /// <returns>The next event</returns>
+        T GetNext();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs b/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs
new file mode 100644
index 0000000..020921f
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs
@@ -0,0 +1,102 @@
+/**
+ * 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.Utilities.Logging;
+using Org.Apache.REEF.Wake.Util;
+
+namespace Org.Apache.REEF.Wake.Examples.P2p
+{
+    /// <summary>Performs a Pull-to-Push conversion in Wake.</summary>
+    /// <remarks>
+    /// Performs a Pull-to-Push conversion in Wake.
+    /// The class pulls from a set of event sources, and pushes to a single
+    /// EventHandler. If the downstream event handler blocks, this will block,
+    /// providing a simple rate limiting scheme.
+    /// The EventSources are managed in a basic Queue.
+    /// </remarks>
+    public sealed class Pull2Push<T> : IStartable, IDisposable
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(Pull2Push<T>));
+        
+        private readonly IEventHandler<T> _output;
+
+        private readonly Queue<IEventSource<T>> _sources = new Queue<IEventSource<T>>();
+
+        private bool _closed = false;
+
+        /// <summary>
+        /// Constructs a new Pull2Push object
+        /// </summary>
+        /// <param name="output">
+        /// the EventHandler that receives the messages from this
+        /// Pull2Push.
+        /// </param>
+        public Pull2Push(IEventHandler<T> output)
+        {
+            // The downstream EventHandler
+            // The upstream event sources
+            _output = output;
+        }
+
+        /// <summary>Registers an event source.</summary>
+        /// <param name="source">
+        /// The source that will be added to the queue of this
+        /// Pull2Push
+        /// </param>
+        public void Register(IEventSource<T> source)
+        {
+            _sources.Enqueue(source);
+        }
+
+        /// <summary>Executes the message loop.</summary>
+        public void Start()
+        {
+            while (!_closed)
+            {
+                // Grab the next available message source, if any
+                IEventSource<T> nextSource = _sources.Dequeue();
+                if (null != nextSource)
+                {
+                    // Grab the next message from that source, if any
+                    T message = nextSource.GetNext();
+                    if (null != message)
+                    {
+                        // Add the source to the end of the queue again.
+                        _sources.Enqueue(nextSource);
+                        // Send the message. Note that this may block depending on the underlying EventHandler.
+                        _output.OnNext(message);
+                    }
+                    else
+                    {
+                        // The message source has returned null as the next message. We drop the message source in that case.
+                        LOGGER.Log(Level.Info, "Droping message source {0} from the queue " + nextSource.ToString());
+                    }
+                }
+            }
+        }
+
+        // No source where available. We could put a wait() here. 
+        public void Dispose()
+        {
+            _closed = true;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Impl/MissingStartHandlerHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Impl/MissingStartHandlerHandler.cs b/lang/cs/Org.Apache.REEF.Wake/Impl/MissingStartHandlerHandler.cs
index 324eb61..e44f335 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Impl/MissingStartHandlerHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Impl/MissingStartHandlerHandler.cs
@@ -20,6 +20,7 @@
 using System;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Wake.Time;
+using Org.Apache.REEF.Wake.Time.Event;
 
 namespace Org.Apache.REEF.Wake.Impl
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Org.Apache.REEF.Wake.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Org.Apache.REEF.Wake.csproj b/lang/cs/Org.Apache.REEF.Wake/Org.Apache.REEF.Wake.csproj
index 0657a1c..9eb820e 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Org.Apache.REEF.Wake.csproj
+++ b/lang/cs/Org.Apache.REEF.Wake/Org.Apache.REEF.Wake.csproj
@@ -90,6 +90,8 @@ under the License.
   </ItemGroup>
   <ItemGroup>
     <Compile Include="AbstractEStage.cs" />
+    <Compile Include="Examples\P2p\IEventSource.cs" />
+    <Compile Include="Examples\P2p\Pull2Push.cs" />
     <Compile Include="IEStage.cs" />
     <Compile Include="IEventHandler.cs" />
     <Compile Include="IIdentifier.cs" />
@@ -106,6 +108,7 @@ under the License.
     <Compile Include="IObserverFactory.cs" />
     <Compile Include="IStage.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Remote\Proto\WakeRemoteProtosGen.cs" />
     <Compile Include="Remote\ICodec.cs" />
     <Compile Include="Remote\ICodecFactory.cs" />
     <Compile Include="Remote\IDecoder.cs" />
@@ -155,10 +158,6 @@ under the License.
     <Compile Include="RX\IStaticObservable.cs" />
     <Compile Include="RX\ISubject.cs" />
     <Compile Include="RX\ObserverCompletedException.cs" />
-    <Compile Include="src\main\cs\Examples\P2p\IEventSource.cs" />
-    <Compile Include="src\main\cs\Examples\P2p\Pull2Push.cs" />
-    <Compile Include="src\main\cs\PeriodicEvent.cs" />
-    <Compile Include="Protobuf\WakeRemoteProtosGen.cs" />
     <Compile Include="Time\Event\Alarm.cs" />
     <Compile Include="Time\Event\StartTime.cs" />
     <Compile Include="Time\Event\StopTime.cs" />
@@ -187,9 +186,10 @@ under the License.
   </ItemGroup>
   <ItemGroup>
     <None Include="packages.config" />
-    <None Include="Protobuf\RemoteProtocol.proto" />
+    <None Include="Remote\Proto\RemoteProtocol.proto" />
   </ItemGroup>
   <ItemGroup>
+    <Folder Include="Proto\" />
     <Folder Include="Time\Time\Event\" />
     <Folder Include="Time\Time\Runtime\Event\" />
     <Folder Include="Util\Util\" />

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Protobuf/RemoteProtocol.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Protobuf/RemoteProtocol.proto b/lang/cs/Org.Apache.REEF.Wake/Protobuf/RemoteProtocol.proto
deleted file mode 100644
index cd28d13..0000000
--- a/lang/cs/Org.Apache.REEF.Wake/Protobuf/RemoteProtocol.proto
+++ /dev/null
@@ -1,36 +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.
- */
-
-option java_package = "org.apache.reef.wake.remote.proto";
-option java_outer_classname = "WakeRemoteProtos";
-option java_generic_services = true;
-option java_generate_equals_and_hash = true;
-
-message WakeMessagePBuf {
-  required bytes data = 1;
-  required int64 seq = 2; 
-  optional string source = 3; 
-  optional string sink = 4; 
-}
-
-message WakeTuplePBuf {
-  required string className = 1;
-  required bytes data = 2; 
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Protobuf/WakeRemoteProtosGen.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Protobuf/WakeRemoteProtosGen.cs b/lang/cs/Org.Apache.REEF.Wake/Protobuf/WakeRemoteProtosGen.cs
deleted file mode 100644
index f3c59f8..0000000
--- a/lang/cs/Org.Apache.REEF.Wake/Protobuf/WakeRemoteProtosGen.cs
+++ /dev/null
@@ -1,96 +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.
- */
-
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-// Generated from: src/main/proto/RemoteProtocol.proto
-namespace Org.Apache.REEF.Wake.Remote.Proto.WakeRemoteProtos
-{
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"WakeMessagePBuf")]
-  public partial class WakeMessagePBuf : global::ProtoBuf.IExtensible
-  {
-    public WakeMessagePBuf() {}
-    
-    private byte[] _data;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"data", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public byte[] data
-    {
-      get { return _data; }
-      set { _data = value; }
-    }
-    private long _seq;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"seq", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public long seq
-    {
-      get { return _seq; }
-      set { _seq = value; }
-    }
-    private string _source = "";
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"source", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string source
-    {
-      get { return _source; }
-      set { _source = value; }
-    }
-    private string _sink = "";
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"sink", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string sink
-    {
-      get { return _sink; }
-      set { _sink = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"WakeTuplePBuf")]
-  public partial class WakeTuplePBuf : global::ProtoBuf.IExtensible
-  {
-    public WakeTuplePBuf() {}
-    
-    private string _className;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"className", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string className
-    {
-      get { return _className; }
-      set { _className = value; }
-    }
-    private byte[] _data;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"data", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public byte[] data
-    {
-      get { return _data; }
-      set { _data = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiDecoder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiDecoder.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiDecoder.cs
index 0aeb3d4..c7db257 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiDecoder.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiDecoder.cs
@@ -23,7 +23,7 @@ using System.Reflection;
 using Org.Apache.REEF.Utilities.Diagnostics;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Wake.Remote;
-using Org.Apache.REEF.Wake.Remote.Proto.WakeRemoteProtos;
+using Org.Apache.REEF.Wake.Remote.Proto;
 
 namespace Org.Apache.REEF.Wake.Remote.Impl
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiEncoder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiEncoder.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiEncoder.cs
index 3ce695b..ee9b0b2 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiEncoder.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/MultiEncoder.cs
@@ -21,7 +21,7 @@ using System;
 using System.Collections.Generic;
 using System.Reflection;
 using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Wake.Remote.Proto.WakeRemoteProtos;
+using Org.Apache.REEF.Wake.Remote.Proto;
 
 namespace Org.Apache.REEF.Wake.Remote.Impl
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventDecoder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventDecoder.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventDecoder.cs
index 19378d7..3fbea4d 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventDecoder.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventDecoder.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Wake.Remote.Proto.WakeRemoteProtos;
+using Org.Apache.REEF.Wake.Remote.Proto;
 
 namespace Org.Apache.REEF.Wake.Remote.Impl
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventEncoder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventEncoder.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventEncoder.cs
index 59e1d6f..76f0590 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventEncoder.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/RemoteEventEncoder.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Wake.Remote.Proto.WakeRemoteProtos;
+using Org.Apache.REEF.Wake.Remote.Proto;
 
 namespace Org.Apache.REEF.Wake.Remote.Impl
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/RemoteProtocol.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/RemoteProtocol.proto b/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/RemoteProtocol.proto
new file mode 100644
index 0000000..cd28d13
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/RemoteProtocol.proto
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+
+option java_package = "org.apache.reef.wake.remote.proto";
+option java_outer_classname = "WakeRemoteProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+
+message WakeMessagePBuf {
+  required bytes data = 1;
+  required int64 seq = 2; 
+  optional string source = 3; 
+  optional string sink = 4; 
+}
+
+message WakeTuplePBuf {
+  required string className = 1;
+  required bytes data = 2; 
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtos.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtos.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtos.cs
index 8731b1d..51ff373 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtos.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtos.cs
@@ -17,12 +17,10 @@
  * under the License.
  */
 
-using ProtoBuf;
-using System;
 using System.IO;
-using System.Runtime.Serialization;
+using ProtoBuf;
 
-namespace Org.Apache.REEF.Wake.Remote.Proto.WakeRemoteProtos
+namespace Org.Apache.REEF.Wake.Remote.Proto
 {
     /// <summary>
     /// Message p buff

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtosGen.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtosGen.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtosGen.cs
new file mode 100644
index 0000000..35af52d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Proto/WakeRemoteProtosGen.cs
@@ -0,0 +1,96 @@
+/**
+ * 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.
+ */
+
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// Generated from: src/main/proto/RemoteProtocol.proto
+namespace Org.Apache.REEF.Wake.Remote.Proto
+{
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"WakeMessagePBuf")]
+  public partial class WakeMessagePBuf : global::ProtoBuf.IExtensible
+  {
+    public WakeMessagePBuf() {}
+    
+    private byte[] _data;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"data", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public byte[] data
+    {
+      get { return _data; }
+      set { _data = value; }
+    }
+    private long _seq;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"seq", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public long seq
+    {
+      get { return _seq; }
+      set { _seq = value; }
+    }
+    private string _source = "";
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"source", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string source
+    {
+      get { return _source; }
+      set { _source = value; }
+    }
+    private string _sink = "";
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"sink", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string sink
+    {
+      get { return _sink; }
+      set { _sink = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"WakeTuplePBuf")]
+  public partial class WakeTuplePBuf : global::ProtoBuf.IExtensible
+  {
+    public WakeTuplePBuf() {}
+    
+    private string _className;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"className", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string className
+    {
+      get { return _className; }
+      set { _className = value; }
+    }
+    private byte[] _data;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"data", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public byte[] data
+    {
+      get { return _data; }
+      set { _data = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/Event/Alarm.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/Event/Alarm.cs b/lang/cs/Org.Apache.REEF.Wake/Time/Event/Alarm.cs
index bb50883..1cc11f3 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/Event/Alarm.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/Event/Alarm.cs
@@ -19,7 +19,7 @@
 
 using System;
 
-namespace Org.Apache.REEF.Wake.Time
+namespace Org.Apache.REEF.Wake.Time.Event
 {
     /// <summary>
     ///  Represents a timer event.

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/Event/StartTime.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/Event/StartTime.cs b/lang/cs/Org.Apache.REEF.Wake/Time/Event/StartTime.cs
index aeb54a6..abe6eab 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/Event/StartTime.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/Event/StartTime.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-namespace Org.Apache.REEF.Wake.Time
+namespace Org.Apache.REEF.Wake.Time.Event
 {
     /// <summary>
     /// Represents the Time at which a component started.

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/Event/StopTime.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/Event/StopTime.cs b/lang/cs/Org.Apache.REEF.Wake/Time/Event/StopTime.cs
index cb1f3fd..a97e682 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/Event/StopTime.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/Event/StopTime.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-namespace Org.Apache.REEF.Wake.Time
+namespace Org.Apache.REEF.Wake.Time.Event
 {
     /// <summary>
     /// Represents the Time at which a component stops.

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/IClock.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/IClock.cs b/lang/cs/Org.Apache.REEF.Wake/Time/IClock.cs
index 9bdbba7..c4b0e14 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/IClock.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/IClock.cs
@@ -22,6 +22,7 @@ using System.Collections.Generic;
 
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Wake.Impl;
+using Org.Apache.REEF.Wake.Time.Event;
 using Org.Apache.REEF.Wake.Time.Runtime.Event;
 
 namespace Org.Apache.REEF.Wake.Time

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/ClientAlarm.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/ClientAlarm.cs b/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/ClientAlarm.cs
index ab2ce53..76a3f82 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/ClientAlarm.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/ClientAlarm.cs
@@ -22,6 +22,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Org.Apache.REEF.Wake.Time.Event;
 
 namespace Org.Apache.REEF.Wake.Time.Runtime.Event
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/RuntimeAlarm.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/RuntimeAlarm.cs b/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/RuntimeAlarm.cs
index 1f228dc..55cb202 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/RuntimeAlarm.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/Event/RuntimeAlarm.cs
@@ -22,6 +22,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Org.Apache.REEF.Wake.Time.Event;
 
 namespace Org.Apache.REEF.Wake.Time.Runtime.Event
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/RuntimeClock.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/RuntimeClock.cs b/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/RuntimeClock.cs
index 0871521..b0eb2c9 100644
--- a/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/RuntimeClock.cs
+++ b/lang/cs/Org.Apache.REEF.Wake/Time/Runtime/RuntimeClock.cs
@@ -20,20 +20,16 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Reactive;
-using System.Reactive.Linq;
-using System.Text;
 using System.Threading;
-using System.Threading.Tasks;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Tang.Implementations.InjectionPlan;
 using Org.Apache.REEF.Utilities.Diagnostics;
 using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tang.Exceptions;
-using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Wake.RX.Impl;
-using Org.Apache.REEF.Tang.Implementations.InjectionPlan;
+using Org.Apache.REEF.Wake.Time.Event;
+using Org.Apache.REEF.Wake.Time.Runtime.Event;
 
-namespace Org.Apache.REEF.Wake.Time.Runtime.Event
+namespace Org.Apache.REEF.Wake.Time.Runtime
 {
     public class RuntimeClock : IClock
     {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/IEventSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/IEventSource.cs b/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/IEventSource.cs
deleted file mode 100644
index d761032..0000000
--- a/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/IEventSource.cs
+++ /dev/null
@@ -1,35 +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.
- */
-
-namespace Wake.Examples.P2p
-{
-    /// <summary>
-    /// The pull side of the interface: Clients implement this and register it with
-    /// the PullToPush class.
-    /// </summary>
-    /// <typeparam name="T">The event type</typeparam>
-    public interface IEventSource<T>
-    {
-        /// <summary>
-        /// Gets the next event
-        /// </summary>
-        /// <returns>The next event</returns>
-        T GetNext();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/Pull2Push.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/Pull2Push.cs b/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/Pull2Push.cs
deleted file mode 100644
index 24d894c..0000000
--- a/lang/cs/Org.Apache.REEF.Wake/src/main/cs/Examples/P2p/Pull2Push.cs
+++ /dev/null
@@ -1,103 +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 Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Wake;
-using Org.Apache.REEF.Wake.Util;
-using System;
-using System.Collections.Generic;
-
-namespace Wake.Examples.P2p
-{
-    /// <summary>Performs a Pull-to-Push conversion in Wake.</summary>
-    /// <remarks>
-    /// Performs a Pull-to-Push conversion in Wake.
-    /// The class pulls from a set of event sources, and pushes to a single
-    /// EventHandler. If the downstream event handler blocks, this will block,
-    /// providing a simple rate limiting scheme.
-    /// The EventSources are managed in a basic Queue.
-    /// </remarks>
-    public sealed class Pull2Push<T> : IStartable, IDisposable
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(Pull2Push<T>));
-        
-        private readonly IEventHandler<T> _output;
-
-        private readonly Queue<IEventSource<T>> _sources = new Queue<IEventSource<T>>();
-
-        private bool _closed = false;
-
-        /// <summary>
-        /// Constructs a new Pull2Push object
-        /// </summary>
-        /// <param name="output">
-        /// the EventHandler that receives the messages from this
-        /// Pull2Push.
-        /// </param>
-        public Pull2Push(IEventHandler<T> output)
-        {
-            // The downstream EventHandler
-            // The upstream event sources
-            _output = output;
-        }
-
-        /// <summary>Registers an event source.</summary>
-        /// <param name="source">
-        /// The source that will be added to the queue of this
-        /// Pull2Push
-        /// </param>
-        public void Register(IEventSource<T> source)
-        {
-            _sources.Enqueue(source);
-        }
-
-        /// <summary>Executes the message loop.</summary>
-        public void Start()
-        {
-            while (!_closed)
-            {
-                // Grab the next available message source, if any
-                IEventSource<T> nextSource = _sources.Dequeue();
-                if (null != nextSource)
-                {
-                    // Grab the next message from that source, if any
-                    T message = nextSource.GetNext();
-                    if (null != message)
-                    {
-                        // Add the source to the end of the queue again.
-                        _sources.Enqueue(nextSource);
-                        // Send the message. Note that this may block depending on the underlying EventHandler.
-                        _output.OnNext(message);
-                    }
-                    else
-                    {
-                        // The message source has returned null as the next message. We drop the message source in that case.
-                        LOGGER.Log(Level.Info, "Droping message source {0} from the queue " + nextSource.ToString());
-                    }
-                }
-            }
-        }
-
-        // No source where available. We could put a wait() here. 
-        public void Dispose()
-        {
-            _closed = true;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Wake/src/main/cs/PeriodicEvent.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Wake/src/main/cs/PeriodicEvent.cs b/lang/cs/Org.Apache.REEF.Wake/src/main/cs/PeriodicEvent.cs
deleted file mode 100644
index a91e298..0000000
--- a/lang/cs/Org.Apache.REEF.Wake/src/main/cs/PeriodicEvent.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Copyright 2013 Microsoft.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-namespace Wake.Impl
-{
-	/// <summary>Periodic event for timers</summary>
-	public class PeriodicEvent
-	{
-	}
-}


[03/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index f275900..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/EvaluatorContext.cs
+++ /dev/null
@@ -1,148 +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 Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver
-{
-    public class EvaluatorContext : IActiveContext
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorContext));
-        
-        private string _identifier;
-
-        private Optional<string> _parentId;
-
-        private EvaluatorManager _evaluatorManager;
-
-        private bool _disposed = false;
-
-        public EvaluatorContext(EvaluatorManager evaluatorManager, string id, Optional<string> parentId)
-        {
-            _identifier = id;
-            _parentId = parentId;
-            _evaluatorManager = evaluatorManager;
-        }
-
-        public string Id
-        {
-            get
-            {
-                return _identifier;
-            }
-
-            set
-            {
-            }
-        }
-
-        public string EvaluatorId
-        {
-            get
-            {
-                return _evaluatorManager.Id;
-            }
-
-            set
-            {
-            }
-        }
-
-        public Optional<string> ParentId
-        {
-            get
-            {
-                return _parentId;
-            }
-
-            set
-            {
-            }
-        }
-
-        public IEvaluatorDescriptor EvaluatorDescriptor
-        {
-            get
-            {
-                return _evaluatorManager.EvaluatorDescriptor;
-            }
-
-            set
-            {
-            }
-        }
-
-        public void Dispose()
-        {
-            if (_disposed)
-            {
-                var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Active context [{0}] already closed", _identifier));
-                Exceptions.Throw(e, LOGGER);
-            }
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Submit close context: RunningEvaluator id [{0}] for context id [{1}]", EvaluatorId, Id));
-            RemoveContextProto removeContextProto = new RemoveContextProto();
-            removeContextProto.context_id = Id;
-            ContextControlProto contextControlProto = new ContextControlProto();
-            contextControlProto.remove_context = removeContextProto;
-            _evaluatorManager.Handle(contextControlProto);
-            _disposed = true;
-        }
-
-        public ClosedContext GetClosedContext(IActiveContext parentContext)
-        {
-            //return new ClosedContext(parentContext, EvaluatorId, Id, ParentId, EvaluatorDescriptor);
-            throw new NotImplementedException();
-        }
-
-        public FailedContext GetFailedContext(Optional<IActiveContext> parentContext, Exception cause)
-        {
-            //return new FailedContext(parentContext, Id, cause, EvaluatorId, ParentId, EvaluatorDescriptor);
-            throw new NotImplementedException();
-        }
-
-        public void SubmitTask(IConfiguration taskConf)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void SubmitContext(IConfiguration contextConfiguration)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void SendMessage(byte[] message)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/IActiveContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/IActiveContext.cs b/lang/cs/Org.Apache.REEF.Driver/context/IActiveContext.cs
deleted file mode 100644
index 87ae9d2..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/IActiveContext.cs
+++ /dev/null
@@ -1,29 +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 Org.Apache.REEF.Common;
-using System;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    public interface IActiveContext : IDisposable, IContext, ITaskSubmittable, IContextSubmittable
-    {
-        void SendMessage(byte[] message);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/IClosedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/IClosedContext.cs b/lang/cs/Org.Apache.REEF.Driver/context/IClosedContext.cs
deleted file mode 100644
index 1fc0213..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/IClosedContext.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    public interface IClosedContext : IContext
-    {
-        IActiveContext ParentContext { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/IContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/IContext.cs b/lang/cs/Org.Apache.REEF.Driver/context/IContext.cs
deleted file mode 100644
index fd6006c..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/IContext.cs
+++ /dev/null
@@ -1,45 +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 Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    /// <summary>
-    /// A common base interface for Contexts, available or failed.
-    /// </summary>
-    public interface IContext : IIdentifiable
-    {
-        /// <summary>
-        /// the identifier of the Evaluator this EvaluatorContext is instantiated on.
-        /// </summary>
-        string EvaluatorId { get; set; }
-
-        /// <summary>
-        /// ID of the parent context, if there is any.
-        /// </summary>
-        Optional<string> ParentId { get; set; }
-
-        /// <summary>
-        /// descriptor of the Evaluator this Context is on.
-        /// </summary>
-        IEvaluatorDescriptor EvaluatorDescriptor { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/IFailedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/IFailedContext.cs b/lang/cs/Org.Apache.REEF.Driver/context/IFailedContext.cs
deleted file mode 100644
index 6e07788..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/IFailedContext.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    public interface IFailedContext : IContext
-    {
-         Optional<IActiveContext> ParentContext { get; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextMessageSource.cs b/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextMessageSource.cs
deleted file mode 100644
index 6c762ab..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextMessageSource.cs
+++ /dev/null
@@ -1,42 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    /// <summary>
-    /// Default ContextMessageSource: return nothing.
-    /// </summary>
-    public class DefaultContextMessageSource : IContextMessageSource
-    {
-        public Optional<Common.Context.ContextMessage> Message
-        {
-            get
-            {
-                return Optional<Common.Context.ContextMessage>.Empty();
-            }
-
-            set
-            {
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStartHandler.cs b/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStartHandler.cs
deleted file mode 100644
index f1bc157..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStartHandler.cs
+++ /dev/null
@@ -1,48 +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 Org.Apache.REEF.Common.Events;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-   /// <summary>
-    /// Default handler for ContextStart
-   /// </summary>
-    public class DefaultContextStartHandler : IObserver<IContextStart>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextStartHandler));
-
-        public void OnNext(IContextStart contextStart)
-        {
-            LOGGER.Log(Level.Info, "DefaultContextStartHandler received for context: " + contextStart.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStopHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStopHandler.cs b/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStopHandler.cs
deleted file mode 100644
index 82f3250..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/defaults/DefaultContextStopHandler.cs
+++ /dev/null
@@ -1,48 +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 Org.Apache.REEF.Common.Events;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    /// <summary>
-    /// Default event handler for ContextStop
-    /// </summary>
-    public class DefaultContextStopHandler : IObserver<IContextStop>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextStopHandler));
-
-        public void OnNext(IContextStop contextStop)
-        {
-            LOGGER.Log(Level.Info, "DefaultContextStopHandler received for context: " + contextStop.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 2c08d0b..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/contract/IBridgeContract.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Contract
-{
-    public interface IBridgeContract
-    {
-        string InstanceId { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseHandler.cs
deleted file mode 100644
index a47a2b1..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseHandler.cs
+++ /dev/null
@@ -1,53 +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 Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default handler for close messages from the client: logging it
-    /// </summary>
-    public class DefaultClientCloseHandler : IObserver<byte[]>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientCloseHandler));
-
-        [Inject]
-        public DefaultClientCloseHandler()
-        {
-        }
-
-        public void OnNext(byte[] value)
-        {
-            LOGGER.Log(Level.Info, "Closing the Client");
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseWithMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseWithMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseWithMessageHandler.cs
deleted file mode 100644
index 0dbb6f0..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientCloseWithMessageHandler.cs
+++ /dev/null
@@ -1,54 +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 Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default handler for close messages from the client: Throw an Exception.
-    /// </summary>
-    public class DefaultClientCloseWithMessageHandler : IObserver<byte[]>
-    {
-        [Inject]
-        public DefaultClientCloseWithMessageHandler()
-        {
-        }
-        
-        public void OnNext(byte[] value)
-        {
-            Exceptions.Throw(new InvalidOperationException("No handler bound for client Close With Message event:" + ByteUtilities.ByteArrarysToString(value)), 
-                Logger.GetLogger(typeof(DefaultClientCloseWithMessageHandler)));
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientMessageHandler.cs
deleted file mode 100644
index ca5ac0e..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultClientMessageHandler.cs
+++ /dev/null
@@ -1,54 +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 Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// DDefault event handler for Client messages: Logging it.
-    /// </summary>
-    public class DefaultClientMessageHandler : IObserver<byte[]>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientMessageHandler));
-        
-        [Inject]
-        public DefaultClientMessageHandler()
-        {
-        }
-
-        public void OnNext(byte[] value)
-        {
-            LOGGER.Log(Level.Info, "Received message: " + ByteUtilities.ByteArrarysToString(value));
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextActiveHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextActiveHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextActiveHandler.cs
deleted file mode 100644
index 7bb27ad..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextActiveHandler.cs
+++ /dev/null
@@ -1,56 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default handler for ActiveContext: Close it.
-    /// </summary>
-    public class DefaultContextActiveHandler : IObserver<IActiveContext>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextActiveHandler));
-        
-        [Inject]
-        public DefaultContextActiveHandler()
-        {
-        }
-
-        public void OnNext(IActiveContext value)
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received ActiveContext :[{0}], closing it", value.Id));
-            value.Dispose();
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextClosureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextClosureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextClosureHandler.cs
deleted file mode 100644
index aa957c7..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextClosureHandler.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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default event handler for ClosedContext: Logging it.
-    /// </summary>
-    public class DefaultContextClosureHandler : IObserver<IClosedContext>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextClosureHandler));
-        
-        [Inject]
-        public DefaultContextClosureHandler()
-        {
-        }
-
-        public void OnNext(IClosedContext value)
-        {
-            LOGGER.Log(Level.Info, "Received ClosedContext :" + value.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextFailureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextFailureHandler.cs
deleted file mode 100644
index d8014c6..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextFailureHandler.cs
+++ /dev/null
@@ -1,51 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    ///  Default event handler used for FailedContext: It crashes the driver.
-    /// </summary>
-    public class DefaultContextFailureHandler : IObserver<IFailedContext>
-    {
-        [Inject]
-        public DefaultContextFailureHandler()
-        {
-        }
-
-        public void OnNext(IFailedContext value)
-        {
-            throw new InvalidOperationException("No handler bound for FailedContext: " + value.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextMessageHandler.cs
deleted file mode 100644
index 0e6715c..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultContextMessageHandler.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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// efault event handler for ContextMessage: Logging it.
-    /// </summary>
-    public class DefaultContextMessageHandler : IObserver<IContextMessage>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextMessageHandler));
-
-        [Inject]
-        public DefaultContextMessageHandler()
-        {
-        }
-
-        public void OnNext(IContextMessage value)
-        {
-            LOGGER.Log(Level.Info, "Received ContextMessage: " + ByteUtilities.ByteArrarysToString(value.Message));
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultCustomTraceListener.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultCustomTraceListener.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultCustomTraceListener.cs
deleted file mode 100644
index a1f897b..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultCustomTraceListener.cs
+++ /dev/null
@@ -1,45 +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 Org.Apache.REEF.Tang.Annotations;
-using System.Diagnostics;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    public class DefaultCustomTraceListener : TraceListener
-    {
-        private readonly TraceListener _listener; 
-
-        [Inject]
-        public DefaultCustomTraceListener()
-        {
-            _listener = new ConsoleTraceListener();
-        }
-
-        public override void Write(string message)
-        {
-            _listener.Write(message);
-        }
-
-        public override void WriteLine(string message)
-        {
-            _listener.WriteLine(message);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartContextActiveHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartContextActiveHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartContextActiveHandler.cs
deleted file mode 100644
index 5ceb271..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartContextActiveHandler.cs
+++ /dev/null
@@ -1,56 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default handler for ActiveContext received during driver restart: Close it.
-    /// </summary>
-    public class DefaultDriverRestartContextActiveHandler : IObserver<IActiveContext>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartContextActiveHandler));
-        
-        [Inject]
-        public DefaultDriverRestartContextActiveHandler()
-        {
-        }
-
-        public void OnNext(IActiveContext value)
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received ActiveContext during driver restart:[{0}], closing it", value.Id));
-            value.Dispose();
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartHandler.cs
deleted file mode 100644
index a895251..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartHandler.cs
+++ /dev/null
@@ -1,54 +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 Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Wake.Time;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    ///  Default event handler for driver restart: Logging it.
-    /// </summary>
-    public class DefaultDriverRestartHandler : IObserver<StartTime>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartHandler));
-        
-        [Inject]
-        public DefaultDriverRestartHandler()
-        {
-        }
-
-        public void OnNext(StartTime startTime)
-        {
-            LOGGER.Log(Level.Info, "Driver restarted at" + new DateTime(startTime.TimeStamp));
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartTaskRunningHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartTaskRunningHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartTaskRunningHandler.cs
deleted file mode 100644
index c202933..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultDriverRestartTaskRunningHandler.cs
+++ /dev/null
@@ -1,54 +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 Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    ///  Default event handler for TaskRuntime received during driver restart: Logging it.
-    /// </summary>
-    public class DefaultDriverRestartTaskRunningHandler : IObserver<IRunningTask>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartTaskRunningHandler));
-        
-        [Inject]
-        public DefaultDriverRestartTaskRunningHandler()
-        {
-        }
-
-        public void OnNext(IRunningTask runningTask)
-        {
-            LOGGER.Log(Level.Info, "Received TaskRuntime during driver restart: " + runningTask.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorAllocationHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorAllocationHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorAllocationHandler.cs
deleted file mode 100644
index 9216b64..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorAllocationHandler.cs
+++ /dev/null
@@ -1,57 +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 Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default handler for AllocatedEvaluator: close it.
-    /// </summary>
-    public class DefaultEvaluatorAllocationHandler : IObserver<IAllocatedEvaluator>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultEvaluatorAllocationHandler));
-        
-        [Inject]
-        public DefaultEvaluatorAllocationHandler()
-        {
-        }
-
-        public void OnNext(IAllocatedEvaluator value)
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received AllocatedEvaluator : {0}, closing", value.Id));
-            value.Dispose();
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorCompletionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorCompletionHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorCompletionHandler.cs
deleted file mode 100644
index fcea53d..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorCompletionHandler.cs
+++ /dev/null
@@ -1,54 +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 Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default event handler for CompletedEvaluator: Logging it.
-    /// </summary>
-    public class DefaultEvaluatorCompletionHandler : IObserver<ICompletedEvaluator>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultEvaluatorCompletionHandler));
-        
-        [Inject]
-        public DefaultEvaluatorCompletionHandler()
-        {
-        }
-
-        public void OnNext(ICompletedEvaluator value)
-        {
-            LOGGER.Log(Level.Info, "Received CompletedEvaluator: " + value.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorFailureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorFailureHandler.cs
deleted file mode 100644
index 82cfd26..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorFailureHandler.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 Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    ///  Default event handler used for FailedEvaluator: It crashes the driver.
-    /// </summary>
-    public class DefaultEvaluatorFailureHandler : IObserver<IFailedEvaluator>
-    {        
-        [Inject]
-        public DefaultEvaluatorFailureHandler()
-        {
-        }
-
-        public void OnNext(IFailedEvaluator value)
-        {
-            var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Evaluator {0} failed, and no handler is bound for FailedEvaluator.", value.Id));
-            Exceptions.Throw(e, Logger.GetLogger(typeof(DefaultEvaluatorFailureHandler)));
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorRequestorHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorRequestorHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorRequestorHandler.cs
deleted file mode 100644
index 465baa7..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultEvaluatorRequestorHandler.cs
+++ /dev/null
@@ -1,61 +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 Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default handler for close messages from the client: logging it
-    /// </summary>
-    public class DefaultEvaluatorRequestorHandler : IObserver<IEvaluatorRequestor>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientCloseHandler));
-
-        [Inject]
-        public DefaultEvaluatorRequestorHandler()
-        {
-        }
-
-        public void OnNext(IEvaluatorRequestor value)
-        {
-            LOGGER.Log(Level.Info, "Default evaluator requstor: requesting 1 evaluator with 512 MB");
-            int evaluatorsNumber = 1;
-            int memory = 512;
-            string rack = "WonderlandRack";
-            EvaluatorRequest request = new EvaluatorRequest(evaluatorsNumber, memory, rack);
-
-            value.Submit(request);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultHttpHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultHttpHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultHttpHandler.cs
deleted file mode 100644
index 831eebe..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultHttpHandler.cs
+++ /dev/null
@@ -1,49 +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.Net;
-using Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    public class DefaultHttpHandler : IHttpHandler
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultHttpHandler));
-
-        [Inject]
-        public DefaultHttpHandler()
-        {
-        }
-
-        public string GetSpecification()
-        {
-            return "Ping";
-        }
-
-        public void OnHttpRequest(ReefHttpRequest requet, ReefHttpResponse response) 
-        {
-            LOGGER.Log(Level.Info, "OnHttpRequest in DefaultHttpHandler is called.");
-            response.Status = HttpStatusCode.OK;
-            response.OutputStream = ByteUtilities.StringToByteArrays("Byte array returned from DefaultHttpHandler in CLR!!!");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskCompletionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskCompletionHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskCompletionHandler.cs
deleted file mode 100644
index 33b6495..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskCompletionHandler.cs
+++ /dev/null
@@ -1,60 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// efault event handler for CompletedTask: Log it and close the context.
-    /// </summary>
-    public class DefaultTaskCompletionHandler : IObserver<ICompletedTask>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskCompletionHandler));
-        
-        [Inject]
-        public DefaultTaskCompletionHandler()
-        {
-        }
-
-        public void OnNext(ICompletedTask value)
-        {
-            IActiveContext activeContext = value.ActiveContext;
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received CompletedTask: {0} :: CLOSING context: {1}", value.Id, activeContext.Id));
-            activeContext.Dispose();
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskFailureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskFailureHandler.cs
deleted file mode 100644
index b39200f..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskFailureHandler.cs
+++ /dev/null
@@ -1,53 +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 Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default event handler used for FailedTask: It crashes the driver.
-    /// </summary>
-    public class DefaultTaskFailureHandler : IObserver<IFailedTask>
-    {
-        [Inject]
-        public DefaultTaskFailureHandler()
-        {
-        }
-
-        public void OnNext(IFailedTask value)
-        {
-            throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task {0} has failed, and no handler was bound for IFailedTask", value.Id) );
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskMessageHandler.cs
deleted file mode 100644
index cdaac06..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskMessageHandler.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 Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default event handler for TaskMessage: Logging it.
-    /// </summary>
-    public class DefaultTaskMessageHandler : IObserver<ITaskMessage>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskMessageHandler));
-        
-        [Inject]
-        public DefaultTaskMessageHandler()
-        {
-        }
-
-        public void OnNext(ITaskMessage value)
-        {
-            LOGGER.Log(Level.Info, "Default TaskMessage handler received message: " + value.Message);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskRunningHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskRunningHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskRunningHandler.cs
deleted file mode 100644
index e356b0e..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskRunningHandler.cs
+++ /dev/null
@@ -1,54 +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 Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    ///  Default event handler for TaskRuntime: Logging it.
-    /// </summary>
-    public class DefaultTaskRunningHandler : IObserver<IRunningTask>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskRunningHandler));
-        
-        [Inject]
-        public DefaultTaskRunningHandler()
-        {
-        }
-
-        public void OnNext(IRunningTask runningTask)
-        {
-            LOGGER.Log(Level.Info, "Received TaskRuntime: " + runningTask.Id);
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskSuspensionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskSuspensionHandler.cs b/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskSuspensionHandler.cs
deleted file mode 100644
index 46ced71..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/defaults/DefaultTaskSuspensionHandler.cs
+++ /dev/null
@@ -1,53 +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 Org.Apache.REEF.Common;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Driver.Defaults
-{
-    /// <summary>
-    /// Default event handler used for SuspendedTask: It crashes the driver.
-    /// </summary>
-    public class DefaultTaskSuspensionHandler : IObserver<ISuspendedTask>
-    {
-        [Inject]
-        public DefaultTaskSuspensionHandler()
-        {
-        }
-
-        public void OnNext(ISuspendedTask value)
-        {
-            Exceptions.Throw(new InvalidOperationException("No handler bound for SuspendedTask: " + value.Id), Logger.GetLogger(typeof(DefaultTaskSuspensionHandler)));
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 0833431..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorDescriptorImpl.cs
+++ /dev/null
@@ -1,218 +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 Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    public class EvaluatorDescriptorImpl : IEvaluatorDescriptor
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorDescriptorImpl));
-        
-        private INodeDescriptor _nodeDescriptor;
-
-        private EvaluatorType _type;
-
-        private int _megaBytes;
-
-        private int _virtualCore;
-
-        private string _rack = "default_rack";
-
-        public EvaluatorDescriptorImpl(string serializedString)
-        {
-            FromString(serializedString);
-        }
-
-        public EvaluatorDescriptorImpl(INodeDescriptor nodeDescriptor, EvaluatorType type, int megaBytes, int core)
-        {
-            _nodeDescriptor = nodeDescriptor;
-            _type = type;
-            _megaBytes = megaBytes;
-            _virtualCore = core;
-        }
-
-        public INodeDescriptor NodeDescriptor 
-        {
-            get
-            {
-                return _nodeDescriptor;
-            }
-
-            set
-            {
-            }
-        }
-
-        public EvaluatorType EvaluatorType
-        {
-            get
-            {
-                return _type;
-            }
-
-            set
-            {
-            }
-        }
-
-        public int Memory
-        {
-            get
-            {
-                return _megaBytes;
-            }
-
-            set
-            {
-            }
-        }
-
-        public int VirtualCore
-        {
-            get
-            {
-                return _virtualCore;
-            }
-
-            set
-            {
-            }
-        }
-
-        public string Rack
-        {
-            get
-            {
-                return _rack;
-            }
-
-            set
-            {
-            }
-        }
-
-        public void FromString(string str)
-        {
-            Dictionary<string, string> settings = new Dictionary<string, string>();
-            string[] components = str.Split(',');
-            foreach (string component in components)
-            {
-                string[] pair = component.Trim().Split('=');
-                if (pair == null || pair.Length != 2)
-                {
-                    var e = new ArgumentException("invalid component to be used as key-value pair:", component);
-                    Exceptions.Throw(e, LOGGER);
-                }
-                settings.Add(pair[0], pair[1]);
-            }
-            string ipAddress;
-            if (!settings.TryGetValue("IP", out ipAddress))
-            {
-                Exceptions.Throw(new ArgumentException("cannot find IP entry"), LOGGER); 
-            }
-            ipAddress = ipAddress.Split('/').Last();
-            string port;
-            if (!settings.TryGetValue("Port", out port))
-            {
-                Exceptions.Throw(new ArgumentException("cannot find Port entry"), LOGGER); 
-            }
-            int portNumber = 0;
-            int.TryParse(port, out portNumber);
-            string hostName;
-            if (!settings.TryGetValue("HostName", out hostName))
-            {
-                Exceptions.Throw(new ArgumentException("cannot find HostName entry"), LOGGER); 
-            }
-            string memory;
-            if (!settings.TryGetValue("Memory", out memory))
-            {
-                Exceptions.Throw(new ArgumentException("cannot find Memory entry"), LOGGER);
-            }
-            int memoryInMegaBytes = 0;
-            int.TryParse(memory, out memoryInMegaBytes);
-
-            string core;
-            if (!settings.TryGetValue("Core", out core))
-            {
-                Exceptions.Throw(new ArgumentException("cannot find Core entry"), LOGGER);
-            }
-            int vCore = 0;
-            int.TryParse(core, out vCore);
-
-            IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(ipAddress), portNumber);
-
-            _nodeDescriptor = new NodeDescriptorImpl();
-            _nodeDescriptor.InetSocketAddress = ipEndPoint;
-            _nodeDescriptor.HostName = hostName;        
-            _type = EvaluatorType.CLR;
-            _megaBytes = memoryInMegaBytes;
-            _virtualCore = vCore;
-        }
-
-        public void SetType(EvaluatorType type)
-        {
-            lock (this)
-            {
-                if (_type != EvaluatorType.UNDECIDED)
-                {
-                    var e = new InvalidOperationException("Cannot change a set evaluator type: " + _type);
-                    Exceptions.Throw(e, LOGGER);
-                }
-                _type = type;
-            }
-        }
-
-        public override bool Equals(object obj)
-        {
-            EvaluatorDescriptorImpl other = obj as EvaluatorDescriptorImpl;
-            if (other == null)
-            {
-                return false;
-            }
-
-            return EquivalentMemory(other);
-            // we don't care about rack now;
-            // && string.Equals(_rack, other.Rack, StringComparison.OrdinalIgnoreCase);
-        }
-
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        private bool EquivalentMemory(EvaluatorDescriptorImpl other)
-        {
-            int granularity = ClrHandlerHelper.MemoryGranularity == 0
-                                  ? Constants.DefaultMemoryGranularity
-                                  : ClrHandlerHelper.MemoryGranularity;
-            int m1 = (Memory - 1) / granularity;
-            int m2 = (other.Memory - 1 ) / granularity;
-            return (m1 == m2);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequest.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequest.cs
deleted file mode 100644
index b04e05b..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequest.cs
+++ /dev/null
@@ -1,108 +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 Org.Apache.REEF.Common.Capabilities;
-using Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Driver.Evaluator;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    public class EvaluatorRequest : IEvaluatorRequest
-    {
-        public EvaluatorRequest() 
-            : this(0, 0, 1, string.Empty, Guid.NewGuid().ToString("N"))
-        {
-        }
-
-        public EvaluatorRequest(int number, int megaBytes) 
-            : this(number, megaBytes, 1, string.Empty, Guid.NewGuid().ToString("N"))
-        {
-        }
-
-        public EvaluatorRequest(int number, int megaBytes, int core)
-            : this(number, megaBytes, core, string.Empty, Guid.NewGuid().ToString("N"))
-        {
-        }
-
-        public EvaluatorRequest(int number, int megaBytes, string rack)
-            : this(number, megaBytes, 1, rack, Guid.NewGuid().ToString("N"))
-        {
-        }
-
-        public EvaluatorRequest(int number, int megaBytes, int core, string rack)
-            : this(number, megaBytes, core, rack, Guid.NewGuid().ToString("N"))
-        {
-        }
-
-        public EvaluatorRequest(int number, int megaBytes, int core, string rack, string evaluatorBatchId)
-        {
-            Number = number;
-            MemoryMegaBytes = megaBytes;
-            VirtualCore = core;
-            Rack = rack;
-            EvaluatorBatchId = evaluatorBatchId;
-        }
-
-        public EvaluatorRequest(int number, int megaBytes, int core, List<ICapability> capabilitieses, IResourceCatalog catalog)
-        {
-            Number = number;
-            MemoryMegaBytes = megaBytes;
-            Capabilities = capabilitieses;
-            VirtualCore = core;
-            Catalog = catalog;
-            EvaluatorBatchId = Guid.NewGuid().ToString("N");
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        [DataMember]
-        public int MemoryMegaBytes { get; set; }
-
-        [DataMember]
-        public int Number { get; set; }
-        
-        [DataMember]
-        public int VirtualCore { get; set; }
-
-        [DataMember]
-        public string Rack { get; set; }
-
-        [DataMember]
-        public string EvaluatorBatchId { get; set; }
-
-        public List<ICapability> Capabilities { get; set; }
-
-        public IResourceCatalog Catalog { get; set; }
-
-        public static EvaluatorRequestBuilder NewBuilder()
-        {
-            return new EvaluatorRequestBuilder();
-        }
-
-        public static EvaluatorRequestBuilder NewBuilder(EvaluatorRequest request)
-        {
-            return new EvaluatorRequestBuilder(request);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequestBuilder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequestBuilder.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequestBuilder.cs
deleted file mode 100644
index 95a1ee3..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/EvaluatorRequestBuilder.cs
+++ /dev/null
@@ -1,60 +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 Org.Apache.REEF.Common.Capabilities;
-using Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Driver.Bridge;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    public class EvaluatorRequestBuilder
-    {
-        public EvaluatorRequestBuilder(EvaluatorRequest request)
-        {
-            foreach (ICapability capability in request.Capabilities)
-            {
-                Capabilities.Add(capability);
-            }
-            Number = request.Number;
-            Catalog = request.Catalog;
-            MegaBytes = request.MemoryMegaBytes;
-            VirtualCore = request.VirtualCore;
-        }
-
-        internal EvaluatorRequestBuilder()
-        {
-        }
-
-        public int Number { get; set; }
-
-        public List<ICapability> Capabilities { get; set; }
-
-        public IResourceCatalog Catalog { get; set; }
-
-        public int MegaBytes { get; set; }
-
-        public int VirtualCore { get; set; }
-
-        public EvaluatorRequest Build()
-        {
-            return new EvaluatorRequest(Number, MegaBytes, VirtualCore, Capabilities, Catalog);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/IAllocatedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/IAllocatedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/IAllocatedEvaluator.cs
deleted file mode 100644
index 794987f..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/IAllocatedEvaluator.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 Org.Apache.REEF.Common;
-using Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Utilities;
-using System;
-using System.Net;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    /// <summary>
-    /// Represents an Evaluator that is allocated, but is not running yet.
-    /// </summary>
-    public interface IAllocatedEvaluator : IDisposable, IIdentifiable, IContextSubmittable, IContextAndTaskSubmittable
-    {
-        EvaluatorType Type { get; set; }
-
-        string NameServerInfo { get; set; }
-
-        string EvaluatorBatchId { get; set; }
-
-        IEvaluatorDescriptor GetEvaluatorDescriptor();
-
-        /// <summary>
-        /// Puts the given file into the working directory of the Evaluator.
-        /// </summary>
-        /// <param name="file">the file to be copied</param>
-        void AddFile(string file);
-
-        /// <summary>
-        /// Puts the given file into the working directory of the Evaluator and adds it to its classpath.
-        /// </summary>
-        /// <param name="file">the file to be copied</param>
-        void AddLibrary(string file);
-
-        void AddFileResource(string file);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/ICompletedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/ICompletedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/ICompletedEvaluator.cs
deleted file mode 100644
index a4b3a69..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/ICompletedEvaluator.cs
+++ /dev/null
@@ -1,30 +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 Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    /// <summary>
-    /// Represents an Evaluator that has completed
-    /// </summary>
-    public interface ICompletedEvaluator : IIdentifiable
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorDescriptor.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorDescriptor.cs
deleted file mode 100644
index 9fadbd9..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorDescriptor.cs
+++ /dev/null
@@ -1,57 +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 Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Common.Evaluator;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    /// <summary>
-    ///  Metadata about an Evaluator.
-    /// </summary>
-    public interface IEvaluatorDescriptor
-    {
-        /// <summary>
-        ///  NodeDescriptor of the node where this Evaluator is running.
-        /// </summary>
-        INodeDescriptor NodeDescriptor { get; set; }
-
-        /// <summary>
-        /// type of Evaluator.
-        /// </summary>
-        EvaluatorType EvaluatorType { get; set; }
-
-        /// <summary>
-        /// the amount of memory allocated to this Evaluator.
-        /// </summary>
-        int Memory { get; set; }
-
-        /// <summary>
-        /// the virtual core allocated to this Evaluator.
-        /// </summary>
-        int VirtualCore { get; set; }
-
-        /// <summary>
-        /// rack on which the evaluator was allocated
-        /// </summary>
-        string Rack { get; set; }
-
-        void FromString(string str);
-    }
-}


[05/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/ClrClientHelper.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrClientHelper.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/ClrClientHelper.cs
deleted file mode 100644
index 03f385a..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrClientHelper.cs
+++ /dev/null
@@ -1,175 +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.IO;
-using System.Linq;
-using Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Interface;
-
-namespace Org.Apache.REEF.Driver.bridge
-{
-    public class ClrClientHelper
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClrClientHelper));
-
-        public static void Run(HashSet<string> appDlls, IConfiguration driverBridgeConfig, DriverSubmissionSettings driverSubmissionSettings, string reefJar = Constants.BridgeJarFileName, string runCommand = "run.cmd", string clrFolder = ".", string className = Constants.BridgeLaunchClass)
-        {
-            using (LOGGER.LogFunction("ClrHandlerHelper::Run"))
-            {
-                if (driverSubmissionSettings.Submit)
-                {
-                    ClrHandlerHelper.CopyDllsToAppDirectory(appDlls);
-                    UpdateJarFileWithAssemblies(reefJar);
-                }
-
-                using (LOGGER.LogScope("ClrHandlerHelper::serialize driverBridgeConfig to clrRuntimeConfigFile"))
-                {
-                    string clrRuntimeConfigFile = Path.Combine(clrFolder, Constants.DriverBridgeConfiguration);
-                    new AvroConfigurationSerializer().ToFile(driverBridgeConfig, clrRuntimeConfigFile);
-                    LOGGER.Log(Level.Info, "CLR driver bridge configurations written to " + clrRuntimeConfigFile);
-                }
-
-                ProcessStartInfo startInfo = new ProcessStartInfo();
-                if (driverSubmissionSettings.RunOnYarn)
-                {
-                    startInfo.FileName = runCommand;
-                    startInfo.Arguments = className + " " + clrFolder +
-                                          driverSubmissionSettings.ToComamndLineArguments();
-                }
-                else
-                {
-                    startInfo.FileName = GetJavaBinary();
-                    string loggingPrefix = string.Empty;
-                    if (driverSubmissionSettings.JavaLogLevel == JavaLoggingSetting.VERBOSE_TO_CLR)
-                    {
-                        loggingPrefix = Constants.JavaToCLRLoggingConfig + " ";
-                    }
-                    else if (driverSubmissionSettings.JavaLogLevel == JavaLoggingSetting.VERBOSE)
-                    {
-                        loggingPrefix = Constants.JavaVerboseLoggingConfig + " ";
-                    }
-                    startInfo.Arguments = loggingPrefix + @"-classpath " + reefJar + " " + Constants.BridgeLaunchClass +
-                                          " " + clrFolder + " " + driverSubmissionSettings.ToComamndLineArguments();
-                }
-                startInfo.RedirectStandardOutput = true;
-                startInfo.UseShellExecute = false;
-                startInfo.CreateNoWindow = false;
-                LOGGER.Log(Level.Info, "Executing\r\n" + startInfo.FileName + "\r\n" + startInfo.Arguments);
-                using (Process process = Process.Start(startInfo))
-                {
-                    process.WaitForExit();
-                }
-            }
-        }
-
-        public static void UpdateJarFileWithAssemblies(string reefJar)
-        {
-            using (LOGGER.LogFunction("ClrHandlerHelper::UpdateJarFileWithAssemblies"))
-            {
-                string assembliesList = ClrHandlerHelper.GetAssembliesListForReefDriverApp();
-                if (!File.Exists(reefJar))
-                {
-                    throw new InvalidOperationException("cannot find reef jar file: " + reefJar);
-                }
-                ProcessStartInfo startInfo = new ProcessStartInfo()
-                    {
-                        FileName = GetJarBinary(),
-                        Arguments = @"uf " + reefJar + " " + assembliesList,
-                        RedirectStandardOutput = true,
-                        RedirectStandardError = true,
-                        UseShellExecute = false,
-                        CreateNoWindow = true
-                    };
-
-                LOGGER.Log(Level.Info, "updating jar file with \r\n" + startInfo.FileName + "\r\n" + startInfo.Arguments);
-                using (Process process = Process.Start(startInfo))
-                {
-                    StreamReader outReader = process.StandardOutput;
-                    StreamReader errorReader = process.StandardError;
-                    string output = outReader.ReadToEnd();
-                    string error = errorReader.ReadToEnd();
-                    process.WaitForExit();
-                    if (process.ExitCode != 0)
-                    {
-                        throw new InvalidOperationException("Failed to update jar file with stdout :" + output +
-                                                            "and stderr:" + error);
-                    }
-                }
-                LOGGER.Log(Level.Info, "jar file updated.");
-            }
-        }
-
-        public static void ExtractConfigfileFromJar(string reefJar, IList<string> configFiles, string dropFolder)
-        {
-                var configFileNames = string.Join(" ", configFiles.ToArray());
-                ProcessStartInfo startInfo = new ProcessStartInfo()
-                {
-                    FileName = GetJarBinary(),
-                    Arguments = @"xf " + reefJar + " " + configFileNames,
-                    RedirectStandardOutput = true,
-                    RedirectStandardError = true,
-                    UseShellExecute = false,
-                    CreateNoWindow = true
-                };
-
-                LOGGER.Log(Level.Info, "extracting files from jar file with \r\n" + startInfo.FileName + "\r\n" + startInfo.Arguments);
-                using (Process process = Process.Start(startInfo))
-                {
-                    StreamReader outReader = process.StandardOutput;
-                    StreamReader errorReader = process.StandardError;
-                    string output = outReader.ReadToEnd();
-                    string error = errorReader.ReadToEnd();
-                    process.WaitForExit();
-                    if (process.ExitCode != 0)
-                    {
-                        throw new InvalidOperationException("Failed to extract files from jar file with stdout :" + output +
-                                                            "and stderr:" + error);
-                    }
-                }
-                LOGGER.Log(Level.Info, "files are extracted.");
-        }
-        
-        private static string GetJarBinary()
-        {
-            string javaHome = Environment.GetEnvironmentVariable("JAVA_HOME");
-            if (string.IsNullOrWhiteSpace(javaHome))
-            {
-                LOGGER.Log(Level.Info, "JAVA_HOME not set. Please set JAVA_HOME environment variable first. Exiting...");
-                Environment.Exit(1);
-            }
-            return Path.Combine(javaHome, "bin", "jar.exe");
-        }
-
-        private static string GetJavaBinary()
-        {
-            string javaHome = Environment.GetEnvironmentVariable("JAVA_HOME");
-            if (string.IsNullOrWhiteSpace(javaHome))
-            {
-                LOGGER.Log(Level.Info, "JAVA_HOME not set. Please set JAVA_HOME environment variable first. Exiting...");
-                Environment.Exit(1);
-            }
-            return Path.Combine(javaHome, "bin", "java.exe");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/ClrHandlerHelper.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrHandlerHelper.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/ClrHandlerHelper.cs
deleted file mode 100644
index 8d9020c..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrHandlerHelper.cs
+++ /dev/null
@@ -1,178 +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 Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Exceptions;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Implementations;
-using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Tang.Protobuf;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using Org.Apache.REEF.Tang.Implementations.Tang;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class ClrHandlerHelper
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClrHandlerHelper));
-
-        public static string[] ReefAssemblies
-        {
-            get
-            {
-                return new[] { "Microsoft.Hadoop.Avro.dll", "Org.Apache.REEF.Driver.dll", "Org.Apache.REEF.Common.dll", "Org.Apache.REEF.Utilities.dll", "Org.Apache.REEF.Network.dll", "Org.Apache.REEF.Tang.dll", "Org.Apache.REEF.Wake.dll", "Newtonsoft.Json.dll", "protobuf-net.dll" };
-            }
-        }
-
-        internal static int MemoryGranularity { get; set; }
-
-        public static ulong CreateHandler(object handler)
-        {
-            GCHandle gc = GCHandle.Alloc(handler);
-            IntPtr intPtr = GCHandle.ToIntPtr(gc);
-            ulong ul = (ulong)intPtr.ToInt64();
-            return ul;
-        }
-
-        public static void FreeHandle(ulong handle)
-        {
-            GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-            gc.Free();
-        }
-
-        public static void SetMemoryGranuality(int granularity)
-        {
-            if (granularity <= 0)
-            {
-                var e = new ArgumentException("granularity must be a positive value, provided: " + granularity);
-                Exceptions.Throw(e, LOGGER);
-            }
-            MemoryGranularity = granularity;
-        }
-
-        public static ulong CreateNullHandler()
-        {
-            return Constants.NullHandler;
-        }
-
-        public static ISet<string> GetCommandLineArguments()
-        {
-            using (LOGGER.LogFunction("ClrHandlerHelper::GetCommandLineArguments"))
-            {
-                string bridgeConfiguration = Path.Combine(Directory.GetCurrentDirectory(), "reef", "global",
-                                                          Constants.DriverBridgeConfiguration);
-
-                if (!File.Exists(bridgeConfiguration))
-                {
-                    string error = "Configuraiton file not found: " + bridgeConfiguration;
-                    LOGGER.Log(Level.Error, error);
-                    Exceptions.Throw(new InvalidOperationException(error), LOGGER);
-                }
-                CommandLineArguments arguments;
-                IInjector injector;
-                try
-                {
-                    IConfiguration driverBridgeConfiguration =
-                        new AvroConfigurationSerializer().FromFile(bridgeConfiguration);
-                    injector = TangFactory.GetTang().NewInjector(driverBridgeConfiguration);
-                    arguments = injector.GetInstance<CommandLineArguments>();
-                }
-                catch (InjectionException e)
-                {
-                    string error = "Cannot inject command line arguments from driver bridge configuration. ";
-                    Exceptions.Caught(e, Level.Error, error, LOGGER);
-                    // return empty string set
-                    return new HashSet<string>();
-                }
-                return arguments.Arguments;
-            }
-        }
-
-        public static void SupplyAdditionalClassPath(params string[] classPaths)
-        {
-            string path = Path.Combine(Directory.GetCurrentDirectory(), Constants.GlobalUserSuppliedJavaLibraries);
-            File.Delete(path);
-            File.WriteAllText(path, string.Join(",", classPaths));
-        }
-
-        public static void GenerateClassHierarchy(HashSet<string> clrDlls)
-        {
-            using (LOGGER.LogFunction("ClrHandlerHelper::GenerateClassHierarchy"))
-            {
-                IClassHierarchy ns = TangFactory.GetTang().GetClassHierarchy(clrDlls.ToArray());
-                ProtocolBufferClassHierarchy.Serialize(Constants.ClassHierarachyBin, ns);
-
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Class hierarchy written to [{0}].", Path.Combine(Directory.GetCurrentDirectory(), Constants.ClassHierarachyBin)));
-            }
-        }
-
-        public static string GetAssembliesListForReefDriverApp()
-        {
-            using (LOGGER.LogFunction("ClrHandlerHelper::GetAssembliesListForReefDriverApp"))
-            {
-                string executionDirectory = Directory.GetCurrentDirectory();
-                IList<string> assemblies =
-                    Directory.GetFiles(Path.Combine(executionDirectory, Constants.DriverAppDirectory), "*.dll")
-                             .Select(f => string.Format(CultureInfo.InvariantCulture, "\"{0}\"", Constants.DriverAppDirectory + @"\" + Path.GetFileName(f))).ToList();
-
-                foreach (string reefAssembly in ReefAssemblies)
-                {
-                    if (!File.Exists(reefAssembly))
-                    {
-                        var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Assembly [{0}] needed for REEF driver not found in {1}", reefAssembly, executionDirectory));
-                        Exceptions.Throw(e, LOGGER);
-                    }
-                    File.Copy(reefAssembly, Path.Combine(executionDirectory, Constants.DriverAppDirectory, reefAssembly), overwrite: true);
-                    assemblies.Add(string.Format(CultureInfo.InvariantCulture, "\"{0}\"", Constants.DriverAppDirectory + @"\" + reefAssembly));
-                }
-                return string.Join(" ", assemblies);
-            }
-        }
-
-        public static void CopyDllsToAppDirectory(HashSet<string> dlls)
-        {
-            using (LOGGER.LogFunction("ClrHandlerHelper::CopyDllsToAppDirectory"))
-            {
-                string executionDirectory = Directory.GetCurrentDirectory();
-                Directory.CreateDirectory(Path.Combine(executionDirectory, Constants.DriverAppDirectory));
-                foreach (string dll in dlls)
-                {
-                    string dllFile = dll;
-                    if (!dll.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
-                    {
-                        dllFile += ".dll";
-                    }
-                    if (!File.Exists(dllFile))
-                    {
-                        var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Assembly [{0}] for REEF application not found in {1}", dllFile, executionDirectory));
-                        Exceptions.Throw(e, LOGGER);
-                    }
-                    File.Copy(dllFile, Path.Combine(executionDirectory, Constants.DriverAppDirectory, dllFile), overwrite: true);
-                }
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/ClrSystemHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrSystemHandler.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/ClrSystemHandler.cs
deleted file mode 100644
index 15b957d..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrSystemHandler.cs
+++ /dev/null
@@ -1,53 +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;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class ClrSystemHandler<T> : IObserver<T>, IObservable<T>
-    {
-        List<IObserver<T>> userHandlers = new List<IObserver<T>>();
-
-        public void OnNext(T value)
-        {
-            foreach (var observer in userHandlers)
-            {
-                observer.OnNext(value);
-            }
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        public IDisposable Subscribe(IObserver<T> observer)
-        {
-            userHandlers.Add(observer);
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 58deabc..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/ClrSystemHandlerWrapper.cs
+++ /dev/null
@@ -1,274 +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.Globalization;
-using System.IO;
-using System.Runtime.InteropServices;
-using Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Driver.bridge;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Implementations;
-using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Wake.Time;
-using Org.Apache.REEF.Tang.Implementations.Tang;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class ClrSystemHandlerWrapper
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClrSystemHandlerWrapper));
-
-        private static DriverBridge _driverBridge;
-
-        public static void Call_ClrSystemAllocatedEvaluatorHandler_OnNext(ulong handle, IAllocatedEvaluaotrClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemAllocatedEvaluatorHandler_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IAllocatedEvaluator> obj = (ClrSystemHandler<IAllocatedEvaluator>)gc.Target;
-                obj.OnNext(new AllocatedEvaluator(clr2Java)); 
-            }       
-        }
-
-        public static void Call_ClrSystemActiveContextHandler_OnNext(ulong handle, IActiveContextClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemActiveContextHandler_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IActiveContext> obj = (ClrSystemHandler<IActiveContext>)gc.Target;
-                obj.OnNext(new ActiveContext(clr2Java));
-            }            
-        }
-
-        public static void Call_ClrSystemDriverRestartActiveContextHandler_OnNext(ulong handle, IActiveContextClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemDriverRestartActiveContextHandler_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IActiveContext> obj = (ClrSystemHandler<IActiveContext>)gc.Target;
-                obj.OnNext(new ActiveContext(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemEvaluatorRequestor_OnNext(ulong handle, IEvaluatorRequestorClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemEvaluatorRequestor_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IEvaluatorRequestor> obj = (ClrSystemHandler<IEvaluatorRequestor>)gc.Target;
-                obj.OnNext(new EvaluatorRequestor(clr2Java));
-            }   
-        }
-
-        public static void Call_ClrSystemTaskMessage_OnNext(ulong handle, ITaskMessageClr2Java clr2Java, byte[] message)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemTaskMessage_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<ITaskMessage> obj = (ClrSystemHandler<ITaskMessage>)gc.Target;
-                obj.OnNext(new TaskMessage(clr2Java, message));
-            }   
-        }
-
-        public static void Call_ClrSystemFailedTask_OnNext(ulong handle, IFailedTaskClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemFailedTask_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IFailedTask> obj = (ClrSystemHandler<IFailedTask>)gc.Target;
-                obj.OnNext(new FailedTask(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemRunningTask_OnNext(ulong handle, IRunningTaskClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemRunningTask_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IRunningTask> obj = (ClrSystemHandler<IRunningTask>)gc.Target;
-                obj.OnNext(new RunningTask(clr2Java));
-            }        
-        }
-
-        public static void Call_ClrSystemDriverRestartRunningTask_OnNext(ulong handle, IRunningTaskClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemDriverRestartRunningTask_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IRunningTask> obj = (ClrSystemHandler<IRunningTask>)gc.Target;
-                obj.OnNext(new RunningTask(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemFailedEvaluator_OnNext(ulong handle, IFailedEvaluatorClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemFailedEvaluator_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IFailedEvaluator> obj = (ClrSystemHandler<IFailedEvaluator>)gc.Target;
-                obj.OnNext(new FailedEvaluator(clr2Java));
-            }     
-        }
-
-        public static void Call_ClrSystemCompletedTask_OnNext(ulong handle, ICompletedTaskClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemCompletedTask_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<ICompletedTask> obj = (ClrSystemHandler<ICompletedTask>)gc.Target;
-                obj.OnNext(new CompletedTask(clr2Java));
-            }         
-        }
-
-        public static void Call_ClrSystemSuspendedTask_OnNext(ulong handle, ISuspendedTaskClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemSuspendedTask_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<ISuspendedTask> obj = (ClrSystemHandler<ISuspendedTask>)gc.Target;
-                obj.OnNext(new SuspendedTask(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemCompletedEvaluator_OnNext(ulong handle, ICompletedEvaluatorClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemCompletedEvaluator_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<ICompletedEvaluator> obj = (ClrSystemHandler<ICompletedEvaluator>)gc.Target;
-                obj.OnNext(new CompletedEvaluator(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemHttpServer_OnNext(ulong handle, IHttpServerBridgeClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemHttpServer_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IHttpMessage> obj = (ClrSystemHandler<IHttpMessage>)gc.Target;
-                obj.OnNext(new HttpMessage(clr2Java));
-            }      
-        }
-
-        public static void Call_ClrSystemClosedContext_OnNext(ulong handle, IClosedContextClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemClosedContext_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IClosedContext> obj = (ClrSystemHandler<IClosedContext>)gc.Target;
-                obj.OnNext(new ClosedContext(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemFailedContext_OnNext(ulong handle, IFailedContextClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemFailedContext_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IFailedContext> obj = (ClrSystemHandler<IFailedContext>)gc.Target;
-                obj.OnNext(new FailedContext(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemContextMessage_OnNext(ulong handle, IContextMessageClr2Java clr2Java)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemContextMessage_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<IContextMessage> obj = (ClrSystemHandler<IContextMessage>)gc.Target;
-                obj.OnNext(new ContextMessage(clr2Java));
-            }
-        }
-
-        public static void Call_ClrSystemDriverRestart_OnNext(ulong handle)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemDriverRestart_OnNext"))
-            {
-                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
-                ClrSystemHandler<StartTime> obj = (ClrSystemHandler<StartTime>)gc.Target;
-                obj.OnNext(new StartTime(DateTime.Now.Ticks));
-            }
-        }
-
-        //Deprecate, remove after both Java and C# code gets checked in
-        public static ulong[] Call_ClrSystemStartHandler_OnStart(DateTime startTime)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemStartHandler_OnStart"))
-            {
-                LOGGER.Log(Level.Info, "*** Start time is " + startTime);
-                return GetHandlers(null);
-            }
-        }
-
-        public static ulong[] Call_ClrSystemStartHandler_OnStart(DateTime startTime, string httpServerPort)
-        {
-            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemStartHandler_OnStart"))
-            {
-                LOGGER.Log(Level.Info, "*** Start time is " + startTime);
-                LOGGER.Log(Level.Info, "*** httpServerPort: " + httpServerPort);
-                return GetHandlers(httpServerPort);
-            }   
-        }
-
-        private static ulong[] GetHandlers(string httpServerPortNumber)
-        {
-            IStartHandler startHandler;
-            IInjector injector = null;
-            string errorMessage;
-            string bridgeConfiguration = Path.Combine(Directory.GetCurrentDirectory(), "reef", "global", Constants.DriverBridgeConfiguration);
-            if (!File.Exists(bridgeConfiguration))
-            {
-                errorMessage = "Cannot find CLR Driver bridge configuration file " + bridgeConfiguration;
-                Exceptions.Throw(new InvalidOperationException(errorMessage), LOGGER);
-            }
-            try
-            {
-                IConfiguration driverBridgeConfiguration = new AvroConfigurationSerializer().FromFile(bridgeConfiguration);
-                injector = TangFactory.GetTang().NewInjector(driverBridgeConfiguration);
-            }
-            catch (Exception e)
-            {
-                errorMessage = "Failed to get injector from driver bridge configuration.";
-                Exceptions.CaughtAndThrow(new InvalidOperationException(errorMessage, e), Level.Error, errorMessage, LOGGER);
-            }
-
-            try
-            {
-                HttpServerPort port = injector.GetInstance<HttpServerPort>();
-                port.PortNumber = httpServerPortNumber == null ? 0 : int.Parse(httpServerPortNumber, CultureInfo.InvariantCulture);
-
-                startHandler = injector.GetInstance<IStartHandler>();
-                LOGGER.Log(Level.Info, "Start handler set to be " + startHandler.Identifier);
-                _driverBridge = injector.GetInstance<DriverBridge>();
-            }
-            catch (Exception e)
-            {
-                Exceptions.CaughtAndThrow(e, Level.Error, "Cannot get instance.", LOGGER);
-            }
-
-            return _driverBridge.Subscribe();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 314aa6a..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/DriverBridge.cs
+++ /dev/null
@@ -1,321 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-
-using Org.Apache.REEF.Wake.Time;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class DriverBridge
-    {
-        private static Logger _logger;
-        
-        private static ClrSystemHandler<IAllocatedEvaluator> _allocatedEvaluatorSubscriber;
-
-        private static ClrSystemHandler<IEvaluatorRequestor> _evaluatorRequestorSubscriber;
-
-        private static ClrSystemHandler<ITaskMessage> _taskMessageSubscriber;
-
-        private static ClrSystemHandler<IActiveContext> _activeContextSubscriber;
-
-        private static ClrSystemHandler<IActiveContext> _driverRestartActiveContextSubscriber;
-
-        private static ClrSystemHandler<IFailedTask> _failedTaskSubscriber;
-
-        private static ClrSystemHandler<IRunningTask> _runningTaskSubscriber;
-
-        private static ClrSystemHandler<IRunningTask> _driverRestartRunningTaskSubscriber;
-
-        private static ClrSystemHandler<ISuspendedTask> _suspendedTaskSubscriber;
-
-        private static ClrSystemHandler<IFailedEvaluator> _failedEvaluatorSubscriber;
-
-        private static ClrSystemHandler<ICompletedEvaluator> _completedEvaluatorSubscriber;
-
-        private static ClrSystemHandler<IHttpMessage> _httpServerEventSubscriber;
-
-        private static ClrSystemHandler<ICompletedTask> _completedTaskSubscriber;
-
-        private static ClrSystemHandler<IClosedContext> _closedContextSubscriber;
-
-        private static ClrSystemHandler<IFailedContext> _failedContextSubscriber;
-
-        private static ClrSystemHandler<IContextMessage> _contextMessageSubscriber;
-
-        private static ClrSystemHandler<StartTime> _driverRestartSubscriber;
-
-        private IObserver<StartTime> _driverRestartHandler; 
-
-        private ISet<IObserver<IEvaluatorRequestor>> _evaluatorRequestHandlers;
-
-        private ISet<IObserver<IAllocatedEvaluator>> _allocatedEvaluatorHandlers;
-
-        private ISet<IObserver<IActiveContext>> _activeContextHandlers;
-
-        private ISet<IObserver<IActiveContext>> _driverRestartActiveContextHandlers;
-
-        private ISet<IObserver<ITaskMessage>> _taskMessageHandlers;
-
-        private ISet<IObserver<IFailedTask>> _failedTaskHandlers;
-
-        private ISet<IObserver<ISuspendedTask>> _suspendedTaskHandlers;
-
-        private ISet<IObserver<IRunningTask>> _runningTaskHandlers;
-
-        private ISet<IObserver<IRunningTask>> _driverRestartRunningTaskHandlers;
-
-        private ISet<IObserver<IFailedEvaluator>> _failedEvaluatorHandlers;
-
-        private ISet<IObserver<ICompletedEvaluator>> _completedEvaluatorHandlers;
-
-        private ISet<IObserver<IClosedContext>> _closedContextHandlers;
-
-        private ISet<IObserver<IFailedContext>> _failedContextHandlers;
-
-        private ISet<IObserver<IContextMessage>> _contextMessageHandlers;
-
-        private ISet<IObserver<ICompletedTask>> _completedTaskHandlers;
-
-        private HttpServerHandler _httpServerHandler;
-
-        [Inject]
-        public DriverBridge(
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.DriverRestartHandler))] IObserver<StartTime> driverRestartHandler,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.EvaluatorRequestHandlers))] ISet<IObserver<IEvaluatorRequestor>> evaluatorRequestHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.AllocatedEvaluatorHandlers))] ISet<IObserver<IAllocatedEvaluator>> allocatedEvaluatorHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.ActiveContextHandlers))] ISet<IObserver<IActiveContext>> activeContextHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.TaskMessageHandlers))] ISet<IObserver<ITaskMessage>> taskMessageHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.FailedTaskHandlers))] ISet<IObserver<IFailedTask>> failedTaskHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.FailedEvaluatorHandlers))] ISet<IObserver<IFailedEvaluator>> failedEvaluatorHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.CompletedEvaluatorHandlers))] ISet<IObserver<ICompletedEvaluator>> completedEvaluatorHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.RunningTaskHandlers))] ISet<IObserver<IRunningTask>> runningTaskHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.CompletedTaskHandlers))] ISet<IObserver<ICompletedTask>> completedTaskHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.SuspendedTaskHandlers))] ISet<IObserver<ISuspendedTask>> suspendedTaskHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.ClosedContextHandlers))] ISet<IObserver<IClosedContext>> closedContextHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.FailedContextHandlers))] ISet<IObserver<IFailedContext>> failedContextHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.ContextMessageHandlers))] ISet<IObserver<IContextMessage>> contextMessageHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.DriverRestartActiveContextHandlers))] ISet<IObserver<IActiveContext>> driverRestartActiveContextHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.DriverRestartRunningTaskHandlers))] ISet<IObserver<IRunningTask>> driverRestartRunningTaskHandlers,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.TraceListenersSet))] ISet<TraceListener> traceListeners,
-            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.TraceLevel))] string traceLevel,
-            HttpServerHandler httpServerHandler)
-        {
-            foreach (TraceListener listener in traceListeners)
-            {
-                Logger.AddTraceListner(listener);
-            }
-            _logger = Logger.GetLogger(typeof(DriverBridge));
-            _logger.Log(Level.Info, "Constructing DriverBridge");
-
-            Level level;
-            if (!Enum.TryParse(traceLevel.ToString(CultureInfo.InvariantCulture), out level))
-            {
-                _logger.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Invalid trace level {0} provided, will by default use verbose level", traceLevel));
-            }
-            else
-            {
-                Logger.SetCustomLevel(level);
-            }
-            
-            _evaluatorRequestHandlers = evaluatorRequestHandlers;
-            _allocatedEvaluatorHandlers = allocatedEvaluatorHandlers;
-            _activeContextHandlers = activeContextHandlers;
-            _taskMessageHandlers = taskMessageHandlers;
-            _failedEvaluatorHandlers = failedEvaluatorHandlers;
-            _failedTaskHandlers = failedTaskHandlers;
-            _completedTaskHandlers = completedTaskHandlers;
-            _runningTaskHandlers = runningTaskHandlers;
-            _suspendedTaskHandlers = suspendedTaskHandlers;
-            _completedEvaluatorHandlers = completedEvaluatorHandlers;
-            _closedContextHandlers = closedContextHandlers;
-            _failedContextHandlers = failedContextHandlers;
-            _contextMessageHandlers = contextMessageHandlers;
-            _driverRestartHandler = driverRestartHandler;
-            _driverRestartActiveContextHandlers = driverRestartActiveContextHandlers;
-            _driverRestartRunningTaskHandlers = driverRestartRunningTaskHandlers;
-            _httpServerHandler = httpServerHandler;
-
-            _evaluatorRequestorSubscriber = new ClrSystemHandler<IEvaluatorRequestor>();
-            _allocatedEvaluatorSubscriber = new ClrSystemHandler<IAllocatedEvaluator>();
-            _completedEvaluatorSubscriber = new ClrSystemHandler<ICompletedEvaluator>();
-            _taskMessageSubscriber = new ClrSystemHandler<ITaskMessage>();
-            _activeContextSubscriber = new ClrSystemHandler<IActiveContext>();
-            _failedTaskSubscriber = new ClrSystemHandler<IFailedTask>();
-            _failedEvaluatorSubscriber = new ClrSystemHandler<IFailedEvaluator>();
-            _httpServerEventSubscriber = new ClrSystemHandler<IHttpMessage>();
-            _completedTaskSubscriber = new ClrSystemHandler<ICompletedTask>();
-            _runningTaskSubscriber = new ClrSystemHandler<IRunningTask>();
-            _suspendedTaskSubscriber = new ClrSystemHandler<ISuspendedTask>();
-            _closedContextSubscriber = new ClrSystemHandler<IClosedContext>();
-            _failedContextSubscriber = new ClrSystemHandler<IFailedContext>();
-            _contextMessageSubscriber = new ClrSystemHandler<IContextMessage>();
-            _driverRestartSubscriber = new ClrSystemHandler<StartTime>();
-            _driverRestartActiveContextSubscriber = new ClrSystemHandler<IActiveContext>();
-            _driverRestartRunningTaskSubscriber = new ClrSystemHandler<IRunningTask>();
-        }
-
-        public ulong[] Subscribe()
-        {
-            ulong[] handlers = Enumerable.Repeat(Constants.NullHandler, Constants.HandlersNumber).ToArray();
-
-            // subscribe to StartTime event for driver restart         
-            _driverRestartSubscriber.Subscribe(_driverRestartHandler);
-            _logger.Log(Level.Info, "subscribed to Driver restart handler: " + _driverRestartHandler);
-            handlers[Constants.Handlers[Constants.DriverRestartHandler]] = ClrHandlerHelper.CreateHandler(_driverRestartSubscriber);
-
-            // subscribe to Evaluator Requestor          
-            foreach (var handler in _evaluatorRequestHandlers)
-            {
-                _evaluatorRequestorSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IEvaluatorRequestor handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.EvaluatorRequestorHandler]] = ClrHandlerHelper.CreateHandler(_evaluatorRequestorSubscriber);
-
-            // subscribe to Allocated Evaluator
-            foreach (var handler in _allocatedEvaluatorHandlers)
-            {
-                _allocatedEvaluatorSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IAllocatedEvaluator handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.AllocatedEvaluatorHandler]] = ClrHandlerHelper.CreateHandler(_allocatedEvaluatorSubscriber);
-
-            // subscribe to TaskMessage
-            foreach (var handler in _taskMessageHandlers)
-            {
-                _taskMessageSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to ITaskMessage handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.TaskMessageHandler]] = ClrHandlerHelper.CreateHandler(_taskMessageSubscriber);
-
-            // subscribe to Active Context
-            foreach (var handler in _activeContextHandlers)
-            {
-                _activeContextSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IActiveContext handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.ActiveContextHandler]] = ClrHandlerHelper.CreateHandler(_activeContextSubscriber);
-
-            // subscribe to Failed Task
-            foreach (var handler in _failedTaskHandlers)
-            {
-                _failedTaskSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IFailedTask handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.FailedTaskHandler]] = ClrHandlerHelper.CreateHandler(_failedTaskSubscriber);
-
-            // subscribe to Running Task
-            foreach (var handler in _runningTaskHandlers)
-            {
-                _runningTaskSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IRunningask handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.RunningTaskHandler]] = ClrHandlerHelper.CreateHandler(_runningTaskSubscriber);
-
-            // subscribe to Completed Task
-            foreach (var handler in _completedTaskHandlers)
-            {
-                _completedTaskSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to ICompletedTask handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.CompletedTaskHandler]] = ClrHandlerHelper.CreateHandler(_completedTaskSubscriber);
-
-            // subscribe to Suspended Task
-            foreach (var handler in _suspendedTaskHandlers)
-            {
-                _suspendedTaskSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to ISuspendedTask handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.SuspendedTaskHandler]] = ClrHandlerHelper.CreateHandler(_suspendedTaskSubscriber);
-
-            // subscribe to Failed Evaluator
-            foreach (var handler in _failedEvaluatorHandlers)
-            {
-                _failedEvaluatorSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IFailedEvaluator handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.FailedEvaluatorHandler]] = ClrHandlerHelper.CreateHandler(_failedEvaluatorSubscriber);
-
-            // subscribe to Completed Evaluator
-            foreach (var handler in _completedEvaluatorHandlers)
-            {
-                _completedEvaluatorSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to ICompletedEvaluator handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.CompletedEvaluatorHandler]] = ClrHandlerHelper.CreateHandler(_completedEvaluatorSubscriber);
-
-            // subscribe to Closed Context
-            foreach (var handler in _closedContextHandlers)
-            {
-                _closedContextSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IClosedContext handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.ClosedContextHandler]] = ClrHandlerHelper.CreateHandler(_closedContextSubscriber);
-
-            // subscribe to Failed Context
-            foreach (var handler in _failedContextHandlers)
-            {
-                _failedContextSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IFailedContext handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.FailedContextHandler]] = ClrHandlerHelper.CreateHandler(_failedContextSubscriber);
-
-            // subscribe to Context Message
-            foreach (var handler in _contextMessageHandlers)
-            {
-                _contextMessageSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to IContextMesage handler: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.ContextMessageHandler]] = ClrHandlerHelper.CreateHandler(_contextMessageSubscriber);
-
-            // subscribe to Active Context received during driver restart
-            foreach (var handler in _driverRestartActiveContextHandlers)
-            {
-                _driverRestartActiveContextSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to handler for IActiveContext received during driver restart: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.DriverRestartActiveContextHandler]] = ClrHandlerHelper.CreateHandler(_driverRestartActiveContextSubscriber);
-
-            // subscribe to Running Task received during driver restart
-            foreach (var handler in _driverRestartRunningTaskHandlers)
-            {
-                _driverRestartRunningTaskSubscriber.Subscribe(handler);
-                _logger.Log(Level.Info, "subscribed to handler for IRunningTask received during driver restart: " + handler);
-            }
-            handlers[Constants.Handlers[Constants.DriverRestartRunningTaskHandler]] = ClrHandlerHelper.CreateHandler(_driverRestartRunningTaskSubscriber);
-
-            // subscribe to Http message
-            _httpServerEventSubscriber.Subscribe(_httpServerHandler);
-            _logger.Log(Level.Info, "subscribed to IHttpMessage handler  :" + _httpServerHandler);
-            handlers[Constants.Handlers[Constants.HttpServerHandler]] = ClrHandlerHelper.CreateHandler(_httpServerEventSubscriber);
-
-            return handlers;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 047ba5d..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/DriverBridgeConfiguration.cs
+++ /dev/null
@@ -1,273 +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 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.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Util;
-using Org.Apache.REEF.Wake.Time;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    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")]
-        public static readonly RequiredImpl<IStartHandler> OnDriverStarted = new RequiredImpl<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<StartTime>> OnDriverRestarted = new OptionalImpl<IObserver<StartTime>>();
-
-        /// <summary>
-        /// The event handler for requesting evaluator
-        /// </summary>
-        [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>> OnDirverRestartContextActive = 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>();
-
-        // 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)
-                .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.DriverRestartHandler>.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, OnDirverRestartContextActive)
-                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartRunningTaskHandlers>.Class, OnDriverRestartTaskRunning)
-                .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.TraceLevel>.Class, CustomTraceLevel)
-                .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/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/DriverBridgeConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/DriverBridgeConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/DriverBridgeConfigurationOptions.cs
deleted file mode 100644
index c2f4bfd..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/DriverBridgeConfigurationOptions.cs
+++ /dev/null
@@ -1,154 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Defaults;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Wake.Time;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "allow name parameter class to be embedded")]
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    /// <summary>
-    /// Hosts all named parameters for Drivers, including bridge handlers.
-    /// </summary>
-    public class DriverBridgeConfigurationOptions
-    {
-        // Level.Verbose (since enum is not suppoted for TANG, we use a string here)
-        private const string _verboseLevel = "Verbose";
-
-        [NamedParameter(documentation: "Called when driver is restarted, after CLR bridge is set up.", defaultClasses: new[] { typeof(DefaultDriverRestartHandler) })]
-        public class DriverRestartHandler : Name<IObserver<StartTime>>
-        {
-        }
-
-        [NamedParameter(documentation: "Called when evaluator is requested.", defaultClasses: new[] { typeof(DefaultEvaluatorRequestorHandler) })] 
-        public class EvaluatorRequestHandlers : Name<ISet<IObserver<IEvaluatorRequestor>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Called when an exception occurs on a running evaluator.", defaultClasses: new[] { typeof(DefaultEvaluatorFailureHandler) })]
-        public class FailedEvaluatorHandlers : Name<ISet<IObserver<IFailedEvaluator>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Called when an evaluator completes.", defaultClasses: new[] { typeof(DefaultEvaluatorCompletionHandler) })]
-        public class CompletedEvaluatorHandlers : Name<ISet<IObserver<ICompletedEvaluator>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Called when an allocated evaluator is given to the client.", defaultClasses: new[] { typeof(DefaultEvaluatorAllocationHandler) })]
-        public class AllocatedEvaluatorHandlers : Name<ISet<IObserver<IAllocatedEvaluator>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Running task handler.", defaultClasses: new[] { typeof(DefaultTaskRunningHandler) })]
-        public class RunningTaskHandlers : Name<ISet<IObserver<IRunningTask>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Running task during driver restart handler.", defaultClasses: new[] { typeof(DefaultDriverRestartTaskRunningHandler) })]
-        public class DriverRestartRunningTaskHandlers : Name<ISet<IObserver<IRunningTask>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Task exception handler.", defaultClasses: new[] { typeof(DefaultTaskFailureHandler) })]
-        public class FailedTaskHandlers : Name<ISet<IObserver<IFailedTask>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Task message handler.", defaultClasses: new[] { typeof(DefaultTaskMessageHandler) })]
-        public class TaskMessageHandlers : Name<ISet<IObserver<ITaskMessage>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Http Event Handlers.", defaultClasses: new[] { typeof(DefaultHttpHandler) })]
-        public class HttpEventHandlers : Name<ISet<IHttpHandler>>
-        {
-        }
-
-        [NamedParameter(documentation: "Completed task handler.", defaultClasses: new[] { typeof(DefaultTaskCompletionHandler) })]
-        public class CompletedTaskHandlers : Name<ISet<IObserver<ICompletedTask>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Suspended task handler.", defaultClasses: new[] { typeof(DefaultTaskSuspensionHandler) })]
-        public class SuspendedTaskHandlers : Name<ISet<IObserver<ISuspendedTask>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Handler for IActiveContext.", defaultClasses: new[] { typeof(DefaultContextActiveHandler) })]
-        public class ActiveContextHandlers : Name<ISet<IObserver<IActiveContext>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Handler for IActiveContext received during driver restart.", defaultClasses: new[] { typeof(DefaultDriverRestartContextActiveHandler) })]
-        public class DriverRestartActiveContextHandlers : Name<ISet<IObserver<IActiveContext>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Handler for ClosedContext.", defaultClasses: new[] { typeof(DefaultContextClosureHandler) })]
-        public class ClosedContextHandlers : Name<ISet<IObserver<IClosedContext>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Handler for FailedContext.", defaultClasses: new[] { typeof(DefaultContextFailureHandler) })]
-        public class FailedContextHandlers : Name<ISet<IObserver<IFailedContext>>>
-        {
-        }
-
-        [NamedParameter(documentation: "Handler for ContextMessage.", defaultClasses: new[] { typeof(DefaultContextMessageHandler) })]
-        public class ContextMessageHandlers : Name<ISet<IObserver<IContextMessage>>>
-        {
-        }
-
-        [NamedParameter("Command Line Arguments supplied by client", "CommandLineArguments", null)]
-        public class ArgumentSets : Name<ISet<string>>
-        {
-        }
-
-        [NamedParameter("Additional trace listners supplied by client", "TraceListeners", null, defaultClasses: new[] { typeof(DefaultCustomTraceListener) })]
-        public class TraceListenersSet : Name<ISet<TraceListener>>
-        {
-        }
-
-        [NamedParameter("Custom Trace Level", "TraceLevel", defaultValue: _verboseLevel)]
-        public class TraceLevel : Name<string>
-        {
-        }
-
-        //[NamedParameter(documentation: "Job message handler.", defaultClasses: new[] { typeof(DefaultClientMessageHandler) })]
-        //public class ClientMessageHandlers : Name<ISet<IObserver<byte[]>>>
-        //{
-        //}
-
-        //[NamedParameter(documentation: "Client close handler.", defaultClasses: new[] { typeof(DefaultClientCloseHandler) })]
-        //public class ClientCloseHandlers : Name<ISet<IObserver<byte[]>>>
-        //{
-        //}
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/HttpMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/HttpMessage.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/HttpMessage.cs
deleted file mode 100644
index 7aa1a33..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/HttpMessage.cs
+++ /dev/null
@@ -1,60 +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.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    public class HttpMessage : IHttpMessage
-    {
-        public HttpMessage(IHttpServerBridgeClr2Java httpServerBridgeClr2Java)
-        {
-            HttpServerBridgeClr2Java = httpServerBridgeClr2Java;
-        }
-
-        [DataMember]
-        private IHttpServerBridgeClr2Java HttpServerBridgeClr2Java { get; set; }
-
-        public string GetRequestString()
-        {
-            return HttpServerBridgeClr2Java.GetQueryString();
-        }
-
-        public void SetQueryResult(string responseString)
-        {
-            HttpServerBridgeClr2Java.SetQueryResult(responseString);
-        }
-
-        public byte[] GetQueryReuestData()
-        {
-            return HttpServerBridgeClr2Java.GetQueryRequestData();            
-        }
-
-        public void SetQueryResponseData(byte[] responseData)
-        {
-            HttpServerBridgeClr2Java.SetQueryResponseData(responseData);
-        }
-
-        public void SetUriSpecification(string uriSpecification)
-        {
-            HttpServerBridgeClr2Java.SetUriSpecification(uriSpecification);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerHandler.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerHandler.cs
deleted file mode 100644
index c6691e7..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerHandler.cs
+++ /dev/null
@@ -1,165 +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 Org.Apache.REEF.Common.Avro;
-using Org.Apache.REEF.Driver.bridge;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Net;
-using Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    /// <summary>
-    ///  HttpServerHandler, the handler for all CLR http events
-    /// </summary>
-    public class HttpServerHandler : IObserver<IHttpMessage>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(HttpServerHandler));
-
-        private static readonly string SPEC = "SPEC";
-
-        private IDictionary<string, IHttpHandler> eventHandlers = new Dictionary<string, IHttpHandler>();
-
-        private HttpServerPort httpServerPort;
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="HttpServerHandler" /> class.
-        /// </summary>
-        /// <param name="httpEventHandlers">The HTTP event handlers.</param>
-        /// <param name="httpServerPort">The HTTP server port.</param>
-        [Inject]
-        public HttpServerHandler([Parameter(Value = typeof(DriverBridgeConfigurationOptions.HttpEventHandlers))] ISet<IHttpHandler> httpEventHandlers,
-                                 HttpServerPort httpServerPort)
-        {
-            LOGGER.Log(Level.Info, "Constructing HttpServerHandler");       
-            foreach (var h in httpEventHandlers)
-            {
-                string spec = h.GetSpecification();
-                if (spec.Contains(":"))
-                {
-                    Exceptions.Throw(new ArgumentException("spec cannot contain :"), "The http spec given is " + spec, LOGGER);
-                }
-                LOGGER.Log(Level.Info, "HttpHandler spec:" + spec);   
-                eventHandlers.Add(spec.ToLower(CultureInfo.CurrentCulture), h);
-            }
-            this.httpServerPort = httpServerPort;
-        }
-
-        /// <summary>
-        /// Called when receving an http request from Java side
-        /// </summary>
-        /// <param name="httpMessage">The HTTP message.</param>
-        public void OnNext(IHttpMessage httpMessage)
-        {
-            LOGGER.Log(Level.Info, "HttpHandler OnNext is called");
-            string requestString = httpMessage.GetRequestString();
-
-            if (requestString != null && requestString.Equals(SPEC))
-            {
-                LOGGER.Log(Level.Info, "HttpHandler OnNext, requestString:" + requestString);
-                LOGGER.Log(Level.Info, "HttpHandler OnNext, port number:" + httpServerPort.PortNumber);
-
-                httpMessage.SetUriSpecification(GetAllSpecifications());
-            }
-            else
-            {
-                LOGGER.Log(Level.Info, "HttpHandler OnNext, handling http request.");
-                byte[] byteData = httpMessage.GetQueryReuestData();                    
-                AvroHttpRequest avroHttpRequest = AvroHttpSerializer.FromBytes(byteData);
-                LOGGER.Log(Level.Info, "HttpHandler OnNext, requestData:" + avroHttpRequest);
-
-                string spec = GetSpecification(avroHttpRequest.PathInfo);
-                if (spec != null)
-                {
-                    LOGGER.Log(Level.Info, "HttpHandler OnNext, target:" + spec);
-                    ReefHttpRequest request = ToHttpRequest(avroHttpRequest);
-                    ReefHttpResponse response = new ReefHttpResponse();
-
-                    IHttpHandler handler;
-                    eventHandlers.TryGetValue(spec.ToLower(CultureInfo.CurrentCulture), out handler);
-
-                    byte[] responseData;
-                    if (handler != null)
-                    {
-                        LOGGER.Log(Level.Info, "HttpHandler OnNext, get eventHandler:" + handler.GetSpecification());
-                        handler.OnHttpRequest(request, response);
-                        responseData = response.OutputStream;
-                    }
-                    else
-                    {
-                        responseData =
-                            ByteUtilities.StringToByteArrays(string.Format(CultureInfo.CurrentCulture,
-                                                                           "No event handler found at CLR side for {0}.",
-                                                                           spec));
-                    }
-                    httpMessage.SetQueryResponseData(responseData);
-                }
-            }
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        private string GetAllSpecifications()
-        {
-            return string.Join(":", eventHandlers.Keys.ToArray());
-        }
-
-        private string GetSpecification(string requestUri)
-        {
-            if (requestUri != null)
-            {
-                string[] parts = requestUri.Split('/');
-
-                if (parts.Length > 1)
-                {
-                    return parts[1];
-                }
-            }
-            return null;            
-        }
-
-        private ReefHttpRequest ToHttpRequest(AvroHttpRequest avroRequest)
-        {
-            ReefHttpRequest httpRequest = new ReefHttpRequest();
-            httpRequest.PathInfo = avroRequest.PathInfo;
-            httpRequest.InputStream = avroRequest.InputStream;
-            httpRequest.Url = avroRequest.RequestUrl;
-            httpRequest.Querystring = avroRequest.QueryString;
-
-            HttpMethod m;
-            HttpMethod.TryParse(avroRequest.HttpMethod, true, out m);
-            httpRequest.Method = m;
-            return httpRequest;
-        }    
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerPort.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerPort.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerPort.cs
deleted file mode 100644
index 50fb915..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/HttpServerPort.cs
+++ /dev/null
@@ -1,33 +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 Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Driver.bridge
-{
-    public class HttpServerPort
-    {
-        [Inject]
-        public HttpServerPort()
-        {            
-        }
-
-        public int PortNumber { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpHandler.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpHandler.cs
deleted file mode 100644
index 409c974..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpHandler.cs
+++ /dev/null
@@ -1,39 +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 Org.Apache.REEF.Driver.Bridge;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IHttpHandler
-    {
-        /// <summary>
-        /// Define the specification of the handler. ":" is not allowed in the specification.
-        /// </summary>
-        /// <returns>string specification</returns>
-        string GetSpecification();
-
-        /// <summary>
-        /// Called when Http request is sent
-        /// </summary>
-        /// <param name="requet">The requet.</param>
-        /// <param name="resonse">The resonse.</param>
-        void OnHttpRequest(ReefHttpRequest requet, ReefHttpResponse resonse);  
-    }
-}


[02/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequest .cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequest .cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequest .cs
deleted file mode 100644
index ded8db6..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequest .cs	
+++ /dev/null
@@ -1,42 +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 Org.Apache.REEF.Common.Capabilities;
-using Org.Apache.REEF.Common.Catalog;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    public interface IEvaluatorRequest
-    {
-        int MemoryMegaBytes { get; set; }
-
-        int Number { get;  set; }
-
-        int VirtualCore { get; set; }
-
-        string Rack { get; set; }
-
-        string EvaluatorBatchId { get; set; }
-
-        List<ICapability> Capabilities { get; set; }
-
-        IResourceCatalog Catalog { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequestor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequestor.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequestor.cs
deleted file mode 100644
index ac374ce..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/IEvaluatorRequestor.cs
+++ /dev/null
@@ -1,47 +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.Collections.Generic;
-
-using Org.Apache.REEF.Common.Catalog;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    /// <summary>
-    /// Interface through which Evaluators can be requested.
-    /// </summary>
-    public interface IEvaluatorRequestor
-    {
-        /// <summary>
-        /// Access to the {@link ResourceCatalog} for the cluster this Factory has access to
-        /// </summary>
-        IResourceCatalog ResourceCatalog { get; set; }
-
-        /// <summary>
-        /// Map between user evaluator id and evaluator information
-        /// </summary>
-        //IDictionary<string, IEvaluatorDescriptor> Evaluators { get; }
-
-        /// <summary>
-        /// Submit the request for new evaluator. The response will surface in the AllocatedEvaluator message handler.
-        /// </summary>
-        /// <param name="request"></param>
-        void Submit(IEvaluatorRequest request);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/evaluator/IFailedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/evaluator/IFailedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/evaluator/IFailedEvaluator.cs
deleted file mode 100644
index cd2ae2c..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/evaluator/IFailedEvaluator.cs
+++ /dev/null
@@ -1,41 +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 Org.Apache.REEF.Common.Exceptions;
-using Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Driver.Evaluator
-{
-    /// <summary>
-    /// Represents an Evaluator that became unavailable.
-    /// </summary>
-    public interface IFailedEvaluator : IIdentifiable
-    {
-        EvaluatorException EvaluatorException { get; set; }
-
-        List<FailedContext> FailedContexts { get; set; }
-
-        Optional<IFailedTask> FailedTask { get; set; }
-
-        IEvaluatorRequestor GetEvaluatorRequetor();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/task/ICompletedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/task/ICompletedTask.cs b/lang/cs/Org.Apache.REEF.Driver/task/ICompletedTask.cs
deleted file mode 100644
index bfd15c7..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/task/ICompletedTask.cs
+++ /dev/null
@@ -1,29 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Task
-{
-    public interface ICompletedTask : IMessage, IIdentifiable
-    {
-         IActiveContext ActiveContext { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/task/IFailedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/task/IFailedTask.cs b/lang/cs/Org.Apache.REEF.Driver/task/IFailedTask.cs
deleted file mode 100644
index 6d12993..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/task/IFailedTask.cs
+++ /dev/null
@@ -1,30 +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 Org.Apache.REEF.Common.Api;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Task
-{
-    public interface IFailedTask : IAbstractFailure
-    {
-        Optional<IActiveContext> GetActiveContext();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/task/IRunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/task/IRunningTask.cs b/lang/cs/Org.Apache.REEF.Driver/task/IRunningTask.cs
deleted file mode 100644
index f1c4ea0..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/task/IRunningTask.cs
+++ /dev/null
@@ -1,65 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities;
-using System;
-
-namespace Org.Apache.REEF.Driver.Task
-{
-    /// <summary>
-    /// Represents a running Task
-    /// </summary>
-    public interface IRunningTask : IIdentifiable, IDisposable
-    {
-        /// <summary>
-        /// the context the task is running on.
-        /// </summary>
-        IActiveContext ActiveContext { get; set; }
-
-        /// <summary>
-        /// Sends the message to the running task.
-        /// </summary>
-        /// <param name="message"></param>
-        void OnNext(byte[] message);
-
-        /// <summary>
-        /// Sends the message
-        /// </summary>
-        /// <param name="message"></param>
-        void Send(byte[] message);
-
-        /// <summary>
-        ///  Signal the task to suspend.
-        /// </summary>
-        /// <param name="message">a message that is sent to the Task.</param>
-        void Suspend(byte[] message);
-
-        /// <summary>
-        /// Sends the message to the running task.
-        /// </summary>
-        void Suspend();
-
-        /// <summary>
-        /// Signal the task to shut down.
-        /// </summary>
-        /// <param name="message">a message that is sent to the Task.</param>
-        void Dispose(byte[] message);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/task/ISuspendedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/task/ISuspendedTask.cs b/lang/cs/Org.Apache.REEF.Driver/task/ISuspendedTask.cs
deleted file mode 100644
index 80f7976..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/task/ISuspendedTask.cs
+++ /dev/null
@@ -1,29 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver
-{
-    public interface ISuspendedTask : IMessage, IIdentifiable
-    {
-        IActiveContext ActiveContext { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/task/ITaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/task/ITaskMessage.cs b/lang/cs/Org.Apache.REEF.Driver/task/ITaskMessage.cs
deleted file mode 100644
index e06c8f3..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/task/ITaskMessage.cs
+++ /dev/null
@@ -1,28 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Task
-{
-    public interface ITaskMessage
-    {
-        byte[] Message { get; set; }
-
-        string TaskId { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 94a4435..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/task/RunningTaskImpl.cs
+++ /dev/null
@@ -1,127 +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 Org.Apache.REEF.Common;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Utilities.Logging;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Driver.Task
-{
-   public class RunningTaskImpl : IRunningTask
-   {
-       private static readonly Logger LOGGER = Logger.GetLogger(typeof(RunningTaskImpl));
-       
-       private string _id;
-
-       private EvaluatorManager _evaluatorManager;
-
-       private EvaluatorContext _evaluatorContext;
-
-       public RunningTaskImpl(EvaluatorManager evaluatorManager, 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;
-       }
-
-       public string Id
-       {
-           get
-           {
-               return _id;
-           }
-
-           set
-           {
-           }
-       }
-
-       public IActiveContext ActiveContext
-       {
-           get
-           {
-               return _evaluatorContext;
-           }
-
-           set
-           {
-           }
-       }
-
-       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()
-       {
-           return "TaskRuntime with taskId = " + _id;
-       }
-
-       public override int GetHashCode()
-       {
-           return _id.GetHashCode();
-       }
-
-       public void Send(byte[] message)
-       {
-           LOGGER.Log(Level.Info, "RunningTaskImpl.Send() is called");
-       }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 39ebfc3..2709be0 100644
--- a/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs
+++ b/lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs
@@ -19,15 +19,11 @@
 
 using Org.Apache.REEF.Common;
 using Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.Evaluator.Context;
-using Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
 using Org.Apache.REEF.Driver.Bridge;
-using Org.Apache.REEF.Services;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Implementations.InjectionPlan;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Diagnostics;
 using Org.Apache.REEF.Utilities.Logging;
@@ -43,6 +39,14 @@ using System.IO;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Runtime.Evaluator;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Context;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Utils;
+using Org.Apache.REEF.Common.Services;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Wake.Time.Runtime;
+using Constants = Org.Apache.REEF.Common.Runtime.Evaluator.Constants;
 
 namespace Org.Apache.REEF.Evaluator
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloActiveContextHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloActiveContextHandler.cs b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloActiveContextHandler.cs
index d18ae44..c6c96e5 100644
--- a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloActiveContextHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloActiveContextHandler.cs
@@ -19,7 +19,6 @@
 
 using Org.Apache.REEF.Driver.Context;
 using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Interface;
@@ -27,6 +26,7 @@ using Org.Apache.REEF.Tang.Util;
 using System;
 using System.Globalization;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
+using Org.Apache.REEF.Common.Tasks;
 
 namespace Org.Apache.REEF.Examples.HelloCLRBridge.Handlers
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloAllocatedEvaluatorHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloAllocatedEvaluatorHandler.cs b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloAllocatedEvaluatorHandler.cs
index c07f809..9172b33 100644
--- a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloAllocatedEvaluatorHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloAllocatedEvaluatorHandler.cs
@@ -17,24 +17,24 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Context;
 using Org.Apache.REEF.Driver.Evaluator;
 using Org.Apache.REEF.Network.Naming;
-using Org.Apache.REEF.Services;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Implementations.Configuration;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities;
 using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
 using System.Net;
+using Org.Apache.REEF.Common.Services;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 
 namespace Org.Apache.REEF.Examples.HelloCLRBridge.Handlers

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloRestartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloRestartHandler.cs b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloRestartHandler.cs
index 6e72147..a5ad24b 100644
--- a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloRestartHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloRestartHandler.cs
@@ -20,6 +20,7 @@
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Wake.Time;
 using System;
+using Org.Apache.REEF.Wake.Time.Event;
 
 namespace Org.Apache.REEF.Examples.HelloCLRBridge.Handlers
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloSimpleEventHandlers.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloSimpleEventHandlers.cs b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloSimpleEventHandlers.cs
index 1e61c61..bab6898 100644
--- a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloSimpleEventHandlers.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloSimpleEventHandlers.cs
@@ -24,7 +24,8 @@ using System.Linq;
 using System.Net;
 using System.Text;
 using System.Threading.Tasks;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Driver;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Context;
@@ -32,12 +33,12 @@ using Org.Apache.REEF.Driver.Evaluator;
 using Org.Apache.REEF.Driver.Task;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 using Org.Apache.REEF.Network.Naming;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
+using IRunningTask = Org.Apache.REEF.Driver.Task.IRunningTask;
 
 namespace Org.Apache.REEF.Examples.HelloCLRBridge.Handlers
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloStartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloStartHandler.cs b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloStartHandler.cs
index 6234fec..04f0a79 100644
--- a/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloStartHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/HelloCLRBridge/Handlers/HelloStartHandler.cs
@@ -18,13 +18,12 @@
  */
 
 using System.Collections.Generic;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Driver;
-using Org.Apache.REEF.Driver.bridge;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 using Org.Apache.REEF.Network.Naming;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Tang.Annotations;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalActiveContextHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalActiveContextHandler.cs b/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalActiveContextHandler.cs
index 8a6be9d..5961e85 100644
--- a/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalActiveContextHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalActiveContextHandler.cs
@@ -18,12 +18,12 @@
  */
 
 using System;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Driver.Context;
 using Org.Apache.REEF.Examples.Tasks.ShellTask;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
-using Org.Apache.REEF.Tasks;
 
 namespace Org.Apache.REEF.Examples.RetainedEvalCLRBridge.Handlers
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalStartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalStartHandler.cs b/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalStartHandler.cs
index f077831..cc2448e 100644
--- a/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalStartHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/RetainedEvalCLRBridge/Handlers/RetainedEvalStartHandler.cs
@@ -20,13 +20,13 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Driver;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Context;
 using Org.Apache.REEF.Driver.Evaluator;
 using Org.Apache.REEF.Examples.Tasks.ShellTask;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
 
 namespace Org.Apache.REEF.Examples.RetainedEvalCLRBridge.Handlers
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/FailedTask/FailedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/FailedTask/FailedTask.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/FailedTask/FailedTask.cs
index aa489ce..a9f7707 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/FailedTask/FailedTask.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/FailedTask/FailedTask.cs
@@ -19,8 +19,8 @@
 
 using System;
 using System.Threading;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
 
 namespace Org.Apache.REEF.Examples.Tasks.FailedTask
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloService.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloService.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloService.cs
index e7734c1..e12bf40 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloService.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloService.cs
@@ -19,7 +19,7 @@
 
 using System;
 using System.Collections.Generic;
-using Org.Apache.REEF.Services;
+using Org.Apache.REEF.Common.Services;
 using Org.Apache.REEF.Tang.Annotations;
 
 namespace Org.Apache.REEF.Examples.Tasks.HelloTask

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTask.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTask.cs
index f832d50..217d22e 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTask.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTask.cs
@@ -21,10 +21,10 @@ using System;
 using System.Linq;
 using System.Net;
 using System.Threading;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Common.Tasks.Events;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Tasks.Events;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Logging;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTaskMessage.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTaskMessage.cs
index 4814e0e..92ee7e2 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTaskMessage.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/HelloTask/HelloTaskMessage.cs
@@ -19,8 +19,8 @@
 
 using System;
 using System.Globalization;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities;
 
 namespace Org.Apache.REEF.Examples.Tasks.HelloTask

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/ShellTask/ShellTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/ShellTask/ShellTask.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/ShellTask/ShellTask.cs
index 7bc90d5..45509d4 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/ShellTask/ShellTask.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/ShellTask/ShellTask.cs
@@ -22,8 +22,8 @@ using System.Diagnostics;
 using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.Text;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities.Diagnostics;
 using Org.Apache.REEF.Utilities.Logging;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask1.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask1.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask1.cs
index f35bf91..def85dc 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask1.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask1.cs
@@ -18,8 +18,8 @@
  */
 
 using System.Threading;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
 
 namespace Org.Apache.REEF.Examples.Tasks.StreamingTasks
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask2.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask2.cs b/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask2.cs
index 16ccfcc..db043d4 100644
--- a/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask2.cs
+++ b/lang/cs/Org.Apache.REEF.Examples/Tasks/StreamingTasks/StreamTask2.cs
@@ -17,8 +17,8 @@
  * under the License.
  */
 
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tasks;
 
 namespace Org.Apache.REEF.Examples.Tasks.StreamingTasks
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingLookupResponseCodec.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingLookupResponseCodec.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingLookupResponseCodec.cs
index 0ee44f2..8b44ded 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingLookupResponseCodec.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingLookupResponseCodec.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Wake.Remote;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingRegisterRequestCodec.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingRegisterRequestCodec.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingRegisterRequestCodec.cs
index ae07bac..966b884 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingRegisterRequestCodec.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Codec/NamingRegisterRequestCodec.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Wake.Remote;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingGetAllResponse.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingGetAllResponse.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingGetAllResponse.cs
index fa89afc..00e7d16 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingGetAllResponse.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingGetAllResponse.cs
@@ -18,7 +18,7 @@
  */
 
 using System.Collections.Generic;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 
 namespace Org.Apache.REEF.Network.Naming.Events
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingLookupResponse.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingLookupResponse.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingLookupResponse.cs
index 8f9a05b..236ef58 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingLookupResponse.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingLookupResponse.cs
@@ -19,7 +19,7 @@
 
 using System.Collections.Generic;
 using Microsoft.Hadoop.Avro;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 
 namespace Org.Apache.REEF.Network.Naming.Events
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingRegisterRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingRegisterRequest.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingRegisterRequest.cs
index 49cbeb6..248265c 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingRegisterRequest.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Events/NamingRegisterRequest.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 
 namespace Org.Apache.REEF.Network.Naming.Events
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/INameServer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/INameServer.cs b/lang/cs/Org.Apache.REEF.Network/Naming/INameServer.cs
index c27abe6..984e919 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/INameServer.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/INameServer.cs
@@ -20,7 +20,7 @@
 using System;
 using System.Collections.Generic;
 using System.Net;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Tang.Annotations;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/NameClient.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/NameClient.cs b/lang/cs/Org.Apache.REEF.Network/Naming/NameClient.cs
index 9b69cec..9e0acac 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/NameClient.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/NameClient.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Codec;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Utilities.Diagnostics;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/NameLookupClient.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/NameLookupClient.cs b/lang/cs/Org.Apache.REEF.Network/Naming/NameLookupClient.cs
index b8c4018..7ca29c5 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/NameLookupClient.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/NameLookupClient.cs
@@ -22,7 +22,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Net;
 using System.Threading;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Wake.Remote.Impl;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/NameRegisterClient.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/NameRegisterClient.cs b/lang/cs/Org.Apache.REEF.Network/Naming/NameRegisterClient.cs
index a18cb31..2709819 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/NameRegisterClient.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/NameRegisterClient.cs
@@ -19,7 +19,7 @@
 
 using System.Collections.Concurrent;
 using System.Net;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Wake.Remote.Impl;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/NameServer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/NameServer.cs b/lang/cs/Org.Apache.REEF.Network/Naming/NameServer.cs
index 26207e0..c42de7e 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/NameServer.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/NameServer.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Codec;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Network.Naming.Observers;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfiguration.cs b/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfiguration.cs
deleted file mode 100644
index 3daac70..0000000
--- a/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfiguration.cs
+++ /dev/null
@@ -1,50 +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.CodeAnalysis;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Util;
-
-namespace Org.Apache.REEF.Naming
-{
-    public class NamingConfiguration : ConfigurationModuleBuilder
-    {
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredParameter<string> NameServerAddress = new RequiredParameter<string>();
-
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredParameter<int> NameServerPort = new RequiredParameter<int>();
-
-        public static ConfigurationModule ConfigurationModule
-        {
-            get
-            {
-                return new NamingConfiguration()
-                    .BindNamedParameter(GenericType<NamingConfigurationOptions.NameServerAddress>.Class, NameServerAddress)
-                    .BindNamedParameter(GenericType<NamingConfigurationOptions.NameServerPort>.Class, NameServerPort)
-                    .Build();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfigurationOptions.cs
deleted file mode 100644
index aa9b6e6..0000000
--- a/lang/cs/Org.Apache.REEF.Network/Naming/NamingConfigurationOptions.cs
+++ /dev/null
@@ -1,41 +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.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Naming
-{
-    public class NamingConfigurationOptions
-    {
-        [NamedParameter("IP address of NameServer")]
-        public class NameServerAddress : Name<string>
-        {
-        }
-
-        [NamedParameter("Port of NameServer")]
-        public class NameServerPort : Name<int>
-        {
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingGetAllRequestObserver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingGetAllRequestObserver.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingGetAllRequestObserver.cs
index df3a4a9..dfc8db0 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingGetAllRequestObserver.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingGetAllRequestObserver.cs
@@ -18,7 +18,7 @@
  */
 
 using System.Collections.Generic;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Wake.RX;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingLookupRequestObserver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingLookupRequestObserver.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingLookupRequestObserver.cs
index 21c602d..c31db7f 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingLookupRequestObserver.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingLookupRequestObserver.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Wake.RX;
 using System.Collections.Generic;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingRegisterRequestObserver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingRegisterRequestObserver.cs b/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingRegisterRequestObserver.cs
index 8ab8f6c..5add16b 100644
--- a/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingRegisterRequestObserver.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Naming/Observers/NamingRegisterRequestObserver.cs
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming.Events;
 using Org.Apache.REEF.Wake.RX;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/NetworkService/INetworkService.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/NetworkService/INetworkService.cs b/lang/cs/Org.Apache.REEF.Network/NetworkService/INetworkService.cs
index a4b845a..b34f94c 100644
--- a/lang/cs/Org.Apache.REEF.Network/NetworkService/INetworkService.cs
+++ b/lang/cs/Org.Apache.REEF.Network/NetworkService/INetworkService.cs
@@ -18,8 +18,8 @@
  */
 
 using System;
-using Org.Apache.REEF.Common.io;
-using Org.Apache.REEF.Services;
+using Org.Apache.REEF.Common.Io;
+using Org.Apache.REEF.Common.Services;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Wake;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkService.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkService.cs b/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkService.cs
index 57eae81..aa365c5 100644
--- a/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkService.cs
+++ b/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkService.cs
@@ -22,7 +22,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Net;
 using System.Reactive;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming;
 using Org.Apache.REEF.Network.NetworkService.Codec;
 using Org.Apache.REEF.Utilities.Logging;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkServiceConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkServiceConfiguration.cs b/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkServiceConfiguration.cs
index 003260c..9c26913 100644
--- a/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkServiceConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Network/NetworkService/NetworkServiceConfiguration.cs
@@ -23,7 +23,7 @@ using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Network.Naming;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Util;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs b/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
index 5465faa..bbf27d7 100644
--- a/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
+++ b/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
@@ -25,7 +25,7 @@ using System.IO;
 using System.Net;
 using System.Net.Sockets;
 using System.Runtime.Remoting;
-using Org.Apache.REEF.Common.io;
+using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Tang.Exceptions;
 using Org.Apache.REEF.Wake;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Org.Apache.REEF.Network.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Org.Apache.REEF.Network.csproj b/lang/cs/Org.Apache.REEF.Network/Org.Apache.REEF.Network.csproj
index 6797c1d..b759c24 100644
--- a/lang/cs/Org.Apache.REEF.Network/Org.Apache.REEF.Network.csproj
+++ b/lang/cs/Org.Apache.REEF.Network/Org.Apache.REEF.Network.csproj
@@ -119,12 +119,6 @@ under the License.
     <Compile Include="Naming\NameLookupClient.cs" />
     <Compile Include="Naming\NameRegisterClient.cs" />
     <Compile Include="Naming\NameServer.cs" />
-    <Compile Include="Naming\NamingConfiguration.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Naming\NamingConfigurationOptions.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="Naming\Observers\NamingGetAllRequestObserver.cs" />
     <Compile Include="Naming\Observers\NamingLookupRequestObserver.cs" />
     <Compile Include="Naming\Observers\NamingRegisterRequestObserver.cs" />

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Network/Utilities/Utils.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Utilities/Utils.cs b/lang/cs/Org.Apache.REEF.Network/Utilities/Utils.cs
index bc02b89..cfa61b0 100644
--- a/lang/cs/Org.Apache.REEF.Network/Utilities/Utils.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Utilities/Utils.cs
@@ -19,8 +19,8 @@
 
 using System.IO;
 using Microsoft.Hadoop.Avro;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Tang.Exceptions;
 using Org.Apache.REEF.Tang.Interface;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
index 1c5a505..a71b973 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
@@ -28,6 +28,7 @@ using Org.Apache.REEF.Tang.Types;
 using Org.Apache.REEF.Tang.Util;
 using System;
 using System.Collections.Generic;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 
 namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy
@@ -410,15 +411,15 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy
         [TestMethod]
         public void TestITackNode()
         {
-            var node = ns.GetNode(typeof(Org.Apache.REEF.Tasks.ITask).AssemblyQualifiedName);
-            Assert.AreEqual(node.GetFullName(), ReflectionUtilities.GetAssemblyQualifiedName(typeof(Org.Apache.REEF.Tasks.ITask)));
+            var node = ns.GetNode(typeof(ITask).AssemblyQualifiedName);
+            Assert.AreEqual(node.GetFullName(), ReflectionUtilities.GetAssemblyQualifiedName(typeof(ITask)));
         }
 
         [TestMethod]
         public void TestNamedParameterIdentifier()
         {
-            var node = ns.GetNode(typeof(Org.Apache.REEF.Tasks.TaskConfigurationOptions.Identifier).AssemblyQualifiedName);
-            Assert.AreEqual(node.GetFullName(), ReflectionUtilities.GetAssemblyQualifiedName(typeof(Org.Apache.REEF.Tasks.TaskConfigurationOptions.Identifier)));
+            var node = ns.GetNode(typeof(TaskConfigurationOptions.Identifier).AssemblyQualifiedName);
+            Assert.AreEqual(node.GetFullName(), ReflectionUtilities.GetAssemblyQualifiedName(typeof(TaskConfigurationOptions.Identifier)));
         }
         [TestMethod]
         public void TestInterface()

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestSerilization.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestSerilization.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestSerilization.cs
index 1ae038f..15e6beb 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestSerilization.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestSerilization.cs
@@ -19,13 +19,13 @@
  using System;
 using System.Collections.Generic;
 using System.Reflection;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Tang.Implementations;
+ using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Protobuf;
 using Org.Apache.REEF.Tang.Types;
 using Org.Apache.REEF.Tang.Util;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using Org.Apache.REEF.Common.Tasks;
  using Org.Apache.REEF.Examples.Tasks.HelloTask;
  using Org.Apache.REEF.Examples.Tasks.StreamingTasks;
  using Org.Apache.REEF.Tang.Examples;
@@ -176,7 +176,7 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy
             cb.BindNamedParameter<Timer.Seconds, Int32>(GenericType < Timer.Seconds>.Class, "2");
             IConfiguration conf = cb.Build();
             IInjector injector = tang.NewInjector(conf);
-            InjectionPlan ip = injector.GetInjectionPlan(timerType);
+            Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan ip = injector.GetInjectionPlan(timerType);
             ProtocolBufferInjectionPlan.Serialize("timerplan.bin", ip);
             var ch = conf.GetClassHierarchy();
             var ip1 = ProtocolBufferInjectionPlan.DeSerialize("timerplan.bin", ch);
@@ -192,7 +192,7 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy
             ICsConfigurationBuilder cb = tang.NewConfigurationBuilder(new string[] { FileNames.Examples });
             IConfiguration conf = cb.Build();
             IInjector injector = tang.NewInjector(conf);
-            InjectionPlan ip = injector.GetInjectionPlan(simpleConstructorType);
+            Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan ip = injector.GetInjectionPlan(simpleConstructorType);
 
             ProtocolBufferInjectionPlan.Serialize("plan.bin", ip);
             var ch = conf.GetClassHierarchy();

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroConfiguration.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroConfiguration.cs
index 630eef0..00900af 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroConfiguration.cs
@@ -18,13 +18,14 @@
  */
 
 using System.Collections.Generic;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 
 namespace Org.Apache.REEF.Tang.Tests.Configuration

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroSerializerRoundTrip.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroSerializerRoundTrip.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroSerializerRoundTrip.cs
index 4551a52..64547d7 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroSerializerRoundTrip.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestAvroSerializerRoundTrip.cs
@@ -21,6 +21,7 @@ using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Tests.SmokeTest;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
 
 namespace Org.Apache.REEF.Tang.Tests.Configuration
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs
index 28e244f..6517e2a 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs
@@ -19,8 +19,7 @@
  using System;
 using System.Collections.Generic;
 using System.Reflection;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Tang.Annotations;
+ using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Examples;
 using Org.Apache.REEF.Tang.Exceptions;
 using Org.Apache.REEF.Tang.Formats;
@@ -31,7 +30,9 @@ using Org.Apache.REEF.Tang.Protobuf;
 using Org.Apache.REEF.Tang.Util;
 using Org.Apache.REEF.Tang.Tests.ScenarioTest;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using Org.Apache.REEF.Common.Tasks;
  using Org.Apache.REEF.Examples.Tasks.HelloTask;
+ using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
  using Org.Apache.REEF.Tang.Implementations.ClassHierarchy;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 
@@ -153,7 +154,7 @@ namespace Org.Apache.REEF.Tang.Tests.Configuration
         [TestMethod]
         public void TestGetConfgiFromProtoBufClassHierarchy()
         {
-            Type iTaskType = typeof(Org.Apache.REEF.Tasks.ITask);
+            Type iTaskType = typeof(ITask);
             Type helloTaskType = typeof(HelloTask);
             Type identifierType = typeof (TaskConfigurationOptions.Identifier);
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/Format/TestTaskConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Format/TestTaskConfiguration.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Format/TestTaskConfiguration.cs
index 7384fde..ee50e20 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Format/TestTaskConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Format/TestTaskConfiguration.cs
@@ -19,13 +19,13 @@
 
 using System;
 using System.Collections.Generic;
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestInjection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestInjection.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestInjection.cs
index 40b9a96..bb57ad1 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestInjection.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestInjection.cs
@@ -25,9 +25,9 @@ using Org.Apache.REEF.Tang.Implementations.ClassHierarchy;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Util;
-using Org.Apache.REEF.Tasks;
 using System;
 using System.Reflection;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 using Org.Apache.REEF.Examples.Tasks.StreamingTasks;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestListInjection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestListInjection.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestListInjection.cs
index 2af4b1b..aa37c72 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestListInjection.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Injection/TestListInjection.cs
@@ -19,12 +19,7 @@
 
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using ClassHierarchyProto;
 using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Types;
 using Org.Apache.REEF.Tang.Util;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang.Tools/Program.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang.Tools/Program.cs b/lang/cs/Org.Apache.REEF.Tang.Tools/Program.cs
index 1fec395..c340b1f 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tools/Program.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tools/Program.cs
@@ -17,7 +17,6 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Tasks;
 using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Protobuf;
@@ -26,6 +25,7 @@ using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Examples.Tasks.HelloTask;
 using Org.Apache.REEF.Examples.Tasks.ShellTask;
 using Org.Apache.REEF.Examples.Tasks.StreamingTasks;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/AvroConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/AvroConfiguration.cs b/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/AvroConfiguration.cs
index 9bf473c..7c8dc0a 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/AvroConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/AvroConfiguration.cs
@@ -21,7 +21,7 @@ using System.Collections.Generic;
 using System.Runtime.Serialization;
 using Newtonsoft.Json;
 
-namespace Org.Apache.REEF.Tang.Formats
+namespace Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract
 {
     [KnownType(typeof(HashSet<ConfigurationEntry>))]
     [DataContract(Name = "AvroConfiguration", Namespace = "org.apache.reef.tang.formats.avro")]

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/ConfigurationEntry.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/ConfigurationEntry.cs b/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/ConfigurationEntry.cs
index de111e9..e8f72d0 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/ConfigurationEntry.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationDataContract/ConfigurationEntry.cs
@@ -19,7 +19,7 @@
 
 using System.Runtime.Serialization;
 
-namespace Org.Apache.REEF.Tang.Formats
+namespace Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract
 {
     [DataContract(Name = "ConfigurationEntry", Namespace = "org.apache.reef.tang.formats.avro")]
     [KnownType(typeof(string))]

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationSerializer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationSerializer.cs b/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationSerializer.cs
index 19822e1..cbb8a29 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationSerializer.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Formats/AvroConfigurationSerializer.cs
@@ -33,6 +33,7 @@ using Org.Apache.REEF.Tang.Implementations;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Types;
 using Newtonsoft.Json;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
 using Org.Apache.REEF.Tang.Implementations.Configuration;
 using Org.Apache.REEF.Tang.Implementations.Tang;
 

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs
index 14a77cf..e47fac7 100644
--- a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs
+++ b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs
@@ -41,22 +41,22 @@ namespace Org.Apache.REEF.Tang.Protobuf
 
         public static void Serialize(string fileName, IClassHierarchy classHierarchy)
         {
-            ClassHierarchyProto.Node node = Serialize(classHierarchy);
+            Org.Apache.REEF.Tang.Protobuf.Node node = Serialize(classHierarchy);
 
             using (var file = File.Create(fileName))
             {
-                Serializer.Serialize<ClassHierarchyProto.Node>(file, node);
+                Serializer.Serialize<Org.Apache.REEF.Tang.Protobuf.Node>(file, node);
             }
         }
 
-        public static ClassHierarchyProto.Node Serialize(IClassHierarchy classHierarchy)
+        public static Org.Apache.REEF.Tang.Protobuf.Node Serialize(IClassHierarchy classHierarchy)
         {
             return SerializeNode(classHierarchy.GetNamespace());
         }
 
-        private static ClassHierarchyProto.Node SerializeNode(INode n)
+        private static Org.Apache.REEF.Tang.Protobuf.Node SerializeNode(INode n)
         {
-            IList<ClassHierarchyProto.Node> children = new List<ClassHierarchyProto.Node>();
+            IList<Org.Apache.REEF.Tang.Protobuf.Node> children = new List<Org.Apache.REEF.Tang.Protobuf.Node>();
 
             foreach (INode child in n.GetChildren())
             {
@@ -75,13 +75,13 @@ namespace Org.Apache.REEF.Tang.Protobuf
                     others.Remove(c);
                 }
 
-                IList<ClassHierarchyProto.ConstructorDef> injectableConstructors = new List<ClassHierarchyProto.ConstructorDef>();
+                IList<Org.Apache.REEF.Tang.Protobuf.ConstructorDef> injectableConstructors = new List<Org.Apache.REEF.Tang.Protobuf.ConstructorDef>();
                 foreach (IConstructorDef inj in injectable)
                 {
                     injectableConstructors.Add(SerializeConstructorDef(inj));
                 }
 
-                IList<ClassHierarchyProto.ConstructorDef> otherConstructors = new List<ClassHierarchyProto.ConstructorDef>();
+                IList<Org.Apache.REEF.Tang.Protobuf.ConstructorDef> otherConstructors = new List<Org.Apache.REEF.Tang.Protobuf.ConstructorDef>();
                 foreach (IConstructorDef other in others)
                 {
                     otherConstructors.Add(SerializeConstructorDef(other));
@@ -112,9 +112,9 @@ namespace Org.Apache.REEF.Tang.Protobuf
             return null;
         }
 
-        private static ClassHierarchyProto.ConstructorDef SerializeConstructorDef(IConstructorDef def)
+        private static Org.Apache.REEF.Tang.Protobuf.ConstructorDef SerializeConstructorDef(IConstructorDef def)
         {
-            IList<ClassHierarchyProto.ConstructorArg> args = new List<ClassHierarchyProto.ConstructorArg>();
+            IList<Org.Apache.REEF.Tang.Protobuf.ConstructorArg> args = new List<Org.Apache.REEF.Tang.Protobuf.ConstructorArg>();
             foreach (IConstructorArg arg in def.GetArgs())
             {
                 args.Add(NewConstructorArg(arg.Gettype(), arg.GetNamedParameterName(), arg.IsInjectionFuture()));
@@ -122,22 +122,22 @@ namespace Org.Apache.REEF.Tang.Protobuf
             return newConstructorDef(def.GetClassName(), args);
         }
 
-        private static ClassHierarchyProto.ConstructorArg NewConstructorArg(
+        private static Org.Apache.REEF.Tang.Protobuf.ConstructorArg NewConstructorArg(
             string fullArgClassName, string namedParameterName, bool isFuture)
         {
-            ClassHierarchyProto.ConstructorArg constArg = new ClassHierarchyProto.ConstructorArg();
+            Org.Apache.REEF.Tang.Protobuf.ConstructorArg constArg = new Org.Apache.REEF.Tang.Protobuf.ConstructorArg();
             constArg.full_arg_class_name = fullArgClassName;
             constArg.named_parameter_name = namedParameterName;
             constArg.is_injection_future = isFuture;
             return constArg;
         }
 
-        private static ClassHierarchyProto.ConstructorDef newConstructorDef(
-             String fullClassName, IList<ClassHierarchyProto.ConstructorArg> args)
+        private static Org.Apache.REEF.Tang.Protobuf.ConstructorDef newConstructorDef(
+             String fullClassName, IList<Org.Apache.REEF.Tang.Protobuf.ConstructorArg> args)
         {
-            ClassHierarchyProto.ConstructorDef constDef = new ClassHierarchyProto.ConstructorDef();
+            Org.Apache.REEF.Tang.Protobuf.ConstructorDef constDef = new Org.Apache.REEF.Tang.Protobuf.ConstructorDef();
             constDef.full_class_name = fullClassName;
-            foreach (ClassHierarchyProto.ConstructorArg arg in args)
+            foreach (Org.Apache.REEF.Tang.Protobuf.ConstructorArg arg in args)
             {
                 constDef.args.Add(arg);
             }
@@ -145,14 +145,14 @@ namespace Org.Apache.REEF.Tang.Protobuf
             return constDef;
         }
 
-        private static ClassHierarchyProto.Node NewClassNode(String name,
+        private static Org.Apache.REEF.Tang.Protobuf.Node NewClassNode(String name,
             String fullName, bool isInjectionCandidate,
             bool isExternalConstructor, bool isUnit,
-            IList<ClassHierarchyProto.ConstructorDef> injectableConstructors,
-            IList<ClassHierarchyProto.ConstructorDef> otherConstructors,
-            IList<String> implFullNames, IList<ClassHierarchyProto.Node> children)
+            IList<Org.Apache.REEF.Tang.Protobuf.ConstructorDef> injectableConstructors,
+            IList<Org.Apache.REEF.Tang.Protobuf.ConstructorDef> otherConstructors,
+            IList<String> implFullNames, IList<Org.Apache.REEF.Tang.Protobuf.Node> children)
         {
-            ClassHierarchyProto.ClassNode classNode = new ClassHierarchyProto.ClassNode();
+            Org.Apache.REEF.Tang.Protobuf.ClassNode classNode = new Org.Apache.REEF.Tang.Protobuf.ClassNode();
             classNode.is_injection_candidate = isInjectionCandidate;
             foreach (var ic in injectableConstructors)
             {
@@ -168,7 +168,7 @@ namespace Org.Apache.REEF.Tang.Protobuf
                 classNode.impl_full_names.Add(implFullName);
             }
 
-            ClassHierarchyProto.Node n = new ClassHierarchyProto.Node();
+            Org.Apache.REEF.Tang.Protobuf.Node n = new Org.Apache.REEF.Tang.Protobuf.Node();
             n.name = name;
             n.full_name = fullName;
             n.class_node = classNode;
@@ -181,14 +181,14 @@ namespace Org.Apache.REEF.Tang.Protobuf
             return n;
         }
 
-        private static ClassHierarchyProto.Node NewNamedParameterNode(string name,
+        private static Org.Apache.REEF.Tang.Protobuf.Node NewNamedParameterNode(string name,
             string fullName, string simpleArgClassName, string fullArgClassName,
             bool isSet, bool isList, string documentation, // can be null
             string shortName, // can be null
             string[] instanceDefault, // can be null
-            IList<ClassHierarchyProto.Node> children)
+            IList<Org.Apache.REEF.Tang.Protobuf.Node> children)
         {
-            ClassHierarchyProto.NamedParameterNode namedParameterNode = new ClassHierarchyProto.NamedParameterNode();
+            Org.Apache.REEF.Tang.Protobuf.NamedParameterNode namedParameterNode = new Org.Apache.REEF.Tang.Protobuf.NamedParameterNode();
             namedParameterNode.simple_arg_class_name = simpleArgClassName;
             namedParameterNode.full_arg_class_name = fullArgClassName;
             namedParameterNode.is_set = isSet;
@@ -209,7 +209,7 @@ namespace Org.Apache.REEF.Tang.Protobuf
                 namedParameterNode.instance_default.Add(id);
             }
 
-            ClassHierarchyProto.Node n = new ClassHierarchyProto.Node();
+            Org.Apache.REEF.Tang.Protobuf.Node n = new Org.Apache.REEF.Tang.Protobuf.Node();
             n.name = name;
             n.full_name = fullName;
             n.named_parameter_node = namedParameterNode;
@@ -222,11 +222,11 @@ namespace Org.Apache.REEF.Tang.Protobuf
             return n;
         }
 
-        private static ClassHierarchyProto.Node NewPackageNode(string name,
-            string fullName, IList<ClassHierarchyProto.Node> children)
+        private static Org.Apache.REEF.Tang.Protobuf.Node NewPackageNode(string name,
+            string fullName, IList<Org.Apache.REEF.Tang.Protobuf.Node> children)
         {
-            ClassHierarchyProto.PackageNode packageNode = new ClassHierarchyProto.PackageNode();
-            ClassHierarchyProto.Node n = new ClassHierarchyProto.Node();
+            Org.Apache.REEF.Tang.Protobuf.PackageNode packageNode = new Org.Apache.REEF.Tang.Protobuf.PackageNode();
+            Org.Apache.REEF.Tang.Protobuf.Node n = new Org.Apache.REEF.Tang.Protobuf.Node();
             n.name = name;
             n.full_name = fullName;
             n.package_node = packageNode;
@@ -241,11 +241,11 @@ namespace Org.Apache.REEF.Tang.Protobuf
 
         public static IClassHierarchy DeSerialize(string fileName)
         {
-            ClassHierarchyProto.Node root;
+            Org.Apache.REEF.Tang.Protobuf.Node root;
 
             using (var file = File.OpenRead(fileName))
             {
-                root = Serializer.Deserialize<ClassHierarchyProto.Node>(file);
+                root = Serializer.Deserialize<Org.Apache.REEF.Tang.Protobuf.Node>(file);
             }
 
             return new ProtocolBufferClassHierarchy(root);
@@ -256,7 +256,7 @@ namespace Org.Apache.REEF.Tang.Protobuf
             this.rootNode = new PackageNodeImpl();
         }
 
-        public ProtocolBufferClassHierarchy(ClassHierarchyProto.Node root)
+        public ProtocolBufferClassHierarchy(Org.Apache.REEF.Tang.Protobuf.Node root)
         {
             this.rootNode = new PackageNodeImpl();
             if (root.package_node == null)
@@ -264,14 +264,14 @@ namespace Org.Apache.REEF.Tang.Protobuf
                 Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("Expected a package node.  Got: " + root), LOGGER); 
             }
             // Register all the classes.
-            foreach (ClassHierarchyProto.Node child in root.children)
+            foreach (Org.Apache.REEF.Tang.Protobuf.Node child in root.children)
             {
                 ParseSubHierarchy(rootNode, child);
             }
             
             BuildHashTable(rootNode);
 
-            foreach (ClassHierarchyProto.Node child in root.children)
+            foreach (Org.Apache.REEF.Tang.Protobuf.Node child in root.children)
             {
                 WireUpInheritanceRelationships(child);
             }
@@ -286,7 +286,7 @@ namespace Org.Apache.REEF.Tang.Protobuf
             }
         }
 
-        private static void ParseSubHierarchy(INode parent, ClassHierarchyProto.Node n)
+        private static void ParseSubHierarchy(INode parent, Org.Apache.REEF.Tang.Protobuf.Node n)
         {
             INode parsed = null;
             if (n.package_node != null)
@@ -295,7 +295,7 @@ namespace Org.Apache.REEF.Tang.Protobuf
             }
             else if (n.named_parameter_node != null)
             {
-                ClassHierarchyProto.NamedParameterNode np = n.named_parameter_node;
+                Org.Apache.REEF.Tang.Protobuf.NamedParameterNode np = n.named_parameter_node;
                 parsed = new NamedParameterNodeImpl(parent, n.name,
                     n.full_name, np.full_arg_class_name, np.simple_arg_class_name,
                     np.is_set, np.is_list, np.documentation, np.short_name,
@@ -303,17 +303,17 @@ namespace Org.Apache.REEF.Tang.Protobuf
             }
             else if (n.class_node != null)
             {
-                ClassHierarchyProto.ClassNode cn = n.class_node;
+                Org.Apache.REEF.Tang.Protobuf.ClassNode cn = n.class_node;
                 IList<IConstructorDef> injectableConstructors = new List<IConstructorDef>();
                 IList<IConstructorDef> allConstructors = new List<IConstructorDef>();
 
-                foreach (ClassHierarchyProto.ConstructorDef injectable in cn.InjectableConstructors)
+                foreach (Org.Apache.REEF.Tang.Protobuf.ConstructorDef injectable in cn.InjectableConstructors)
                 {
                     IConstructorDef def = ParseConstructorDef(injectable, true);
                     injectableConstructors.Add(def);
                     allConstructors.Add(def);
                 }
-                foreach (ClassHierarchyProto.ConstructorDef other in cn.OtherConstructors)
+                foreach (Org.Apache.REEF.Tang.Protobuf.ConstructorDef other in cn.OtherConstructors)
                 {
                     IConstructorDef def = ParseConstructorDef(other, false);
                     allConstructors.Add(def);
@@ -331,27 +331,27 @@ namespace Org.Apache.REEF.Tang.Protobuf
                 Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new IllegalStateException("Bad protocol buffer: got abstract node" + n), LOGGER); 
             }
 
-            foreach (ClassHierarchyProto.Node child in n.children)
+            foreach (Org.Apache.REEF.Tang.Protobuf.Node child in n.children)
             {
                 ParseSubHierarchy(parsed, child);
             }
         }
 
-        private static IConstructorDef ParseConstructorDef(ClassHierarchyProto.ConstructorDef def, bool isInjectable)
+        private static IConstructorDef ParseConstructorDef(Org.Apache.REEF.Tang.Protobuf.ConstructorDef def, bool isInjectable)
         {
             IList<IConstructorArg> args = new List<IConstructorArg>();
-            foreach (ClassHierarchyProto.ConstructorArg arg in def.args)
+            foreach (Org.Apache.REEF.Tang.Protobuf.ConstructorArg arg in def.args)
             {
                 args.Add(new ConstructorArgImpl(arg.full_arg_class_name, arg.named_parameter_name, arg.is_injection_future));
             }
             return new ConstructorDefImpl(def.full_class_name, args.ToArray(), isInjectable);
         }
 
-        private void WireUpInheritanceRelationships(ClassHierarchyProto.Node n)
+        private void WireUpInheritanceRelationships(Org.Apache.REEF.Tang.Protobuf.Node n)
         {
             if (n.class_node != null)
             {
-                ClassHierarchyProto.ClassNode cn = n.class_node;
+                Org.Apache.REEF.Tang.Protobuf.ClassNode cn = n.class_node;
                 IClassNode iface = null;
                 try
                 {


[15/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..9231575
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextManager.cs
@@ -0,0 +1,359 @@
+/**
+ * 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.Collections.ObjectModel;
+using System.Globalization;
+using System.Linq;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Task;
+using Org.Apache.REEF.Common.Services;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    public class ContextManager : IDisposable
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextManager));
+        
+        private readonly Stack<ContextRuntime> _contextStack = new Stack<ContextRuntime>();
+
+        private readonly HeartBeatManager _heartBeatManager;
+
+        private RootContextLauncher _rootContextLauncher;
+
+        public ContextManager(HeartBeatManager heartBeatManager, Optional<ServiceConfiguration> rootServiceConfig, Optional<TaskConfiguration> rootTaskConfig)
+        {
+            using (LOGGER.LogFunction("ContextManager::ContextManager"))
+            {
+                _heartBeatManager = heartBeatManager;
+                _rootContextLauncher = new RootContextLauncher(_heartBeatManager.EvaluatorSettings.RootContextConfig, rootServiceConfig, rootTaskConfig);
+            }
+        }
+
+        /// <summary>
+        /// Start the context manager. This initiates the root context.
+        /// </summary>
+        public void Start()
+        {
+            lock (_contextStack)
+            {
+                ContextRuntime rootContext = _rootContextLauncher.GetRootContext();
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Instantiating root context with Id {0}", rootContext.Id));
+                _contextStack.Push(rootContext);
+
+                if (_rootContextLauncher.RootTaskConfig.IsPresent())
+                {
+                    LOGGER.Log(Level.Info, "Launching the initial Task");
+                    try
+                    {
+                        _contextStack.Peek().StartTask(_rootContextLauncher.RootTaskConfig.Value, _rootContextLauncher.RootContextConfig.Id, _heartBeatManager);
+                    }
+                    catch (TaskClientCodeException e)
+                    {
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Exception when trying to start a task.", LOGGER);
+                        HandleTaskException(e);
+                    }
+                }
+            }
+        }
+
+        public bool ContextStackIsEmpty()
+        {
+            lock (_contextStack)
+            {
+                return (_contextStack.Count == 0);
+            }
+        }
+
+        // TODO: codes here are slightly different from java since the protobuf.net does not generate the HasXXX method, may want to switch to proto-port later
+
+        /// <summary>
+        /// Processes the given ContextControlProto to launch / close / suspend Tasks and Contexts.
+        /// This also triggers the HeartBeatManager to send a heartbeat with the result of this operation.
+        /// </summary>
+        /// <param name="controlMessage"></param>
+        public void HandleTaskControl(ContextControlProto controlMessage)
+        {
+            try
+            {
+                byte[] message = controlMessage.task_message;
+                if (controlMessage.add_context != null && controlMessage.remove_context != null)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException("Received a message with both add and remove context. This is unsupported."), LOGGER);
+                }
+                if (controlMessage.add_context != null)
+                {
+                    LOGGER.Log(Level.Info, "AddContext");
+                    AddContext(controlMessage.add_context);
+                    // support submitContextAndTask()
+                    if (controlMessage.start_task != null)
+                    {
+                        LOGGER.Log(Level.Info, "StartTask");
+                        StartTask(controlMessage.start_task);
+                    }
+                    else
+                    {
+                        // We need to trigger a heartbeat here. In other cases, the heartbeat will be triggered by the TaskRuntime
+                        // Therefore this call can not go into addContext
+                        LOGGER.Log(Level.Info, "Trigger Heartbeat");
+                        _heartBeatManager.OnNext();
+                    }
+                }
+                else if (controlMessage.remove_context != null)
+                {
+                    LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "RemoveContext with id {0}", controlMessage.remove_context.context_id));
+                    RemoveContext(controlMessage.remove_context.context_id);
+                }
+                else if (controlMessage.start_task != null)
+                {
+                    LOGGER.Log(Level.Info, "StartTask only");
+                    StartTask(controlMessage.start_task);
+                }
+                else if (controlMessage.stop_task != null)
+                {
+                    LOGGER.Log(Level.Info, "CloseTask");
+                    _contextStack.Peek().CloseTask(message);
+                }
+                else if (controlMessage.suspend_task != null)
+                {
+                    LOGGER.Log(Level.Info, "SuspendTask");
+                    _contextStack.Peek().SuspendTask(message);
+                }
+                else if (controlMessage.task_message != null)
+                {
+                    LOGGER.Log(Level.Info, "DeliverTaskMessage");
+                    _contextStack.Peek().DeliverTaskMessage(message);
+                }
+                else if (controlMessage.context_message != null)
+                {
+                    LOGGER.Log(Level.Info, "Handle context contol message");
+                    ContextMessageProto contextMessageProto = controlMessage.context_message;
+                    bool deliveredMessage = false;
+                    foreach (ContextRuntime context in _contextStack)
+                    {
+                        if (context.Id.Equals(contextMessageProto.context_id))
+                        {
+                            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Handle context message {0}", controlMessage.context_message.message));
+                            context.HandleContextMessaage(controlMessage.context_message.message);
+                            deliveredMessage = true;
+                            break;
+                        }
+                    }
+                    if (!deliveredMessage)
+                    {
+                        InvalidOperationException e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Sent message to unknown context {0}", contextMessageProto.context_id));
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                    }
+                }
+                else
+                {
+                    InvalidOperationException e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Unknown task control message: {0}", controlMessage.ToString()));
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                } 
+            }
+            catch (Exception e)
+            {
+                if (e is TaskClientCodeException)
+                {
+                    HandleTaskException((TaskClientCodeException)e);
+                }
+                else if (e is ContextClientCodeException)
+                {
+                    HandlContextException((ContextClientCodeException)e);
+                }
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, LOGGER);
+            }  
+        }
+
+        /// <summary>
+        /// Get TaskStatusProto of the currently running task, if there is any
+        /// </summary>
+        /// <returns>the TaskStatusProto of the currently running task, if there is any</returns>
+        public Optional<TaskStatusProto> GetTaskStatus()
+        {
+            if (_contextStack.Count == 0)
+            {
+                return Optional<TaskStatusProto>.Empty();
+
+                //throw new InvalidOperationException("Asked for an Task status while there isn't even a context running.");
+            }
+            return _contextStack.Peek().GetTaskStatus();
+        }
+
+        /// <summary>
+        /// get status of all contexts in the stack.
+        /// </summary>
+        /// <returns>the status of all contexts in the stack.</returns>
+        public ICollection<ContextStatusProto> GetContextStatusCollection()
+        {
+            ICollection<ContextStatusProto> result = new Collection<ContextStatusProto>();
+            foreach (ContextRuntime runtime in _contextStack)
+            {
+                ContextStatusProto contextStatusProto = runtime.GetContextStatus();
+                LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "Add context status: {0}", contextStatusProto));
+                result.Add(contextStatusProto);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Shuts down. This forecefully kills the Task if there is one and then shuts down all Contexts on the stack,
+        /// starting at the top.
+        /// </summary>
+        public void Dispose()
+        {
+            lock (_contextStack)
+            {
+                if (_contextStack != null && _contextStack.Any())
+                {
+                    LOGGER.Log(Level.Info, "context stack not empty, forcefully closing context runtime.");
+                    ContextRuntime runtime = _contextStack.Last();
+                    if (runtime != null)
+                    {
+                        runtime.Dispose();
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Add a context to the stack.
+        /// </summary>
+        /// <param name="addContextProto"></param>
+        private void AddContext(AddContextProto addContextProto)
+        {
+            lock (_contextStack)
+            {
+                ContextRuntime currentTopContext = _contextStack.Peek();
+                if (!currentTopContext.Id.Equals(addContextProto.parent_context_id, StringComparison.OrdinalIgnoreCase))
+                {
+                    var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Trying to instantiate a child context on context with id '{0}' while the current top context id is {1}",
+                        addContextProto.parent_context_id,
+                        currentTopContext.Id));
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                string contextConfigString = addContextProto.context_configuration;
+                ContextConfiguration contextConfiguration = new ContextConfiguration(contextConfigString);
+                ContextRuntime newTopContext;
+                if (addContextProto.service_configuration != null)
+                {
+                    ServiceConfiguration serviceConfiguration = new ServiceConfiguration(addContextProto.service_configuration);
+                    newTopContext = currentTopContext.SpawnChildContext(contextConfiguration, serviceConfiguration.TangConfig);
+                }
+                else
+                {
+                    newTopContext = currentTopContext.SpawnChildContext(contextConfiguration);
+                }
+                _contextStack.Push(newTopContext);
+            }
+        }
+
+        /// <summary>
+        /// Remove the context with the given ID from the stack.
+        /// </summary>
+        /// <param name="contextId"> context id</param>
+        private void RemoveContext(string contextId)
+        {
+            lock (_contextStack)
+            {
+                string currentTopContextId = _contextStack.Peek().Id;
+                if (!contextId.Equals(_contextStack.Peek().Id, StringComparison.OrdinalIgnoreCase))
+                {
+                    var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Trying to close context with id '{0}' while the top context id is {1}", contextId, currentTopContextId));
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                _contextStack.Peek().Dispose();
+                if (_contextStack.Count > 1)
+                {
+                    // We did not close the root context. Therefore, we need to inform the
+                    // driver explicitly that this context is closed. The root context notification
+                    // is implicit in the Evaluator close/done notification.
+                    _heartBeatManager.OnNext(); // Ensure Driver gets notified of context DONE state
+                }
+                _contextStack.Pop();
+            }
+            //  System.gc(); // TODO: garbage collect?
+        }
+
+        /// <summary>
+        /// Launch an Task.
+        /// </summary>
+        /// <param name="startTaskProto"></param>
+        private void StartTask(StartTaskProto startTaskProto)
+        {
+            lock (_contextStack)
+            {
+                ContextRuntime currentActiveContext = _contextStack.Peek();
+                string expectedContextId = startTaskProto.context_id;
+                if (!expectedContextId.Equals(currentActiveContext.Id, StringComparison.OrdinalIgnoreCase))
+                {
+                    var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task expected context '{0}' but the active context has Id '{1}'", expectedContextId, currentActiveContext.Id));
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                TaskConfiguration taskConfiguration = new TaskConfiguration(startTaskProto.configuration);
+                currentActiveContext.StartTask(taskConfiguration, expectedContextId, _heartBeatManager);
+            }
+        }
+
+        /// <summary>
+        ///  THIS ASSUMES THAT IT IS CALLED ON A THREAD HOLDING THE LOCK ON THE HeartBeatManager
+        /// </summary>
+        /// <param name="e"></param>
+        private void HandleTaskException(TaskClientCodeException e)
+        {
+            LOGGER.Log(Level.Error, "TaskClientCodeException", e);
+            byte[] exception = ByteUtilities.StringToByteArrays(e.ToString());
+            TaskStatusProto taskStatus = new TaskStatusProto()
+            {
+                context_id = e.ContextId,
+                task_id = e.TaskId,
+                result = exception,
+                state = State.FAILED
+            };
+            LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "Sending Heartbeatb for a failed task: {0}", taskStatus.ToString()));
+            _heartBeatManager.OnNext(taskStatus);
+        }
+
+        /// <summary>
+        /// THIS ASSUMES THAT IT IS CALLED ON A THREAD HOLDING THE LOCK ON THE HeartBeatManager
+        /// </summary>
+        /// <param name="e"></param>
+        private void HandlContextException(ContextClientCodeException e)
+        {
+            LOGGER.Log(Level.Error, "ContextClientCodeException", e);
+            byte[] exception = ByteUtilities.StringToByteArrays(e.ToString());
+            ContextStatusProto contextStatusProto = new ContextStatusProto()
+            {
+                context_id = e.ContextId,
+                context_state = ContextStatusProto.State.FAIL,
+                error = exception
+            };
+            if (e.ParentId.IsPresent())
+            {
+                contextStatusProto.parent_id = e.ParentId.Value;
+            }
+            LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "Sending Heartbeat for a failed context: {0}", contextStatusProto.ToString()));
+            _heartBeatManager.OnNext(contextStatusProto);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..6a5f7cb
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextRuntime.cs
@@ -0,0 +1,478 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Task;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    public 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;
+
+        // Convenience class to hold all the event handlers for the context as well as the service instances.
+        private readonly ContextLifeCycle _contextLifeCycle;
+
+        // The child context, if any.
+        private Optional<ContextRuntime> _childContext = Optional<ContextRuntime>.Empty();
+
+        // The parent context, if any.
+        private Optional<ContextRuntime> _parentContext = Optional<ContextRuntime>.Empty();
+
+        // The currently running task, if any.
+        private Optional<TaskRuntime> _task = Optional<TaskRuntime>.Empty();
+
+        private ContextStatusProto.State _contextState = ContextStatusProto.State.READY;
+
+        /// <summary>
+        /// Create a new ContextRuntime.
+        /// </summary>
+        /// <param name="serviceInjector"></param>
+        /// <param name="contextConfiguration">the Configuration for this context.</param>
+        /// <param name="parentContext"></param>
+        public ContextRuntime(
+                IInjector serviceInjector,
+                IConfiguration contextConfiguration,
+                Optional<ContextRuntime> parentContext)
+        {
+            ContextConfiguration config = contextConfiguration as ContextConfiguration;
+            if (config == null)
+            {
+                var e = new ArgumentException("contextConfiguration is not of type ContextConfiguration");
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+            }
+            _contextLifeCycle = new ContextLifeCycle(config.Id);
+            _serviceInjector = serviceInjector;
+            _parentContext = parentContext;
+            try
+            {
+                _contextInjector = serviceInjector.ForkInjector();
+            }
+            catch (Exception e)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
+
+                Optional<string> parentId = ParentContext.IsPresent() ?
+                    Optional<string>.Of(ParentContext.Value.Id) :
+                    Optional<string>.Empty();
+                ContextClientCodeException ex = new ContextClientCodeException(ContextClientCodeException.GetId(contextConfiguration), parentId, "Unable to spawn context", e);
+                
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
+            }
+            // Trigger the context start events on contextInjector.
+            _contextLifeCycle.Start();
+        }
+
+        /// <summary>
+        ///  Create a new ContextRuntime for the root context.
+        /// </summary>
+        /// <param name="serviceInjector"> </param> the serviceInjector to be used.
+        /// <param name="contextConfiguration"> the Configuration for this context.</param>
+        public ContextRuntime(
+            IInjector serviceInjector,
+            IConfiguration contextConfiguration)
+            : this(serviceInjector, contextConfiguration, Optional<ContextRuntime>.Empty())
+        {
+            LOGGER.Log(Level.Info, "Instantiating root context");
+        }
+
+        public string Id
+        {
+            get { return _contextLifeCycle.Id; }
+        }
+
+        public Optional<ContextRuntime> ParentContext
+        {
+            get { return _parentContext; }
+        }
+
+        /// <summary>
+        ///  Spawns a new context.
+        ///  The new context will have a serviceInjector that is created by forking the one in this object with the given
+        ///  serviceConfiguration. The contextConfiguration is used to fork the contextInjector from that new serviceInjector.
+        /// </summary>
+        /// <param name="contextConfiguration">the new context's context (local) Configuration.</param>
+        /// <param name="serviceConfiguration">the new context's service Configuration.</param>
+        /// <returns>a child context.</returns>
+        public ContextRuntime SpawnChildContext(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
+        {
+            ContextRuntime childContext = null;
+            lock (_contextLifeCycle)
+            {
+                if (_task.IsPresent())
+                {
+                    var e = new InvalidOperationException(
+                        string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                if (_childContext.IsPresent())
+                {
+                    var e = new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                try
+                {
+                    IInjector childServiceInjector = _serviceInjector.ForkInjector(new IConfiguration[] { serviceConfiguration });
+                    childContext = new ContextRuntime(childServiceInjector, contextConfiguration, Optional<ContextRuntime>.Of(this));
+                    _childContext = Optional<ContextRuntime>.Of(childContext);
+                    return childContext;
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
+
+                    Optional<string> parentId = ParentContext.IsPresent() ?
+                        Optional<string>.Of(ParentContext.Value.Id) :
+                        Optional<string>.Empty();
+                    ContextClientCodeException ex = new ContextClientCodeException(ContextClientCodeException.GetId(contextConfiguration), parentId, "Unable to spawn context", e);
+                    
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
+                }
+            }
+            return childContext;
+        }
+
+        /// <summary>
+        /// Spawns a new context without services of its own.
+        /// The new context will have a serviceInjector that is created by forking the one in this object. The
+        /// contextConfiguration is used to fork the contextInjector from that new serviceInjector.
+        /// </summary>
+        /// <param name="contextConfiguration">the new context's context (local) Configuration.</param>
+        /// <returns> a child context.</returns>
+        public ContextRuntime SpawnChildContext(IConfiguration contextConfiguration)
+        {
+            lock (_contextLifeCycle)
+            {
+                if (_task.IsPresent())
+                {
+                    var e = new InvalidOperationException(
+                        string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                if (_childContext.IsPresent())
+                {
+                    var e = new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                IInjector childServiceInjector = _serviceInjector.ForkInjector();
+                ContextRuntime childContext = new ContextRuntime(childServiceInjector, contextConfiguration, Optional<ContextRuntime>.Of(this));
+                _childContext = Optional<ContextRuntime>.Of(childContext);
+                return childContext;
+            }
+        }
+
+        /// <summary>
+        ///  Launches an Task on this context.
+        /// </summary>
+        /// <param name="taskConfiguration"></param>
+        /// <param name="contextId"></param>
+        /// <param name="heartBeatManager"></param>
+        public void StartTask(TaskConfiguration taskConfiguration, string contextId, HeartBeatManager heartBeatManager)
+        {
+            lock (_contextLifeCycle)
+            {
+                bool taskPresent = _task.IsPresent();
+                bool taskEnded = taskPresent && _task.Value.HasEnded();
+
+                LOGGER.Log(Level.Info, "ContextRuntime::StartTask(TaskConfiguration)" + "task is present: " + taskPresent + " task has ended: " + taskEnded);
+                if (taskPresent)
+                {
+                    LOGGER.Log(Level.Info, "Task state: " + _task.Value.GetTaskState());
+                }
+
+                if (taskEnded)
+                {
+                    // clean up state
+                    _task = Optional<TaskRuntime>.Empty();
+                    taskPresent = false;
+                }
+                if (taskPresent)
+                {
+                    var e = new InvalidOperationException(
+                        string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                if (_childContext.IsPresent())
+                {
+                    var e = new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                try
+                {
+                    IInjector taskInjector = _contextInjector.ForkInjector(new IConfiguration[] { taskConfiguration.TangConfig });
+                    LOGGER.Log(Level.Info, "Trying to inject task with configuration" + taskConfiguration.ToString());
+                    TaskRuntime taskRuntime = new TaskRuntime(taskInjector, contextId, taskConfiguration.TaskId, heartBeatManager); // taskInjector.getInstance(TaskRuntime.class);
+                    taskRuntime.Initialize();
+                    System.Threading.Tasks.Task.Run(new Action(taskRuntime.Start));                    
+                    _task = Optional<TaskRuntime>.Of(taskRuntime);
+                }
+                catch (Exception e)
+                {
+                    var ex = new TaskClientCodeException(taskConfiguration.TaskId, Id, "Unable to instantiate the new task", e);
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(ex, Level.Error, "Task start error.", LOGGER);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Close this context. If there is a child context, this recursively closes it before closing this context. If
+        /// there is an Task currently running, that will be closed.
+        /// </summary>
+        public void Dispose()
+        {
+            lock (_contextLifeCycle)
+            {
+                _contextState = ContextStatusProto.State.DONE;
+                if (_task.IsPresent())
+                {
+                    LOGGER.Log(Level.Warning, "Shutting down an task because the underlying context is being closed.");
+                    _task.Value.Close(null);
+                }
+                if (_childContext.IsPresent())
+                {
+                    LOGGER.Log(Level.Warning, "Closing a context because its parent context is being closed.");
+                    _childContext.Value.Dispose();
+                }
+                _contextLifeCycle.Close();
+                if (_parentContext.IsPresent())
+                {
+                    ParentContext.Value.ResetChildContext();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Issue a suspend call to the Task
+        /// Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
+        /// in the log.
+        /// </summary>
+        /// <param name="message"> the suspend message to deliver or null if there is none.</param>
+        public void SuspendTask(byte[] message)
+        {
+            lock (_contextLifeCycle)
+            {
+                if (!_task.IsPresent())
+                {
+                    LOGGER.Log(Level.Warning, "Received a suspend task while there was no task running. Ignored");
+                }
+                else
+                {
+                    _task.Value.Suspend(message);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Issue a close call to the Task
+        /// Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
+        /// in the log.
+        /// </summary>
+        /// <param name="message">the close  message to deliver or null if there is none.</param>
+        public void CloseTask(byte[] message)
+        {
+            lock (_contextLifeCycle)
+            {
+                if (!_task.IsPresent())
+                {
+                    LOGGER.Log(Level.Warning, "Received a close task while there was no task running. Ignored");
+                }
+                else
+                {
+                    _task.Value.Close(message);
+                }
+            }
+        }
+
+        /// <summary>
+        ///  Deliver a message to the Task
+        /// Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
+        /// in the log.
+        /// </summary>
+        /// <param name="message">the message to deliver or null if there is none.</param>
+        public void DeliverTaskMessage(byte[] message)
+        {
+            lock (_contextLifeCycle)
+            {
+                if (!_task.IsPresent())
+                {
+                    LOGGER.Log(Level.Warning, "Received an task message while there was no task running. Ignored");
+                }
+                else
+                {
+                    _task.Value.Deliver(message);
+                }
+            }
+        }
+
+        public void HandleContextMessaage(byte[] mesage)
+        {
+            _contextLifeCycle.HandleContextMessage(mesage);
+        }
+
+        /// <summary>
+        /// get state of the running Task
+        /// </summary>
+        /// <returns> the state of the running Task, if one is running.</returns>
+        public Optional<TaskStatusProto> GetTaskStatus()
+        {
+            lock (_contextLifeCycle)
+            {
+                if (_task.IsPresent())
+                {
+                    if (_task.Value.HasEnded())
+                    {
+                        _task = Optional<TaskRuntime>.Empty();
+                        return Optional<TaskStatusProto>.Empty();
+                    }
+                    else
+                    {
+                        TaskStatusProto taskStatusProto = _task.Value.GetStatusProto();
+                        if (taskStatusProto.state == State.RUNNING)
+                        {
+                            // only RUNNING status is allowed to rurn here, all other state pushed out to heartbeat 
+                            return Optional<TaskStatusProto>.Of(taskStatusProto);
+                        }
+                        var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task state must be RUNNING, but instead is in {0} state", taskStatusProto.state));
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                        return Optional<TaskStatusProto>.Empty();
+                    }
+                }
+                else
+                {
+                    return Optional<TaskStatusProto>.Empty();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Reset child context when parent is being closed
+        /// </summary>
+        public void ResetChildContext()
+        {
+            lock (_contextLifeCycle)
+            {
+                if (_childContext.IsPresent())
+                {
+                    _childContext = Optional<ContextRuntime>.Empty();
+                }
+                else
+                {
+                    var e = new InvalidOperationException("no child context set");
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+            }
+        }
+
+        /// <summary>
+        /// get context's status in protocol buffer
+        /// </summary>
+        /// <returns>this context's status in protocol buffer form.</returns>
+        public ContextStatusProto GetContextStatus()
+        {
+            lock (_contextLifeCycle)
+            {
+                ContextStatusProto contextStatusProto = new ContextStatusProto()
+                {
+                    context_id = Id,
+                    context_state = _contextState,
+                };
+                if (_parentContext.IsPresent())
+                {
+                    contextStatusProto.parent_id = _parentContext.Value.Id;
+                }
+
+                foreach (IContextMessageSource source in _contextLifeCycle.ContextMessageSources)
+                {
+                    Optional<ContextMessage> contextMessageOptional = source.Message;
+                    if (contextMessageOptional.IsPresent())
+                    {
+                        ContextStatusProto.ContextMessageProto contextMessageProto
+                            = new ContextStatusProto.ContextMessageProto()
+                            {
+                                source_id = contextMessageOptional.Value.MessageSourceId,
+                            };
+                        contextMessageProto.message = ByteUtilities.CopyBytesFrom(contextMessageOptional.Value.Bytes);
+                        contextStatusProto.context_message.Add(contextMessageProto);
+                    }
+                }
+                return contextStatusProto;
+            }
+        }
+    }
+}
+        ///// <summary>
+        ///// TODO: remove and use parameterless GetContextStatus above
+        ///// </summary>
+        ///// <returns>this context's status in protocol buffer form.</returns>
+        //public ContextStatusProto GetContextStatus(string contextId)
+        //{
+        //    ContextStatusProto contextStatusProto = new ContextStatusProto()
+        //    {
+        //        context_id = contextId,
+        //        context_state = _contextState,
+        //    };
+        //    return contextStatusProto;
+        //}
+
+        ////// TODO: remove and use injection
+        //public void StartTask(ITask task, HeartBeatManager heartBeatManager, string taskId, string contextId)
+        //{
+        //    lock (_contextLifeCycle)
+        //    {
+        //        if (_task.IsPresent() && _task.Value.HasEnded())
+        //        {
+        //            // clean up state
+        //            _task = Optional<TaskRuntime>.Empty();
+        //        }
+        //        if (_task.IsPresent())
+        //        {
+        //            throw new InvalidOperationException(
+        //                string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
+        //        }
+        //        if (_childContext.IsPresent())
+        //        {
+        //            throw new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
+        //        }
+        //        try
+        //        {
+        //            // final Injector taskInjector = contextInjector.forkInjector(taskConfiguration);
+        //            TaskRuntime taskRuntime  // taskInjector.getInstance(TaskRuntime.class);
+        //                = new TaskRuntime(task, heartBeatManager);
+        //            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Starting task '{0}'", taskId));
+        //            taskRuntime.Initialize(taskId, contextId);
+        //            taskRuntime.Start();
+        //            _task = Optional<TaskRuntime>.Of(taskRuntime);
+        //        }
+        //        catch (Exception e)
+        //        {
+        //            throw new InvalidOperationException("Unable to instantiate the new task");
+        //        }
+        //    }
+        //}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStartImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStartImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStartImpl.cs
new file mode 100644
index 0000000..be23398
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStartImpl.cs
@@ -0,0 +1,33 @@
+/**
+ * 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.Common.Events;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    class ContextStartImpl : IContextStart
+    {
+        public ContextStartImpl(string id)
+        {
+            Id = id;
+        }
+
+        public string Id { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStopImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStopImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStopImpl.cs
new file mode 100644
index 0000000..95634d2
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextStopImpl.cs
@@ -0,0 +1,33 @@
+/**
+ * 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.Common.Events;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    class ContextStopImpl : IContextStop
+    {
+        public ContextStopImpl(string id)
+        {
+            Id = id;
+        }
+        
+        public string Id { get; set; }   
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/RootContextLauncher.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/RootContextLauncher.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/RootContextLauncher.cs
new file mode 100644
index 0000000..2dd417a
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/RootContextLauncher.cs
@@ -0,0 +1,124 @@
+/**
+ * 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.Common.Services;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Tang.Implementations.Tang;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    /// <summary>
+    ///  Helper class that encapsulates the root context configuration: With or without services and an initial task.
+    /// </summary>
+    public sealed class RootContextLauncher
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(RootContextLauncher));
+        
+        private readonly IInjector _rootServiceInjector = null;
+
+        private ContextRuntime _rootContext = null;
+
+        private ContextConfiguration _rootContextConfiguration = null;
+
+        public RootContextLauncher(ContextConfiguration rootContextConfig, Optional<ServiceConfiguration> rootServiceConfig, Optional<TaskConfiguration> rootTaskConfig)
+        {
+            _rootContextConfiguration = rootContextConfig;
+            _rootServiceInjector = InjectServices(rootServiceConfig);
+            RootTaskConfig = rootTaskConfig;
+        }
+
+        public Optional<TaskConfiguration> RootTaskConfig { get; set; }
+
+        public ContextConfiguration RootContextConfig
+        {
+            get { return _rootContextConfiguration; }
+            set { _rootContextConfiguration = value; }
+        }
+
+        public ContextRuntime GetRootContext()
+        {
+            if (_rootContext == null)
+            {
+                _rootContext = GetRootContext(_rootServiceInjector, _rootContextConfiguration);
+            }
+            return _rootContext;
+        }
+
+        private IInjector InjectServices(Optional<ServiceConfiguration> serviceConfig)
+        {
+            IInjector rootServiceInjector;
+
+            if (serviceConfig.IsPresent())
+            {
+                rootServiceInjector = TangFactory.GetTang().NewInjector(serviceConfig.Value.TangConfig);
+                InjectedServices services = null;
+                try
+                {
+                    services = rootServiceInjector.GetInstance<InjectedServices>();
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Failed to instantiate service.", LOGGER);
+                    InvalidOperationException ex = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Failed to inject service: encoutned error {1} with message [{0}] and stack trace:[{1}]", e, e.Message, e.StackTrace));
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
+                }
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "injected {0} service(s)", services.Services.Count));
+            }
+            else
+            {
+                rootServiceInjector = TangFactory.GetTang().NewInjector();
+                LOGGER.Log(Level.Info, "no service provided for injection.");
+            }
+            
+            return rootServiceInjector;
+        }
+
+        private ContextRuntime GetRootContext( 
+            IInjector rootServiceInjector,
+            IConfiguration rootContextConfiguration)
+        {
+            ContextRuntime result;
+            result = new ContextRuntime(rootServiceInjector, rootContextConfiguration);
+            return result;
+        }
+    }
+}
+//if (rootServiceInjector != null)
+//{
+//    try
+//    {
+//        rootServiceInjector = rootServiceInjector.ForkInjector(serviceConfigs);
+//    }
+//    catch (Exception e)
+//    {
+//        throw new ContextClientCodeException(ContextClientCodeException.GetId(rootContextConfiguration),
+//                                             Optional<String>.Empty(),
+//                                             "Unable to instatiate the root context", e);
+//    }
+//    result = new ContextRuntime(rootServiceInjector, rootContextConfiguration);
+//}
+//else
+//{
+//    result = new ContextRuntime(rootServiceInjector.ForkInjector(), rootContextConfiguration);
+//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorRuntime.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorRuntime.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorRuntime.cs
new file mode 100644
index 0000000..3af0aba
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorRuntime.cs
@@ -0,0 +1,251 @@
+/**
+ * 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.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Context;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Wake.Remote;
+using Org.Apache.REEF.Wake.Time;
+using Org.Apache.REEF.Wake.Time.Runtime.Event;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator
+{
+    public class EvaluatorRuntime : IObserver<RuntimeStart>, IObserver<RuntimeStop>, IObserver<REEFMessage>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorRuntime));
+        
+        private readonly string _evaluatorId;
+
+        private readonly ContextManager _contextManager;
+
+        private readonly HeartBeatManager _heartBeatManager;
+
+        private readonly IRemoteManager<REEFMessage> _remoteManager;
+
+        private readonly IClock _clock;
+
+        private State _state = State.INIT;
+
+        private IDisposable _evaluatorControlChannel; 
+
+        [Inject]
+        public EvaluatorRuntime(
+            ContextManager contextManager,
+            HeartBeatManager heartBeatManager)
+        {
+            using (LOGGER.LogFunction("EvaluatorRuntime::EvaluatorRuntime"))
+            {
+                _clock = heartBeatManager.EvaluatorSettings.RuntimeClock;
+                _heartBeatManager = heartBeatManager;
+                _contextManager = contextManager;
+                _evaluatorId = heartBeatManager.EvaluatorSettings.EvalutorId;
+                _remoteManager = heartBeatManager.EvaluatorSettings.RemoteManager;
+
+                ReefMessageProtoObserver driverObserver = new ReefMessageProtoObserver();
+
+                // subscribe to driver proto message
+                driverObserver.Subscribe(o => OnNext(o.Message));
+
+                // register the driver observer
+                _evaluatorControlChannel = _remoteManager.RegisterObserver(driverObserver);
+
+                // start the hearbeat
+                _clock.ScheduleAlarm(0, heartBeatManager);
+            }
+        }
+
+        public State State
+        {
+            get
+            {
+                return _state;
+            }
+        }
+
+        public void Handle(EvaluatorControlProto message)
+        {
+            lock (_heartBeatManager)
+            {
+                LOGGER.Log(Level.Info, "Handle Evaluator control message");
+                if (!message.identifier.Equals(_evaluatorId, StringComparison.OrdinalIgnoreCase))
+                {
+                    Handle(new InvalidOperationException(
+                        string.Format(CultureInfo.InvariantCulture, "Identifier mismatch: message for evaluator id[{0}] sent to evaluator id[{1}]", message.identifier, _evaluatorId)));
+                }
+                else if (_state != State.RUNNING)
+                {
+                    Handle(new InvalidOperationException(
+                        string.Format(CultureInfo.InvariantCulture, "Evaluator received a control message but its state is not {0} but rather {1}", State.RUNNING, _state)));
+                }
+                else
+                {
+                    if (message.context_control != null)
+                    {
+                        LOGGER.Log(Level.Info, "Send task control message to ContextManager");
+                        try
+                        {
+                            _contextManager.HandleTaskControl(message.context_control);
+                            if (_contextManager.ContextStackIsEmpty() && _state == State.RUNNING)
+                            {
+                                LOGGER.Log(Level.Info, "Context stack is empty, done");
+                                _state = State.DONE;
+                                _heartBeatManager.OnNext(GetEvaluatorStatus());
+                                _clock.Dispose();
+                            }
+                        }
+                        catch (Exception e)
+                        {
+                            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
+                            Handle(e);
+                            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException(e.ToString(), e), LOGGER);
+                        }
+                    }
+                    if (message.kill_evaluator != null)
+                    {
+                        LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Evaluator {0} has been killed by the driver.", _evaluatorId));
+                        _state = State.KILLED;
+                        _clock.Dispose();
+                    }
+                }
+            }
+        }
+
+        public EvaluatorStatusProto GetEvaluatorStatus()
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Evaluator state : {0}", _state));
+            EvaluatorStatusProto evaluatorStatusProto = new EvaluatorStatusProto()
+            {
+                evaluator_id = _evaluatorId,
+                state = _state
+            };
+            return evaluatorStatusProto;
+        }
+
+        public void OnNext(RuntimeStart runtimeStart)
+        {
+            lock (_evaluatorId)
+            {
+                try
+                {
+                    LOGGER.Log(Level.Info, "Runtime start");
+                    if (_state != State.INIT)
+                    {
+                        var e = new InvalidOperationException("State should be init.");
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                    }
+                    _state = State.RUNNING;
+                    _contextManager.Start();
+                    _heartBeatManager.OnNext();
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
+                    Handle(e);
+                }
+            }
+        }
+
+        void IObserver<RuntimeStart>.OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<REEFMessage>.OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<REEFMessage>.OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<RuntimeStop>.OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<RuntimeStop>.OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<RuntimeStart>.OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnNext(RuntimeStop runtimeStop)
+        {
+            LOGGER.Log(Level.Info, "Runtime stop");
+            _contextManager.Dispose();
+
+            if (_state == State.RUNNING)
+            {
+                _state = State.DONE;
+                _heartBeatManager.OnNext();
+            }
+            try
+            {
+                _evaluatorControlChannel.Dispose();
+            }
+            catch (Exception e)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(new InvalidOperationException("Cannot stop evaluator properly", e), Level.Error, "Exception during shut down.", LOGGER);
+            }
+            LOGGER.Log(Level.Info, "EvaluatorRuntime shutdown complete");        
+        }
+
+        public void OnNext(REEFMessage value)
+        {
+            if (value != null && value.evaluatorControl != null)
+            {
+                LOGGER.Log(Level.Info, "Received a REEFMessage with EvaluatorControl");
+                Handle(value.evaluatorControl);
+            }
+        }
+
+        private void Handle(Exception e)
+        {
+            lock (_heartBeatManager)
+            {
+                LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "evaluator {0} failed with exception", _evaluatorId), e);
+                _state = State.FAILED;
+                string errorMessage = string.Format(
+                        CultureInfo.InvariantCulture,
+                        "failed with error [{0}] with mesage [{1}] and stack trace [{2}]",
+                        e,
+                        e.Message,
+                        e.StackTrace);
+                EvaluatorStatusProto evaluatorStatusProto = new EvaluatorStatusProto()
+                {
+                    evaluator_id = _evaluatorId,
+                    error = ByteUtilities.StringToByteArrays(errorMessage),
+                    state = _state
+                };
+                _heartBeatManager.OnNext(evaluatorStatusProto);
+                _contextManager.Dispose();
+            }       
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorSettings.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorSettings.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorSettings.cs
new file mode 100644
index 0000000..a9b436b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/EvaluatorSettings.cs
@@ -0,0 +1,185 @@
+/**
+ * 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.Common.Evaluator;
+using Org.Apache.REEF.Common.Io;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Context;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Wake.Remote;
+using Org.Apache.REEF.Wake.Time;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator
+{
+    // TODO: merge with EvaluatorConfigurations class
+    public class EvaluatorSettings
+    {
+        private string _applicationId;
+
+        private string _evaluatorId;
+
+        private int _heartBeatPeriodInMs;
+
+        private int _maxHeartbeatRetries;
+
+        private ContextConfiguration _rootContextConfig;
+
+        private IClock _clock;
+
+        private IRemoteManager<REEFMessage> _remoteManager;
+
+        private IInjector _injector;
+
+        private EvaluatorOperationState _operationState;
+
+        private INameClient _nameClient;
+
+        public EvaluatorSettings(
+            string applicationId,
+            string evaluatorId,
+            int heartbeatPeriodInMs,
+            int maxHeartbeatRetries,
+            ContextConfiguration rootContextConfig,
+            IClock clock,
+            IRemoteManager<REEFMessage> remoteManager,
+            IInjector injecor)
+        {
+            if (string.IsNullOrWhiteSpace(evaluatorId))
+            {
+                throw new ArgumentNullException("evaluatorId");
+            }
+            if (rootContextConfig == null)
+            {
+                throw new ArgumentNullException("rootContextConfig");
+            }
+            if (clock == null)
+            {
+                throw new ArgumentNullException("clock");
+            }
+            if (remoteManager == null)
+            {
+                throw new ArgumentNullException("remoteManager");
+            }
+            if (injecor == null)
+            {
+                throw new ArgumentNullException("injecor");
+            }
+            _applicationId = applicationId;
+            _evaluatorId = evaluatorId;
+            _heartBeatPeriodInMs = heartbeatPeriodInMs;
+            _maxHeartbeatRetries = maxHeartbeatRetries;
+            _rootContextConfig = rootContextConfig;
+            _clock = clock;
+            _remoteManager = remoteManager;
+            _injector = injecor;
+            _operationState = EvaluatorOperationState.OPERATIONAL;
+        }
+
+        public EvaluatorOperationState OperationState
+        {
+            get
+            {
+                return _operationState;
+            }
+
+            set
+            {
+                _operationState = value;
+            }
+        }
+
+        public string EvalutorId
+        {
+            get
+            {
+                return _evaluatorId;
+            }
+        }
+
+        public int HeartBeatPeriodInMs
+        {
+            get
+            {
+                return _heartBeatPeriodInMs;
+            }
+        }
+
+        public string ApplicationId
+        {
+            get
+            {
+                return _applicationId;
+            }
+        }
+
+        public int MaxHeartbeatFailures
+        {
+            get
+            {
+                return _maxHeartbeatRetries;
+            }
+        }
+
+        public ContextConfiguration RootContextConfig
+        {
+            get
+            {
+                return _rootContextConfig;
+            }
+        }
+
+        public IClock RuntimeClock
+        {
+            get
+            {
+                return _clock;
+            }
+        }
+
+        public INameClient NameClient
+        {
+            get
+            {
+                return _nameClient;
+            }
+
+            set
+            {
+                _nameClient = value;
+            }
+        }
+
+        public IRemoteManager<REEFMessage> RemoteManager
+        {
+            get
+            {
+                return _remoteManager;
+            }
+        }
+
+        public IInjector Injector
+        {
+            get
+            {
+                return _injector;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/HeartBeatManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/HeartBeatManager.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/HeartBeatManager.cs
new file mode 100644
index 0000000..6a6e287
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/HeartBeatManager.cs
@@ -0,0 +1,387 @@
+/**
+ * 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.CodeAnalysis;
+using System.Globalization;
+using System.Linq;
+using System.Net;
+using System.Threading;
+using Org.Apache.REEF.Common.Evaluator;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Runtime.Evaluator.Context;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Wake.Remote;
+using Org.Apache.REEF.Wake.Remote.Impl;
+using Org.Apache.REEF.Wake.Time;
+using Org.Apache.REEF.Wake.Time.Event;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator
+{
+    public class HeartBeatManager : IObserver<Alarm>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(HeartBeatManager));
+
+        private static readonly MachineStatus MachineStatus = new MachineStatus();
+
+        private readonly IRemoteManager<REEFMessage> _remoteManager;
+
+        private readonly IClock _clock;
+
+        private readonly int _heartBeatPeriodInMillSeconds;
+
+        private readonly int _maxHeartbeatRetries = 0;
+
+        private readonly string _evaluatorId;
+
+        private IRemoteIdentifier _remoteId;
+
+        private IObserver<REEFMessage> _observer;
+
+        private int _heartbeatFailures = 0;
+
+        private IDriverConnection _driverConnection;
+
+        private EvaluatorSettings _evaluatorSettings;
+
+        // the queue can only contains the following:
+        // 1. all failed heartbeats (regular and event-based) before entering RECOVERY state
+        // 2. event-based heartbeats generated in RECOVERY state (since there will be no attempt to send regular heartbeat)
+        private Queue<EvaluatorHeartbeatProto> _queuedHeartbeats = new Queue<EvaluatorHeartbeatProto>();
+
+        public HeartBeatManager(EvaluatorSettings settings, IRemoteIdentifier remoteId)
+        {
+            using (LOGGER.LogFunction("HeartBeatManager::HeartBeatManager"))
+            {
+                _remoteManager = settings.RemoteManager;
+                _remoteId = remoteId;
+                _evaluatorId = settings.EvalutorId;
+                _observer = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint<REEFMessage>(_remoteId));
+                _clock = settings.RuntimeClock;
+                _heartBeatPeriodInMillSeconds = settings.HeartBeatPeriodInMs;
+                _maxHeartbeatRetries = settings.MaxHeartbeatFailures;
+                EvaluatorSettings = settings;
+                MachineStatus.ToString(); // kick start the CPU perf counter
+            }
+        }
+
+        [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Intended to be private, exposed now before using future injection")]
+        public EvaluatorRuntime _evaluatorRuntime { get; set; }
+
+        [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Intended to be private, exposed now before using future injection")]
+        public ContextManager _contextManager { get; set; }
+
+        public EvaluatorSettings EvaluatorSettings
+        {
+            get
+            {
+                return _evaluatorSettings;
+            }
+
+            private set
+            {
+                _evaluatorSettings = value;
+            }
+        }
+
+        public void Send(EvaluatorHeartbeatProto evaluatorHeartbeatProto)
+        {
+            lock (_queuedHeartbeats)
+            {
+                if (_evaluatorSettings.OperationState == EvaluatorOperationState.RECOVERY)
+                {
+                    LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "In RECOVERY mode, heartbeat queued as [{0}]. ", evaluatorHeartbeatProto));
+                    _queuedHeartbeats.Enqueue(evaluatorHeartbeatProto);
+                    return;
+                }
+
+                // NOT during recovery, try to send
+                REEFMessage payload = new REEFMessage(evaluatorHeartbeatProto);
+                try
+                {
+                    _observer.OnNext(payload);
+                    _heartbeatFailures = 0; // reset failure counts if we are having intermidtten (not continuous) failures
+                }
+                catch (Exception e)
+                {
+                    if (evaluatorHeartbeatProto.task_status == null || evaluatorHeartbeatProto.task_status.state != State.RUNNING)
+                    {
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, "Lost communications to driver when no task is running, recovery NOT supported for such scenario", LOGGER);
+                    }
+
+                    _heartbeatFailures++;
+
+                    _queuedHeartbeats.Enqueue(evaluatorHeartbeatProto);
+                    LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "Sending heartbeat to driver experienced #{0} failure. Hearbeat queued as: [{1}]. ", _heartbeatFailures, evaluatorHeartbeatProto), e);
+
+                    if (_heartbeatFailures >= _maxHeartbeatRetries)
+                    {
+                        LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Heartbeat communications to driver reached max of {0} failures. \n==== Driver is considered dead/unreachable. === \n=========== Entering RECOVERY mode. ===========", _heartbeatFailures));
+                        try
+                        {
+                            _driverConnection = _evaluatorSettings.Injector.GetInstance<IDriverConnection>();
+                        }
+                        catch (Exception ex)
+                        {
+                            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(ex, Level.Error, "Failed to inject the driver reconnect implementation", LOGGER);
+                        }
+                        LOGGER.Log(Level.Info, "instantiate driver reconnect implementation: " + _driverConnection);
+                        _evaluatorSettings.OperationState = EvaluatorOperationState.RECOVERY;
+
+                        // clean heartbeat failure
+                        _heartbeatFailures = 0;
+                    }
+                }
+            }     
+        }
+
+        /// <summary>
+        /// Assemble a complete new heartbeat and send it out.
+        /// </summary>
+        public void OnNext()
+        {
+            LOGGER.Log(Level.Verbose, "Before aqcuiring lock: HeartbeatManager::OnNext()");
+            lock (this)
+            {
+                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext()");
+                EvaluatorHeartbeatProto heartbeatProto = GetEvaluatorHeartbeatProto();
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
+                Send(heartbeatProto);
+            }
+        }
+
+        /// <summary>
+        /// Called with a specific TaskStatus that must be delivered to the driver
+        /// </summary>
+        /// <param name="taskStatusProto"></param>
+        public void OnNext(TaskStatusProto taskStatusProto)
+        {
+            LOGGER.Log(Level.Verbose, "Before aqcuiring lock: HeartbeatManager::OnNext(TaskStatusProto)");
+            lock (this)
+            {
+                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(TaskStatusProto)");
+                EvaluatorHeartbeatProto heartbeatProto = GetEvaluatorHeartbeatProto(
+                    _evaluatorRuntime.GetEvaluatorStatus(),
+                    _contextManager.GetContextStatusCollection(),
+                     Optional<TaskStatusProto>.Of(taskStatusProto));
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
+                Send(heartbeatProto);
+            }
+        }
+
+        /// <summary>
+        ///  Called with a specific ContextStatusProto that must be delivered to the driver
+        /// </summary>
+        /// <param name="contextStatusProto"></param>
+        public void OnNext(ContextStatusProto contextStatusProto)
+        {
+            LOGGER.Log(Level.Verbose, "Before aqcuiring lock: HeartbeatManager::OnNext(ContextStatusProto)");
+            lock (this)
+            {
+                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(ContextStatusProto)");
+                List<ContextStatusProto> contextStatusProtos = new List<ContextStatusProto>();
+                contextStatusProtos.Add(contextStatusProto);
+                contextStatusProtos.AddRange(_contextManager.GetContextStatusCollection());
+                EvaluatorHeartbeatProto heartbeatProto = GetEvaluatorHeartbeatProto(
+                    _evaluatorRuntime.GetEvaluatorStatus(),
+                    contextStatusProtos,
+                    Optional<TaskStatusProto>.Empty());
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
+                Send(heartbeatProto);
+            }
+        }
+
+        /// <summary>
+        /// Called with a specific EvaluatorStatus that must be delivered to the driver
+        /// </summary>
+        /// <param name="evaluatorStatusProto"></param>
+        public void OnNext(EvaluatorStatusProto evaluatorStatusProto)
+        {
+            LOGGER.Log(Level.Verbose, "Before acquring lock: HeartbeatManager::OnNext(EvaluatorStatusProto)");
+            lock (this)
+            {
+                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(EvaluatorStatusProto)");
+                EvaluatorHeartbeatProto heartbeatProto = new EvaluatorHeartbeatProto()
+                {
+                    timestamp = CurrentTimeMilliSeconds(),
+                    evaluator_status = evaluatorStatusProto
+                };
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
+                Send(heartbeatProto);
+            }
+        }
+
+        public void OnNext(Alarm value)
+        {
+            LOGGER.Log(Level.Verbose, "Before acquring lock: HeartbeatManager::OnNext(Alarm)");
+            lock (this)
+            {
+                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(Alarm)");
+                if (_evaluatorSettings.OperationState == EvaluatorOperationState.OPERATIONAL && _evaluatorRuntime.State == State.RUNNING)
+                {
+                    EvaluatorHeartbeatProto evaluatorHeartbeatProto = GetEvaluatorHeartbeatProto();
+                    LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}. {1}Node Health: {2}", evaluatorHeartbeatProto, Environment.NewLine, MachineStatus.ToString()));
+                    Send(evaluatorHeartbeatProto);
+                    _clock.ScheduleAlarm(_heartBeatPeriodInMillSeconds, this);
+                }
+                else
+                {
+                    LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "Ignoring regular heartbeat since Evaluator operation state is [{0}] and runtime state is [{1}]. ", _evaluatorSettings.OperationState,  _evaluatorRuntime.State));
+                    try
+                    {
+                        DriverInformation driverInformation = _driverConnection.GetDriverInformation(_evaluatorSettings.ApplicationId);
+                        if (driverInformation == null)
+                        {
+                            LOGGER.Log(Level.Verbose, "In RECOVERY mode, cannot retrieve driver information, will try again later.");
+                        }
+                        else
+                        {
+                            LOGGER.Log(
+                                Level.Info, 
+                                string.Format(CultureInfo.InvariantCulture, "Detect driver restarted at {0} and is running on endpoint {1} with services {2}. Now trying to re-establish connection", driverInformation.DriverStartTime, driverInformation.DriverRemoteIdentifier, driverInformation.NameServerId));
+                            Recover(driverInformation);
+                        }
+                    }
+                    catch (Exception e)
+                    {
+                        // we do not want any exception to stop the query for driver status
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, LOGGER);
+                    }
+                    _clock.ScheduleAlarm(_heartBeatPeriodInMillSeconds, this);
+                }
+            }
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        private static long CurrentTimeMilliSeconds()
+        {
+            // this is an implmenation to get current time milli second counted from Jan 1st, 1970
+            // it is chose as such to be compatible with java implmentation
+            DateTime jan1St1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+            return (long)(DateTime.UtcNow - jan1St1970).TotalMilliseconds;
+        }
+
+        private void Recover(DriverInformation driverInformation)
+        {
+            IPEndPoint driverEndpoint = NetUtilities.ParseIpEndpoint(driverInformation.DriverRemoteIdentifier);
+            _remoteId = new SocketRemoteIdentifier(driverEndpoint);
+            _observer = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint<REEFMessage>(_remoteId));
+            lock (_evaluatorSettings)
+            {
+                if (_evaluatorSettings.NameClient != null)
+                {
+                    try
+                    {
+                        LOGGER.Log(Level.Verbose, "Trying to reset and reconnect to name server" + driverInformation.NameServerId);
+                        _evaluatorSettings.NameClient.Restart(NetUtilities.ParseIpEndpoint(driverInformation.NameServerId));
+                        LOGGER.Log(Level.Info, "Reconnected to name server: " + driverInformation.NameServerId);
+                    }
+                    catch (Exception e)
+                    {
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
+                    }
+                }
+            }
+
+            lock (_queuedHeartbeats)
+            {
+                bool firstHeartbeatInQueue = true;
+                while (_queuedHeartbeats.Any())
+                {
+                    LOGGER.Log(Level.Info, "Sending cached recovery heartbeats to " + _remoteId);
+                    try
+                    {
+                        if (firstHeartbeatInQueue)
+                        {
+                            // first heartbeat is specially construted to include the recovery flag
+                            EvaluatorHeartbeatProto recoveryHeartbeat = ConstructRecoveryHeartBeat(_queuedHeartbeats.Dequeue());
+                            LOGGER.Log(Level.Info, "Recovery heartbeat to be sent:" + recoveryHeartbeat);
+                            _observer.OnNext(new REEFMessage(recoveryHeartbeat));
+                            firstHeartbeatInQueue = false;
+                        }
+                        else
+                        {
+                            _observer.OnNext(new REEFMessage(_queuedHeartbeats.Dequeue()));
+                        }
+                    }
+                    catch (Exception e)
+                    {
+                        // we do not handle failures during RECOVERY 
+                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(
+                            e,
+                            Level.Error,
+                            string.Format(CultureInfo.InvariantCulture, "Hearbeat attempt failed in RECOVERY mode to Driver {0} , giving up...", _remoteId),
+                            LOGGER);
+                    }
+                    Thread.Sleep(500);
+                }
+            }        
+            _evaluatorSettings.OperationState = EvaluatorOperationState.OPERATIONAL;
+            LOGGER.Log(Level.Info, "=========== Exiting RECOVERY mode. ===========");
+        }
+
+        private EvaluatorHeartbeatProto ConstructRecoveryHeartBeat(EvaluatorHeartbeatProto heartbeat)
+        {
+            heartbeat.recovery = true;
+            heartbeat.context_status.ForEach(c => c.recovery = true);
+            heartbeat.task_status.recovery = true;
+            return heartbeat;
+        }
+
+        private EvaluatorHeartbeatProto GetEvaluatorHeartbeatProto()
+        {
+            return GetEvaluatorHeartbeatProto(
+                _evaluatorRuntime.GetEvaluatorStatus(),
+                _contextManager.GetContextStatusCollection(),
+                _contextManager.GetTaskStatus());
+        }
+
+        private EvaluatorHeartbeatProto GetEvaluatorHeartbeatProto(
+            EvaluatorStatusProto evaluatorStatusProto,
+            ICollection<ContextStatusProto> contextStatusProtos,
+            Optional<TaskStatusProto> taskStatusProto)
+        {
+            EvaluatorHeartbeatProto evaluatorHeartbeatProto = new EvaluatorHeartbeatProto()
+            {
+                timestamp = CurrentTimeMilliSeconds(),
+                evaluator_status = evaluatorStatusProto
+            };
+            foreach (ContextStatusProto contextStatusProto in contextStatusProtos)
+            {
+                evaluatorHeartbeatProto.context_status.Add(contextStatusProto);
+            }
+            if (taskStatusProto.IsPresent())
+            {
+                evaluatorHeartbeatProto.task_status = taskStatusProto.Value;
+            }
+            return evaluatorHeartbeatProto;
+        }
+    }
+}


[16/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_service_protos.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_service_protos.proto b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_service_protos.proto
new file mode 100644
index 0000000..a553ca9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_service_protos.proto
@@ -0,0 +1,117 @@
+/**
+ * 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.
+ */
+option java_package = "org.apache.reef.reef.proto";
+
+option java_outer_classname = "ReefServiceProtos";
+
+option java_generic_services = true;
+
+option java_generate_equals_and_hash = true;
+
+enum State {
+    INIT = 0;
+    RUNNING = 1;
+    DONE = 2;
+    SUSPEND = 3;
+    FAILED = 4;
+    KILLED = 5;
+}
+
+enum FileType {
+    PLAIN = 0;
+    LIB = 1;
+    ARCHIVE = 2;
+}
+
+// Removed in REEF 0.3 in favor of explicit memory sizes.
+// enum SIZE {
+//    SMALL = 0;
+//    MEDIUM = 1;
+//    LARGE = 2;
+//    XLARGE = 3;
+//}
+
+enum ProcessType {
+    JVM = 0;
+    CLR = 1;
+}
+
+message FileResourceProto {
+    required FileType type = 1;
+    required string name = 2;
+    required string path = 3;
+}
+
+message RuntimeErrorProto {
+    required string name = 1; // e.g., local, yarn21
+    required string message = 2;
+    optional bytes exception = 3;
+
+    optional string identifier = 5; // e.g., evaluator id
+}
+
+message JobStatusProto {
+    required string identifier = 1;
+    required State state = 2;
+    optional bytes message = 3;
+    optional bytes exception = 4;
+}
+
+message ContextStatusProto {
+    enum State {
+        READY = 0;
+        DONE = 1;
+        FAIL = 2;
+    }
+    required State context_state = 1;
+
+    required string context_id = 2;
+    optional string parent_id = 3;
+
+    optional bytes error = 5; // when creating the context
+
+    optional bool recovery = 6;
+    // Context messages
+    message ContextMessageProto {
+        required string source_id = 1;
+        required bytes message = 2;
+    }
+    repeated ContextMessageProto context_message = 7;
+}
+
+message TaskStatusProto {
+    required string task_id = 1;
+    required string context_id = 2;
+    required State state = 3;
+    optional bytes result = 4; // e.g., return value from Task.call()
+    optional bool  recovery = 5;
+
+    // TaskMessageSource messages
+    message TaskMessageProto {
+        required string source_id = 1;
+        required bytes message = 2;
+    }
+    repeated TaskMessageProto task_message = 6;
+}
+
+message EvaluatorStatusProto {
+    required string evaluator_id = 1;
+    required State state = 2;
+    optional bytes error = 3;
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ClientRuntime.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ClientRuntime.pb.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ClientRuntime.pb.cs
new file mode 100644
index 0000000..857332d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ClientRuntime.pb.cs
@@ -0,0 +1,145 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// Generated from: client_runtime.proto
+// Note: requires additional types generated from: reef_service_protos.proto
+
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol{
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobSubmissionProto")]
+  public partial class JobSubmissionProto : global::ProtoBuf.IExtensible
+  {
+    public JobSubmissionProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private string _remote_id;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"remote_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string remote_id
+    {
+      get { return _remote_id; }
+      set { _remote_id = value; }
+    }
+    private string _configuration;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string configuration
+    {
+      get { return _configuration; }
+      set { _configuration = value; }
+    }
+    private string _user_name;
+    [global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"user_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string user_name
+    {
+      get { return _user_name; }
+      set { _user_name = value; }
+    }
+    private SIZE _driver_size = SIZE.SMALL;
+    [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"driver_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(SIZE.SMALL)]
+    public SIZE driver_size
+    {
+      get { return _driver_size; }
+      set { _driver_size = value; }
+    }
+    private int _driver_memory = default(int);
+    [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"driver_memory", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int driver_memory
+    {
+      get { return _driver_memory; }
+      set { _driver_memory = value; }
+    }
+    private int _priority = default(int);
+    [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"priority", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int priority
+    {
+      get { return _priority; }
+      set { _priority = value; }
+    }
+    private string _queue = "";
+    [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"queue", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string queue
+    {
+      get { return _queue; }
+      set { _queue = value; }
+    }
+    private readonly global::System.Collections.Generic.List<FileResourceProto> _global_file = new global::System.Collections.Generic.List<FileResourceProto>();
+    [global::ProtoBuf.ProtoMember(11, Name=@"global_file", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<FileResourceProto> global_file
+    {
+      get { return _global_file; }
+    }
+  
+    private readonly global::System.Collections.Generic.List<FileResourceProto> _local_File = new global::System.Collections.Generic.List<FileResourceProto>();
+    [global::ProtoBuf.ProtoMember(12, Name=@"local_File", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<FileResourceProto> local_File
+    {
+      get { return _local_File; }
+    }
+  
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobControlProto")]
+  public partial class JobControlProto : global::ProtoBuf.IExtensible
+  {
+    public JobControlProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private Signal _signal = Signal.SIG_TERMINATE;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"signal", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(Signal.SIG_TERMINATE)]
+    public Signal signal
+    {
+      get { return _signal; }
+      set { _signal = value; }
+    }
+    private byte[] _message = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] message
+    {
+      get { return _message; }
+      set { _message = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+    [global::ProtoBuf.ProtoContract(Name=@"Signal")]
+    public enum Signal
+    {
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"SIG_TERMINATE", Value=1)]
+      SIG_TERMINATE = 1,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"SIG_SUSPEND", Value=2)]
+      SIG_SUSPEND = 2,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"SIG_RESUME", Value=3)]
+      SIG_RESUME = 3
+    }
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/DriverRuntime.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/DriverRuntime.pb.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/DriverRuntime.pb.cs
new file mode 100644
index 0000000..d778d0d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/DriverRuntime.pb.cs
@@ -0,0 +1,337 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// Generated from: driver_runtime.proto
+// Note: requires additional types generated from: reef_service_protos.proto
+
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+{
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"DriverProcessRegistrationProto")]
+  public partial class DriverProcessRegistrationProto : global::ProtoBuf.IExtensible
+  {
+    public DriverProcessRegistrationProto() {}
+    
+    private string _remote_identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"remote_identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string remote_identifier
+    {
+      get { return _remote_identifier; }
+      set { _remote_identifier = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NodeDescriptorProto")]
+  public partial class NodeDescriptorProto : global::ProtoBuf.IExtensible
+  {
+    public NodeDescriptorProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private string _host_name;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"host_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string host_name
+    {
+      get { return _host_name; }
+      set { _host_name = value; }
+    }
+    private int _port;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"port", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public int port
+    {
+      get { return _port; }
+      set { _port = value; }
+    }
+    private int _memory_size;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"memory_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public int memory_size
+    {
+      get { return _memory_size; }
+      set { _memory_size = value; }
+    }
+    private string _rack_name = "";
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"rack_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string rack_name
+    {
+      get { return _rack_name; }
+      set { _rack_name = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceAllocationProto")]
+  public partial class ResourceAllocationProto : global::ProtoBuf.IExtensible
+  {
+    public ResourceAllocationProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private int _resource_memory;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"resource_memory", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public int resource_memory
+    {
+      get { return _resource_memory; }
+      set { _resource_memory = value; }
+    }
+    private string _node_id;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"node_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string node_id
+    {
+      get { return _node_id; }
+      set { _node_id = value; }
+    }
+    private int _virtual_cores = default(int);
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"virtual_cores", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int virtual_cores
+    {
+      get { return _virtual_cores; }
+      set { _virtual_cores = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceStatusProto")]
+  public partial class ResourceStatusProto : global::ProtoBuf.IExtensible
+  {
+    public ResourceStatusProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private State _state;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public State state
+    {
+      get { return _state; }
+      set { _state = value; }
+    }
+    private string _diagnostics = "";
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"diagnostics", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string diagnostics
+    {
+      get { return _diagnostics; }
+      set { _diagnostics = value; }
+    }
+    private int _exit_code = default(int);
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"exit_code", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int exit_code
+    {
+      get { return _exit_code; }
+      set { _exit_code = value; }
+    }
+    private bool _is_from_previous_driver = default(bool);
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"is_from_previous_driver", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(default(bool))]
+    public bool is_from_previous_driver
+    {
+      get { return _is_from_previous_driver; }
+      set { _is_from_previous_driver = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RuntimeStatusProto")]
+  public partial class RuntimeStatusProto : global::ProtoBuf.IExtensible
+  {
+    public RuntimeStatusProto() {}
+    
+    private string _name;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string name
+    {
+      get { return _name; }
+      set { _name = value; }
+    }
+    private State _state;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public State state
+    {
+      get { return _state; }
+      set { _state = value; }
+    }
+    private RuntimeErrorProto _error = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"error", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public RuntimeErrorProto error
+    {
+      get { return _error; }
+      set { _error = value; }
+    }
+    private int _outstanding_container_requests = default(int);
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"outstanding_container_requests", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int outstanding_container_requests
+    {
+      get { return _outstanding_container_requests; }
+      set { _outstanding_container_requests = value; }
+    }
+    private readonly global::System.Collections.Generic.List<string> _container_allocation = new global::System.Collections.Generic.List<string>();
+    [global::ProtoBuf.ProtoMember(6, Name=@"container_allocation", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<string> container_allocation
+    {
+      get { return _container_allocation; }
+    }
+  
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceRequestProto")]
+  public partial class ResourceRequestProto : global::ProtoBuf.IExtensible
+  {
+    public ResourceRequestProto() {}
+    
+    private int _memory_size = default(int);
+    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"memory_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int memory_size
+    {
+      get { return _memory_size; }
+      set { _memory_size = value; }
+    }
+    private int _priority = default(int);
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"priority", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int priority
+    {
+      get { return _priority; }
+      set { _priority = value; }
+    }
+    private int _virtual_cores = default(int);
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"virtual_cores", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    [global::System.ComponentModel.DefaultValue(default(int))]
+    public int virtual_cores
+    {
+      get { return _virtual_cores; }
+      set { _virtual_cores = value; }
+    }
+    private int _resource_count;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"resource_count", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public int resource_count
+    {
+      get { return _resource_count; }
+      set { _resource_count = value; }
+    }
+    private readonly global::System.Collections.Generic.List<string> _node_name = new global::System.Collections.Generic.List<string>();
+    [global::ProtoBuf.ProtoMember(6, Name=@"node_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<string> node_name
+    {
+      get { return _node_name; }
+    }
+  
+    private readonly global::System.Collections.Generic.List<string> _rack_name = new global::System.Collections.Generic.List<string>();
+    [global::ProtoBuf.ProtoMember(7, Name=@"rack_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<string> rack_name
+    {
+      get { return _rack_name; }
+    }
+  
+    private bool _relax_locality = default(bool);
+    [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"relax_locality", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(default(bool))]
+    public bool relax_locality
+    {
+      get { return _relax_locality; }
+      set { _relax_locality = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceReleaseProto")]
+  public partial class ResourceReleaseProto : global::ProtoBuf.IExtensible
+  {
+    public ResourceReleaseProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceLaunchProto")]
+  public partial class ResourceLaunchProto : global::ProtoBuf.IExtensible
+  {
+    public ResourceLaunchProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private string _remote_id;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"remote_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string remote_id
+    {
+      get { return _remote_id; }
+      set { _remote_id = value; }
+    }
+    private string _evaluator_conf;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"evaluator_conf", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string evaluator_conf
+    {
+      get { return _evaluator_conf; }
+      set { _evaluator_conf = value; }
+    }
+    private ProcessType _type;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public ProcessType type
+    {
+      get { return _type; }
+      set { _type = value; }
+    }
+    private readonly global::System.Collections.Generic.List<FileResourceProto> _file = new global::System.Collections.Generic.List<FileResourceProto>();
+    [global::ProtoBuf.ProtoMember(10, Name=@"file", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<FileResourceProto> file
+    {
+      get { return _file; }
+    }
+  
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorHeartbeatProtoCodec.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorHeartbeatProtoCodec.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorHeartbeatProtoCodec.cs
new file mode 100644
index 0000000..93b6330
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorHeartbeatProtoCodec.cs
@@ -0,0 +1,40 @@
+/**
+ * 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.Wake.Remote;
+
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+{
+    public class EvaluatorHeartbeatProtoCodec : ICodec<EvaluatorHeartbeatProto>
+    {
+        public byte[] Encode(EvaluatorHeartbeatProto obj)
+        {
+            EvaluatorHeartbeatProto pbuf = new EvaluatorHeartbeatProto();
+
+            pbuf.evaluator_status = obj.evaluator_status;
+            return pbuf.Serialize();
+        }
+
+        public EvaluatorHeartbeatProto Decode(byte[] data)
+        {
+            EvaluatorHeartbeatProto pbuf = EvaluatorHeartbeatProto.Deserialize(data);
+            return pbuf;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorRunTime.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorRunTime.pb.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorRunTime.pb.cs
new file mode 100644
index 0000000..931d221
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/EvaluatorRunTime.pb.cs
@@ -0,0 +1,304 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// Generated from: evaluator_runtime.proto
+// Note: requires additional types generated from: reef_service_protos.proto
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+{
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StopEvaluatorProto")]
+  public partial class StopEvaluatorProto : global::ProtoBuf.IExtensible
+  {
+    public StopEvaluatorProto() {}
+    
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"KillEvaluatorProto")]
+  public partial class KillEvaluatorProto : global::ProtoBuf.IExtensible
+  {
+    public KillEvaluatorProto() {}
+    
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StartTaskProto")]
+  public partial class StartTaskProto : global::ProtoBuf.IExtensible
+  {
+    public StartTaskProto() {}
+    
+    private string _context_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string context_id
+    {
+      get { return _context_id; }
+      set { _context_id = value; }
+    }
+    private string _configuration;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string configuration
+    {
+      get { return _configuration; }
+      set { _configuration = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"AddContextProto")]
+  public partial class AddContextProto : global::ProtoBuf.IExtensible
+  {
+    public AddContextProto() {}
+    
+    private string _parent_context_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"parent_context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string parent_context_id
+    {
+      get { return _parent_context_id; }
+      set { _parent_context_id = value; }
+    }
+    private string _context_configuration;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"context_configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string context_configuration
+    {
+      get { return _context_configuration; }
+      set { _context_configuration = value; }
+    }
+    private string _service_configuration = "";
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"service_configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string service_configuration
+    {
+      get { return _service_configuration; }
+      set { _service_configuration = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RemoveContextProto")]
+  public partial class RemoveContextProto : global::ProtoBuf.IExtensible
+  {
+    public RemoveContextProto() {}
+    
+    private string _context_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string context_id
+    {
+      get { return _context_id; }
+      set { _context_id = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StopTaskProto")]
+  public partial class StopTaskProto : global::ProtoBuf.IExtensible
+  {
+    public StopTaskProto() {}
+    
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SuspendTaskProto")]
+  public partial class SuspendTaskProto : global::ProtoBuf.IExtensible
+  {
+    public SuspendTaskProto() {}
+    
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextMessageProto")]
+  public partial class ContextMessageProto : global::ProtoBuf.IExtensible
+  {
+    public ContextMessageProto() {}
+    
+    private string _context_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string context_id
+    {
+      get { return _context_id; }
+      set { _context_id = value; }
+    }
+    private byte[] _message;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public byte[] message
+    {
+      get { return _message; }
+      set { _message = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextControlProto")]
+  public partial class ContextControlProto : global::ProtoBuf.IExtensible
+  {
+    public ContextControlProto() {}
+    
+    private byte[] _task_message = null;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"task_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] task_message
+    {
+      get { return _task_message; }
+      set { _task_message = value; }
+    }
+    private ContextMessageProto _context_message = null;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"context_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public ContextMessageProto context_message
+    {
+      get { return _context_message; }
+      set { _context_message = value; }
+    }
+    private AddContextProto _add_context = null;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"add_context", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public AddContextProto add_context
+    {
+      get { return _add_context; }
+      set { _add_context = value; }
+    }
+    private RemoveContextProto _remove_context = null;
+    [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"remove_context", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public RemoveContextProto remove_context
+    {
+      get { return _remove_context; }
+      set { _remove_context = value; }
+    }
+    private StartTaskProto _start_task = null;
+    [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"start_task", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public StartTaskProto start_task
+    {
+      get { return _start_task; }
+      set { _start_task = value; }
+    }
+    private StopTaskProto _stop_task = null;
+    [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"stop_task", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public StopTaskProto stop_task
+    {
+      get { return _stop_task; }
+      set { _stop_task = value; }
+    }
+    private SuspendTaskProto _suspend_task = null;
+    [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"suspend_task", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public SuspendTaskProto suspend_task
+    {
+      get { return _suspend_task; }
+      set { _suspend_task = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EvaluatorHeartbeatProto")]
+  public partial class EvaluatorHeartbeatProto : global::ProtoBuf.IExtensible
+  {
+    public EvaluatorHeartbeatProto() {}
+    
+    private long _timestamp;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public long timestamp
+    {
+      get { return _timestamp; }
+      set { _timestamp = value; }
+    }
+    private EvaluatorStatusProto _evaluator_status;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"evaluator_status", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public EvaluatorStatusProto evaluator_status
+    {
+      get { return _evaluator_status; }
+      set { _evaluator_status = value; }
+    }
+    private readonly global::System.Collections.Generic.List<ContextStatusProto> _context_status = new global::System.Collections.Generic.List<ContextStatusProto>();
+    [global::ProtoBuf.ProtoMember(3, Name=@"context_status", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<ContextStatusProto> context_status
+    {
+      get { return _context_status; }
+    }
+  
+    private TaskStatusProto _task_status = null;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"task_status", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public TaskStatusProto task_status
+    {
+      get { return _task_status; }
+      set { _task_status = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+
+    private bool _recovery;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name = @"recovery", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public bool recovery
+    {
+        get { return _recovery; }
+        set { _recovery = value; }
+    }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EvaluatorControlProto")]
+  public partial class EvaluatorControlProto : global::ProtoBuf.IExtensible
+  {
+    public EvaluatorControlProto() {}
+    
+    private long _timestamp;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public long timestamp
+    {
+      get { return _timestamp; }
+      set { _timestamp = value; }
+    }
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private ContextControlProto _context_control = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"context_control", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public ContextControlProto context_control
+    {
+      get { return _context_control; }
+      set { _context_control = value; }
+    }
+    private KillEvaluatorProto _kill_evaluator = null;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"kill_evaluator", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public KillEvaluatorProto kill_evaluator
+    {
+      get { return _kill_evaluator; }
+      set { _kill_evaluator = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/REEFMessageCodec.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/REEFMessageCodec.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/REEFMessageCodec.cs
new file mode 100644
index 0000000..e8c7515
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/REEFMessageCodec.cs
@@ -0,0 +1,37 @@
+/**
+ * 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.Wake.Remote;
+
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+{
+    public class REEFMessageCodec : ICodec<REEFMessage>
+    {
+        public byte[] Encode(REEFMessage obj)
+        {
+            return obj.Serialize();
+        }
+
+        public REEFMessage Decode(byte[] data)
+        {
+            REEFMessage pbuf = REEFMessage.Deserialize(data);
+            return pbuf;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefProtocol.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefProtocol.pb.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefProtocol.pb.cs
new file mode 100644
index 0000000..93fee85
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefProtocol.pb.cs
@@ -0,0 +1,75 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// Generated from: reef_protocol.proto
+// Note: requires additional types generated from: client_runtime.proto
+// Note: requires additional types generated from: evaluator_runtime.proto
+// Note: requires additional types generated from: reef_service_protos.proto
+
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+{
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"REEFMessage")]
+  public partial class REEFMessage : global::ProtoBuf.IExtensible
+  {
+    public REEFMessage() {}
+    
+    private JobSubmissionProto _jobSubmission = null;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"jobSubmission", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public JobSubmissionProto jobSubmission
+    {
+      get { return _jobSubmission; }
+      set { _jobSubmission = value; }
+    }
+    private JobControlProto _jobControl = null;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"jobControl", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public JobControlProto jobControl
+    {
+      get { return _jobControl; }
+      set { _jobControl = value; }
+    }
+    private RuntimeErrorProto _runtimeError = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"runtimeError", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public RuntimeErrorProto runtimeError
+    {
+      get { return _runtimeError; }
+      set { _runtimeError = value; }
+    }
+    private JobStatusProto _jobStatus = null;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"jobStatus", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public JobStatusProto jobStatus
+    {
+      get { return _jobStatus; }
+      set { _jobStatus = value; }
+    }
+    private EvaluatorControlProto _evaluatorControl = null;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"evaluatorControl", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public EvaluatorControlProto evaluatorControl
+    {
+      get { return _evaluatorControl; }
+      set { _evaluatorControl = value; }
+    }
+    private EvaluatorHeartbeatProto _evaluatorHeartBeat = null;
+    [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"evaluatorHeartBeat", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public EvaluatorHeartbeatProto evaluatorHeartBeat
+    {
+      get { return _evaluatorHeartBeat; }
+      set { _evaluatorHeartBeat = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefService.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefService.pb.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefService.pb.cs
new file mode 100644
index 0000000..bff57f5
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/ReefService.pb.cs
@@ -0,0 +1,393 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// Generated from: reef_service_protos.proto
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+
+{
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"FileResourceProto")]
+  public partial class FileResourceProto : global::ProtoBuf.IExtensible
+  {
+    public FileResourceProto() {}
+    
+    private FileType _type;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public FileType type
+    {
+      get { return _type; }
+      set { _type = value; }
+    }
+    private string _name;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string name
+    {
+      get { return _name; }
+      set { _name = value; }
+    }
+    private string _path;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string path
+    {
+      get { return _path; }
+      set { _path = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RuntimeErrorProto")]
+  public partial class RuntimeErrorProto : global::ProtoBuf.IExtensible
+  {
+    public RuntimeErrorProto() {}
+    
+    private string _name;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string name
+    {
+      get { return _name; }
+      set { _name = value; }
+    }
+    private string _message;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string message
+    {
+      get { return _message; }
+      set { _message = value; }
+    }
+    private byte[] _exception = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"exception", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] exception
+    {
+      get { return _exception; }
+      set { _exception = value; }
+    }
+    private string _identifier = "";
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobStatusProto")]
+  public partial class JobStatusProto : global::ProtoBuf.IExtensible
+  {
+    public JobStatusProto() {}
+    
+    private string _identifier;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string identifier
+    {
+      get { return _identifier; }
+      set { _identifier = value; }
+    }
+    private State _state;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public State state
+    {
+      get { return _state; }
+      set { _state = value; }
+    }
+    private byte[] _message = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] message
+    {
+      get { return _message; }
+      set { _message = value; }
+    }
+    private byte[] _exception = null;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"exception", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] exception
+    {
+      get { return _exception; }
+      set { _exception = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextStatusProto")]
+  public partial class ContextStatusProto : global::ProtoBuf.IExtensible
+  {
+    public ContextStatusProto() {}
+    
+    private ContextStatusProto.State _context_state;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public ContextStatusProto.State context_state
+    {
+      get { return _context_state; }
+      set { _context_state = value; }
+    }
+    private string _context_id;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string context_id
+    {
+      get { return _context_id; }
+      set { _context_id = value; }
+    }
+    private string _parent_id = "";
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"parent_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue("")]
+    public string parent_id
+    {
+      get { return _parent_id; }
+      set { _parent_id = value; }
+    }
+    private byte[] _error = null;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"error", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] error
+    {
+      get { return _error; }
+      set { _error = value; }
+    }
+    private bool _recovery = false;
+    [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name = @"recovery", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(false)]
+    public bool recovery
+    {
+        get { return _recovery; }
+        set { _recovery = value; }
+    }
+    private readonly global::System.Collections.Generic.List<ContextStatusProto.ContextMessageProto> _context_message = new global::System.Collections.Generic.List<ContextStatusProto.ContextMessageProto>();
+    [global::ProtoBuf.ProtoMember(7, Name=@"context_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<ContextStatusProto.ContextMessageProto> context_message
+    {
+      get { return _context_message; }
+    }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextMessageProto")]
+  public partial class ContextMessageProto : global::ProtoBuf.IExtensible
+  {
+    public ContextMessageProto() {}
+    
+    private string _source_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"source_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string source_id
+    {
+      get { return _source_id; }
+      set { _source_id = value; }
+    }
+    private byte[] _message;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public byte[] message
+    {
+      get { return _message; }
+      set { _message = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+    [global::ProtoBuf.ProtoContract(Name=@"State")]
+    public enum State
+    {
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"READY", Value=0)]
+      READY = 0,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"DONE", Value=1)]
+      DONE = 1,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=2)]
+      FAIL = 2
+    }
+  
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"TaskStatusProto")]
+  public partial class TaskStatusProto : global::ProtoBuf.IExtensible
+  {
+    public TaskStatusProto() {}
+    
+    private string _task_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"task_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string task_id
+    {
+      get { return _task_id; }
+      set { _task_id = value; }
+    }
+    private string _context_id;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string context_id
+    {
+      get { return _context_id; }
+      set { _context_id = value; }
+    }
+    private State _state;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public State state
+    {
+      get { return _state; }
+      set { _state = value; }
+    }
+    private byte[] _result = null;
+    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"result", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] result
+    {
+      get { return _result; }
+      set { _result = value; }
+    }
+    private bool _recovery = false;
+    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name = @"recovery", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(false)]
+    public bool recovery
+    {
+        get { return _recovery; }
+        set { _recovery = value; }
+    }
+    private readonly global::System.Collections.Generic.List<TaskStatusProto.TaskMessageProto> _task_message = new global::System.Collections.Generic.List<TaskStatusProto.TaskMessageProto>();
+    [global::ProtoBuf.ProtoMember(6, Name=@"task_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public global::System.Collections.Generic.List<TaskStatusProto.TaskMessageProto> task_message
+    {
+      get { return _task_message; }
+    }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"TaskMessageProto")]
+  public partial class TaskMessageProto : global::ProtoBuf.IExtensible
+  {
+    public TaskMessageProto() {}
+    
+    private string _source_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"source_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string source_id
+    {
+      get { return _source_id; }
+      set { _source_id = value; }
+    }
+    private byte[] _message;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public byte[] message
+    {
+      get { return _message; }
+      set { _message = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EvaluatorStatusProto")]
+  public partial class EvaluatorStatusProto : global::ProtoBuf.IExtensible
+  {
+    public EvaluatorStatusProto() {}
+    
+    private string _evaluator_id;
+    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"evaluator_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    public string evaluator_id
+    {
+      get { return _evaluator_id; }
+      set { _evaluator_id = value; }
+    }
+    private State _state;
+    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+    public State state
+    {
+      get { return _state; }
+      set { _state = value; }
+    }
+    private byte[] _error = null;
+    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"error", DataFormat = global::ProtoBuf.DataFormat.Default)]
+    [global::System.ComponentModel.DefaultValue(null)]
+    public byte[] error
+    {
+      get { return _error; }
+      set { _error = value; }
+    }
+    private global::ProtoBuf.IExtension extensionObject;
+    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+  }
+  
+    [global::ProtoBuf.ProtoContract(Name=@"State")]
+    public enum State
+    {
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"INIT", Value=0)]
+      INIT = 0,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"RUNNING", Value=1)]
+      RUNNING = 1,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"DONE", Value=2)]
+      DONE = 2,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"SUSPEND", Value=3)]
+      SUSPEND = 3,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"FAILED", Value=4)]
+      FAILED = 4,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"KILLED", Value=5)]
+      KILLED = 5
+    }
+  
+    [global::ProtoBuf.ProtoContract(Name=@"FileType")]
+    public enum FileType
+    {
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"PLAIN", Value=0)]
+      PLAIN = 0,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"LIB", Value=1)]
+      LIB = 1,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"ARCHIVE", Value=2)]
+      ARCHIVE = 2
+    }
+  
+    [global::ProtoBuf.ProtoContract(Name=@"SIZE")]
+    public enum SIZE
+    {
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"SMALL", Value=0)]
+      SMALL = 0,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"MEDIUM", Value=1)]
+      MEDIUM = 1,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"LARGE", Value=2)]
+      LARGE = 2,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"XLARGE", Value=3)]
+      XLARGE = 3
+    }
+  
+    [global::ProtoBuf.ProtoContract(Name=@"ProcessType")]
+    public enum ProcessType
+    {
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"JVM", Value=0)]
+      JVM = 0,
+            
+      [global::ProtoBuf.ProtoEnum(Name=@"CLR", Value=1)]
+      CLR = 1
+    }
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/Serializer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/Serializer.cs b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/Serializer.cs
new file mode 100644
index 0000000..093d0d3
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/ReefProtocol/Serializer.cs
@@ -0,0 +1,123 @@
+/**
+ * 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.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.IO;
+using Org.Apache.REEF.Utilities;
+using ProtoBuf;
+
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1403:FileMayOnlyContainASingleNamespace", Justification = "Serializers for all protobuf types")]
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Serializers for all protobuf types")]
+
+namespace Org.Apache.REEF.Common.Protobuf.ReefProtocol
+{
+    /// <summary>
+    /// Add serializer/deserializer to REEFMessage
+    /// </summary>
+    public partial class REEFMessage
+    {
+        public REEFMessage(EvaluatorHeartbeatProto evaluatorHeartbeatProto)
+        {
+            _evaluatorHeartBeat = evaluatorHeartbeatProto;
+        }
+
+        public static REEFMessage Deserialize(byte[] bytes)
+        {
+            REEFMessage pbuf = null;
+            using (var s = new MemoryStream(bytes))
+            {
+                pbuf = Serializer.Deserialize<REEFMessage>(s);
+            }
+            return pbuf;
+        }
+
+        public byte[] Serialize()
+        {
+            byte[] b = null;
+            using (var s = new MemoryStream())
+            {
+                Serializer.Serialize<REEFMessage>(s, this);
+                b = new byte[s.Position];
+                var fullBuffer = s.GetBuffer();
+                Array.Copy(fullBuffer, b, b.Length);
+            }
+            return b;
+        }
+    }
+
+    /// <summary>
+    /// Add serializer/deserializer to EvaluatorHeartbeatProto
+    /// </summary>
+    public partial class EvaluatorHeartbeatProto
+    {
+        public static EvaluatorHeartbeatProto Deserialize(byte[] bytes)
+        {
+            EvaluatorHeartbeatProto pbuf = null;
+            using (var s = new MemoryStream(bytes))
+            {
+                pbuf = Serializer.Deserialize<EvaluatorHeartbeatProto>(s);
+            }
+            return pbuf;
+        }
+
+        public byte[] Serialize()
+        {
+            byte[] b = null;
+            using (var s = new MemoryStream())
+            {
+                Serializer.Serialize<EvaluatorHeartbeatProto>(s, this);
+                b = new byte[s.Position];
+                var fullBuffer = s.GetBuffer();
+                Array.Copy(fullBuffer, b, b.Length);
+            }
+            return b;
+        }
+
+        public override string ToString()
+        {
+            string contextStatus = string.Empty;
+            string taskStatusMessage = string.Empty;
+            foreach (ContextStatusProto contextStatusProto in context_status)
+            {
+                contextStatus += string.Format(CultureInfo.InvariantCulture, "evaluator {0} has context {1} in state {2} with recovery flag {3}",
+                    evaluator_status.evaluator_id,
+                    contextStatusProto.context_id,
+                    contextStatusProto.context_state,
+                    contextStatusProto.recovery);
+            }
+            if (task_status != null && task_status.task_message != null && task_status.task_message.Count > 0)
+            {
+                foreach (TaskStatusProto.TaskMessageProto taskMessageProto in task_status.task_message)
+                {
+                    taskStatusMessage += ByteUtilities.ByteArrarysToString(taskMessageProto.message);
+                }
+            }
+            return string.Format(CultureInfo.InvariantCulture, "EvaluatorHeartbeatProto: task_id=[{0}], task_status=[{1}], task_message=[{2}], evaluator_status=[{3}], context_status=[{4}], timestamp=[{5}], recoveryFlag =[{6}]",
+                task_status == null ? string.Empty : task_status.task_id,
+                task_status == null ? string.Empty : task_status.state.ToString(),
+                taskStatusMessage,
+                evaluator_status.state.ToString(),
+                contextStatus,
+                timestamp,
+                recovery);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Constants.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Constants.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Constants.cs
new file mode 100644
index 0000000..4683f7f
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Constants.cs
@@ -0,0 +1,40 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator
+{
+    public class Constants
+    {
+        public const string RootContextConfiguration = "RootContextConfiguration";
+
+        public const string EvaluatorIdentifier = "EvaluatorIdentifier";
+
+        public const string RootServiceConfiguration = "RootServiceConfiguration";
+
+        public const string TaskConfiguration = "TaskConfiguration";
+
+        public const string ContextIdentifier = "ContextIdentifier";
+
+        public const string ApplicationIdentifier = "ApplicationIdentifier";
+
+        public const int DefaultEvaluatorHeartbeatPeriodInMs = 4000;
+
+        public const int DefaultEvaluatorHeartbeatMaxRetry = 3;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextClientCodeException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextClientCodeException.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextClientCodeException.cs
new file mode 100644
index 0000000..16375a1
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextClientCodeException.cs
@@ -0,0 +1,70 @@
+/**
+ * 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.Interface;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    public class ContextClientCodeException : Exception
+    {
+        private readonly string _contextId;
+        private readonly Optional<string> _parentId;
+
+        /// <summary>
+        /// construt the exception that caused the error
+        /// </summary>
+        /// <param name="contextId"> the id of the failed context.</param>
+        /// <param name="parentId"> the id of the failed context's parent, if any.</param>
+        /// <param name="message"> the error message </param>
+        /// <param name="cause"> the exception that caused the error</param>
+        public ContextClientCodeException(
+                string contextId,
+                Optional<string> parentId,
+                string message,
+                Exception cause)
+            : base("Failure in context '" + contextId + "': " + message, cause)
+        {
+            _contextId = contextId;
+            _parentId = parentId;
+        }
+
+        public string ContextId
+        {
+            get { return _contextId; }
+        }
+
+        public Optional<string> ParentId
+        {
+            get { return _parentId; }
+        }
+
+        /// <summary>
+        /// Extracts a context id from the given configuration.
+        /// </summary>
+        /// <param name="c"></param>
+        /// <returns>the context id in the given configuration.</returns>
+        public static string GetId(IConfiguration c)
+        {
+            // TODO: update after TANG is available
+            return string.Empty;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextConfiguration.cs
new file mode 100644
index 0000000..7191924
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextConfiguration.cs
@@ -0,0 +1,140 @@
+/**
+ * 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.Globalization;
+using System.IO;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Tang.Types;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    public class ContextConfiguration : IConfiguration
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextConfiguration));
+        
+        private Dictionary<string, string> _settings;
+
+        public ContextConfiguration(string configString)
+        {
+            using (LOGGER.LogFunction("ContextConfiguration::ContextConfigurationn"))
+            {
+                ContainerDirectory = Directory.GetCurrentDirectory();
+
+                _settings = new Dictionary<string, string>();
+                AvroConfiguration avroConfiguration = AvroConfiguration.GetAvroConfigurationFromEmbeddedString(configString);
+                foreach (ConfigurationEntry config in avroConfiguration.Bindings)
+                {
+                    if (config.key.Contains(Constants.ContextIdentifier))
+                    {
+                        config.key = Constants.ContextIdentifier;
+                        LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "{0} detected for context id with value {1}", config.key, config.value));
+                    }
+                    _settings.Add(config.key, config.value);
+                }
+                if (!_settings.ContainsKey(Constants.ContextIdentifier))
+                {
+                    string msg = "Required parameter ContextIdentifier not provided.";
+                    LOGGER.Log(Level.Error, msg);
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException(msg), LOGGER);
+                }
+            }
+        }
+
+        public string Id
+        {
+            get { return _settings[Constants.ContextIdentifier]; }
+        }
+
+        public string ContainerDirectory { get; set; }
+
+        public IConfigurationBuilder newBuilder()
+        {
+            throw new NotImplementedException();
+        }
+
+        public string GetNamedParameter(INamedParameterNode np)
+        {
+            throw new NotImplementedException();
+        }
+
+        public IClassHierarchy GetClassHierarchy()
+        {
+            throw new NotImplementedException();
+        }
+
+        public ISet<object> GetBoundSet(INamedParameterNode np)
+        {
+            throw new NotImplementedException();
+        }
+
+        public IClassNode GetBoundConstructor(IClassNode cn)
+        {
+            throw new NotImplementedException();
+        }
+
+        public IClassNode GetBoundImplementation(IClassNode cn)
+        {
+            throw new NotImplementedException();
+        }
+
+        public IConstructorDef GetLegacyConstructor(IClassNode cn)
+        {
+            throw new NotImplementedException();
+        }
+
+        public ICollection<IClassNode> GetBoundImplementations()
+        {
+            throw new NotImplementedException();
+        }
+
+        public ICollection<IClassNode> GetBoundConstructors()
+        {
+            throw new NotImplementedException();
+        }
+
+        public ICollection<INamedParameterNode> GetNamedParameters()
+        {
+            throw new NotImplementedException();
+        }
+
+        public ICollection<IClassNode> GetLegacyConstructors()
+        {
+            throw new NotImplementedException();
+        }
+
+        public IList<object> GetBoundList(INamedParameterNode np)
+        {
+            throw new NotImplementedException();
+        }
+
+        public IEnumerator<KeyValuePair<INamedParameterNode, object>> GetBoundSets()
+        {
+            throw new NotImplementedException();
+        }
+
+        public IDictionary<INamedParameterNode, IList<object>> GetBoundList()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextLifeCycle.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextLifeCycle.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextLifeCycle.cs
new file mode 100644
index 0000000..a6e6b4a
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Context/ContextLifeCycle.cs
@@ -0,0 +1,106 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Common.Events;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Context
+{
+    /// <summary>
+    /// This class is used to trigger all the context life-cycle dependent events.
+    /// </summary>
+    class ContextLifeCycle
+    {
+        private HashSet<IObserver<IContextStart>> _contextStartHandlers;
+
+        private HashSet<IObserver<IContextStop>> _contextStopHandlers;
+
+        private HashSet<IContextMessageSource> _contextMessageSources;
+
+        // @Inject
+        public ContextLifeCycle(
+            string id,
+            HashSet<IObserver<IContextStart>> contextStartHandlers,
+            HashSet<IObserver<IContextStop>> contextStopHandlers,
+            HashSet<IContextMessageSource> contextMessageSources)
+        {
+            Id = id;
+            _contextStartHandlers = contextStartHandlers;
+            _contextStopHandlers = contextStopHandlers;
+            _contextMessageSources = contextMessageSources;
+        }
+
+        public ContextLifeCycle(string contextId)
+        {
+            Id = contextId;
+            _contextStartHandlers = new HashSet<IObserver<IContextStart>>();
+            _contextStopHandlers = new HashSet<IObserver<IContextStop>>();
+            _contextMessageSources = new HashSet<IContextMessageSource>();
+        }
+
+        public string Id { get; private set; }
+
+        public HashSet<IContextMessageSource> ContextMessageSources
+        {
+            get { return _contextMessageSources; }
+        }
+
+        /// <summary>
+        /// Fires ContextStart to all registered event handlers.
+        /// </summary>
+        public void Start()
+        {
+            IContextStart contextStart = new ContextStartImpl(Id);
+            
+            // TODO: enable
+            //foreach (IObserver<IContextStart> startHandler in _contextStartHandlers)
+            //{
+            //    startHandler.OnNext(contextStart);
+            //}
+        }
+
+        /// <summary>
+        /// Fires ContextStop to all registered event handlers.
+        /// </summary>
+        public void Close()
+        {
+            //IContextStop contextStop = new ContextStopImpl(Id);
+            //foreach (IObserver<IContextStop> startHandler in _contextStopHandlers)
+            //{
+            //    startHandler.OnNext(contextStop);
+            //}
+        }
+
+        public void HandleContextMessage(byte[] message)
+        {
+            //contextMessageHandler.onNext(message);
+        }
+
+        /// <summary>
+        /// get the set of ContextMessageSources configured
+        /// </summary>
+        /// <returns>(a shallow copy of) the set of ContextMessageSources configured.</returns>
+        public HashSet<IContextMessageSource> GetContextMessageSources()
+        {
+            return new HashSet<IContextMessageSource>(_contextMessageSources);
+        }
+    }
+}


[11/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/proto/evaluator_runtime.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/evaluator_runtime.proto b/lang/cs/Org.Apache.REEF.Common/protobuf/proto/evaluator_runtime.proto
deleted file mode 100644
index 1415e5c..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/evaluator_runtime.proto
+++ /dev/null
@@ -1,91 +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.
- */
-option java_package = "org.apache.reef.proto";
-option java_outer_classname = "EvaluatorRuntimeProtocol";
-option java_generic_services = true;
-option java_generate_equals_and_hash = true;
-
-import "reef_service_protos.proto";
-
-// Stop the evaluator
-message StopEvaluatorProto {
-}
-
-// Kill the evaluator
-message KillEvaluatorProto {
-}
-
-// Start a task
-message StartTaskProto {
-    required string context_id = 1;
-    required string configuration = 2;
-}
-
-message AddContextProto {
-    required string parent_context_id = 1;
-    required string context_configuration = 2;
-    optional string service_configuration = 3;
-}
-
-message RemoveContextProto {
-    required string context_id = 1;
-}
-
-// Stop the task
-message StopTaskProto {
-}
-
-// Suspend the task
-message SuspendTaskProto {
-}
-
-/////////////////////////////////////////
-// Message aggregators
-
-message ContextMessageProto {
-    required string context_id = 1;
-    required bytes message = 2;
-}
-
-message ContextControlProto {
-    optional bytes task_message = 1;
-    optional ContextMessageProto context_message = 2;
-
-    optional AddContextProto    add_context    = 5;
-    optional RemoveContextProto remove_context = 6;
-    optional StartTaskProto     start_task     = 7;
-    optional StopTaskProto      stop_task      = 8;
-    optional SuspendTaskProto   suspend_task   = 9;
-}
-
-message EvaluatorHeartbeatProto {
-    required int64 timestamp = 1;
-    required EvaluatorStatusProto evaluator_status = 2;
-    repeated ContextStatusProto   context_status   = 3;
-    optional TaskStatusProto      task_status      = 4;
-    optional bool                 recovery         = 5;  
-}
-
-message EvaluatorControlProto {
-    required int64 timestamp = 1;
-    required string identifier = 2;
-
-    optional ContextControlProto context_control = 3;
-    optional KillEvaluatorProto kill_evaluator = 4;
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_protocol.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_protocol.proto b/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_protocol.proto
deleted file mode 100644
index 6b99415..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_protocol.proto
+++ /dev/null
@@ -1,44 +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.
- */
-import "client_runtime.proto";
-
-import "evaluator_runtime.proto";
-
-import "reef_service_protos.proto";
-
-
-option java_package = "com.Org.Apache.REEF.proto";
-
-option java_generic_services = true;
-
-option java_generate_equals_and_hash = true;
-
-option java_outer_classname = "REEFProtocol";
-
-message REEFMessage {
-    // Messages defined in client_runtime.proto
-    optional JobSubmissionProto jobSubmission = 1;
-    optional JobControlProto jobControl = 2;
-    // Messages defined in reef_service_protos.proto
-    optional RuntimeErrorProto runtimeError = 3;
-    optional JobStatusProto jobStatus = 4;
-    // Messages from evaluator_runtime.proto
-    optional EvaluatorControlProto evaluatorControl = 5;
-    optional EvaluatorHeartbeatProto evaluatorHeartBeat = 6;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_service_protos.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_service_protos.proto b/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_service_protos.proto
deleted file mode 100644
index a553ca9..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/reef_service_protos.proto
+++ /dev/null
@@ -1,117 +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.
- */
-option java_package = "org.apache.reef.reef.proto";
-
-option java_outer_classname = "ReefServiceProtos";
-
-option java_generic_services = true;
-
-option java_generate_equals_and_hash = true;
-
-enum State {
-    INIT = 0;
-    RUNNING = 1;
-    DONE = 2;
-    SUSPEND = 3;
-    FAILED = 4;
-    KILLED = 5;
-}
-
-enum FileType {
-    PLAIN = 0;
-    LIB = 1;
-    ARCHIVE = 2;
-}
-
-// Removed in REEF 0.3 in favor of explicit memory sizes.
-// enum SIZE {
-//    SMALL = 0;
-//    MEDIUM = 1;
-//    LARGE = 2;
-//    XLARGE = 3;
-//}
-
-enum ProcessType {
-    JVM = 0;
-    CLR = 1;
-}
-
-message FileResourceProto {
-    required FileType type = 1;
-    required string name = 2;
-    required string path = 3;
-}
-
-message RuntimeErrorProto {
-    required string name = 1; // e.g., local, yarn21
-    required string message = 2;
-    optional bytes exception = 3;
-
-    optional string identifier = 5; // e.g., evaluator id
-}
-
-message JobStatusProto {
-    required string identifier = 1;
-    required State state = 2;
-    optional bytes message = 3;
-    optional bytes exception = 4;
-}
-
-message ContextStatusProto {
-    enum State {
-        READY = 0;
-        DONE = 1;
-        FAIL = 2;
-    }
-    required State context_state = 1;
-
-    required string context_id = 2;
-    optional string parent_id = 3;
-
-    optional bytes error = 5; // when creating the context
-
-    optional bool recovery = 6;
-    // Context messages
-    message ContextMessageProto {
-        required string source_id = 1;
-        required bytes message = 2;
-    }
-    repeated ContextMessageProto context_message = 7;
-}
-
-message TaskStatusProto {
-    required string task_id = 1;
-    required string context_id = 2;
-    required State state = 3;
-    optional bytes result = 4; // e.g., return value from Task.call()
-    optional bool  recovery = 5;
-
-    // TaskMessageSource messages
-    message TaskMessageProto {
-        required string source_id = 1;
-        required bytes message = 2;
-    }
-    repeated TaskMessageProto task_message = 6;
-}
-
-message EvaluatorStatusProto {
-    required string evaluator_id = 1;
-    required State state = 2;
-    optional bytes error = 3;
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 54aca4c..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/MachineStatus.cs
+++ /dev/null
@@ -1,137 +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.Diagnostics;
-using System.Globalization;
-using Org.Apache.REEF.Utilities.Logging;
-
-namespace Org.Apache.REEF.Common.Runtime
-{
-    public class MachineStatus
-    {
-        private static PerformanceCounter _cpuCounter;
-
-        private static PerformanceCounter _ramCounter;
-
-        private static PerformanceCounter _processCpuCounter;
-
-        private static Process _process;
-
-        private static bool _checkStatus;
-
-        static MachineStatus()
-        {
-            _checkStatus = true;
-            _process = Process.GetCurrentProcess();
-            string processName = _process.ProcessName;
-
-            _cpuCounter = _cpuCounter ?? new PerformanceCounter()
-            {
-                CategoryName = "Processor",
-                CounterName = "% Processor Time",
-                InstanceName = "_Total",
-            };
-
-            _ramCounter = _ramCounter ?? new PerformanceCounter()
-            {
-                CategoryName = "Memory",
-                CounterName = "Available MBytes"
-            };
-
-            _processCpuCounter = _processCpuCounter ?? new PerformanceCounter()
-            {
-                CategoryName = "Process",
-                CounterName = "% Processor Time",
-                InstanceName = processName
-            };
-        }
-
-        public static string CurrentNodeCpuUsage
-        {
-            get
-            {
-                return _cpuCounter.NextValue() + "%";
-            }
-        }
-
-        public static string AvailableMemory
-        {
-            get
-            {
-                return _ramCounter.NextValue() + "MB";
-            }
-        }
-
-        public static string CurrentProcessMemoryUsage
-        {
-            get
-            {
-                return ((float)_process.WorkingSet64 / 1000000.0).ToString(CultureInfo.InvariantCulture) + "MB";
-            }
-        }
-
-        public static string PeakProcessMemoryUsage
-        {
-            get
-            {
-                return ((float)_process.PeakWorkingSet64 / 1000000.0).ToString(CultureInfo.InvariantCulture) + "MB";
-            }
-        }
-
-        // this may not be accurate if there are multiple evaluator processes running on a single machine
-        public static string CurrentProcessCpuUsage
-        {
-            get
-            {
-                return ((float)_processCpuCounter.RawValue / 1000000.0) + "%";
-            }
-        }
-
-        public override string ToString()
-        {
-            string info = "No machine status information retrieved. Could be due to lack of admin right to get the info.";
-            if (_checkStatus)
-            {
-                try
-                {
-                    _process.Refresh();
-                    info = string.Format(
-                    CultureInfo.InvariantCulture,
-                    "current node is running at [{0}] CPU usage and with [{1}] memory available.{2}             current evaluator process is using [{3}] of CPU and [{4}] of memory, with a peak memory usage of [{5}]",
-                    CurrentNodeCpuUsage,
-                    AvailableMemory,
-                    Environment.NewLine,
-                    CurrentProcessCpuUsage,
-                    CurrentProcessMemoryUsage,
-                    PeakProcessMemoryUsage);
-                }
-                catch (Exception e)
-                {
-                    _checkStatus = false; // It only takes one exception to switch the cheking 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.
-                    info = "Cannot obtain machine status due to error " + e.Message;
-                }
-            }
-            
-            return info;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/Constants.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/Constants.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/Constants.cs
deleted file mode 100644
index 97d705b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/Constants.cs
+++ /dev/null
@@ -1,40 +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.
- */
-
-namespace Org.Apache.REEF.Evaluator
-{
-    public class Constants
-    {
-        public const string RootContextConfiguration = "RootContextConfiguration";
-
-        public const string EvaluatorIdentifier = "EvaluatorIdentifier";
-
-        public const string RootServiceConfiguration = "RootServiceConfiguration";
-
-        public const string TaskConfiguration = "TaskConfiguration";
-
-        public const string ContextIdentifier = "ContextIdentifier";
-
-        public const string ApplicationIdentifier = "ApplicationIdentifier";
-
-        public const int DefaultEvaluatorHeartbeatPeriodInMs = 4000;
-
-        public const int DefaultEvaluatorHeartbeatMaxRetry = 3;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorRuntime.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorRuntime.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorRuntime.cs
deleted file mode 100644
index 217e24d..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorRuntime.cs
+++ /dev/null
@@ -1,255 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Evaluator;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Wake.Remote;
-using Org.Apache.REEF.Wake.Time;
-using Org.Apache.REEF.Wake.Time.Runtime.Event;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Common
-{
-    public class EvaluatorRuntime : IObserver<RuntimeStart>, IObserver<RuntimeStop>, IObserver<REEFMessage>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorRuntime));
-        
-        private readonly string _evaluatorId;
-
-        private readonly ContextManager _contextManager;
-
-        private readonly HeartBeatManager _heartBeatManager;
-
-        private readonly IRemoteManager<REEFMessage> _remoteManager;
-
-        private readonly IClock _clock;
-
-        private State _state = State.INIT;
-
-        private IDisposable _evaluatorControlChannel; 
-
-        [Inject]
-        public EvaluatorRuntime(
-            ContextManager contextManager,
-            HeartBeatManager heartBeatManager)
-        {
-            using (LOGGER.LogFunction("EvaluatorRuntime::EvaluatorRuntime"))
-            {
-                _clock = heartBeatManager.EvaluatorSettings.RuntimeClock;
-                _heartBeatManager = heartBeatManager;
-                _contextManager = contextManager;
-                _evaluatorId = heartBeatManager.EvaluatorSettings.EvalutorId;
-                _remoteManager = heartBeatManager.EvaluatorSettings.RemoteManager;
-
-                ReefMessageProtoObserver driverObserver = new ReefMessageProtoObserver();
-
-                // subscribe to driver proto message
-                driverObserver.Subscribe(o => OnNext(o.Message));
-
-                // register the driver observer
-                _evaluatorControlChannel = _remoteManager.RegisterObserver(driverObserver);
-
-                // start the hearbeat
-                _clock.ScheduleAlarm(0, heartBeatManager);
-            }
-        }
-
-        public State State
-        {
-            get
-            {
-                return _state;
-            }
-        }
-
-        public void Handle(EvaluatorControlProto message)
-        {
-            lock (_heartBeatManager)
-            {
-                LOGGER.Log(Level.Info, "Handle Evaluator control message");
-                if (!message.identifier.Equals(_evaluatorId, StringComparison.OrdinalIgnoreCase))
-                {
-                    Handle(new InvalidOperationException(
-                        string.Format(CultureInfo.InvariantCulture, "Identifier mismatch: message for evaluator id[{0}] sent to evaluator id[{1}]", message.identifier, _evaluatorId)));
-                }
-                else if (_state != State.RUNNING)
-                {
-                    Handle(new InvalidOperationException(
-                        string.Format(CultureInfo.InvariantCulture, "Evaluator received a control message but its state is not {0} but rather {1}", State.RUNNING, _state)));
-                }
-                else
-                {
-                    if (message.context_control != null)
-                    {
-                        LOGGER.Log(Level.Info, "Send task control message to ContextManager");
-                        try
-                        {
-                            _contextManager.HandleTaskControl(message.context_control);
-                            if (_contextManager.ContextStackIsEmpty() && _state == State.RUNNING)
-                            {
-                                LOGGER.Log(Level.Info, "Context stack is empty, done");
-                                _state = State.DONE;
-                                _heartBeatManager.OnNext(GetEvaluatorStatus());
-                                _clock.Dispose();
-                            }
-                        }
-                        catch (Exception e)
-                        {
-                            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
-                            Handle(e);
-                            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException(e.ToString(), e), LOGGER);
-                        }
-                    }
-                    if (message.kill_evaluator != null)
-                    {
-                        LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Evaluator {0} has been killed by the driver.", _evaluatorId));
-                        _state = State.KILLED;
-                        _clock.Dispose();
-                    }
-                }
-            }
-        }
-
-        public EvaluatorStatusProto GetEvaluatorStatus()
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Evaluator state : {0}", _state));
-            EvaluatorStatusProto evaluatorStatusProto = new EvaluatorStatusProto()
-            {
-                evaluator_id = _evaluatorId,
-                state = _state
-            };
-            return evaluatorStatusProto;
-        }
-
-        public void OnNext(RuntimeStart runtimeStart)
-        {
-            lock (_evaluatorId)
-            {
-                try
-                {
-                    LOGGER.Log(Level.Info, "Runtime start");
-                    if (_state != State.INIT)
-                    {
-                        var e = new InvalidOperationException("State should be init.");
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                    }
-                    _state = State.RUNNING;
-                    _contextManager.Start();
-                    _heartBeatManager.OnNext();
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
-                    Handle(e);
-                }
-            }
-        }
-
-        void IObserver<RuntimeStart>.OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<REEFMessage>.OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<REEFMessage>.OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<RuntimeStop>.OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<RuntimeStop>.OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<RuntimeStart>.OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnNext(RuntimeStop runtimeStop)
-        {
-            LOGGER.Log(Level.Info, "Runtime stop");
-            _contextManager.Dispose();
-
-            if (_state == State.RUNNING)
-            {
-                _state = State.DONE;
-                _heartBeatManager.OnNext();
-            }
-            try
-            {
-                _evaluatorControlChannel.Dispose();
-            }
-            catch (Exception e)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(new InvalidOperationException("Cannot stop evaluator properly", e), Level.Error, "Exception during shut down.", LOGGER);
-            }
-            LOGGER.Log(Level.Info, "EvaluatorRuntime shutdown complete");        
-        }
-
-        public void OnNext(REEFMessage value)
-        {
-            if (value != null && value.evaluatorControl != null)
-            {
-                LOGGER.Log(Level.Info, "Received a REEFMessage with EvaluatorControl");
-                Handle(value.evaluatorControl);
-            }
-        }
-
-        private void Handle(Exception e)
-        {
-            lock (_heartBeatManager)
-            {
-                LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "evaluator {0} failed with exception", _evaluatorId), e);
-                _state = State.FAILED;
-                string errorMessage = string.Format(
-                        CultureInfo.InvariantCulture,
-                        "failed with error [{0}] with mesage [{1}] and stack trace [{2}]",
-                        e,
-                        e.Message,
-                        e.StackTrace);
-                EvaluatorStatusProto evaluatorStatusProto = new EvaluatorStatusProto()
-                {
-                    evaluator_id = _evaluatorId,
-                    error = ByteUtilities.StringToByteArrays(errorMessage),
-                    state = _state
-                };
-                _heartBeatManager.OnNext(evaluatorStatusProto);
-                _contextManager.Dispose();
-            }       
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorSettings.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorSettings.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorSettings.cs
deleted file mode 100644
index bc939d9..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/EvaluatorSettings.cs
+++ /dev/null
@@ -1,185 +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 Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Common.Evaluator.Context;
-using Org.Apache.REEF.Common.io;
-using Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
-using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Wake.Remote;
-using Org.Apache.REEF.Wake.Time;
-using System;
-
-namespace Org.Apache.REEF.Evaluator
-{
-    // TODO: merge with EvaluatorConfigurations class
-    public class EvaluatorSettings
-    {
-        private string _applicationId;
-
-        private string _evaluatorId;
-
-        private int _heartBeatPeriodInMs;
-
-        private int _maxHeartbeatRetries;
-
-        private ContextConfiguration _rootContextConfig;
-
-        private IClock _clock;
-
-        private IRemoteManager<REEFMessage> _remoteManager;
-
-        private IInjector _injector;
-
-        private EvaluatorOperationState _operationState;
-
-        private INameClient _nameClient;
-
-        public EvaluatorSettings(
-            string applicationId,
-            string evaluatorId,
-            int heartbeatPeriodInMs,
-            int maxHeartbeatRetries,
-            ContextConfiguration rootContextConfig,
-            IClock clock,
-            IRemoteManager<REEFMessage> remoteManager,
-            IInjector injecor)
-        {
-            if (string.IsNullOrWhiteSpace(evaluatorId))
-            {
-                throw new ArgumentNullException("evaluatorId");
-            }
-            if (rootContextConfig == null)
-            {
-                throw new ArgumentNullException("rootContextConfig");
-            }
-            if (clock == null)
-            {
-                throw new ArgumentNullException("clock");
-            }
-            if (remoteManager == null)
-            {
-                throw new ArgumentNullException("remoteManager");
-            }
-            if (injecor == null)
-            {
-                throw new ArgumentNullException("injecor");
-            }
-            _applicationId = applicationId;
-            _evaluatorId = evaluatorId;
-            _heartBeatPeriodInMs = heartbeatPeriodInMs;
-            _maxHeartbeatRetries = maxHeartbeatRetries;
-            _rootContextConfig = rootContextConfig;
-            _clock = clock;
-            _remoteManager = remoteManager;
-            _injector = injecor;
-            _operationState = EvaluatorOperationState.OPERATIONAL;
-        }
-
-        public EvaluatorOperationState OperationState
-        {
-            get
-            {
-                return _operationState;
-            }
-
-            set
-            {
-                _operationState = value;
-            }
-        }
-
-        public string EvalutorId
-        {
-            get
-            {
-                return _evaluatorId;
-            }
-        }
-
-        public int HeartBeatPeriodInMs
-        {
-            get
-            {
-                return _heartBeatPeriodInMs;
-            }
-        }
-
-        public string ApplicationId
-        {
-            get
-            {
-                return _applicationId;
-            }
-        }
-
-        public int MaxHeartbeatFailures
-        {
-            get
-            {
-                return _maxHeartbeatRetries;
-            }
-        }
-
-        public ContextConfiguration RootContextConfig
-        {
-            get
-            {
-                return _rootContextConfig;
-            }
-        }
-
-        public IClock RuntimeClock
-        {
-            get
-            {
-                return _clock;
-            }
-        }
-
-        public INameClient NameClient
-        {
-            get
-            {
-                return _nameClient;
-            }
-
-            set
-            {
-                _nameClient = value;
-            }
-        }
-
-        public IRemoteManager<REEFMessage> RemoteManager
-        {
-            get
-            {
-                return _remoteManager;
-            }
-        }
-
-        public IInjector Injector
-        {
-            get
-            {
-                return _injector;
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/HeartBeatManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/HeartBeatManager.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/HeartBeatManager.cs
deleted file mode 100644
index 6d2121e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/HeartBeatManager.cs
+++ /dev/null
@@ -1,390 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Common.Runtime;
-using Org.Apache.REEF.Evaluator;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Wake.Remote;
-using Org.Apache.REEF.Wake.Remote.Impl;
-using Org.Apache.REEF.Wake.Time;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.Linq;
-using System.Net;
-using System.Threading;
-
-namespace Org.Apache.REEF.Common
-{
-    public class HeartBeatManager : IObserver<Alarm>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(HeartBeatManager));
-
-        private static readonly MachineStatus MachineStatus = new MachineStatus();
-
-        private readonly IRemoteManager<REEFMessage> _remoteManager;
-
-        private readonly IClock _clock;
-
-        private readonly int _heartBeatPeriodInMillSeconds;
-
-        private readonly int _maxHeartbeatRetries = 0;
-
-        private readonly string _evaluatorId;
-
-        private IRemoteIdentifier _remoteId;
-
-        private IObserver<REEFMessage> _observer;
-
-        private int _heartbeatFailures = 0;
-
-        private IDriverConnection _driverConnection;
-
-        private EvaluatorSettings _evaluatorSettings;
-
-        // the queue can only contains the following:
-        // 1. all failed heartbeats (regular and event-based) before entering RECOVERY state
-        // 2. event-based heartbeats generated in RECOVERY state (since there will be no attempt to send regular heartbeat)
-        private Queue<EvaluatorHeartbeatProto> _queuedHeartbeats = new Queue<EvaluatorHeartbeatProto>();
-
-        public HeartBeatManager(EvaluatorSettings settings, IRemoteIdentifier remoteId)
-        {
-            using (LOGGER.LogFunction("HeartBeatManager::HeartBeatManager"))
-            {
-                _remoteManager = settings.RemoteManager;
-                _remoteId = remoteId;
-                _evaluatorId = settings.EvalutorId;
-                _observer = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint<REEFMessage>(_remoteId));
-                _clock = settings.RuntimeClock;
-                _heartBeatPeriodInMillSeconds = settings.HeartBeatPeriodInMs;
-                _maxHeartbeatRetries = settings.MaxHeartbeatFailures;
-                EvaluatorSettings = settings;
-                MachineStatus.ToString(); // kick start the CPU perf counter
-            }
-        }
-
-        [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Intended to be private, exposed now before using future injection")]
-        public EvaluatorRuntime _evaluatorRuntime { get; set; }
-
-        [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter", Justification = "Intended to be private, exposed now before using future injection")]
-        public ContextManager _contextManager { get; set; }
-
-        public EvaluatorSettings EvaluatorSettings
-        {
-            get
-            {
-                return _evaluatorSettings;
-            }
-
-            private set
-            {
-                _evaluatorSettings = value;
-            }
-        }
-
-        public void Send(EvaluatorHeartbeatProto evaluatorHeartbeatProto)
-        {
-            lock (_queuedHeartbeats)
-            {
-                if (_evaluatorSettings.OperationState == EvaluatorOperationState.RECOVERY)
-                {
-                    LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "In RECOVERY mode, heartbeat queued as [{0}]. ", evaluatorHeartbeatProto));
-                    _queuedHeartbeats.Enqueue(evaluatorHeartbeatProto);
-                    return;
-                }
-
-                // NOT during recovery, try to send
-                REEFMessage payload = new REEFMessage(evaluatorHeartbeatProto);
-                try
-                {
-                    _observer.OnNext(payload);
-                    _heartbeatFailures = 0; // reset failure counts if we are having intermidtten (not continuous) failures
-                }
-                catch (Exception e)
-                {
-                    if (evaluatorHeartbeatProto.task_status == null || evaluatorHeartbeatProto.task_status.state != State.RUNNING)
-                    {
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, "Lost communications to driver when no task is running, recovery NOT supported for such scenario", LOGGER);
-                    }
-
-                    _heartbeatFailures++;
-
-                    _queuedHeartbeats.Enqueue(evaluatorHeartbeatProto);
-                    LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "Sending heartbeat to driver experienced #{0} failure. Hearbeat queued as: [{1}]. ", _heartbeatFailures, evaluatorHeartbeatProto), e);
-
-                    if (_heartbeatFailures >= _maxHeartbeatRetries)
-                    {
-                        LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Heartbeat communications to driver reached max of {0} failures. \n==== Driver is considered dead/unreachable. === \n=========== Entering RECOVERY mode. ===========", _heartbeatFailures));
-                        try
-                        {
-                            _driverConnection = _evaluatorSettings.Injector.GetInstance<IDriverConnection>();
-                        }
-                        catch (Exception ex)
-                        {
-                            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(ex, Level.Error, "Failed to inject the driver reconnect implementation", LOGGER);
-                        }
-                        LOGGER.Log(Level.Info, "instantiate driver reconnect implementation: " + _driverConnection);
-                        _evaluatorSettings.OperationState = EvaluatorOperationState.RECOVERY;
-
-                        // clean heartbeat failure
-                        _heartbeatFailures = 0;
-                    }
-                }
-            }     
-        }
-
-        /// <summary>
-        /// Assemble a complete new heartbeat and send it out.
-        /// </summary>
-        public void OnNext()
-        {
-            LOGGER.Log(Level.Verbose, "Before aqcuiring lock: HeartbeatManager::OnNext()");
-            lock (this)
-            {
-                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext()");
-                EvaluatorHeartbeatProto heartbeatProto = GetEvaluatorHeartbeatProto();
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
-                Send(heartbeatProto);
-            }
-        }
-
-        /// <summary>
-        /// Called with a specific TaskStatus that must be delivered to the driver
-        /// </summary>
-        /// <param name="taskStatusProto"></param>
-        public void OnNext(TaskStatusProto taskStatusProto)
-        {
-            LOGGER.Log(Level.Verbose, "Before aqcuiring lock: HeartbeatManager::OnNext(TaskStatusProto)");
-            lock (this)
-            {
-                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(TaskStatusProto)");
-                EvaluatorHeartbeatProto heartbeatProto = GetEvaluatorHeartbeatProto(
-                    _evaluatorRuntime.GetEvaluatorStatus(),
-                    _contextManager.GetContextStatusCollection(),
-                     Optional<TaskStatusProto>.Of(taskStatusProto));
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
-                Send(heartbeatProto);
-            }
-        }
-
-        /// <summary>
-        ///  Called with a specific ContextStatusProto that must be delivered to the driver
-        /// </summary>
-        /// <param name="contextStatusProto"></param>
-        public void OnNext(ContextStatusProto contextStatusProto)
-        {
-            LOGGER.Log(Level.Verbose, "Before aqcuiring lock: HeartbeatManager::OnNext(ContextStatusProto)");
-            lock (this)
-            {
-                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(ContextStatusProto)");
-                List<ContextStatusProto> contextStatusProtos = new List<ContextStatusProto>();
-                contextStatusProtos.Add(contextStatusProto);
-                contextStatusProtos.AddRange(_contextManager.GetContextStatusCollection());
-                EvaluatorHeartbeatProto heartbeatProto = GetEvaluatorHeartbeatProto(
-                    _evaluatorRuntime.GetEvaluatorStatus(),
-                    contextStatusProtos,
-                    Optional<TaskStatusProto>.Empty());
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
-                Send(heartbeatProto);
-            }
-        }
-
-        /// <summary>
-        /// Called with a specific EvaluatorStatus that must be delivered to the driver
-        /// </summary>
-        /// <param name="evaluatorStatusProto"></param>
-        public void OnNext(EvaluatorStatusProto evaluatorStatusProto)
-        {
-            LOGGER.Log(Level.Verbose, "Before acquring lock: HeartbeatManager::OnNext(EvaluatorStatusProto)");
-            lock (this)
-            {
-                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(EvaluatorStatusProto)");
-                EvaluatorHeartbeatProto heartbeatProto = new EvaluatorHeartbeatProto()
-                {
-                    timestamp = CurrentTimeMilliSeconds(),
-                    evaluator_status = evaluatorStatusProto
-                };
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}.", heartbeatProto));
-                Send(heartbeatProto);
-            }
-        }
-
-        public void OnNext(Alarm value)
-        {
-            LOGGER.Log(Level.Verbose, "Before acquring lock: HeartbeatManager::OnNext(Alarm)");
-            lock (this)
-            {
-                LOGGER.Log(Level.Verbose, "HeartbeatManager::OnNext(Alarm)");
-                if (_evaluatorSettings.OperationState == EvaluatorOperationState.OPERATIONAL && _evaluatorRuntime.State == State.RUNNING)
-                {
-                    EvaluatorHeartbeatProto evaluatorHeartbeatProto = GetEvaluatorHeartbeatProto();
-                    LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "Triggered a heartbeat: {0}. {1}Node Health: {2}", evaluatorHeartbeatProto, Environment.NewLine, MachineStatus.ToString()));
-                    Send(evaluatorHeartbeatProto);
-                    _clock.ScheduleAlarm(_heartBeatPeriodInMillSeconds, this);
-                }
-                else
-                {
-                    LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "Ignoring regular heartbeat since Evaluator operation state is [{0}] and runtime state is [{1}]. ", _evaluatorSettings.OperationState,  _evaluatorRuntime.State));
-                    try
-                    {
-                        DriverInformation driverInformation = _driverConnection.GetDriverInformation(_evaluatorSettings.ApplicationId);
-                        if (driverInformation == null)
-                        {
-                            LOGGER.Log(Level.Verbose, "In RECOVERY mode, cannot retrieve driver information, will try again later.");
-                        }
-                        else
-                        {
-                            LOGGER.Log(
-                                Level.Info, 
-                                string.Format(CultureInfo.InvariantCulture, "Detect driver restarted at {0} and is running on endpoint {1} with services {2}. Now trying to re-establish connection", driverInformation.DriverStartTime, driverInformation.DriverRemoteIdentifier, driverInformation.NameServerId));
-                            Recover(driverInformation);
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        // we do not want any exception to stop the query for driver status
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, LOGGER);
-                    }
-                    _clock.ScheduleAlarm(_heartBeatPeriodInMillSeconds, this);
-                }
-            }
-        }
-
-        public void OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        private static long CurrentTimeMilliSeconds()
-        {
-            // this is an implmenation to get current time milli second counted from Jan 1st, 1970
-            // it is chose as such to be compatible with java implmentation
-            DateTime jan1St1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
-            return (long)(DateTime.UtcNow - jan1St1970).TotalMilliseconds;
-        }
-
-        private void Recover(DriverInformation driverInformation)
-        {
-            IPEndPoint driverEndpoint = NetUtilities.ParseIpEndpoint(driverInformation.DriverRemoteIdentifier);
-            _remoteId = new SocketRemoteIdentifier(driverEndpoint);
-            _observer = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint<REEFMessage>(_remoteId));
-            lock (_evaluatorSettings)
-            {
-                if (_evaluatorSettings.NameClient != null)
-                {
-                    try
-                    {
-                        LOGGER.Log(Level.Verbose, "Trying to reset and reconnect to name server" + driverInformation.NameServerId);
-                        _evaluatorSettings.NameClient.Restart(NetUtilities.ParseIpEndpoint(driverInformation.NameServerId));
-                        LOGGER.Log(Level.Info, "Reconnected to name server: " + driverInformation.NameServerId);
-                    }
-                    catch (Exception e)
-                    {
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
-                    }
-                }
-            }
-
-            lock (_queuedHeartbeats)
-            {
-                bool firstHeartbeatInQueue = true;
-                while (_queuedHeartbeats.Any())
-                {
-                    LOGGER.Log(Level.Info, "Sending cached recovery heartbeats to " + _remoteId);
-                    try
-                    {
-                        if (firstHeartbeatInQueue)
-                        {
-                            // first heartbeat is specially construted to include the recovery flag
-                            EvaluatorHeartbeatProto recoveryHeartbeat = ConstructRecoveryHeartBeat(_queuedHeartbeats.Dequeue());
-                            LOGGER.Log(Level.Info, "Recovery heartbeat to be sent:" + recoveryHeartbeat);
-                            _observer.OnNext(new REEFMessage(recoveryHeartbeat));
-                            firstHeartbeatInQueue = false;
-                        }
-                        else
-                        {
-                            _observer.OnNext(new REEFMessage(_queuedHeartbeats.Dequeue()));
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        // we do not handle failures during RECOVERY 
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(
-                            e,
-                            Level.Error,
-                            string.Format(CultureInfo.InvariantCulture, "Hearbeat attempt failed in RECOVERY mode to Driver {0} , giving up...", _remoteId),
-                            LOGGER);
-                    }
-                    Thread.Sleep(500);
-                }
-            }        
-            _evaluatorSettings.OperationState = EvaluatorOperationState.OPERATIONAL;
-            LOGGER.Log(Level.Info, "=========== Exiting RECOVERY mode. ===========");
-        }
-
-        private EvaluatorHeartbeatProto ConstructRecoveryHeartBeat(EvaluatorHeartbeatProto heartbeat)
-        {
-            heartbeat.recovery = true;
-            heartbeat.context_status.ForEach(c => c.recovery = true);
-            heartbeat.task_status.recovery = true;
-            return heartbeat;
-        }
-
-        private EvaluatorHeartbeatProto GetEvaluatorHeartbeatProto()
-        {
-            return GetEvaluatorHeartbeatProto(
-                _evaluatorRuntime.GetEvaluatorStatus(),
-                _contextManager.GetContextStatusCollection(),
-                _contextManager.GetTaskStatus());
-        }
-
-        private EvaluatorHeartbeatProto GetEvaluatorHeartbeatProto(
-            EvaluatorStatusProto evaluatorStatusProto,
-            ICollection<ContextStatusProto> contextStatusProtos,
-            Optional<TaskStatusProto> taskStatusProto)
-        {
-            EvaluatorHeartbeatProto evaluatorHeartbeatProto = new EvaluatorHeartbeatProto()
-            {
-                timestamp = CurrentTimeMilliSeconds(),
-                evaluator_status = evaluatorStatusProto
-            };
-            foreach (ContextStatusProto contextStatusProto in contextStatusProtos)
-            {
-                evaluatorHeartbeatProto.context_status.Add(contextStatusProto);
-            }
-            if (taskStatusProto.IsPresent())
-            {
-                evaluatorHeartbeatProto.task_status = taskStatusProto.Value;
-            }
-            return evaluatorHeartbeatProto;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/ReefMessageProtoObserver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/ReefMessageProtoObserver.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/ReefMessageProtoObserver.cs
deleted file mode 100644
index 5593e08..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/ReefMessageProtoObserver.cs
+++ /dev/null
@@ -1,140 +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 Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Wake.Remote;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace Org.Apache.REEF.Common
-{
-    public class ReefMessageProtoObserver :
-        IObserver<IRemoteMessage<REEFMessage>>,
-        IObservable<IRemoteMessage<REEFMessage>>,
-        IDisposable
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ReefMessageProtoObserver));
-        private volatile IObserver<IRemoteMessage<REEFMessage>> _observer = null;
-        private long _count = 0;
-        private DateTime _begin;
-        private DateTime _origBegin;
-
-        public void OnCompleted()
-        {
-        }
-
-        public void OnError(Exception error)
-        {
-        }
-
-        public void OnNext(IRemoteMessage<REEFMessage> value)
-        {
-            REEFMessage remoteEvent = value.Message;
-            IRemoteIdentifier id = value.Identifier;
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "receive a ReefMessage from {0} Driver at {1}.", remoteEvent, id));
-
-            if (remoteEvent.evaluatorControl != null)
-            {
-                if (remoteEvent.evaluatorControl.context_control != null)
-                {
-                    string context_message = null;
-                    string task_message = null;
-
-                    if (remoteEvent.evaluatorControl.context_control.context_message != null)
-                    {
-                        context_message = remoteEvent.evaluatorControl.context_control.context_message.ToString();
-                    }
-                    if (remoteEvent.evaluatorControl.context_control.task_message != null)
-                    {
-                        task_message = ByteUtilities.ByteArrarysToString(remoteEvent.evaluatorControl.context_control.task_message);
-                    }
-
-                    if (!(string.IsNullOrEmpty(context_message) && string.IsNullOrEmpty(task_message)))
-                    {
-                        LOGGER.Log(Level.Info, 
-                            string.Format(CultureInfo.InvariantCulture, "Control protobuf with context message [{0}] and task message [{1}]", context_message, task_message));
-                    }                   
-                    else if (remoteEvent.evaluatorControl.context_control.remove_context != null)
-                    {
-                         LOGGER.Log(Level.Info, 
-                            string.Format(CultureInfo.InvariantCulture, "Control protobuf to remove context {0}", remoteEvent.evaluatorControl.context_control.remove_context.context_id));
-                    }
-                    else if (remoteEvent.evaluatorControl.context_control.add_context != null)
-                    {
-                        LOGGER.Log(Level.Info, 
-                            string.Format(CultureInfo.InvariantCulture, "Control protobuf to add a context on top of {0}", remoteEvent.evaluatorControl.context_control.add_context.parent_context_id));
-                    }
-                    else if (remoteEvent.evaluatorControl.context_control.start_task != null)
-                    {
-                        LOGGER.Log(Level.Info, 
-                            string.Format(CultureInfo.InvariantCulture, "Control protobuf to start an task in {0}", remoteEvent.evaluatorControl.context_control.start_task.context_id));
-                    }
-                    else if (remoteEvent.evaluatorControl.context_control.stop_task != null)
-                    {
-                        LOGGER.Log(Level.Info, "Control protobuf to stop task");
-                    }
-                    else if (remoteEvent.evaluatorControl.context_control.suspend_task != null)
-                    {
-                        LOGGER.Log(Level.Info, "Control protobuf to suspend task"); 
-                    }
-                }
-            } 
-            if (_count == 0)
-            {
-                _begin = DateTime.Now;
-                _origBegin = _begin;
-            }
-            var count = Interlocked.Increment(ref _count);
-
-            int printBatchSize = 100000;
-            if (count % printBatchSize == 0)
-            {
-                DateTime end = DateTime.Now;
-                var diff = (end - _begin).TotalMilliseconds;
-                double seconds = diff / 1000.0;
-                long eventsPerSecond = (long)(printBatchSize / seconds);
-                _begin = DateTime.Now;
-            }
-
-            var observer = _observer;
-            if (observer != null)
-            {
-                observer.OnNext(value);
-            }
-        }
-
-        public IDisposable Subscribe(IObserver<IRemoteMessage<REEFMessage>> observer)
-        {
-            if (_observer != null)
-            {
-                return null;
-            }
-            _observer = observer;
-            return this;
-        }
-
-        public void Dispose()
-        {
-            _observer = null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextClientCodeException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextClientCodeException.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextClientCodeException.cs
deleted file mode 100644
index 3a0b474..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextClientCodeException.cs
+++ /dev/null
@@ -1,70 +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 Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public class ContextClientCodeException : Exception
-    {
-        private readonly string _contextId;
-        private readonly Optional<string> _parentId;
-
-        /// <summary>
-        /// construt the exception that caused the error
-        /// </summary>
-        /// <param name="contextId"> the id of the failed context.</param>
-        /// <param name="parentId"> the id of the failed context's parent, if any.</param>
-        /// <param name="message"> the error message </param>
-        /// <param name="cause"> the exception that caused the error</param>
-        public ContextClientCodeException(
-                string contextId,
-                Optional<string> parentId,
-                string message,
-                Exception cause)
-            : base("Failure in context '" + contextId + "': " + message, cause)
-        {
-            _contextId = contextId;
-            _parentId = parentId;
-        }
-
-        public string ContextId
-        {
-            get { return _contextId; }
-        }
-
-        public Optional<string> ParentId
-        {
-            get { return _parentId; }
-        }
-
-        /// <summary>
-        /// Extracts a context id from the given configuration.
-        /// </summary>
-        /// <param name="c"></param>
-        /// <returns>the context id in the given configuration.</returns>
-        public static string GetId(IConfiguration c)
-        {
-            // TODO: update after TANG is available
-            return string.Empty;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextConfiguration.cs
deleted file mode 100644
index bcd7fb0..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextConfiguration.cs
+++ /dev/null
@@ -1,140 +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 Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using Org.Apache.REEF.Tang.Types;
-
-namespace Org.Apache.REEF.Common.Evaluator.Context
-{
-    public class ContextConfiguration : IConfiguration
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextConfiguration));
-        
-        private Dictionary<string, string> _settings;
-
-        public ContextConfiguration(string configString)
-        {
-            using (LOGGER.LogFunction("ContextConfiguration::ContextConfigurationn"))
-            {
-                ContainerDirectory = Directory.GetCurrentDirectory();
-
-                _settings = new Dictionary<string, string>();
-                AvroConfiguration avroConfiguration = AvroConfiguration.GetAvroConfigurationFromEmbeddedString(configString);
-                foreach (ConfigurationEntry config in avroConfiguration.Bindings)
-                {
-                    if (config.key.Contains(REEF.Evaluator.Constants.ContextIdentifier))
-                    {
-                        config.key = REEF.Evaluator.Constants.ContextIdentifier;
-                        LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "{0} detected for context id with value {1}", config.key, config.value));
-                    }
-                    _settings.Add(config.key, config.value);
-                }
-                if (!_settings.ContainsKey(REEF.Evaluator.Constants.ContextIdentifier))
-                {
-                    string msg = "Required parameter ContextIdentifier not provided.";
-                    LOGGER.Log(Level.Error, msg);
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException(msg), LOGGER);
-                }
-            }
-        }
-
-        public string Id
-        {
-            get { return _settings[REEF.Evaluator.Constants.ContextIdentifier]; }
-        }
-
-        public string ContainerDirectory { get; set; }
-
-        public IConfigurationBuilder newBuilder()
-        {
-            throw new NotImplementedException();
-        }
-
-        public string GetNamedParameter(INamedParameterNode np)
-        {
-            throw new NotImplementedException();
-        }
-
-        public IClassHierarchy GetClassHierarchy()
-        {
-            throw new NotImplementedException();
-        }
-
-        public ISet<object> GetBoundSet(INamedParameterNode np)
-        {
-            throw new NotImplementedException();
-        }
-
-        public IClassNode GetBoundConstructor(IClassNode cn)
-        {
-            throw new NotImplementedException();
-        }
-
-        public IClassNode GetBoundImplementation(IClassNode cn)
-        {
-            throw new NotImplementedException();
-        }
-
-        public IConstructorDef GetLegacyConstructor(IClassNode cn)
-        {
-            throw new NotImplementedException();
-        }
-
-        public ICollection<IClassNode> GetBoundImplementations()
-        {
-            throw new NotImplementedException();
-        }
-
-        public ICollection<IClassNode> GetBoundConstructors()
-        {
-            throw new NotImplementedException();
-        }
-
-        public ICollection<INamedParameterNode> GetNamedParameters()
-        {
-            throw new NotImplementedException();
-        }
-
-        public ICollection<IClassNode> GetLegacyConstructors()
-        {
-            throw new NotImplementedException();
-        }
-
-        public IList<object> GetBoundList(INamedParameterNode np)
-        {
-            throw new NotImplementedException();
-        }
-
-        public IEnumerator<KeyValuePair<INamedParameterNode, object>> GetBoundSets()
-        {
-            throw new NotImplementedException();
-        }
-
-        public IDictionary<INamedParameterNode, IList<object>> GetBoundList()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextLifeCycle.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextLifeCycle.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextLifeCycle.cs
deleted file mode 100644
index 97e65c0..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextLifeCycle.cs
+++ /dev/null
@@ -1,105 +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 Org.Apache.REEF.Common.Events;
-using System;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    /// <summary>
-    /// This class is used to trigger all the context life-cycle dependent events.
-    /// </summary>
-    class ContextLifeCycle
-    {
-        private HashSet<IObserver<IContextStart>> _contextStartHandlers;
-
-        private HashSet<IObserver<IContextStop>> _contextStopHandlers;
-
-        private HashSet<IContextMessageSource> _contextMessageSources;
-
-        // @Inject
-        public ContextLifeCycle(
-            string id,
-            HashSet<IObserver<IContextStart>> contextStartHandlers,
-            HashSet<IObserver<IContextStop>> contextStopHandlers,
-            HashSet<IContextMessageSource> contextMessageSources)
-        {
-            Id = id;
-            _contextStartHandlers = contextStartHandlers;
-            _contextStopHandlers = contextStopHandlers;
-            _contextMessageSources = contextMessageSources;
-        }
-
-        public ContextLifeCycle(string contextId)
-        {
-            Id = contextId;
-            _contextStartHandlers = new HashSet<IObserver<IContextStart>>();
-            _contextStopHandlers = new HashSet<IObserver<IContextStop>>();
-            _contextMessageSources = new HashSet<IContextMessageSource>();
-        }
-
-        public string Id { get; private set; }
-
-        public HashSet<IContextMessageSource> ContextMessageSources
-        {
-            get { return _contextMessageSources; }
-        }
-
-        /// <summary>
-        /// Fires ContextStart to all registered event handlers.
-        /// </summary>
-        public void Start()
-        {
-            IContextStart contextStart = new ContextStartImpl(Id);
-            
-            // TODO: enable
-            //foreach (IObserver<IContextStart> startHandler in _contextStartHandlers)
-            //{
-            //    startHandler.OnNext(contextStart);
-            //}
-        }
-
-        /// <summary>
-        /// Fires ContextStop to all registered event handlers.
-        /// </summary>
-        public void Close()
-        {
-            //IContextStop contextStop = new ContextStopImpl(Id);
-            //foreach (IObserver<IContextStop> startHandler in _contextStopHandlers)
-            //{
-            //    startHandler.OnNext(contextStop);
-            //}
-        }
-
-        public void HandleContextMessage(byte[] message)
-        {
-            //contextMessageHandler.onNext(message);
-        }
-
-        /// <summary>
-        /// get the set of ContextMessageSources configured
-        /// </summary>
-        /// <returns>(a shallow copy of) the set of ContextMessageSources configured.</returns>
-        public HashSet<IContextMessageSource> GetContextMessageSources()
-        {
-            return new HashSet<IContextMessageSource>(_contextMessageSources);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 7c4d288..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextManager.cs
+++ /dev/null
@@ -1,362 +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 Org.Apache.REEF.Common.Evaluator.Context;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Evaluator;
-using Org.Apache.REEF.Services;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Globalization;
-using System.Linq;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public class ContextManager : IDisposable
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextManager));
-        
-        private readonly Stack<ContextRuntime> _contextStack = new Stack<ContextRuntime>();
-
-        private readonly HeartBeatManager _heartBeatManager;
-
-        private RootContextLauncher _rootContextLauncher;
-
-        public ContextManager(HeartBeatManager heartBeatManager, Optional<ServiceConfiguration> rootServiceConfig, Optional<TaskConfiguration> rootTaskConfig)
-        {
-            using (LOGGER.LogFunction("ContextManager::ContextManager"))
-            {
-                _heartBeatManager = heartBeatManager;
-                _rootContextLauncher = new RootContextLauncher(_heartBeatManager.EvaluatorSettings.RootContextConfig, rootServiceConfig, rootTaskConfig);
-            }
-        }
-
-        /// <summary>
-        /// Start the context manager. This initiates the root context.
-        /// </summary>
-        public void Start()
-        {
-            lock (_contextStack)
-            {
-                ContextRuntime rootContext = _rootContextLauncher.GetRootContext();
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Instantiating root context with Id {0}", rootContext.Id));
-                _contextStack.Push(rootContext);
-
-                if (_rootContextLauncher.RootTaskConfig.IsPresent())
-                {
-                    LOGGER.Log(Level.Info, "Launching the initial Task");
-                    try
-                    {
-                        _contextStack.Peek().StartTask(_rootContextLauncher.RootTaskConfig.Value, _rootContextLauncher.RootContextConfig.Id, _heartBeatManager);
-                    }
-                    catch (TaskClientCodeException e)
-                    {
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Exception when trying to start a task.", LOGGER);
-                        HandleTaskException(e);
-                    }
-                }
-            }
-        }
-
-        public bool ContextStackIsEmpty()
-        {
-            lock (_contextStack)
-            {
-                return (_contextStack.Count == 0);
-            }
-        }
-
-        // TODO: codes here are slightly different from java since the protobuf.net does not generate the HasXXX method, may want to switch to proto-port later
-
-        /// <summary>
-        /// Processes the given ContextControlProto to launch / close / suspend Tasks and Contexts.
-        /// This also triggers the HeartBeatManager to send a heartbeat with the result of this operation.
-        /// </summary>
-        /// <param name="controlMessage"></param>
-        public void HandleTaskControl(ContextControlProto controlMessage)
-        {
-            try
-            {
-                byte[] message = controlMessage.task_message;
-                if (controlMessage.add_context != null && controlMessage.remove_context != null)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException("Received a message with both add and remove context. This is unsupported."), LOGGER);
-                }
-                if (controlMessage.add_context != null)
-                {
-                    LOGGER.Log(Level.Info, "AddContext");
-                    AddContext(controlMessage.add_context);
-                    // support submitContextAndTask()
-                    if (controlMessage.start_task != null)
-                    {
-                        LOGGER.Log(Level.Info, "StartTask");
-                        StartTask(controlMessage.start_task);
-                    }
-                    else
-                    {
-                        // We need to trigger a heartbeat here. In other cases, the heartbeat will be triggered by the TaskRuntime
-                        // Therefore this call can not go into addContext
-                        LOGGER.Log(Level.Info, "Trigger Heartbeat");
-                        _heartBeatManager.OnNext();
-                    }
-                }
-                else if (controlMessage.remove_context != null)
-                {
-                    LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "RemoveContext with id {0}", controlMessage.remove_context.context_id));
-                    RemoveContext(controlMessage.remove_context.context_id);
-                }
-                else if (controlMessage.start_task != null)
-                {
-                    LOGGER.Log(Level.Info, "StartTask only");
-                    StartTask(controlMessage.start_task);
-                }
-                else if (controlMessage.stop_task != null)
-                {
-                    LOGGER.Log(Level.Info, "CloseTask");
-                    _contextStack.Peek().CloseTask(message);
-                }
-                else if (controlMessage.suspend_task != null)
-                {
-                    LOGGER.Log(Level.Info, "SuspendTask");
-                    _contextStack.Peek().SuspendTask(message);
-                }
-                else if (controlMessage.task_message != null)
-                {
-                    LOGGER.Log(Level.Info, "DeliverTaskMessage");
-                    _contextStack.Peek().DeliverTaskMessage(message);
-                }
-                else if (controlMessage.context_message != null)
-                {
-                    LOGGER.Log(Level.Info, "Handle context contol message");
-                    ContextMessageProto contextMessageProto = controlMessage.context_message;
-                    bool deliveredMessage = false;
-                    foreach (ContextRuntime context in _contextStack)
-                    {
-                        if (context.Id.Equals(contextMessageProto.context_id))
-                        {
-                            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Handle context message {0}", controlMessage.context_message.message));
-                            context.HandleContextMessaage(controlMessage.context_message.message);
-                            deliveredMessage = true;
-                            break;
-                        }
-                    }
-                    if (!deliveredMessage)
-                    {
-                        InvalidOperationException e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Sent message to unknown context {0}", contextMessageProto.context_id));
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                    }
-                }
-                else
-                {
-                    InvalidOperationException e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Unknown task control message: {0}", controlMessage.ToString()));
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                } 
-            }
-            catch (Exception e)
-            {
-                if (e is TaskClientCodeException)
-                {
-                    HandleTaskException((TaskClientCodeException)e);
-                }
-                else if (e is ContextClientCodeException)
-                {
-                    HandlContextException((ContextClientCodeException)e);
-                }
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, LOGGER);
-            }  
-        }
-
-        /// <summary>
-        /// Get TaskStatusProto of the currently running task, if there is any
-        /// </summary>
-        /// <returns>the TaskStatusProto of the currently running task, if there is any</returns>
-        public Optional<TaskStatusProto> GetTaskStatus()
-        {
-            if (_contextStack.Count == 0)
-            {
-                return Optional<TaskStatusProto>.Empty();
-
-                //throw new InvalidOperationException("Asked for an Task status while there isn't even a context running.");
-            }
-            return _contextStack.Peek().GetTaskStatus();
-        }
-
-        /// <summary>
-        /// get status of all contexts in the stack.
-        /// </summary>
-        /// <returns>the status of all contexts in the stack.</returns>
-        public ICollection<ContextStatusProto> GetContextStatusCollection()
-        {
-            ICollection<ContextStatusProto> result = new Collection<ContextStatusProto>();
-            foreach (ContextRuntime runtime in _contextStack)
-            {
-                ContextStatusProto contextStatusProto = runtime.GetContextStatus();
-                LOGGER.Log(Level.Verbose, string.Format(CultureInfo.InvariantCulture, "Add context status: {0}", contextStatusProto));
-                result.Add(contextStatusProto);
-            }
-            return result;
-        }
-
-        /// <summary>
-        /// Shuts down. This forecefully kills the Task if there is one and then shuts down all Contexts on the stack,
-        /// starting at the top.
-        /// </summary>
-        public void Dispose()
-        {
-            lock (_contextStack)
-            {
-                if (_contextStack != null && _contextStack.Any())
-                {
-                    LOGGER.Log(Level.Info, "context stack not empty, forcefully closing context runtime.");
-                    ContextRuntime runtime = _contextStack.Last();
-                    if (runtime != null)
-                    {
-                        runtime.Dispose();
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Add a context to the stack.
-        /// </summary>
-        /// <param name="addContextProto"></param>
-        private void AddContext(AddContextProto addContextProto)
-        {
-            lock (_contextStack)
-            {
-                ContextRuntime currentTopContext = _contextStack.Peek();
-                if (!currentTopContext.Id.Equals(addContextProto.parent_context_id, StringComparison.OrdinalIgnoreCase))
-                {
-                    var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Trying to instantiate a child context on context with id '{0}' while the current top context id is {1}",
-                        addContextProto.parent_context_id,
-                        currentTopContext.Id));
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                string contextConfigString = addContextProto.context_configuration;
-                ContextConfiguration contextConfiguration = new ContextConfiguration(contextConfigString);
-                ContextRuntime newTopContext;
-                if (addContextProto.service_configuration != null)
-                {
-                    ServiceConfiguration serviceConfiguration = new ServiceConfiguration(addContextProto.service_configuration);
-                    newTopContext = currentTopContext.SpawnChildContext(contextConfiguration, serviceConfiguration.TangConfig);
-                }
-                else
-                {
-                    newTopContext = currentTopContext.SpawnChildContext(contextConfiguration);
-                }
-                _contextStack.Push(newTopContext);
-            }
-        }
-
-        /// <summary>
-        /// Remove the context with the given ID from the stack.
-        /// </summary>
-        /// <param name="contextId"> context id</param>
-        private void RemoveContext(string contextId)
-        {
-            lock (_contextStack)
-            {
-                string currentTopContextId = _contextStack.Peek().Id;
-                if (!contextId.Equals(_contextStack.Peek().Id, StringComparison.OrdinalIgnoreCase))
-                {
-                    var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Trying to close context with id '{0}' while the top context id is {1}", contextId, currentTopContextId));
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                _contextStack.Peek().Dispose();
-                if (_contextStack.Count > 1)
-                {
-                    // We did not close the root context. Therefore, we need to inform the
-                    // driver explicitly that this context is closed. The root context notification
-                    // is implicit in the Evaluator close/done notification.
-                    _heartBeatManager.OnNext(); // Ensure Driver gets notified of context DONE state
-                }
-                _contextStack.Pop();
-            }
-            //  System.gc(); // TODO: garbage collect?
-        }
-
-        /// <summary>
-        /// Launch an Task.
-        /// </summary>
-        /// <param name="startTaskProto"></param>
-        private void StartTask(StartTaskProto startTaskProto)
-        {
-            lock (_contextStack)
-            {
-                ContextRuntime currentActiveContext = _contextStack.Peek();
-                string expectedContextId = startTaskProto.context_id;
-                if (!expectedContextId.Equals(currentActiveContext.Id, StringComparison.OrdinalIgnoreCase))
-                {
-                    var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task expected context '{0}' but the active context has Id '{1}'", expectedContextId, currentActiveContext.Id));
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                TaskConfiguration taskConfiguration = new TaskConfiguration(startTaskProto.configuration);
-                currentActiveContext.StartTask(taskConfiguration, expectedContextId, _heartBeatManager);
-            }
-        }
-
-        /// <summary>
-        ///  THIS ASSUMES THAT IT IS CALLED ON A THREAD HOLDING THE LOCK ON THE HeartBeatManager
-        /// </summary>
-        /// <param name="e"></param>
-        private void HandleTaskException(TaskClientCodeException e)
-        {
-            LOGGER.Log(Level.Error, "TaskClientCodeException", e);
-            byte[] exception = ByteUtilities.StringToByteArrays(e.ToString());
-            TaskStatusProto taskStatus = new TaskStatusProto()
-            {
-                context_id = e.ContextId,
-                task_id = e.TaskId,
-                result = exception,
-                state = State.FAILED
-            };
-            LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "Sending Heartbeatb for a failed task: {0}", taskStatus.ToString()));
-            _heartBeatManager.OnNext(taskStatus);
-        }
-
-        /// <summary>
-        /// THIS ASSUMES THAT IT IS CALLED ON A THREAD HOLDING THE LOCK ON THE HeartBeatManager
-        /// </summary>
-        /// <param name="e"></param>
-        private void HandlContextException(ContextClientCodeException e)
-        {
-            LOGGER.Log(Level.Error, "ContextClientCodeException", e);
-            byte[] exception = ByteUtilities.StringToByteArrays(e.ToString());
-            ContextStatusProto contextStatusProto = new ContextStatusProto()
-            {
-                context_id = e.ContextId,
-                context_state = ContextStatusProto.State.FAIL,
-                error = exception
-            };
-            if (e.ParentId.IsPresent())
-            {
-                contextStatusProto.parent_id = e.ParentId.Value;
-            }
-            LOGGER.Log(Level.Error, string.Format(CultureInfo.InvariantCulture, "Sending Heartbeat for a failed context: {0}", contextStatusProto.ToString()));
-            _heartBeatManager.OnNext(contextStatusProto);
-        }
-    }
-}
\ No newline at end of file


[17/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/RAM.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/RAM.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/RAM.cs
new file mode 100644
index 0000000..94358e3
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/RAM.cs
@@ -0,0 +1,51 @@
+/**
+ * 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.Globalization;
+
+namespace Org.Apache.REEF.Common.Catalog.Capabilities
+{
+    public class RAM : ICapability
+    {
+        private int _megaBytes;
+
+        public RAM(int megaBytes)
+        {
+            _megaBytes = megaBytes;
+        }
+
+        public int MegaBytes
+        {
+            get
+            {
+                return _megaBytes;
+            }
+        }
+
+        public override string ToString()
+        {
+            return string.Format(CultureInfo.InvariantCulture, "RAM(in mega bytes) = [{0}]", MegaBytes);
+        }
+
+        public override int GetHashCode()
+        {
+            return MegaBytes.GetHashCode();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/INodeDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/INodeDescriptor.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/INodeDescriptor.cs
new file mode 100644
index 0000000..e6222a9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/INodeDescriptor.cs
@@ -0,0 +1,35 @@
+/**
+ * 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.Net;
+using Org.Apache.REEF.Common.Catalog.Capabilities;
+
+namespace Org.Apache.REEF.Common.Catalog
+{
+    public interface INodeDescriptor
+    {
+        IPEndPoint InetSocketAddress { get; set; }
+
+        string HostName { get; set; }
+
+        CPU Cpu { get; set; }
+
+        RAM Ram { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/IRackDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/IRackDescriptor.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/IRackDescriptor.cs
new file mode 100644
index 0000000..5e6bb32
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/IRackDescriptor.cs
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Catalog
+{
+    public interface IRackDescriptor : IResourceCatalog
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/IResourceCatalog.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/IResourceCatalog.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/IResourceCatalog.cs
new file mode 100644
index 0000000..dd2adf3
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/IResourceCatalog.cs
@@ -0,0 +1,37 @@
+/**
+ * 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.Common.Catalog.Capabilities;
+
+namespace Org.Apache.REEF.Common.Catalog
+{
+    public interface IResourceCatalog
+    {
+        string Name { get; set; }
+
+        ICollection<ICapability> Capabilities { get; set; }
+
+        ICollection<INodeDescriptor> Nodes { get; set; }
+
+        ICollection<IRackDescriptor> Racks { get; set; }
+
+        INodeDescriptor GetNode(string nodeId);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/NodeDescriptorImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/NodeDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/NodeDescriptorImpl.cs
new file mode 100644
index 0000000..0e2cb90
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/NodeDescriptorImpl.cs
@@ -0,0 +1,116 @@
+/**
+ * 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 System.Net;
+using Org.Apache.REEF.Common.Catalog.Capabilities;
+
+namespace Org.Apache.REEF.Common.Catalog
+{
+    public class NodeDescriptorImpl : INodeDescriptor
+    {
+        private RackDescriptorImpl _rack;
+
+        private string _id;
+
+        private IPEndPoint _address;
+
+        private RAM _ram;
+
+        private IList<ICapability> _capabilities;
+
+        public NodeDescriptorImpl()
+        {
+        }
+
+        public NodeDescriptorImpl(string id, IPEndPoint addresss, RackDescriptorImpl rack, RAM ram)
+        {
+            _id = id;
+            _address = addresss;
+            _rack = rack;
+            _ram = ram;
+            _capabilities = new List<ICapability>();
+            _rack.AddNodeDescriptor(this);
+        }
+
+        public RackDescriptorImpl Rack 
+        {
+            get
+            {
+                return _rack;
+            }
+        }
+
+        public string Id
+        {
+            get
+            {
+                return _id;
+            }
+        }
+
+        public string HostName { get; set; }
+
+        public CPU Cpu
+        {
+            get
+            {
+                return new CPU(1);
+            }
+
+            set
+            {
+            }
+        }
+
+        public RAM Ram
+        {
+            get
+            {
+                return _ram;
+            }
+
+            set
+            {
+                _ram = value;
+            }
+        }
+
+        public IList<ICapability> Capabilities
+        {
+            get
+            {
+                return _capabilities;
+            }
+        }
+
+        public IPEndPoint InetSocketAddress
+        {
+            get
+            {
+                return _address;
+            }
+
+            set
+            {
+                _address = value;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/RackDescriptorImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/RackDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/RackDescriptorImpl.cs
new file mode 100644
index 0000000..02a3715
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/RackDescriptorImpl.cs
@@ -0,0 +1,75 @@
+/**
+ * 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.Text;
+using Org.Apache.REEF.Common.Catalog.Capabilities;
+
+namespace Org.Apache.REEF.Common.Catalog
+{
+    public class RackDescriptorImpl : IRackDescriptor
+    {
+        public RackDescriptorImpl(string name)
+        {
+            Name = name;
+            Capabilities = new List<ICapability>();
+            Nodes = new List<INodeDescriptor>();
+        }
+
+        public string Name { get; set; }
+
+        public ICollection<ICapability> Capabilities { get; set; }
+
+        public ICollection<INodeDescriptor> Nodes { get; set; }
+
+        public ICollection<IRackDescriptor> Racks { get; set; }
+
+        public INodeDescriptor GetNode(string nodeId)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void AddNodeDescriptor(NodeDescriptorImpl node)
+        {
+            Nodes.Add(node);
+        }
+
+        public override string ToString()
+        {
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder.Append("Rack " + Name);
+            foreach (INodeDescriptor nodeDescriptor in Nodes)
+            {
+                stringBuilder.Append(Environment.NewLine + nodeDescriptor);
+            }
+            return stringBuilder.ToString();
+        }
+
+        public override int GetHashCode()
+        {
+            return Name.GetHashCode();
+        }
+
+        public override bool Equals(object obj)
+        {
+            return base.Equals(obj);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/ResourceCatalogImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/ResourceCatalogImpl.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/ResourceCatalogImpl.cs
new file mode 100644
index 0000000..22947ca
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/ResourceCatalogImpl.cs
@@ -0,0 +1,95 @@
+/**
+ * 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.Utilities.Logging;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Net;
+using System.Text;
+using Org.Apache.REEF.Common.Catalog.Capabilities;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+
+namespace Org.Apache.REEF.Common.Catalog
+{
+    public class ResourceCatalogImpl : IResourceCatalog
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ResourceCatalogImpl));
+        
+        private static string defaultRackName = "default-rack";
+
+        private Dictionary<string, RackDescriptorImpl> _racks = new Dictionary<string, RackDescriptorImpl>();
+ 
+        private Dictionary<string, NodeDescriptorImpl> _nodes = new Dictionary<string, NodeDescriptorImpl>();
+
+        public string Name { get; set; }
+
+        public ICollection<ICapability> Capabilities { get; set; }
+
+        public ICollection<INodeDescriptor> Nodes { get; set; }
+
+        public ICollection<IRackDescriptor> Racks { get; set; }
+
+        public INodeDescriptor GetNode(string nodeId)
+        {
+            return _nodes[nodeId];
+        }
+
+        public void Handle(NodeDescriptorProto node)
+        {
+            string rackName = node.rack_name == null ? node.rack_name : defaultRackName;
+            string message = string.Format(
+                CultureInfo.InvariantCulture,
+                "Catalog new node: id[{0}], rack[{1}], host[{2}], port[{3}], memory[{4}]",
+                node.identifier,
+                rackName,
+                node.host_name,
+                node.port,
+                node.memory_size);
+            LOGGER.Log(Level.Info, message);
+            if (!string.IsNullOrWhiteSpace(rackName) && !_racks.ContainsKey(rackName))
+            {
+                RackDescriptorImpl newRack = new RackDescriptorImpl(rackName);
+                _racks.Add(rackName, newRack);
+            }
+            RackDescriptorImpl rack = _racks[rackName];
+            IPAddress ipAddress = null;
+            IPAddress.TryParse(node.host_name, out ipAddress);
+            if (ipAddress == null)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("cannot parse host ipaddress: " + node.host_name), LOGGER);
+            }
+            IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, node.port);
+            RAM ram = new RAM(node.memory_size);
+            NodeDescriptorImpl nodeDescriptor = new NodeDescriptorImpl(node.identifier, ipEndPoint, rack, ram);
+            _nodes.Add(nodeDescriptor.Id, nodeDescriptor);
+        }
+
+        public override string ToString()
+        {
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder.Append("=== Resource Catalog ===");
+            foreach (IRackDescriptor rackDescriptor in Racks)
+            {
+                stringBuilder.Append(Environment.NewLine + rackDescriptor);
+            }
+            return stringBuilder.ToString();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 84e916f..158161c 100644
--- a/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs
+++ b/lang/cs/Org.Apache.REEF.Common/ClientJobStatusHandler.cs
@@ -17,15 +17,13 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.Client;
-using Org.Apache.REEF.Common.ProtoBuf.ClienRuntimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
 using Org.Apache.REEF.Utilities;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Wake.Remote;
 using Org.Apache.REEF.Wake.Time;
 using System;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Wake.Time.Event;
 
 namespace Org.Apache.REEF.Common
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Context/ContextMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Context/ContextMessage.cs b/lang/cs/Org.Apache.REEF.Common/Context/ContextMessage.cs
new file mode 100644
index 0000000..7f9b226
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Context/ContextMessage.cs
@@ -0,0 +1,66 @@
+/**
+ * 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.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Context
+{
+    public class ContextMessage
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextMessage));
+        private readonly string _messageSourcId;
+        private readonly byte[] _bytes;
+
+        private ContextMessage(string messageSourceId, byte[] bytes)
+        {
+            _messageSourcId = messageSourceId;
+            _bytes = bytes;
+        }
+
+        public string MessageSourceId
+        {
+            get { return _messageSourcId; }
+        }
+
+        public byte[] Bytes
+        {
+            get { return _bytes; }
+        }
+
+        /// <summary>
+        /// construt a new new ContextMessage with the given content.
+        /// </summary>
+        /// <param name="messageSourceId">The message's sourceID. This will be accessible in the Driver for routing.</param>
+        /// <param name="bytes">The actual content of the message, serialized into a byte[]</param>
+        /// <returns>new ContextMessage with the given content.</returns>
+        public static ContextMessage From(string messageSourceId, byte[] bytes)
+        {
+            if (string.IsNullOrEmpty(messageSourceId))
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("messageSourceId"), LOGGER);
+            }
+            if (bytes == null)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("bytes"), LOGGER);
+            }
+            return new ContextMessage(messageSourceId, bytes);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Context/IContextMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Context/IContextMessage.cs b/lang/cs/Org.Apache.REEF.Common/Context/IContextMessage.cs
new file mode 100644
index 0000000..7d7a298
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Context/IContextMessage.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Common.Context
+{
+    public interface IContextMessage : IMessage, IIdentifiable
+    {
+        string MessageSourceId { get; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageHandler.cs
new file mode 100644
index 0000000..044d0af
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageHandler.cs
@@ -0,0 +1,27 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Common.Context
+{
+    public interface IContextMessageHandler : IObserver<byte[]>
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageSource.cs
new file mode 100644
index 0000000..d1eb08c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Context/IContextMessageSource.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Common.Context
+{
+    public interface IContextMessageSource
+    {
+        Optional<ContextMessage> Message { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultLocalHttpDriverConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultLocalHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultLocalHttpDriverConnection.cs
new file mode 100644
index 0000000..26049e6
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultLocalHttpDriverConnection.cs
@@ -0,0 +1,45 @@
+/**
+ * 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;
+using System;
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public class DefaultLocalHttpDriverConnection : IDriverConnection
+    {
+        private readonly Uri _queryUri;
+
+        [Inject]
+        public DefaultLocalHttpDriverConnection()
+        {
+            _queryUri = new Uri(
+                    string.Concat(
+                    Constants.LocalHttpEndpointBaseUri,
+                    Constants.HttpReefUriSpecification,
+                    Constants.HttpDriverUriTarget));
+        }
+
+        public DriverInformation GetDriverInformation(string applicationId)
+        {
+            // application id not needed for local runtime
+            return DriverInformation.GetDriverInformationFromHttp(_queryUri);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..e0076e7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnClusterHttpDriverConnection.cs
@@ -0,0 +1,44 @@
+/**
+ * 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;
+using System;
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public class DefaultYarnClusterHttpDriverConnection : IDriverConnection
+    {
+        [Inject]
+        public DefaultYarnClusterHttpDriverConnection()
+        {
+        }
+
+        public DriverInformation GetDriverInformation(string applicationId)
+        {
+            // e.g., http://headnodehost:9014/proxy/application_1407519727821_0012/reef/v1/driver
+            Uri queryUri = new Uri(
+                string.Concat(
+                Constants.HDInsightClusterHttpEndpointBaseUri,
+                applicationId,
+                Constants.HttpReefUriSpecification,
+                Constants.HttpDriverUriTarget));
+            return DriverInformation.GetDriverInformationFromHttp(queryUri);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnOneBoxHttpDriverConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnOneBoxHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnOneBoxHttpDriverConnection.cs
new file mode 100644
index 0000000..9a4974c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/DefaultYarnOneBoxHttpDriverConnection.cs
@@ -0,0 +1,46 @@
+/**
+ * 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;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public class DefaultYarnOneBoxHttpDriverConnection : IDriverConnection
+    {
+        [Inject]
+        public DefaultYarnOneBoxHttpDriverConnection()
+        {
+        }
+
+        public DriverInformation GetDriverInformation(string applicationId)
+        {
+            // e.g., http://yingdac1:8088/proxy/application_1407519727821_0012/reef/v1/driver
+            string oneBoxHost = string.Format(CultureInfo.InvariantCulture, "http://{0}:8088/proxy/", Environment.MachineName);
+            Uri queryUri = new Uri(
+                string.Concat(
+                oneBoxHost,
+                applicationId,
+                Constants.HttpReefUriSpecification,
+                Constants.HttpDriverUriTarget));
+            return DriverInformation.GetDriverInformationFromHttp(queryUri);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverInformation.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverInformation.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverInformation.cs
new file mode 100644
index 0000000..055784e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/DriverInformation.cs
@@ -0,0 +1,136 @@
+/**
+ * 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.Common.Avro;
+using Org.Apache.REEF.Utilities.Logging;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public class DriverInformation
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DriverInformation));
+        
+        private string _rid;
+
+        private string _startTime;
+
+        private string _nameServerId;
+
+        private IList<AvroReefServiceInfo> _services;
+
+        public DriverInformation(string rid, string startTime, IList<AvroReefServiceInfo> services)
+        {
+            _rid = rid;
+            _startTime = startTime;
+            _services = services;
+
+            if (_services == null)
+            {
+                LOGGER.Log(Level.Warning, "no services information from driver.");
+            }
+            else
+            {
+                AvroReefServiceInfo nameServerInfo =
+                  _services.FirstOrDefault(
+                      s => s.serviceName.Equals(Constants.NameServerServiceName, StringComparison.OrdinalIgnoreCase));
+                if (nameServerInfo != null)
+                {
+                    _nameServerId = nameServerInfo.serviceInfo;
+                }
+            }  
+        }
+
+        public string DriverRemoteIdentifier
+        {
+            get
+            {
+                return _rid;
+            }
+        }
+
+        public string DriverStartTime
+        {
+            get
+            {
+                return _startTime;
+            }
+        }
+
+        public string NameServerId
+        {
+            get
+            {
+                return _nameServerId;
+            }
+        }
+
+        public static DriverInformation GetDriverInformationFromHttp(Uri queryUri)
+        {
+            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(queryUri);
+            request.AllowAutoRedirect = false;
+            request.KeepAlive = false;
+            request.ContentType = "text/html";
+
+            string driverInfomation;
+            AvroDriverInfo info = null;
+            try
+            {
+                using (HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse())
+                {
+                    Stream stream = webResponse.GetResponseStream();
+                    if (stream == null)
+                    {
+                        return null;
+                    }
+                    using (StreamReader streamReader = new StreamReader(stream, Encoding.UTF8))
+                    {
+                        driverInfomation = streamReader.ReadToEnd();
+                        LOGGER.Log(Level.Verbose, "Http response line: " + driverInfomation);
+                        info = AvroJsonSerializer<AvroDriverInfo>.FromString(driverInfomation);
+                    }
+                }
+            }
+            catch (WebException)
+            {
+                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "In RECOVERY mode, cannot connect to [{0}] for driver information, will try again later.", queryUri));
+                return null;
+            }
+            catch (Exception e)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, string.Format(CultureInfo.InvariantCulture, "Cannot read content from {0}.", queryUri), LOGGER);
+            }
+
+            if (info != null)
+            {
+                LOGGER.Log(
+                    Level.Verbose, 
+                    string.Format(CultureInfo.InvariantCulture, "Driver information extracted with remote identier [{0}], start time [{1}], and servics [{2}]", info.remoteId, info.startTime, info.services));
+                return new DriverInformation(info.remoteId, info.startTime, info.services);
+            }
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorOperationState.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorOperationState.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorOperationState.cs
new file mode 100644
index 0000000..22ffa67
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorOperationState.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.
+ */
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public enum EvaluatorOperationState
+    {
+        /// <summary>
+        /// default state
+        /// </summary>
+        UNINITIATED = 0,
+
+        /// <summary>
+        /// normal operational state
+        /// </summary>
+        OPERATIONAL = 1,
+
+        /// <summary>
+        /// in the process of recovering 
+        /// </summary>
+        RECOVERY = 2
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorRuntimeState.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorRuntimeState.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorRuntimeState.cs
new file mode 100644
index 0000000..cc879bb
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorRuntimeState.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.
+ */
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public enum EvaluatorRuntimeState
+    {
+        /// <summary>
+        /// default state
+        /// </summary>
+        UNINITIATED = 0,
+
+        /// <summary>
+        /// normal operational state
+        /// </summary>
+        RUNNING = 1,
+
+        /// <summary>
+        /// in the process of recovering 
+        /// </summary>
+        RECOVERY = 2
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorType.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorType.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorType.cs
new file mode 100644
index 0000000..4269dd2
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/EvaluatorType.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.
+ */
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public enum EvaluatorType
+    {
+        /// <summary>
+        /// default  type
+        /// </summary>
+        UNDECIDED = 0,
+
+        /// <summary>
+        /// Indicates an Evaluator that runs on the JVM
+        /// </summary>
+        JVM = 1,
+
+        /// <summary>
+        /// Indicates an Evaluator that runs on the CLR
+        /// </summary>
+        CLR = 2
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Evaluator/IDriverConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Evaluator/IDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/Evaluator/IDriverConnection.cs
new file mode 100644
index 0000000..10c6d6e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Evaluator/IDriverConnection.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Evaluator
+{
+    public interface IDriverConnection
+    {
+        DriverInformation GetDriverInformation(string applicationId);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Events/IContextStart.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Events/IContextStart.cs b/lang/cs/Org.Apache.REEF.Common/Events/IContextStart.cs
new file mode 100644
index 0000000..924f2c4
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Events/IContextStart.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Events
+{
+    public interface IContextStart
+    {
+        string Id { get; set; }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Events/IContextStop.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Events/IContextStop.cs b/lang/cs/Org.Apache.REEF.Common/Events/IContextStop.cs
new file mode 100644
index 0000000..bdc5a73
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Events/IContextStop.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Events
+{
+    public interface IContextStop
+    {
+        string Id { get; set; }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Exceptions/EvaluatorException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Exceptions/EvaluatorException.cs b/lang/cs/Org.Apache.REEF.Common/Exceptions/EvaluatorException.cs
new file mode 100644
index 0000000..d1bb558
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Exceptions/EvaluatorException.cs
@@ -0,0 +1,75 @@
+/**
+ * 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.Utilities;
+using System;
+using Org.Apache.REEF.Common.Tasks;
+
+namespace Org.Apache.REEF.Common.Exceptions
+{
+    public class EvaluatorException : System.Exception, IIdentifiable
+    {
+        private readonly string _evaluatorId;
+
+        public EvaluatorException(string evaluatorId)
+        {
+            _evaluatorId = evaluatorId;
+            RunningTask = null;
+        }
+
+        public EvaluatorException(string evaluatorId, string message, System.Exception cause)
+            : base(message, cause)
+        {
+            _evaluatorId = evaluatorId;
+            RunningTask = null;
+        }
+
+        public EvaluatorException(string evaluatorId, string message)
+            : this(evaluatorId, message, (IRunningTask)null)
+        {
+        }
+
+        public EvaluatorException(string evaluatorId, string message, IRunningTask runningTask)
+            : base(message)
+        {
+            _evaluatorId = evaluatorId;
+            RunningTask = runningTask;
+        }
+
+        public EvaluatorException(string evaluatorId, System.Exception cause)
+            : this(evaluatorId, cause, null)
+        {
+        }
+
+        public EvaluatorException(string evaluatorId, Exception cause, IRunningTask runningTask)
+            : base(string.Empty, cause)
+        {
+            _evaluatorId = evaluatorId;
+            RunningTask = runningTask;
+        }
+
+        public IRunningTask RunningTask { get; set; }
+
+        public string Id
+        {
+            get { return _evaluatorId; }
+            set { }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Exceptions/JobException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Exceptions/JobException.cs b/lang/cs/Org.Apache.REEF.Common/Exceptions/JobException.cs
new file mode 100644
index 0000000..e379b92
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Exceptions/JobException.cs
@@ -0,0 +1,58 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Common.Exceptions
+{
+    public class JobException : Exception, IIdentifiable
+    {
+        private string _jobId;
+
+        public JobException(string jobId)
+        {
+            _jobId = jobId;
+        }
+
+        public JobException(string jobId, string message, Exception cause) 
+            : base(message, cause)
+        {
+            _jobId = jobId;
+        }
+
+        public JobException(string jobId, string message)
+            : base(message)
+        {
+            _jobId = jobId;
+        }
+
+        public JobException(string jobId, Exception cause)
+            : base(string.Empty, cause)
+        {
+            _jobId = jobId;
+        }
+
+        public string Id
+        {
+            get { return _jobId; }
+            set { }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/FailedRuntime.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/FailedRuntime.cs b/lang/cs/Org.Apache.REEF.Common/FailedRuntime.cs
index 078feb8..2ac6781 100644
--- a/lang/cs/Org.Apache.REEF.Common/FailedRuntime.cs
+++ b/lang/cs/Org.Apache.REEF.Common/FailedRuntime.cs
@@ -18,9 +18,9 @@
  */
 
 using Org.Apache.REEF.Common.Api;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
 using Org.Apache.REEF.Utilities;
 using System;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 
 namespace Org.Apache.REEF.Common
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/IJobMessageObserver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/IJobMessageObserver.cs b/lang/cs/Org.Apache.REEF.Common/IJobMessageObserver.cs
index 0de5039..b1ba4ed 100644
--- a/lang/cs/Org.Apache.REEF.Common/IJobMessageObserver.cs
+++ b/lang/cs/Org.Apache.REEF.Common/IJobMessageObserver.cs
@@ -19,7 +19,7 @@
 
 using System;
 
-namespace Org.Apache.REEF.Common.Client
+namespace Org.Apache.REEF.Common
 {
     /// <summary>
     ///  The driver uses this interface to communicate with the job client.

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Io/INameClient.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Io/INameClient.cs b/lang/cs/Org.Apache.REEF.Common/Io/INameClient.cs
new file mode 100644
index 0000000..8fc1f2d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Io/INameClient.cs
@@ -0,0 +1,71 @@
+/**
+ * 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.Net;
+
+namespace Org.Apache.REEF.Common.Io
+{
+    /// <summary>
+    /// Client for the Reef name service. 
+    /// Used to register, unregister, and lookup IP Addresses of known hosts.
+    /// </summary>
+    public interface INameClient : IDisposable
+    {
+        /// <summary>
+        /// Registers the identifier with the NameService.  
+        /// Overwrites the previous mapping if the identifier has already 
+        /// been registered.
+        /// </summary>
+        /// <param name="id">The key used to map the remote endpoint</param>
+        /// <param name="endpoint">The endpoint to map</param>
+        void Register(string id, IPEndPoint endpoint);
+
+        /// <summary>
+        /// Unregisters the remote identifier with the NameService
+        /// </summary>
+        /// <param name="id">The identifier to unregister</param>
+        void Unregister(string id);
+
+        /// <summary>
+        /// Looks up the IPEndpoint for the registered identifier.
+        /// </summary>
+        /// <param name="id">The identifier to look up</param>
+        /// <returns>The mapped IPEndpoint for the identifier, or null if
+        /// the identifier has not been registered with the NameService</returns>
+        IPEndPoint Lookup(string id);
+
+        /// <summary>
+        /// Looks up the IPEndpoint for each of the registered identifiers in the list.
+        /// </summary>
+        /// <param name="ids">The list of identifiers to look up</param>
+        /// <returns>The list of NameAssignments representing a pair of identifer
+        /// and mapped IPEndpoint for that identifier.  If any of the requested identifiers
+        /// are not registered with the NameService, their corresponding NameAssignment
+        /// IPEndpoint value will be null.</returns>
+        List<NameAssignment> Lookup(List<string> ids);
+
+        /// <summary>
+        /// Restart the name client in case of failure.
+        /// </summary>
+        /// <param name="serverEndpoint">The new server endpoint to connect to</param>
+        void Restart(IPEndPoint serverEndpoint);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Io/NameAssignment.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Io/NameAssignment.cs b/lang/cs/Org.Apache.REEF.Common/Io/NameAssignment.cs
new file mode 100644
index 0000000..bfd97a2
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Io/NameAssignment.cs
@@ -0,0 +1,60 @@
+/**
+ * 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.Net;
+using System.Net.Sockets;
+
+namespace Org.Apache.REEF.Common.Io
+{
+    /// <summary>
+    /// Tuple containing the string identifier and IPEndpoint.
+    /// Used by NameServer and NameClient
+    /// </summary>
+    public class NameAssignment
+    {
+        public NameAssignment(string id, IPEndPoint endpoint)
+        {
+            Identifier = id;
+            Endpoint = endpoint;
+        }
+
+        public NameAssignment(string id, string address, int port)
+        {
+            Identifier = id;
+            IPAddress ipAddress;
+            if (!IPAddress.TryParse(address, out ipAddress))
+            {
+                IPHostEntry hostEntry = Dns.GetHostEntry(address);
+                foreach (var ip in hostEntry.AddressList)
+                {
+                    if (ip.AddressFamily == AddressFamily.InterNetwork)
+                    {
+                        ipAddress = ip;
+                        break;
+                    }
+                }
+            }
+            Endpoint = new IPEndPoint(ipAddress, port);
+        }
+
+        public string Identifier { get; set; }
+
+        public IPEndPoint Endpoint { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Io/NamingConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Io/NamingConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/Io/NamingConfiguration.cs
new file mode 100644
index 0000000..0f922dd
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Io/NamingConfiguration.cs
@@ -0,0 +1,45 @@
+/**
+ * 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.Diagnostics.CodeAnalysis;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Util;
+
+namespace Org.Apache.REEF.Common.Io
+{
+    public class NamingConfiguration : ConfigurationModuleBuilder
+    {
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly RequiredParameter<string> NameServerAddress = new RequiredParameter<string>();
+
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly RequiredParameter<int> NameServerPort = new RequiredParameter<int>();
+
+        public static ConfigurationModule ConfigurationModule
+        {
+            get
+            {
+                return new NamingConfiguration()
+                    .BindNamedParameter(GenericType<NamingConfigurationOptions.NameServerAddress>.Class, NameServerAddress)
+                    .BindNamedParameter(GenericType<NamingConfigurationOptions.NameServerPort>.Class, NameServerPort)
+                    .Build();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Io/NamingConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Io/NamingConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/Io/NamingConfigurationOptions.cs
new file mode 100644
index 0000000..8e7e91d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Io/NamingConfigurationOptions.cs
@@ -0,0 +1,36 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Common.Io
+{
+    public class NamingConfigurationOptions
+    {
+        [NamedParameter("IP address of NameServer")]
+        public class NameServerAddress : Name<string>
+        {
+        }
+
+        [NamedParameter("Port of NameServer")]
+        public class NameServerPort : Name<int>
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 572af49..85e48b7 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
@@ -28,7 +28,7 @@ under the License.
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <RestorePackages>true</RestorePackages>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..</SolutionDir>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
   </PropertyGroup>
   <Import Project="$(SolutionDir)\build.props" />
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -95,117 +95,114 @@ under the License.
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="api\AbstractFailure.cs" />
-    <Compile Include="api\IAbstractFailure.cs" />
-    <Compile Include="api\IFailure.cs" />
-    <Compile Include="api\IResourceLaunchHandler.cs" />
-    <Compile Include="api\IResourceReleaseHandler.cs" />
-    <Compile Include="api\IResourceRequestHandler.cs" />
-    <Compile Include="avro\AvroDriverInfo.cs" />
-    <Compile Include="avro\AvroHttpRequest.cs" />
-    <Compile Include="avro\AvroHttpSerializer.cs" />
-    <Compile Include="avro\AvroJsonSerializer.cs" />
-    <Compile Include="avro\AvroReefServiceInfo.cs" />
-    <Compile Include="catalog\capabilities\CPU.cs" />
-    <Compile Include="catalog\capabilities\ICapability.cs" />
-    <Compile Include="catalog\capabilities\RAM.cs" />
-    <Compile Include="catalog\INodeDescriptor.cs" />
-    <Compile Include="catalog\IRackDescriptor.cs" />
-    <Compile Include="catalog\IResourceCatalog.cs" />
-    <Compile Include="catalog\NodeDescriptorImpl.cs" />
-    <Compile Include="catalog\RackDescriptorImpl.cs" />
-    <Compile Include="catalog\ResourceCatalogImpl.cs" />
+    <Compile Include="Api\AbstractFailure.cs" />
+    <Compile Include="Api\IAbstractFailure.cs" />
+    <Compile Include="Api\IFailure.cs" />
+    <Compile Include="Api\IResourceLaunchHandler.cs" />
+    <Compile Include="Api\IResourceReleaseHandler.cs" />
+    <Compile Include="Api\IResourceRequestHandler.cs" />
+    <Compile Include="Avro\AvroDriverInfo.cs" />
+    <Compile Include="Avro\AvroHttpRequest.cs" />
+    <Compile Include="Avro\AvroHttpSerializer.cs" />
+    <Compile Include="Avro\AvroJsonSerializer.cs" />
+    <Compile Include="Avro\AvroReefServiceInfo.cs" />
+    <Compile Include="Catalog\Capabilities\CPU.cs" />
+    <Compile Include="Catalog\Capabilities\ICapability.cs" />
+    <Compile Include="Catalog\Capabilities\RAM.cs" />
+    <Compile Include="Catalog\INodeDescriptor.cs" />
+    <Compile Include="Catalog\IRackDescriptor.cs" />
+    <Compile Include="Catalog\IResourceCatalog.cs" />
+    <Compile Include="Catalog\NodeDescriptorImpl.cs" />
+    <Compile Include="Catalog\RackDescriptorImpl.cs" />
+    <Compile Include="Catalog\ResourceCatalogImpl.cs" />
     <Compile Include="ClientJobStatusHandler.cs" />
     <Compile Include="Constants.cs" />
-    <Compile Include="context\ContextMessage.cs" />
-    <Compile Include="context\IContextMessage.cs" />
-    <Compile Include="context\IContextMessageHandler.cs" />
-    <Compile Include="context\IContextMessageSource.cs" />
+    <Compile Include="Context\ContextMessage.cs" />
+    <Compile Include="Context\IContextMessage.cs" />
+    <Compile Include="Context\IContextMessageHandler.cs" />
+    <Compile Include="Context\IContextMessageSource.cs" />
     <Compile Include="EvaluatorHeartBeatSanityChecker.cs" />
-    <Compile Include="evaluator\DefaultLocalHttpDriverConnection.cs" />
-    <Compile Include="evaluator\DefaultYarnClusterHttpDriverConnection.cs" />
-    <Compile Include="evaluator\DefaultYarnOneBoxHttpDriverConnection.cs" />
-    <Compile Include="evaluator\DriverInformation.cs" />
-    <Compile Include="evaluator\EvaluatorOperationState.cs" />
-    <Compile Include="evaluator\EvaluatorRuntimeState.cs" />
-    <Compile Include="evaluator\EvaluatorType.cs" />
-    <Compile Include="evaluator\IDriverConnection.cs" />
-    <Compile Include="events\IContextStart.cs" />
-    <Compile Include="events\IContextStop.cs" />
-    <Compile Include="exceptions\EvaluatorException.cs" />
-    <Compile Include="exceptions\JobException.cs" />
+    <Compile Include="Evaluator\DefaultLocalHttpDriverConnection.cs" />
+    <Compile Include="Evaluator\DefaultYarnClusterHttpDriverConnection.cs" />
+    <Compile Include="Evaluator\DefaultYarnOneBoxHttpDriverConnection.cs" />
+    <Compile Include="Evaluator\DriverInformation.cs" />
+    <Compile Include="Evaluator\EvaluatorOperationState.cs" />
+    <Compile Include="Evaluator\EvaluatorRuntimeState.cs" />
+    <Compile Include="Evaluator\EvaluatorType.cs" />
+    <Compile Include="Evaluator\IDriverConnection.cs" />
+    <Compile Include="Events\IContextStart.cs" />
+    <Compile Include="Events\IContextStop.cs" />
+    <Compile Include="Exceptions\EvaluatorException.cs" />
+    <Compile Include="Exceptions\JobException.cs" />
     <Compile Include="FailedRuntime.cs" />
     <Compile Include="IContextAndTaskSubmittable.cs" />
     <Compile Include="IContextSubmittable.cs" />
     <Compile Include="IJobMessageObserver.cs" />
-    <Compile Include="io\INameClient.cs" />
-    <Compile Include="io\NameAssignment.cs" />
-    <Compile Include="io\NamingConfiguration.cs" />
-    <Compile Include="io\NamingConfigurationOptions.cs" />
+    <Compile Include="Io\INameClient.cs" />
+    <Compile Include="Io\NameAssignment.cs" />
+    <Compile Include="Io\NamingConfiguration.cs" />
+    <Compile Include="Io\NamingConfigurationOptions.cs" />
     <Compile Include="ITaskSubmittable.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="protobuf\cs\ClientRuntime.pb.cs" />
-    <Compile Include="protobuf\cs\codec\EvaluatorHeartbeatProtoCodec.cs" />
-    <Compile Include="protobuf\cs\codec\REEFMessageCodec.cs" />
-    <Compile Include="protobuf\cs\DriverRuntime.pb.cs" />
-    <Compile Include="protobuf\cs\EvaluatorRunTime.pb.cs" />
-    <Compile Include="protobuf\cs\ReefProtocol.pb.cs" />
-    <Compile Include="protobuf\cs\ReefService.pb.cs" />
-    <Compile Include="protobuf\cs\Serializer.cs" />
-    <Compile Include="runtime\evaluator\Constants.cs" />
-    <Compile Include="runtime\evaluator\context\ContextClientCodeException.cs" />
-    <Compile Include="runtime\evaluator\context\ContextConfiguration.cs" />
-    <Compile Include="runtime\evaluator\context\ContextLifeCycle.cs" />
-    <Compile Include="runtime\evaluator\context\ContextManager.cs" />
-    <Compile Include="runtime\evaluator\context\ContextRuntime.cs" />
-    <Compile Include="runtime\evaluator\context\ContextStartImpl.cs" />
-    <Compile Include="runtime\evaluator\context\ContextStopImpl.cs" />
-    <Compile Include="runtime\evaluator\context\RootContextLauncher.cs" />
-    <Compile Include="runtime\evaluator\EvaluatorRuntime.cs" />
-    <Compile Include="runtime\evaluator\EvaluatorSettings.cs" />
-    <Compile Include="runtime\evaluator\HeartBeatManager.cs" />
-    <Compile Include="runtime\evaluator\ReefMessageProtoObserver.cs" />
-    <Compile Include="runtime\evaluator\task\CloseEventImpl.cs" />
-    <Compile Include="runtime\evaluator\task\DriverMessageImpl.cs" />
-    <Compile Include="runtime\evaluator\task\SuspendEventImpl.cs" />
-    <Compile Include="runtime\evaluator\task\TaskClientCodeException.cs" />
-    <Compile Include="runtime\evaluator\task\TaskLifeCycle.cs" />
-    <Compile Include="runtime\evaluator\task\TaskRuntime.cs" />
-    <Compile Include="runtime\evaluator\task\TaskStartImpl.cs" />
-    <Compile Include="runtime\evaluator\task\TaskState.cs" />
-    <Compile Include="runtime\evaluator\task\TaskStatus.cs" />
-    <Compile Include="runtime\evaluator\task\TaskStopImpl.cs" />
-    <Compile Include="runtime\evaluator\utils\EvaluatorConfigurations.cs" />
-    <Compile Include="runtime\evaluator\utils\RemoteManager.cs" />
+    <Compile Include="Protobuf\ReefProtocol\ClientRuntime.pb.cs" />
+    <Compile Include="Protobuf\ReefProtocol\DriverRuntime.pb.cs" />
+    <Compile Include="Protobuf\ReefProtocol\EvaluatorHeartbeatProtoCodec.cs" />
+    <Compile Include="Protobuf\ReefProtocol\EvaluatorRunTime.pb.cs" />
+    <Compile Include="Protobuf\ReefProtocol\REEFMessageCodec.cs" />
+    <Compile Include="Protobuf\ReefProtocol\ReefProtocol.pb.cs" />
+    <Compile Include="Protobuf\ReefProtocol\ReefService.pb.cs" />
+    <Compile Include="Protobuf\ReefProtocol\Serializer.cs" />
+    <Compile Include="Runtime\Evaluator\Constants.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextClientCodeException.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextConfiguration.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextLifeCycle.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextManager.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextRuntime.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextStartImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Context\ContextStopImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Context\RootContextLauncher.cs" />
+    <Compile Include="Runtime\Evaluator\EvaluatorRuntime.cs" />
+    <Compile Include="Runtime\Evaluator\EvaluatorSettings.cs" />
+    <Compile Include="Runtime\Evaluator\HeartBeatManager.cs" />
+    <Compile Include="Runtime\Evaluator\ReefMessageProtoObserver.cs" />
+    <Compile Include="Runtime\Evaluator\Task\CloseEventImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Task\DriverMessageImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Task\SuspendEventImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskClientCodeException.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskLifeCycle.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskRuntime.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskStartImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskState.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskStatus.cs" />
+    <Compile Include="Runtime\Evaluator\Task\TaskStopImpl.cs" />
+    <Compile Include="Runtime\Evaluator\Utils\EvaluatorConfigurations.cs" />
+    <Compile Include="Runtime\Evaluator\Utils\RemoteManager.cs" />
     <Compile Include="runtime\MachineStatus.cs" />
-    <Compile Include="services\IService.cs" />
-    <Compile Include="services\ServiceConfiguration.cs" />
-    <Compile Include="services\ServicesConfigurationOptions.cs" />
-    <Compile Include="tasks\defaults\DefaultDriverMessageHandler.cs" />
-    <Compile Include="tasks\defaults\DefaultTaskMessageSource.cs" />
-    <Compile Include="tasks\events\ICloseEvent.cs" />
-    <Compile Include="tasks\events\IDriverMessage.cs" />
-    <Compile Include="tasks\events\ISuspendEvent.cs" />
-    <Compile Include="tasks\events\ITaskStart.cs" />
-    <Compile Include="tasks\events\ITaskStop.cs" />
-    <Compile Include="tasks\IDriverMessageHandler.cs" />
-    <Compile Include="tasks\IRunningTask.cs" />
-    <Compile Include="tasks\ITask.cs" />
-    <Compile Include="tasks\ITaskMessageSource.cs" />
-    <Compile Include="tasks\TaskConfiguration.cs" />
-    <Compile Include="tasks\TaskConfigurationOptions.cs" />
-    <Compile Include="tasks\TaskMessage.cs" />
+    <Compile Include="Services\IService.cs" />
+    <Compile Include="Services\ServiceConfiguration.cs" />
+    <Compile Include="Services\ServicesConfigurationOptions.cs" />
+    <Compile Include="Tasks\Defaults\DefaultDriverMessageHandler.cs" />
+    <Compile Include="Tasks\Defaults\DefaultTaskMessageSource.cs" />
+    <Compile Include="Tasks\Events\ICloseEvent.cs" />
+    <Compile Include="Tasks\Events\IDriverMessage.cs" />
+    <Compile Include="Tasks\Events\ISuspendEvent.cs" />
+    <Compile Include="Tasks\Events\ITaskStart.cs" />
+    <Compile Include="Tasks\Events\ITaskStop.cs" />
+    <Compile Include="Tasks\IDriverMessageHandler.cs" />
+    <Compile Include="Tasks\IRunningTask.cs" />
+    <Compile Include="Tasks\ITask.cs" />
+    <Compile Include="Tasks\ITaskMessageSource.cs" />
+    <Compile Include="Tasks\TaskConfiguration.cs" />
+    <Compile Include="Tasks\TaskConfigurationOptions.cs" />
+    <Compile Include="Tasks\TaskMessage.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="packages.config" />
-    <None Include="protobuf\proto\client_runtime.proto" />
-    <None Include="protobuf\proto\driver_runtime.proto" />
-    <None Include="protobuf\proto\evaluator_runtime.proto" />
-    <None Include="protobuf\proto\reef_protocol.proto" />
-    <None Include="protobuf\proto\reef_service_protos.proto" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="protobuf\tools\" />
+    <None Include="Protobuf\Proto\client_runtime.proto" />
+    <None Include="Protobuf\Proto\driver_runtime.proto" />
+    <None Include="Protobuf\Proto\evaluator_runtime.proto" />
+    <None Include="Protobuf\Proto\reef_protocol.proto" />
+    <None Include="Protobuf\Proto\reef_service_protos.proto" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="$(SolutionDir)\Org.Apache.REEF.Tang\Org.Apache.REEF.Tang.csproj">
@@ -216,7 +213,7 @@ under the License.
       <Project>{79e7f89a-1dfb-45e1-8d43-d71a954aeb98}</Project>
       <Name>Org.Apache.REEF.Utilities</Name>
     </ProjectReference>
-    <ProjectReference Include="..\Org.Apache.REEF.Wake\Org.Apache.REEF.Wake.csproj">
+    <ProjectReference Include="$(SolutionDir)\Org.Apache.REEF.Wake\Org.Apache.REEF.Wake.csproj">
       <Project>{cdfb3464-4041-42b1-9271-83af24cd5008}</Project>
       <Name>Org.Apache.REEF.Wake</Name>
     </ProjectReference>

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/client_runtime.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/client_runtime.proto b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/client_runtime.proto
new file mode 100644
index 0000000..3d1f927
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/client_runtime.proto
@@ -0,0 +1,56 @@
+/**
+ * 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.
+ */
+option java_package = "org.apache.reef.proto";
+option java_outer_classname = "ClientRuntimeProtocol";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+
+import "reef_service_protos.proto";
+
+// Messages from REEF Client -> Driver Runtime
+
+message JobSubmissionProto {
+	required string identifier     = 1; // the job identifier
+	required string remote_id      = 2; // the remote identifier
+	required string configuration  = 5; // the runtime configuration
+	required string user_name      = 6; // the user name
+
+  optional SIZE   driver_size    = 7;
+  optional int32  driver_memory  = 8;
+  optional int32  priority       = 9;
+  optional string queue          = 10;
+
+	repeated FileResourceProto global_file = 11; // files that should be placed on the driver and all subsequent evaluators
+	repeated FileResourceProto local_File  = 12; // files that should be placed on the driver only
+
+}
+
+enum Signal {
+	SIG_TERMINATE = 1;
+	SIG_SUSPEND   = 2;
+	SIG_RESUME    = 3;
+}
+
+message JobControlProto {
+	required string identifier = 1;
+	optional Signal signal     = 2;
+	optional bytes message     = 3;
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/driver_runtime.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/driver_runtime.proto b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/driver_runtime.proto
new file mode 100644
index 0000000..2b21ac7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/driver_runtime.proto
@@ -0,0 +1,90 @@
+/**
+ * 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.
+ */
+option java_package = "org.apache.reef.proto";
+option java_outer_classname = "DriverRuntimeProtocol";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+
+
+import "reef_service_protos.proto";
+
+// Messages from Driver Runtime -> Driver Process
+
+message DriverProcessRegistrationProto {
+	required string remote_identifier = 1;
+}
+
+
+message NodeDescriptorProto {
+	required string identifier = 1;
+	required string host_name  = 2; // e.g., IP address
+	required int32 port        = 3; // e.g., IP port
+	required int32 memory_size = 4;
+	optional string rack_name  = 5; // e.g., /default-rack
+}
+
+message ResourceAllocationProto {
+	required string identifier     = 1; // e.g., the container id, or the thread id
+	required int32 resource_memory = 2; // megabytes
+	required string node_id        = 3;
+}
+
+message ResourceStatusProto {
+	required string identifier   = 1;
+	required State  state        = 2;
+	optional string diagnostics  = 3;
+	optional int32  exit_code    = 4;
+	optional bool is_from_previous_driver = 5;
+}
+
+message RuntimeStatusProto {
+   required string name  = 1;   // e.g., local, yarn21
+   required State  state = 2;
+   optional RuntimeErrorProto error = 3; // runtime (e.g., YARN) error
+
+   optional int32 outstanding_container_requests = 5;
+   repeated string container_allocation = 6;
+}
+
+//////////////////////////////////////////////////////
+// Messages from Driver Process -> Driver Runtime
+
+message ResourceRequestProto {
+	// optional SIZE resource_size   = 1; // Removed in REEF 0.3 in favor of memory_size.
+    optional int32 memory_size = 2; // Memory size of the evaluator in MB
+    optional int32 priority       = 3;
+
+    required int32 resource_count = 5;
+	repeated string node_name     = 6; // a list of specific nodes
+	repeated string rack_name     = 7; // a list of specific racks
+
+    optional bool relax_locality = 10;
+}
+
+message ResourceReleaseProto {
+	required string identifier = 1;
+}
+
+message ResourceLaunchProto {
+	required string identifier      = 1;
+	required string remote_id       = 2;
+	required string evaluator_conf  = 3;
+    required ProcessType type       = 4;
+	repeated FileResourceProto file = 10;
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/evaluator_runtime.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/evaluator_runtime.proto b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/evaluator_runtime.proto
new file mode 100644
index 0000000..1415e5c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/evaluator_runtime.proto
@@ -0,0 +1,91 @@
+/**
+ * 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.
+ */
+option java_package = "org.apache.reef.proto";
+option java_outer_classname = "EvaluatorRuntimeProtocol";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+
+import "reef_service_protos.proto";
+
+// Stop the evaluator
+message StopEvaluatorProto {
+}
+
+// Kill the evaluator
+message KillEvaluatorProto {
+}
+
+// Start a task
+message StartTaskProto {
+    required string context_id = 1;
+    required string configuration = 2;
+}
+
+message AddContextProto {
+    required string parent_context_id = 1;
+    required string context_configuration = 2;
+    optional string service_configuration = 3;
+}
+
+message RemoveContextProto {
+    required string context_id = 1;
+}
+
+// Stop the task
+message StopTaskProto {
+}
+
+// Suspend the task
+message SuspendTaskProto {
+}
+
+/////////////////////////////////////////
+// Message aggregators
+
+message ContextMessageProto {
+    required string context_id = 1;
+    required bytes message = 2;
+}
+
+message ContextControlProto {
+    optional bytes task_message = 1;
+    optional ContextMessageProto context_message = 2;
+
+    optional AddContextProto    add_context    = 5;
+    optional RemoveContextProto remove_context = 6;
+    optional StartTaskProto     start_task     = 7;
+    optional StopTaskProto      stop_task      = 8;
+    optional SuspendTaskProto   suspend_task   = 9;
+}
+
+message EvaluatorHeartbeatProto {
+    required int64 timestamp = 1;
+    required EvaluatorStatusProto evaluator_status = 2;
+    repeated ContextStatusProto   context_status   = 3;
+    optional TaskStatusProto      task_status      = 4;
+    optional bool                 recovery         = 5;  
+}
+
+message EvaluatorControlProto {
+    required int64 timestamp = 1;
+    required string identifier = 2;
+
+    optional ContextControlProto context_control = 3;
+    optional KillEvaluatorProto kill_evaluator = 4;
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_protocol.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_protocol.proto b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_protocol.proto
new file mode 100644
index 0000000..6b99415
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Protobuf/Proto/reef_protocol.proto
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+import "client_runtime.proto";
+
+import "evaluator_runtime.proto";
+
+import "reef_service_protos.proto";
+
+
+option java_package = "com.Org.Apache.REEF.proto";
+
+option java_generic_services = true;
+
+option java_generate_equals_and_hash = true;
+
+option java_outer_classname = "REEFProtocol";
+
+message REEFMessage {
+    // Messages defined in client_runtime.proto
+    optional JobSubmissionProto jobSubmission = 1;
+    optional JobControlProto jobControl = 2;
+    // Messages defined in reef_service_protos.proto
+    optional RuntimeErrorProto runtimeError = 3;
+    optional JobStatusProto jobStatus = 4;
+    // Messages from evaluator_runtime.proto
+    optional EvaluatorControlProto evaluatorControl = 5;
+    optional EvaluatorHeartbeatProto evaluatorHeartBeat = 6;
+}
\ No newline at end of file


[19/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
[REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

This is to harmonize namespaces and folder names in Org.Apache.REEF for most of the projects.
Update folder name convention
Change namespace follow the folder structure
Update clr for driver name space
Updated jar file used in testing

Most projects have done only with a few proto related left. Will do it is a separate PR
JIRA: Reef-132. (https://issues.apache.org/jira/browse/REEF-132)
JIRA: Reef-135. (https://issues.apache.org/jira/browse/REEF-135)
JIRA: Reef-136. (https://issues.apache.org/jira/browse/REEF-136)
JIRA: Reef-137. (https://issues.apache.org/jira/browse/REEF-137)

Author: Julia Wang  Email: jwang98052@yahoo.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/7edb8570
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/7edb8570
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/7edb8570

Branch: refs/heads/master
Commit: 7edb8570e0f312f01f7cd7aedba1f49ce6d03799
Parents: 02c0ad5
Author: Julia Wang <jw...@yahoo.com>
Authored: Mon Feb 9 20:01:41 2015 -0800
Committer: tmajest <tm...@microsoft.com>
Committed: Tue Feb 10 12:02:02 2015 -0800

----------------------------------------------------------------------
 .../JavaClrBridge/ActiveContextClr2Java.cpp     | 120 ++---
 .../AllocatedEvaluatorClr2Java.cpp              | 282 +++++------
 .../JavaClrBridge/ClosedContextClr2Java.cpp     | 106 ++--
 .../Cpp/CppBridge/JavaClrBridge/Clr2JavaImpl.h  | 372 ++++++++-------
 .../CppBridge/JavaClrBridge/CommonUtilities.cpp |  54 ++-
 .../CompletedEvaluatorClr2Java.cpp              |  66 +--
 .../JavaClrBridge/CompletedTaskClr2Java.cpp     |  84 ++--
 .../JavaClrBridge/ContextMessageClr2Java.cpp    |  94 ++--
 .../EvaluatorRequestorClr2Java.cpp              |  88 ++--
 .../JavaClrBridge/FailedContextClr2Java.cpp     | 120 ++---
 .../JavaClrBridge/FailedEvaluatorClr2Java.cpp   |  84 ++--
 .../JavaClrBridge/FailedTaskClr2Java.cpp        |  98 ++--
 .../JavaClrBridge/HttpServerClr2Java.cpp        | 202 ++++----
 .../CppBridge/JavaClrBridge/JavaClrBridge.cpp   |   2 +-
 .../JavaClrBridge/RunningTaskClr2Java.cpp       | 114 ++---
 .../JavaClrBridge/SuspendedTaskClr2Java.cpp     | 108 +++--
 .../JavaClrBridge/TaskMessageClr2Java.cpp       |  66 +--
 .../Org.Apache.REEF.Client/CLRBridgeClient.cs   |   1 -
 .../Api/AbstractFailure.cs                      | 142 ++++++
 .../Api/IAbstractFailure.cs                     |  25 +
 lang/cs/Org.Apache.REEF.Common/Api/IFailure.cs  |  57 +++
 .../Api/IResourceLaunchHandler.cs               |  28 ++
 .../Api/IResourceReleaseHandler.cs              |  28 ++
 .../Api/IResourceRequestHandler.cs              |  28 ++
 .../Avro/AvroDriverInfo.cs                      |  65 +++
 .../Avro/AvroHttpRequest.cs                     |  79 +++
 .../Avro/AvroHttpSerializer.cs                  |  36 ++
 .../Avro/AvroJsonSerializer.cs                  |  52 ++
 .../Avro/AvroReefServiceInfo.cs                 |  55 +++
 .../Catalog/Capabilities/CPU.cs                 |  59 +++
 .../Catalog/Capabilities/ICapability.cs         |  25 +
 .../Catalog/Capabilities/RAM.cs                 |  51 ++
 .../Catalog/INodeDescriptor.cs                  |  35 ++
 .../Catalog/IRackDescriptor.cs                  |  25 +
 .../Catalog/IResourceCatalog.cs                 |  37 ++
 .../Catalog/NodeDescriptorImpl.cs               | 116 +++++
 .../Catalog/RackDescriptorImpl.cs               |  75 +++
 .../Catalog/ResourceCatalogImpl.cs              |  95 ++++
 .../ClientJobStatusHandler.cs                   |   6 +-
 .../Context/ContextMessage.cs                   |  66 +++
 .../Context/IContextMessage.cs                  |  28 ++
 .../Context/IContextMessageHandler.cs           |  27 ++
 .../Context/IContextMessageSource.cs            |  28 ++
 .../DefaultLocalHttpDriverConnection.cs         |  45 ++
 .../DefaultYarnClusterHttpDriverConnection.cs   |  44 ++
 .../DefaultYarnOneBoxHttpDriverConnection.cs    |  46 ++
 .../Evaluator/DriverInformation.cs              | 136 ++++++
 .../Evaluator/EvaluatorOperationState.cs        |  39 ++
 .../Evaluator/EvaluatorRuntimeState.cs          |  39 ++
 .../Evaluator/EvaluatorType.cs                  |  39 ++
 .../Evaluator/IDriverConnection.cs              |  26 +
 .../Events/IContextStart.cs                     |  26 +
 .../Events/IContextStop.cs                      |  26 +
 .../Exceptions/EvaluatorException.cs            |  75 +++
 .../Exceptions/JobException.cs                  |  58 +++
 lang/cs/Org.Apache.REEF.Common/FailedRuntime.cs |   2 +-
 .../IJobMessageObserver.cs                      |   2 +-
 .../cs/Org.Apache.REEF.Common/Io/INameClient.cs |  71 +++
 .../Org.Apache.REEF.Common/Io/NameAssignment.cs |  60 +++
 .../Io/NamingConfiguration.cs                   |  45 ++
 .../Io/NamingConfigurationOptions.cs            |  36 ++
 .../Org.Apache.REEF.Common.csproj               | 197 ++++----
 .../Protobuf/Proto/client_runtime.proto         |  56 +++
 .../Protobuf/Proto/driver_runtime.proto         |  90 ++++
 .../Protobuf/Proto/evaluator_runtime.proto      |  91 ++++
 .../Protobuf/Proto/reef_protocol.proto          |  44 ++
 .../Protobuf/Proto/reef_service_protos.proto    | 117 +++++
 .../Protobuf/ReefProtocol/ClientRuntime.pb.cs   | 145 ++++++
 .../Protobuf/ReefProtocol/DriverRuntime.pb.cs   | 337 +++++++++++++
 .../EvaluatorHeartbeatProtoCodec.cs             |  40 ++
 .../ReefProtocol/EvaluatorRunTime.pb.cs         | 304 ++++++++++++
 .../Protobuf/ReefProtocol/REEFMessageCodec.cs   |  37 ++
 .../Protobuf/ReefProtocol/ReefProtocol.pb.cs    |  75 +++
 .../Protobuf/ReefProtocol/ReefService.pb.cs     | 393 +++++++++++++++
 .../Protobuf/ReefProtocol/Serializer.cs         | 123 +++++
 .../Runtime/Evaluator/Constants.cs              |  40 ++
 .../Context/ContextClientCodeException.cs       |  70 +++
 .../Evaluator/Context/ContextConfiguration.cs   | 140 ++++++
 .../Evaluator/Context/ContextLifeCycle.cs       | 106 ++++
 .../Runtime/Evaluator/Context/ContextManager.cs | 359 ++++++++++++++
 .../Runtime/Evaluator/Context/ContextRuntime.cs | 478 +++++++++++++++++++
 .../Evaluator/Context/ContextStartImpl.cs       |  33 ++
 .../Evaluator/Context/ContextStopImpl.cs        |  33 ++
 .../Evaluator/Context/RootContextLauncher.cs    | 124 +++++
 .../Runtime/Evaluator/EvaluatorRuntime.cs       | 251 ++++++++++
 .../Runtime/Evaluator/EvaluatorSettings.cs      | 185 +++++++
 .../Runtime/Evaluator/HeartBeatManager.cs       | 387 +++++++++++++++
 .../Evaluator/ReefMessageProtoObserver.cs       | 140 ++++++
 .../Runtime/Evaluator/Task/CloseEventImpl.cs    |  48 ++
 .../Runtime/Evaluator/Task/DriverMessageImpl.cs |  52 ++
 .../Runtime/Evaluator/Task/SuspendEventImpl.cs  |  48 ++
 .../Evaluator/Task/TaskClientCodeException.cs   |  65 +++
 .../Runtime/Evaluator/Task/TaskLifeCycle.cs     |  68 +++
 .../Runtime/Evaluator/Task/TaskRuntime.cs       | 326 +++++++++++++
 .../Runtime/Evaluator/Task/TaskStartImpl.cs     |  34 ++
 .../Runtime/Evaluator/Task/TaskState.cs         |  40 ++
 .../Runtime/Evaluator/Task/TaskStatus.cs        | 330 +++++++++++++
 .../Runtime/Evaluator/Task/TaskStopImpl.cs      |  34 ++
 .../Evaluator/Utils/EvaluatorConfigurations.cs  | 122 +++++
 .../Runtime/Evaluator/Utils/RemoteManager.cs    |  25 +
 .../Runtime/MachineStatus.cs                    | 137 ++++++
 .../Org.Apache.REEF.Common/Services/IService.cs |  25 +
 .../Services/ServiceConfiguration.cs            |  83 ++++
 .../Services/ServicesConfigurationOptions.cs    |  31 ++
 .../Defaults/DefaultDriverMessageHandler.cs     |  41 ++
 .../Tasks/Defaults/DefaultTaskMessageSource.cs  |  49 ++
 .../Tasks/Events/ICloseEvent.cs                 |  28 ++
 .../Tasks/Events/IDriverMessage.cs              |  28 ++
 .../Tasks/Events/ISuspendEvent.cs               |  25 +
 .../Tasks/Events/ITaskStart.cs                  |  26 +
 .../Tasks/Events/ITaskStop.cs                   |  26 +
 .../Tasks/IDriverMessageHandler.cs              |  29 ++
 .../Tasks/IRunningTask.cs                       |  53 ++
 lang/cs/Org.Apache.REEF.Common/Tasks/ITask.cs   |  28 ++
 .../Tasks/ITaskMessageSource.cs                 |  31 ++
 .../Tasks/TaskConfiguration.cs                  | 149 ++++++
 .../Tasks/TaskConfigurationOptions.cs           |  69 +++
 .../Org.Apache.REEF.Common/Tasks/TaskMessage.cs |  68 +++
 .../api/AbstractFailure.cs                      | 142 ------
 .../api/IAbstractFailure.cs                     |  25 -
 lang/cs/Org.Apache.REEF.Common/api/IFailure.cs  |  57 ---
 .../api/IResourceLaunchHandler.cs               |  28 --
 .../api/IResourceReleaseHandler.cs              |  28 --
 .../api/IResourceRequestHandler.cs              |  28 --
 .../avro/AvroDriverInfo.cs                      |  65 ---
 .../avro/AvroHttpRequest.cs                     |  79 ---
 .../avro/AvroHttpSerializer.cs                  |  36 --
 .../avro/AvroJsonSerializer.cs                  |  52 --
 .../avro/AvroReefServiceInfo.cs                 |  55 ---
 .../catalog/INodeDescriptor.cs                  |  36 --
 .../catalog/IRackDescriptor.cs                  |  25 -
 .../catalog/IResourceCatalog.cs                 |  37 --
 .../catalog/NodeDescriptorImpl.cs               | 116 -----
 .../catalog/RackDescriptorImpl.cs               |  75 ---
 .../catalog/ResourceCatalogImpl.cs              |  95 ----
 .../catalog/capabilities/CPU.cs                 |  60 ---
 .../catalog/capabilities/ICapability.cs         |  25 -
 .../catalog/capabilities/RAM.cs                 |  51 --
 .../context/ContextMessage.cs                   |  66 ---
 .../context/IContextMessage.cs                  |  28 --
 .../context/IContextMessageHandler.cs           |  27 --
 .../context/IContextMessageSource.cs            |  28 --
 .../DefaultLocalHttpDriverConnection.cs         |  45 --
 .../DefaultYarnClusterHttpDriverConnection.cs   |  44 --
 .../DefaultYarnOneBoxHttpDriverConnection.cs    |  46 --
 .../evaluator/DriverInformation.cs              | 136 ------
 .../evaluator/EvaluatorOperationState.cs        |  39 --
 .../evaluator/EvaluatorRuntimeState.cs          |  39 --
 .../evaluator/EvaluatorType.cs                  |  39 --
 .../evaluator/IDriverConnection.cs              |  26 -
 .../events/IContextStart.cs                     |  26 -
 .../events/IContextStop.cs                      |  26 -
 .../exceptions/EvaluatorException.cs            |  75 ---
 .../exceptions/JobException.cs                  |  58 ---
 .../cs/Org.Apache.REEF.Common/io/INameClient.cs |  71 ---
 .../Org.Apache.REEF.Common/io/NameAssignment.cs |  60 ---
 .../io/NamingConfiguration.cs                   |  45 --
 .../io/NamingConfigurationOptions.cs            |  36 --
 .../protobuf/cs/ClientRuntime.pb.cs             | 147 ------
 .../protobuf/cs/DriverRuntime.pb.cs             | 339 -------------
 .../protobuf/cs/EvaluatorRunTime.pb.cs          | 305 ------------
 .../protobuf/cs/ReefProtocol.pb.cs              |  78 ---
 .../protobuf/cs/ReefService.pb.cs               | 393 ---------------
 .../protobuf/cs/Serializer.cs                   | 130 -----
 .../cs/codec/EvaluatorHeartbeatProtoCodec.cs    |  41 --
 .../protobuf/cs/codec/REEFMessageCodec.cs       |  37 --
 .../protobuf/proto/client_runtime.proto         |  56 ---
 .../protobuf/proto/driver_runtime.proto         |  90 ----
 .../protobuf/proto/evaluator_runtime.proto      |  91 ----
 .../protobuf/proto/reef_protocol.proto          |  44 --
 .../protobuf/proto/reef_service_protos.proto    | 117 -----
 .../runtime/MachineStatus.cs                    | 137 ------
 .../runtime/evaluator/Constants.cs              |  40 --
 .../runtime/evaluator/EvaluatorRuntime.cs       | 255 ----------
 .../runtime/evaluator/EvaluatorSettings.cs      | 185 -------
 .../runtime/evaluator/HeartBeatManager.cs       | 390 ---------------
 .../evaluator/ReefMessageProtoObserver.cs       | 140 ------
 .../context/ContextClientCodeException.cs       |  70 ---
 .../evaluator/context/ContextConfiguration.cs   | 140 ------
 .../evaluator/context/ContextLifeCycle.cs       | 105 ----
 .../runtime/evaluator/context/ContextManager.cs | 362 --------------
 .../runtime/evaluator/context/ContextRuntime.cs | 478 -------------------
 .../evaluator/context/ContextStartImpl.cs       |  33 --
 .../evaluator/context/ContextStopImpl.cs        |  33 --
 .../evaluator/context/RootContextLauncher.cs    | 126 -----
 .../runtime/evaluator/task/CloseEventImpl.cs    |  48 --
 .../runtime/evaluator/task/DriverMessageImpl.cs |  52 --
 .../runtime/evaluator/task/SuspendEventImpl.cs  |  48 --
 .../evaluator/task/TaskClientCodeException.cs   |  65 ---
 .../runtime/evaluator/task/TaskLifeCycle.cs     |  69 ---
 .../runtime/evaluator/task/TaskRuntime.cs       | 328 -------------
 .../runtime/evaluator/task/TaskStartImpl.cs     |  34 --
 .../runtime/evaluator/task/TaskState.cs         |  40 --
 .../runtime/evaluator/task/TaskStatus.cs        | 330 -------------
 .../runtime/evaluator/task/TaskStopImpl.cs      |  35 --
 .../evaluator/utils/EvaluatorConfigurations.cs  | 121 -----
 .../runtime/evaluator/utils/RemoteManager.cs    |  25 -
 .../Org.Apache.REEF.Common/services/IService.cs |  25 -
 .../services/ServiceConfiguration.cs            |  83 ----
 .../services/ServicesConfigurationOptions.cs    |  31 --
 .../tasks/IDriverMessageHandler.cs              |  31 --
 .../tasks/IRunningTask.cs                       |  53 --
 lang/cs/Org.Apache.REEF.Common/tasks/ITask.cs   |  28 --
 .../tasks/ITaskMessageSource.cs                 |  31 --
 .../tasks/TaskConfiguration.cs                  | 148 ------
 .../tasks/TaskConfigurationOptions.cs           |  69 ---
 .../Org.Apache.REEF.Common/tasks/TaskMessage.cs |  68 ---
 .../defaults/DefaultDriverMessageHandler.cs     |  42 --
 .../tasks/defaults/DefaultTaskMessageSource.cs  |  49 --
 .../tasks/events/ICloseEvent.cs                 |  28 --
 .../tasks/events/IDriverMessage.cs              |  28 --
 .../tasks/events/ISuspendEvent.cs               |  25 -
 .../tasks/events/ITaskStart.cs                  |  26 -
 .../tasks/events/ITaskStop.cs                   |  26 -
 .../Bridge/BridgeLogger.cs                      |  65 +++
 .../Bridge/Clr2java/IActiveContextClr2Java.cs   |  36 ++
 .../Clr2java/IAllocatedEvaluaotrClr2Java.cs     |  42 ++
 .../Bridge/Clr2java/IClosedContextClr2Java.cs   |  34 ++
 .../Bridge/Clr2java/IClr2Java.cs                |  26 +
 .../Clr2java/ICompletedEvaluatorClr2Java.cs     |  30 ++
 .../Bridge/Clr2java/ICompletedTaskClr2Java.cs   |  28 ++
 .../Bridge/Clr2java/IContextMessageClr2Java.cs  |  30 ++
 .../Clr2java/IEvaluatorRequestorClr2Java.cs     |  28 ++
 .../Bridge/Clr2java/IFailedContextClr2Java.cs   |  36 ++
 .../Bridge/Clr2java/IFailedEvaluatorClr2Java.cs |  28 ++
 .../Bridge/Clr2java/IFailedTaskClr2Java.cs      |  28 ++
 .../Clr2java/IHttpServerBridgeClr2Java.cs       |  34 ++
 .../Bridge/Clr2java/IRunningTaskClr2Java.cs     |  30 ++
 .../Bridge/Clr2java/ISuspendedTaskClr2Java.cs   |  42 ++
 .../Bridge/Clr2java/ITaskMessageClr2Java.cs     |  26 +
 .../Bridge/ClrClientHelper.cs                   | 174 +++++++
 .../Bridge/ClrHandlerHelper.cs                  | 178 +++++++
 .../Bridge/ClrSystemHandler.cs                  |  53 ++
 .../Bridge/ClrSystemHandlerWrapper.cs           | 277 +++++++++++
 .../Bridge/DriverBridge.cs                      | 322 +++++++++++++
 .../Bridge/DriverBridgeConfiguration.cs         | 274 +++++++++++
 .../Bridge/DriverBridgeConfigurationOptions.cs  | 155 ++++++
 .../Bridge/Events/ActiveContext.cs              | 118 +++++
 .../Bridge/Events/AllocatedEvaluator.cs         | 175 +++++++
 .../Bridge/Events/ClosedContext.cs              |  99 ++++
 .../Bridge/Events/CompletedEvaluator.cs         |  61 +++
 .../Bridge/Events/CompletedTask.cs              |  76 +++
 .../Bridge/Events/ContextMessage.cs             |  54 +++
 .../Bridge/Events/EvaluatorRequstor.cs          |  96 ++++
 .../Bridge/Events/FailedContext.cs              | 111 +++++
 .../Bridge/Events/FailedEvaluator.cs            |  72 +++
 .../Bridge/Events/FailedTask.cs                 | 141 ++++++
 .../Bridge/Events/RunningTask.cs                |  98 ++++
 .../Bridge/Events/SuspendedTask.cs              |  83 ++++
 .../Bridge/Events/TaskMessage.cs                |  65 +++
 .../Bridge/HttpMessage.cs                       |  61 +++
 .../Bridge/HttpServerHandler.cs                 | 164 +++++++
 .../Bridge/HttpServerPort.cs                    |  33 ++
 .../Bridge/IHttpHandler.cs                      |  39 ++
 .../Bridge/IHttpMessage.cs                      |  33 ++
 .../Bridge/ReefHttpRequest.cs                   |  49 ++
 .../Bridge/ReefHttpResponse.cs                  |  30 ++
 lang/cs/Org.Apache.REEF.Driver/ClientManager.cs |   2 +-
 .../Context/ContextConfiguration.cs             |  93 ++++
 .../Context/ContextConfigurationOptions.cs      |  61 +++
 .../Defaults/DefaultContextMessageSource.cs     |  42 ++
 .../Defaults/DefaultContextStartHandler.cs      |  48 ++
 .../Defaults/DefaultContextStopHandler.cs       |  48 ++
 .../Context/EvaluatorContext.cs                 | 147 ++++++
 .../Context/IActiveContext.cs                   |  29 ++
 .../Context/IClosedContext.cs                   |  26 +
 .../Org.Apache.REEF.Driver/Context/IContext.cs  |  45 ++
 .../Context/IFailedContext.cs                   |  28 ++
 .../Contract/IBridgeContract.cs                 |  26 +
 .../Defaults/DefaultClientCloseHandler.cs       |  53 ++
 .../DefaultClientCloseWithMessageHandler.cs     |  54 +++
 .../Defaults/DefaultClientMessageHandler.cs     |  54 +++
 .../Defaults/DefaultContextActiveHandler.cs     |  56 +++
 .../Defaults/DefaultContextClosureHandler.cs    |  55 +++
 .../Defaults/DefaultContextFailureHandler.cs    |  51 ++
 .../Defaults/DefaultContextMessageHandler.cs    |  55 +++
 .../Defaults/DefaultCustomTraceListener.cs      |  45 ++
 .../DefaultDriverRestartContextActiveHandler.cs |  56 +++
 .../Defaults/DefaultDriverRestartHandler.cs     |  55 +++
 .../DefaultDriverRestartTaskRunningHandler.cs   |  54 +++
 .../DefaultEvaluatorAllocationHandler.cs        |  57 +++
 .../DefaultEvaluatorCompletionHandler.cs        |  54 +++
 .../Defaults/DefaultEvaluatorFailureHandler.cs  |  55 +++
 .../DefaultEvaluatorRequestorHandler.cs         |  61 +++
 .../Defaults/DefaultHttpHandler.cs              |  49 ++
 .../Defaults/DefaultTaskCompletionHandler.cs    |  60 +++
 .../Defaults/DefaultTaskFailureHandler.cs       |  53 ++
 .../Defaults/DefaultTaskMessageHandler.cs       |  55 +++
 .../Defaults/DefaultTaskRunningHandler.cs       |  54 +++
 .../Defaults/DefaultTaskSuspensionHandler.cs    |  54 +++
 .../DriverConfigGenerator.cs                    |   3 +-
 lang/cs/Org.Apache.REEF.Driver/DriverManager.cs |   5 +-
 .../DriverRuntimeConfiguration.cs               |   1 -
 .../Evaluator/EvaluatorDescriptorImpl.cs        | 218 +++++++++
 .../Evaluator/EvaluatorRequest.cs               | 107 +++++
 .../Evaluator/EvaluatorRequestBuilder.cs        |  60 +++
 .../Evaluator/IAllocatedEvaluator.cs            |  55 +++
 .../Evaluator/ICompletedEvaluator.cs            |  30 ++
 .../Evaluator/IEvaluatorDescriptor.cs           |  57 +++
 .../Evaluator/IEvaluatorRequest .cs             |  42 ++
 .../Evaluator/IEvaluatorRequestor.cs            |  47 ++
 .../Evaluator/IFailedEvaluator.cs               |  42 ++
 .../Org.Apache.REEF.Driver/EvaluatorManager.cs  |   8 +-
 .../Org.Apache.REEF.Driver.csproj               | 184 +++----
 .../Task/ICompletedTask.cs                      |  29 ++
 .../Org.Apache.REEF.Driver/Task/IFailedTask.cs  |  30 ++
 .../Org.Apache.REEF.Driver/Task/IRunningTask.cs |  65 +++
 .../Task/ISuspendedTask.cs                      |  29 ++
 .../Org.Apache.REEF.Driver/Task/ITaskMessage.cs |  28 ++
 .../Task/RunningTaskImpl.cs                     | 127 +++++
 .../bridge/BridgeLogger.cs                      |  65 ---
 .../bridge/ClrClientHelper.cs                   | 175 -------
 .../bridge/ClrHandlerHelper.cs                  | 178 -------
 .../bridge/ClrSystemHandler.cs                  |  53 --
 .../bridge/ClrSystemHandlerWrapper.cs           | 274 -----------
 .../bridge/DriverBridge.cs                      | 321 -------------
 .../bridge/DriverBridgeConfiguration.cs         | 273 -----------
 .../bridge/DriverBridgeConfigurationOptions.cs  | 154 ------
 .../bridge/HttpMessage.cs                       |  60 ---
 .../bridge/HttpServerHandler.cs                 | 165 -------
 .../bridge/HttpServerPort.cs                    |  33 --
 .../bridge/IHttpHandler.cs                      |  39 --
 .../bridge/IHttpMessage.cs                      |  33 --
 .../bridge/ReefHttpRequest.cs                   |  49 --
 .../bridge/ReefHttpResponse.cs                  |  30 --
 .../bridge/clr2java/IActiveContextClr2Java.cs   |  36 --
 .../clr2java/IAllocatedEvaluaotrClr2Java.cs     |  42 --
 .../bridge/clr2java/IClosedContextClr2Java.cs   |  34 --
 .../bridge/clr2java/IClr2Java.cs                |  26 -
 .../clr2java/ICompletedEvaluatorClr2Java.cs     |  30 --
 .../bridge/clr2java/ICompletedTaskClr2Java.cs   |  28 --
 .../bridge/clr2java/IContextMessageClr2Java.cs  |  30 --
 .../clr2java/IEvaluatorRequestorClr2Java.cs     |  28 --
 .../bridge/clr2java/IFailedContextClr2Java.cs   |  36 --
 .../bridge/clr2java/IFailedEvaluatorClr2Java.cs |  30 --
 .../bridge/clr2java/IFailedTaskClr2Java.cs      |  28 --
 .../clr2java/IHttpServerBridgeClr2Java.cs       |  34 --
 .../bridge/clr2java/IRunningTaskClr2Java.cs     |  30 --
 .../bridge/clr2java/ISuspendedTaskClr2Java.cs   |  42 --
 .../bridge/clr2java/ITaskMessageClr2Java.cs     |  26 -
 .../bridge/events/ActiveContext.cs              | 117 -----
 .../bridge/events/AllocatedEvaluator.cs         | 175 -------
 .../bridge/events/ClosedContext.cs              |  98 ----
 .../bridge/events/CompletedEvaluator.cs         |  60 ---
 .../bridge/events/CompletedTask.cs              |  75 ---
 .../bridge/events/ContextMessage.cs             |  53 --
 .../bridge/events/EvaluatorRequstor.cs          |  95 ----
 .../bridge/events/FailedContext.cs              | 110 -----
 .../bridge/events/FailedEvaluator.cs            |  72 ---
 .../bridge/events/FailedTask.cs                 | 140 ------
 .../bridge/events/RunningTask.cs                |  97 ----
 .../bridge/events/SuspendedTask.cs              |  81 ----
 .../bridge/events/TaskMessage.cs                |  64 ---
 .../context/ContextConfiguration.cs             |  93 ----
 .../context/ContextConfigurationOptions.cs      |  60 ---
 .../context/EvaluatorContext.cs                 | 148 ------
 .../context/IActiveContext.cs                   |  29 --
 .../context/IClosedContext.cs                   |  26 -
 .../Org.Apache.REEF.Driver/context/IContext.cs  |  45 --
 .../context/IFailedContext.cs                   |  28 --
 .../defaults/DefaultContextMessageSource.cs     |  42 --
 .../defaults/DefaultContextStartHandler.cs      |  48 --
 .../defaults/DefaultContextStopHandler.cs       |  48 --
 .../contract/IBridgeContract.cs                 |  26 -
 .../defaults/DefaultClientCloseHandler.cs       |  53 --
 .../DefaultClientCloseWithMessageHandler.cs     |  54 ---
 .../defaults/DefaultClientMessageHandler.cs     |  54 ---
 .../defaults/DefaultContextActiveHandler.cs     |  56 ---
 .../defaults/DefaultContextClosureHandler.cs    |  55 ---
 .../defaults/DefaultContextFailureHandler.cs    |  51 --
 .../defaults/DefaultContextMessageHandler.cs    |  55 ---
 .../defaults/DefaultCustomTraceListener.cs      |  45 --
 .../DefaultDriverRestartContextActiveHandler.cs |  56 ---
 .../defaults/DefaultDriverRestartHandler.cs     |  54 ---
 .../DefaultDriverRestartTaskRunningHandler.cs   |  54 ---
 .../DefaultEvaluatorAllocationHandler.cs        |  57 ---
 .../DefaultEvaluatorCompletionHandler.cs        |  54 ---
 .../defaults/DefaultEvaluatorFailureHandler.cs  |  55 ---
 .../DefaultEvaluatorRequestorHandler.cs         |  61 ---
 .../defaults/DefaultHttpHandler.cs              |  49 --
 .../defaults/DefaultTaskCompletionHandler.cs    |  60 ---
 .../defaults/DefaultTaskFailureHandler.cs       |  53 --
 .../defaults/DefaultTaskMessageHandler.cs       |  55 ---
 .../defaults/DefaultTaskRunningHandler.cs       |  54 ---
 .../defaults/DefaultTaskSuspensionHandler.cs    |  53 --
 .../evaluator/EvaluatorDescriptorImpl.cs        | 218 ---------
 .../evaluator/EvaluatorRequest.cs               | 108 -----
 .../evaluator/EvaluatorRequestBuilder.cs        |  60 ---
 .../evaluator/IAllocatedEvaluator.cs            |  55 ---
 .../evaluator/ICompletedEvaluator.cs            |  30 --
 .../evaluator/IEvaluatorDescriptor.cs           |  57 ---
 .../evaluator/IEvaluatorRequest .cs             |  42 --
 .../evaluator/IEvaluatorRequestor.cs            |  47 --
 .../evaluator/IFailedEvaluator.cs               |  41 --
 .../task/ICompletedTask.cs                      |  29 --
 .../Org.Apache.REEF.Driver/task/IFailedTask.cs  |  30 --
 .../Org.Apache.REEF.Driver/task/IRunningTask.cs |  65 ---
 .../task/ISuspendedTask.cs                      |  29 --
 .../Org.Apache.REEF.Driver/task/ITaskMessage.cs |  28 --
 .../task/RunningTaskImpl.cs                     | 127 -----
 lang/cs/Org.Apache.REEF.Evaluator/Evaluator.cs  |  12 +-
 .../Handlers/HelloActiveContextHandler.cs       |   2 +-
 .../Handlers/HelloAllocatedEvaluatorHandler.cs  |   6 +-
 .../Handlers/HelloRestartHandler.cs             |   1 +
 .../Handlers/HelloSimpleEventHandlers.cs        |   5 +-
 .../Handlers/HelloStartHandler.cs               |   5 +-
 .../RetainedEvalActiveContextHandler.cs         |   2 +-
 .../Handlers/RetainedEvalStartHandler.cs        |   2 +-
 .../Tasks/FailedTask/FailedTask.cs              |   2 +-
 .../Tasks/HelloTask/HelloService.cs             |   2 +-
 .../Tasks/HelloTask/HelloTask.cs                |   6 +-
 .../Tasks/HelloTask/HelloTaskMessage.cs         |   2 +-
 .../Tasks/ShellTask/ShellTask.cs                |   2 +-
 .../Tasks/StreamingTasks/StreamTask1.cs         |   2 +-
 .../Tasks/StreamingTasks/StreamTask2.cs         |   2 +-
 .../Naming/Codec/NamingLookupResponseCodec.cs   |   2 +-
 .../Naming/Codec/NamingRegisterRequestCodec.cs  |   2 +-
 .../Naming/Events/NamingGetAllResponse.cs       |   2 +-
 .../Naming/Events/NamingLookupResponse.cs       |   2 +-
 .../Naming/Events/NamingRegisterRequest.cs      |   2 +-
 .../Naming/INameServer.cs                       |   2 +-
 .../Naming/NameClient.cs                        |   2 +-
 .../Naming/NameLookupClient.cs                  |   2 +-
 .../Naming/NameRegisterClient.cs                |   2 +-
 .../Naming/NameServer.cs                        |   2 +-
 .../Naming/NamingConfiguration.cs               |  50 --
 .../Naming/NamingConfigurationOptions.cs        |  41 --
 .../Observers/NamingGetAllRequestObserver.cs    |   2 +-
 .../Observers/NamingLookupRequestObserver.cs    |   2 +-
 .../Observers/NamingRegisterRequestObserver.cs  |   2 +-
 .../NetworkService/INetworkService.cs           |   4 +-
 .../NetworkService/NetworkService.cs            |   2 +-
 .../NetworkServiceConfiguration.cs              |   2 +-
 .../NetworkService/NsConnection.cs              |   2 +-
 .../Org.Apache.REEF.Network.csproj              |   6 -
 .../Org.Apache.REEF.Network/Utilities/Utils.cs  |   2 +-
 .../ClassHierarchy/TestClassHierarchy.cs        |   9 +-
 .../ClassHierarchy/TestSerilization.cs          |   8 +-
 .../Configuration/TestAvroConfiguration.cs      |   3 +-
 .../TestAvroSerializerRoundTrip.cs              |   1 +
 .../Configuration/TestConfiguration.cs          |   7 +-
 .../Format/TestTaskConfiguration.cs             |   2 +-
 .../Injection/TestInjection.cs                  |   2 +-
 .../Injection/TestListInjection.cs              |   5 -
 lang/cs/Org.Apache.REEF.Tang.Tools/Program.cs   |   2 +-
 .../AvroConfiguration.cs                        |   2 +-
 .../ConfigurationEntry.cs                       |   2 +-
 .../Formats/AvroConfigurationSerializer.cs      |   1 +
 .../Protobuf/ProtocolBufferClassHierarchy.cs    |  88 ++--
 .../Protobuf/ProtocolBufferInjectionPlan.cs     |  82 ++--
 .../Protobuf/class_hierarchy.cs                 |   2 +-
 .../Protobuf/injection_plan.cs                  |   2 +-
 .../Evaluator/EvaluatorConfigurationsTests.cs   |   2 +-
 .../Evaluator/EvaluatorTests.cs                 |   3 +-
 .../Functional/Driver/DriverTestStartHandler.cs |   2 +-
 .../Functional/Messaging/MessageDriver.cs       |   3 +-
 .../Functional/Messaging/MessageTask.cs         |   4 +-
 .../Functional/ReefFunctionalTest.cs            |   2 +-
 .../Network/NameServerTests.cs                  |   2 +-
 .../Network/NetworkServiceTests.cs              |   2 +-
 ...bridge-0.11.0-incubating-SNAPSHOT-shaded.jar | Bin 13555222 -> 13555272 bytes
 lang/cs/Org.Apache.REEF.Wake.Tests/ClockTest.cs |   1 +
 .../Examples/P2p/IEventSource.cs                |  35 ++
 .../Examples/P2p/Pull2Push.cs                   | 102 ++++
 .../Impl/MissingStartHandlerHandler.cs          |   1 +
 .../Org.Apache.REEF.Wake.csproj                 |  10 +-
 .../Protobuf/RemoteProtocol.proto               |  36 --
 .../Protobuf/WakeRemoteProtosGen.cs             |  96 ----
 .../Remote/Impl/MultiDecoder.cs                 |   2 +-
 .../Remote/Impl/MultiEncoder.cs                 |   2 +-
 .../Remote/Impl/RemoteEventDecoder.cs           |   2 +-
 .../Remote/Impl/RemoteEventEncoder.cs           |   2 +-
 .../Remote/Proto/RemoteProtocol.proto           |  36 ++
 .../Remote/Proto/WakeRemoteProtos.cs            |   6 +-
 .../Remote/Proto/WakeRemoteProtosGen.cs         |  96 ++++
 .../cs/Org.Apache.REEF.Wake/Time/Event/Alarm.cs |   2 +-
 .../Time/Event/StartTime.cs                     |   2 +-
 .../Org.Apache.REEF.Wake/Time/Event/StopTime.cs |   2 +-
 lang/cs/Org.Apache.REEF.Wake/Time/IClock.cs     |   1 +
 .../Time/Runtime/Event/ClientAlarm.cs           |   1 +
 .../Time/Runtime/Event/RuntimeAlarm.cs          |   1 +
 .../Time/Runtime/RuntimeClock.cs                |  14 +-
 .../src/main/cs/Examples/P2p/IEventSource.cs    |  35 --
 .../src/main/cs/Examples/P2p/Pull2Push.cs       | 103 ----
 .../src/main/cs/PeriodicEvent.cs                |  23 -
 485 files changed, 16429 insertions(+), 16540 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ActiveContextClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ActiveContextClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ActiveContextClr2Java.cpp
index 3ad4e43..6e56806 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ActiveContextClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ActiveContextClr2Java.cpp
@@ -23,83 +23,85 @@ namespace Org {
 		namespace REEF {
 			namespace Driver {
 				namespace Bridge {
-					private ref class ManagedLog {
+					namespace Clr2java {
+						private ref class ManagedLog {
 						internal:
 							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+						};
 
-					ActiveContextClr2Java::ActiveContextClr2Java(JNIEnv *env, jobject jobjectActiveContext) {
-						ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::ActiveContextClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
+						ActiveContextClr2Java::ActiveContextClr2Java(JNIEnv *env, jobject jobjectActiveContext) {
+							ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::ActiveContextClr2Java");
+							pin_ptr<JavaVM*> pJavaVm = &_jvm;
+							if (env->GetJavaVM(pJavaVm) != 0) {
+								ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+							}
 
-						_jobjectActiveContext = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectActiveContext));
+							_jobjectActiveContext = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectActiveContext));
 
-						jclass jclassActiveContext = env->GetObjectClass(_jobjectActiveContext);
+							jclass jclassActiveContext = env->GetObjectClass(_jobjectActiveContext);
 
-						jfieldID jidContextId = env->GetFieldID(jclassActiveContext, "contextId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectActiveContext, jidContextId)));
+							jfieldID jidContextId = env->GetFieldID(jclassActiveContext, "contextId", "Ljava/lang/String;");
+							_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectActiveContext, jidContextId)));
 
-						jfieldID jidEvaluatorId = env->GetFieldID(jclassActiveContext, "evaluatorId", "Ljava/lang/String;");
-						_jstringEvaluatorId = (jstring)env->GetObjectField(_jobjectActiveContext, jidEvaluatorId);
-						_jstringEvaluatorId = reinterpret_cast<jstring>(env->NewGlobalRef(_jstringEvaluatorId));
+							jfieldID jidEvaluatorId = env->GetFieldID(jclassActiveContext, "evaluatorId", "Ljava/lang/String;");
+							_jstringEvaluatorId = (jstring)env->GetObjectField(_jobjectActiveContext, jidEvaluatorId);
+							_jstringEvaluatorId = reinterpret_cast<jstring>(env->NewGlobalRef(_jstringEvaluatorId));
 
-						ManagedLog::LOGGER->LogStop("ActiveContextClr2Java::ActiveContextClr2Java");
-					}
+							ManagedLog::LOGGER->LogStop("ActiveContextClr2Java::ActiveContextClr2Java");
+						}
 
-					void ActiveContextClr2Java::SubmitTask(String^ taskConfigStr) {
-						ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::SubmitTask");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassActiveContext = env->GetObjectClass (_jobjectActiveContext);
-						jmethodID jmidSubmitTask = env->GetMethodID(jclassActiveContext, "submitTaskString", "(Ljava/lang/String;)V");
+						void ActiveContextClr2Java::SubmitTask(String^ taskConfigStr) {
+							ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::SubmitTask");
+							JNIEnv *env = RetrieveEnv(_jvm);
+							jclass jclassActiveContext = env->GetObjectClass(_jobjectActiveContext);
+							jmethodID jmidSubmitTask = env->GetMethodID(jclassActiveContext, "submitTaskString", "(Ljava/lang/String;)V");
 
-						if (jmidSubmitTask == NULL) {
-							ManagedLog::LOGGER->Log("jmidSubmitTask is NULL");
-							return;
+							if (jmidSubmitTask == NULL) {
+								ManagedLog::LOGGER->Log("jmidSubmitTask is NULL");
+								return;
+							}
+							env->CallObjectMethod(
+								_jobjectActiveContext,
+								jmidSubmitTask,
+								JavaStringFromManagedString(env, taskConfigStr));
+							ManagedLog::LOGGER->LogStop("ActiveContextClr2Java::SubmitTask");
 						}
-						env -> CallObjectMethod(
-							_jobjectActiveContext,
-							jmidSubmitTask,
-							JavaStringFromManagedString(env, taskConfigStr));
-						ManagedLog::LOGGER->LogStop("ActiveContextClr2Java::SubmitTask");
-					}
 
-					void ActiveContextClr2Java::OnError(String^ message) {
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectActiveContext);
-					}
+						void ActiveContextClr2Java::OnError(String^ message) {
+							JNIEnv *env = RetrieveEnv(_jvm);
+							HandleClr2JavaError(env, message, _jobjectActiveContext);
+						}
 
-					void ActiveContextClr2Java::Close() {
-						ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::Close");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassActiveContext = env->GetObjectClass (_jobjectActiveContext);
-						jmethodID jmidClose = env->GetMethodID(jclassActiveContext, "close", "()V");
+						void ActiveContextClr2Java::Close() {
+							ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::Close");
+							JNIEnv *env = RetrieveEnv(_jvm);
+							jclass jclassActiveContext = env->GetObjectClass(_jobjectActiveContext);
+							jmethodID jmidClose = env->GetMethodID(jclassActiveContext, "close", "()V");
 
-						if (jmidClose == NULL) {
-							ManagedLog::LOGGER->Log("jmidClose is NULL");
-							return;
+							if (jmidClose == NULL) {
+								ManagedLog::LOGGER->Log("jmidClose is NULL");
+								return;
+							}
+							env->CallObjectMethod(
+								_jobjectActiveContext,
+								jmidClose);
+							ManagedLog::LOGGER->LogStop("ActiveContextClr2Java::Close");
 						}
-						env -> CallObjectMethod(
-							_jobjectActiveContext,
-							jmidClose);
-						ManagedLog::LOGGER->LogStop("ActiveContextClr2Java::Close");
-					}
 
-					String^ ActiveContextClr2Java::GetId() {
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
+						String^ ActiveContextClr2Java::GetId() {
+							JNIEnv *env = RetrieveEnv(_jvm);
+							return ManagedStringFromJavaString(env, _jstringId);
+						}
 
-					String^ ActiveContextClr2Java::GetEvaluatorId() {
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringEvaluatorId);
-					}
+						String^ ActiveContextClr2Java::GetEvaluatorId() {
+							JNIEnv *env = RetrieveEnv(_jvm);
+							return ManagedStringFromJavaString(env, _jstringEvaluatorId);
+						}
 
-					IEvaluatorDescriptor^ ActiveContextClr2Java::GetEvaluatorDescriptor() {
-						ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::GetEvaluatorDescriptor");
-						return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectActiveContext, _jvm);
+						IEvaluatorDescriptor^ ActiveContextClr2Java::GetEvaluatorDescriptor() {
+							ManagedLog::LOGGER->LogStart("ActiveContextClr2Java::GetEvaluatorDescriptor");
+							return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectActiveContext, _jvm);
+						}
 					}
 				}
 			}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/AllocatedEvaluatorClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/AllocatedEvaluatorClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/AllocatedEvaluatorClr2Java.cpp
index b8f18c5..4dabd96 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/AllocatedEvaluatorClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/AllocatedEvaluatorClr2Java.cpp
@@ -22,145 +22,147 @@ using namespace JavaClrBridge;
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
-
-					AllocatedEvaluatorClr2Java::AllocatedEvaluatorClr2Java(JNIEnv *env, jobject jallocatedEvaluator) {
-
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::AllocatedEvaluatorClr2Java");
-
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectAllocatedEvaluator = reinterpret_cast<jobject>(env->NewGlobalRef(jallocatedEvaluator));
-
-						jclass jclassAllocatedEvaluator = env->GetObjectClass (_jobjectAllocatedEvaluator);
-						jfieldID jidEvaluatorId = env->GetFieldID(jclassAllocatedEvaluator, "evaluatorId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectAllocatedEvaluator, jidEvaluatorId)));
-
-						jfieldID jidNameServerInfo = env->GetFieldID(jclassAllocatedEvaluator, "nameServerInfo", "Ljava/lang/String;");
-						_jstringNameServerInfo = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectAllocatedEvaluator, jidNameServerInfo)));
-
-						ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::AllocatedEvaluatorClr2Java");
-					}
-
-					void AllocatedEvaluatorClr2Java::SubmitContext(String^ contextConfigStr) {
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContext");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassAllocatedEvaluator = env->GetObjectClass (_jobjectAllocatedEvaluator);
-						jmethodID jmidSubmitContext = env->GetMethodID(jclassAllocatedEvaluator, "submitContextString", "(Ljava/lang/String;)V");
-
-						if (jmidSubmitContext == NULL) {
-							ManagedLog::LOGGER->Log("jmidSubmitContext is NULL");
-							return;
-						}
-						env -> CallObjectMethod(
-							_jobjectAllocatedEvaluator,
-							jmidSubmitContext,
-							JavaStringFromManagedString(env, contextConfigStr));
-						ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContext");
-					}
-
-					void AllocatedEvaluatorClr2Java::SubmitContextAndTask(String^ contextConfigStr, String^ taskConfigStr) {
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContextAndTask");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassAllocatedEvaluator = env->GetObjectClass (_jobjectAllocatedEvaluator);
-						jmethodID jmidSubmitContextAndTask = env->GetMethodID(jclassAllocatedEvaluator, "submitContextAndTaskString", "(Ljava/lang/String;Ljava/lang/String;)V");
-
-						if (jmidSubmitContextAndTask == NULL) {
-							ManagedLog::LOGGER->Log("jmidSubmitContextAndTask is NULL");
-							return;
-						}
-						env -> CallObjectMethod(
-							_jobjectAllocatedEvaluator,
-							jmidSubmitContextAndTask,
-							JavaStringFromManagedString(env, contextConfigStr),
-							JavaStringFromManagedString(env, taskConfigStr));
-						ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContextAndTask");
-					}
-
-					void AllocatedEvaluatorClr2Java::SubmitContextAndService(String^ contextConfigStr, String^ serviceConfigStr) {
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContextAndService");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassAllocatedEvaluator = env->GetObjectClass (_jobjectAllocatedEvaluator);
-						jmethodID jmidSubmitContextAndService = env->GetMethodID(jclassAllocatedEvaluator, "submitContextAndServiceString", "(Ljava/lang/String;Ljava/lang/String;)V");
-
-						if (jmidSubmitContextAndService == NULL) {
-							ManagedLog::LOGGER->Log("jmidSubmitContextAndService is NULL");
-							return;
-						}
-						env -> CallObjectMethod(
-							_jobjectAllocatedEvaluator,
-							jmidSubmitContextAndService,
-							JavaStringFromManagedString(env, contextConfigStr),
-							JavaStringFromManagedString(env, serviceConfigStr));
-						ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContextAndService");
-					}
-
-					void AllocatedEvaluatorClr2Java::SubmitContextAndServiceAndTask(String^ contextConfigStr, String^ serviceConfigStr, String^ taskConfigStr) {
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContextAndServiceAndTask");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassAllocatedEvaluator = env->GetObjectClass (_jobjectAllocatedEvaluator);
-						jmethodID jmidSubmitContextAndServiceAndTask = env->GetMethodID(jclassAllocatedEvaluator, "submitContextAndServiceAndTaskString", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
-
-						if (jmidSubmitContextAndServiceAndTask == NULL) {
-							ManagedLog::LOGGER->Log("jmidSubmitContextAndServiceAndTask is NULL");
-							return;
-						}
-						env -> CallObjectMethod(
-							_jobjectAllocatedEvaluator,
-							jmidSubmitContextAndServiceAndTask,
-							JavaStringFromManagedString(env, contextConfigStr),
-							JavaStringFromManagedString(env, serviceConfigStr),
-							JavaStringFromManagedString(env, taskConfigStr));
-						ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContextAndServiceAndTask");
-					}
-
-					void AllocatedEvaluatorClr2Java::OnError(String^ message) {
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectAllocatedEvaluator);
-					}
-
-					void AllocatedEvaluatorClr2Java::Close() {
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::Close");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassAllocatedEvaluator = env->GetObjectClass (_jobjectAllocatedEvaluator);
-						jmethodID jmidClose = env->GetMethodID(jclassAllocatedEvaluator, "close", "()V");
-
-						if (jmidClose == NULL) {
-							ManagedLog::LOGGER->Log("jmidClose is NULL");
-							return;
-						}
-						env -> CallObjectMethod(
-							_jobjectAllocatedEvaluator,
-							jmidClose);
-						ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::Close");
-					}
-
-					String^ AllocatedEvaluatorClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("AllocatedEvaluatorClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
-
-					String^ AllocatedEvaluatorClr2Java::GetNameServerInfo() {
-						ManagedLog::LOGGER->Log("AllocatedEvaluatorClr2Java::GetNameServerInfo");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringNameServerInfo);
-					}
-
-					IEvaluatorDescriptor^ AllocatedEvaluatorClr2Java::GetEvaluatorDescriptor() {
-						ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::GetEvaluatorDescriptor");
-						return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectAllocatedEvaluator, _jvm);
-					}
-				}
-			}
-		}
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
+
+					  AllocatedEvaluatorClr2Java::AllocatedEvaluatorClr2Java(JNIEnv *env, jobject jallocatedEvaluator) {
+
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::AllocatedEvaluatorClr2Java");
+
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectAllocatedEvaluator = reinterpret_cast<jobject>(env->NewGlobalRef(jallocatedEvaluator));
+
+						  jclass jclassAllocatedEvaluator = env->GetObjectClass(_jobjectAllocatedEvaluator);
+						  jfieldID jidEvaluatorId = env->GetFieldID(jclassAllocatedEvaluator, "evaluatorId", "Ljava/lang/String;");
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectAllocatedEvaluator, jidEvaluatorId)));
+
+						  jfieldID jidNameServerInfo = env->GetFieldID(jclassAllocatedEvaluator, "nameServerInfo", "Ljava/lang/String;");
+						  _jstringNameServerInfo = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectAllocatedEvaluator, jidNameServerInfo)));
+
+						  ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::AllocatedEvaluatorClr2Java");
+					  }
+
+					  void AllocatedEvaluatorClr2Java::SubmitContext(String^ contextConfigStr) {
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContext");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassAllocatedEvaluator = env->GetObjectClass(_jobjectAllocatedEvaluator);
+						  jmethodID jmidSubmitContext = env->GetMethodID(jclassAllocatedEvaluator, "submitContextString", "(Ljava/lang/String;)V");
+
+						  if (jmidSubmitContext == NULL) {
+							  ManagedLog::LOGGER->Log("jmidSubmitContext is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectAllocatedEvaluator,
+							  jmidSubmitContext,
+							  JavaStringFromManagedString(env, contextConfigStr));
+						  ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContext");
+					  }
+
+					  void AllocatedEvaluatorClr2Java::SubmitContextAndTask(String^ contextConfigStr, String^ taskConfigStr) {
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContextAndTask");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassAllocatedEvaluator = env->GetObjectClass(_jobjectAllocatedEvaluator);
+						  jmethodID jmidSubmitContextAndTask = env->GetMethodID(jclassAllocatedEvaluator, "submitContextAndTaskString", "(Ljava/lang/String;Ljava/lang/String;)V");
+
+						  if (jmidSubmitContextAndTask == NULL) {
+							  ManagedLog::LOGGER->Log("jmidSubmitContextAndTask is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectAllocatedEvaluator,
+							  jmidSubmitContextAndTask,
+							  JavaStringFromManagedString(env, contextConfigStr),
+							  JavaStringFromManagedString(env, taskConfigStr));
+						  ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContextAndTask");
+					  }
+
+					  void AllocatedEvaluatorClr2Java::SubmitContextAndService(String^ contextConfigStr, String^ serviceConfigStr) {
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContextAndService");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassAllocatedEvaluator = env->GetObjectClass(_jobjectAllocatedEvaluator);
+						  jmethodID jmidSubmitContextAndService = env->GetMethodID(jclassAllocatedEvaluator, "submitContextAndServiceString", "(Ljava/lang/String;Ljava/lang/String;)V");
+
+						  if (jmidSubmitContextAndService == NULL) {
+							  ManagedLog::LOGGER->Log("jmidSubmitContextAndService is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectAllocatedEvaluator,
+							  jmidSubmitContextAndService,
+							  JavaStringFromManagedString(env, contextConfigStr),
+							  JavaStringFromManagedString(env, serviceConfigStr));
+						  ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContextAndService");
+					  }
+
+					  void AllocatedEvaluatorClr2Java::SubmitContextAndServiceAndTask(String^ contextConfigStr, String^ serviceConfigStr, String^ taskConfigStr) {
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::SubmitContextAndServiceAndTask");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassAllocatedEvaluator = env->GetObjectClass(_jobjectAllocatedEvaluator);
+						  jmethodID jmidSubmitContextAndServiceAndTask = env->GetMethodID(jclassAllocatedEvaluator, "submitContextAndServiceAndTaskString", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
+
+						  if (jmidSubmitContextAndServiceAndTask == NULL) {
+							  ManagedLog::LOGGER->Log("jmidSubmitContextAndServiceAndTask is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectAllocatedEvaluator,
+							  jmidSubmitContextAndServiceAndTask,
+							  JavaStringFromManagedString(env, contextConfigStr),
+							  JavaStringFromManagedString(env, serviceConfigStr),
+							  JavaStringFromManagedString(env, taskConfigStr));
+						  ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::SubmitContextAndServiceAndTask");
+					  }
+
+					  void AllocatedEvaluatorClr2Java::OnError(String^ message) {
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectAllocatedEvaluator);
+					  }
+
+					  void AllocatedEvaluatorClr2Java::Close() {
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::Close");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassAllocatedEvaluator = env->GetObjectClass(_jobjectAllocatedEvaluator);
+						  jmethodID jmidClose = env->GetMethodID(jclassAllocatedEvaluator, "close", "()V");
+
+						  if (jmidClose == NULL) {
+							  ManagedLog::LOGGER->Log("jmidClose is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectAllocatedEvaluator,
+							  jmidClose);
+						  ManagedLog::LOGGER->LogStop("AllocatedEvaluatorClr2Java::Close");
+					  }
+
+					  String^ AllocatedEvaluatorClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("AllocatedEvaluatorClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
+
+					  String^ AllocatedEvaluatorClr2Java::GetNameServerInfo() {
+						  ManagedLog::LOGGER->Log("AllocatedEvaluatorClr2Java::GetNameServerInfo");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringNameServerInfo);
+					  }
+
+					  IEvaluatorDescriptor^ AllocatedEvaluatorClr2Java::GetEvaluatorDescriptor() {
+						  ManagedLog::LOGGER->LogStart("AllocatedEvaluatorClr2Java::GetEvaluatorDescriptor");
+						  return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectAllocatedEvaluator, _jvm);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ClosedContextClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ClosedContextClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ClosedContextClr2Java.cpp
index 1e1c879..6584abe 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ClosedContextClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ClosedContextClr2Java.cpp
@@ -20,69 +20,71 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
-					ClosedContextClr2Java::ClosedContextClr2Java(JNIEnv *env, jobject jobjectClosedContext) {
-						ManagedLog::LOGGER->LogStart("ClosedContextClr2Java::ClosedContextClr2Java");
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
+					  ClosedContextClr2Java::ClosedContextClr2Java(JNIEnv *env, jobject jobjectClosedContext) {
+						  ManagedLog::LOGGER->LogStart("ClosedContextClr2Java::ClosedContextClr2Java");
 
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectClosedContext = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectClosedContext));
-						jclass jclassClosedContext = env->GetObjectClass (_jobjectClosedContext);
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectClosedContext = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectClosedContext));
+						  jclass jclassClosedContext = env->GetObjectClass(_jobjectClosedContext);
 
-						jfieldID jidContextId = env->GetFieldID(jclassClosedContext, "contextId", "Ljava/lang/String;");
-						jfieldID jidEvaluatorId = env->GetFieldID(jclassClosedContext, "evaluatorId", "Ljava/lang/String;");
+						  jfieldID jidContextId = env->GetFieldID(jclassClosedContext, "contextId", "Ljava/lang/String;");
+						  jfieldID jidEvaluatorId = env->GetFieldID(jclassClosedContext, "evaluatorId", "Ljava/lang/String;");
 
-						_jstringContextId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectClosedContext, jidContextId)));
-						_jstringEvaluatorId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectClosedContext, jidEvaluatorId)));
+						  _jstringContextId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectClosedContext, jidContextId)));
+						  _jstringEvaluatorId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectClosedContext, jidEvaluatorId)));
 
-						ManagedLog::LOGGER->LogStop("ClosedContextClr2Java::ClosedContextClr2Java");
-					}
+						  ManagedLog::LOGGER->LogStop("ClosedContextClr2Java::ClosedContextClr2Java");
+					  }
 
-					IActiveContextClr2Java^ ClosedContextClr2Java::GetParentContext() {
-						ManagedLog::LOGGER->LogStart("ClosedContextClr2Java::GetParentContext");
+					  IActiveContextClr2Java^ ClosedContextClr2Java::GetParentContext() {
+						  ManagedLog::LOGGER->LogStart("ClosedContextClr2Java::GetParentContext");
 
-						JNIEnv *env = RetrieveEnv(_jvm);
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassClosedContext = env->GetObjectClass(_jobjectClosedContext);
-						jfieldID jidParentContext = env->GetFieldID(jclassClosedContext, "parentContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
-						jobject jobjectParentContext = env->GetObjectField(_jobjectClosedContext, jidParentContext);
-						ManagedLog::LOGGER->LogStop("ClosedContextClr2Java::GetParentContext");
+						  jclass jclassClosedContext = env->GetObjectClass(_jobjectClosedContext);
+						  jfieldID jidParentContext = env->GetFieldID(jclassClosedContext, "parentContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
+						  jobject jobjectParentContext = env->GetObjectField(_jobjectClosedContext, jidParentContext);
+						  ManagedLog::LOGGER->LogStop("ClosedContextClr2Java::GetParentContext");
 
-						return gcnew ActiveContextClr2Java(env, jobjectParentContext);
-					}
+						  return gcnew ActiveContextClr2Java(env, jobjectParentContext);
+					  }
 
-					String^ ClosedContextClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("ClosedContextClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringContextId);
-					}
+					  String^ ClosedContextClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("ClosedContextClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringContextId);
+					  }
 
-					String^ ClosedContextClr2Java::GetEvaluatorId() {
-						ManagedLog::LOGGER->Log("ClosedContextClr2Java::GetEvaluatorId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringEvaluatorId);
-					}
+					  String^ ClosedContextClr2Java::GetEvaluatorId() {
+						  ManagedLog::LOGGER->Log("ClosedContextClr2Java::GetEvaluatorId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringEvaluatorId);
+					  }
 
-					IEvaluatorDescriptor^ ClosedContextClr2Java::GetEvaluatorDescriptor() {
-						ManagedLog::LOGGER->LogStart("ClosedContextClr2Java::GetEvaluatorDescriptor");
-						return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectClosedContext, _jvm);
-					}
+					  IEvaluatorDescriptor^ ClosedContextClr2Java::GetEvaluatorDescriptor() {
+						  ManagedLog::LOGGER->LogStart("ClosedContextClr2Java::GetEvaluatorDescriptor");
+						  return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectClosedContext, _jvm);
+					  }
 
-					void ClosedContextClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("ClosedContextClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectClosedContext);
-					}
-				}
-			}
-		}
+					  void ClosedContextClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("ClosedContextClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectClosedContext);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/Clr2JavaImpl.h
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/Clr2JavaImpl.h b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/Clr2JavaImpl.h
index 55c332a..cf0dd1c 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/Clr2JavaImpl.h
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/Clr2JavaImpl.h
@@ -33,190 +33,192 @@ using namespace Org::Apache::REEF::Driver::Evaluator;
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					public ref class CommonUtilities {
-						public:
-							static IEvaluatorDescriptor^ RetrieveEvaluatorDescriptor(jobject object, JavaVM* jvm);
-					};
-
-					public ref class AllocatedEvaluatorClr2Java : public IAllocatedEvaluaotrClr2Java {
-							jobject  _jobjectAllocatedEvaluator;
-							JavaVM* _jvm;
-							jstring _jstringId;
-							jstring _jstringNameServerInfo;
-						public:
-							AllocatedEvaluatorClr2Java(JNIEnv *env, jobject jallocatedEvaluator);
-							virtual void SubmitContextAndTask(String^ contextConfigStr, String^ taskConfigStr);
-							virtual void SubmitContext(String^ contextConfigStr);
-							virtual void SubmitContextAndService(String^ contextConfigStr, String^ serviceConfigStr);
-							virtual void SubmitContextAndServiceAndTask(String^ contextConfigStr, String^ serviceConfigStr, String^ taskConfigStr);
-							virtual void OnError(String^ message);
-							virtual void Close();
-							virtual String^ GetId();
-							virtual String^ GetNameServerInfo();
-							virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
-					};
-
-					public ref class ActiveContextClr2Java : public IActiveContextClr2Java {
-							jobject _jobjectActiveContext;
-							jstring _jstringId;
-							jstring _jstringEvaluatorId;
-							JavaVM* _jvm;
-						public:
-							ActiveContextClr2Java(JNIEnv *env, jobject jallocatedEvaluator);
-							virtual void SubmitTask(String^ taskConfigStr);
-							virtual void Close();
-							virtual void OnError(String^ message);
-							virtual String^ GetId();
-							virtual String^ GetEvaluatorId();
-							virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
-					};
-
-					public ref class EvaluatorRequestorClr2Java : public IEvaluatorRequestorClr2Java {
-							jobject  _jobjectEvaluatorRequestor;
-							JavaVM* _jvm;
-						public:
-							EvaluatorRequestorClr2Java(JNIEnv *env, jobject jevaluatorRequestor);
-							virtual void OnError(String^ message);
-							virtual void Submit(IEvaluatorRequest^ request);
-					};
-
-					public ref class TaskMessageClr2Java : public ITaskMessageClr2Java {
-							jobject  _jobjectTaskMessage;
-							JavaVM* _jvm;
-							jstring _jstringId;
-						public:
-							TaskMessageClr2Java(JNIEnv *env, jobject jtaskMessage);
-							virtual void OnError(String^ message);
-							virtual String^ GetId();
-					};
-
-					public ref class FailedTaskClr2Java : public IFailedTaskClr2Java {
-							jobject  _jobjectFailedTask;
-							JavaVM* _jvm;
-						public:
-							FailedTaskClr2Java(JNIEnv *env, jobject jfailedTask);
-							virtual void OnError(String^ message);
-							virtual IActiveContextClr2Java^ GetActiveContext();
-							virtual String^ GetString();
-					};
-
-					public ref class RunningTaskClr2Java : public IRunningTaskClr2Java {
-							jobject  _jobjectRunningTask;
-							JavaVM* _jvm;
-							jstring _jstringId;
-						public:
-							RunningTaskClr2Java(JNIEnv *env, jobject jrunningTask);
-							virtual void OnError(String^ message);
-							virtual IActiveContextClr2Java^ GetActiveContext();
-							virtual String^ GetId();
-							virtual void Send(array<byte>^ message);
-					};
-
-					public ref class FailedEvaluatorClr2Java : public IFailedEvaluatorClr2Java {
-							jobject  _jobjectFailedEvaluator;
-							JavaVM* _jvm;
-							jstring _jstringId;
-						public:
-							FailedEvaluatorClr2Java(JNIEnv *env, jobject jfailedEvaluator);
-							virtual void OnError(String^ message);
-							virtual IEvaluatorRequestorClr2Java^ GetEvaluatorRequestor();
-							virtual String^ GetId();
-					};
-
-					public ref class HttpServerClr2Java : public IHttpServerBridgeClr2Java {
-							jobject _jhttpServerEventBridge;
-							JavaVM* _jvm;
-						public:
-							HttpServerClr2Java(JNIEnv *env, jobject jhttpServerEventBridge);
-							virtual void OnError(String^ message);
-							virtual String^ GetQueryString();
-							virtual void SetUriSpecification(String^ uriSpecification);
-							virtual void SetQueryResult(String^ queryResult);
-							virtual array<byte>^ GetQueryRequestData();
-							virtual void SetQueryResponseData(array<byte>^ responseData);
-					};
-
-					public ref class CompletedTaskClr2Java : public ICompletedTaskClr2Java {
-							jobject  _jobjectCompletedTask;
-							JavaVM* _jvm;
-							jstring _jstringId;
-						public:
-							CompletedTaskClr2Java(JNIEnv *env, jobject jcompletedTask);
-							virtual void OnError(String^ message);
-							virtual IActiveContextClr2Java^ GetActiveContext();
-							virtual String^ GetId();
-					};
-
-					public ref class SuspendedTaskClr2Java : public ISuspendedTaskClr2Java {
-							jobject  _jobjectSuspendedTask;
-							JavaVM* _jvm;
-							jstring _jstringId;
-						public:
-							SuspendedTaskClr2Java(JNIEnv *env, jobject jobjectSuspendedTask);
-							virtual void OnError(String^ message);
-							virtual IActiveContextClr2Java^ GetActiveContext();
-							virtual String^ GetId();
-							virtual array<byte>^ Get();
-					};
-
-					public ref class CompletedEvaluatorClr2Java : public ICompletedEvaluatorClr2Java {
-							jobject  _jobjectCompletedEvaluator;
-							JavaVM* _jvm;
-							jstring _jstringId;
-						public:
-							CompletedEvaluatorClr2Java(JNIEnv *env, jobject jobjectCompletedEvaluator);
-							virtual void OnError(String^ message);
-							virtual String^ GetId();
-					};
-
-					public ref class ClosedContextClr2Java : public IClosedContextClr2Java {
-							jobject  _jobjectClosedContext;
-							JavaVM* _jvm;
-							jstring _jstringContextId;
-							jstring _jstringEvaluatorId;
-						public:
-							ClosedContextClr2Java(JNIEnv *env, jobject jobjectClosedContext);
-							virtual void OnError(String^ message);
-							virtual String^ GetId();
-							virtual String^ GetEvaluatorId();
-							virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
-							virtual IActiveContextClr2Java^ GetParentContext();
-					};
-
-					public ref class FailedContextClr2Java : public IFailedContextClr2Java {
-							jobject  _jobjectFailedContext;
-							JavaVM* _jvm;
-							jstring _jstringContextId;
-							jstring _jstringEvaluatorId;
-							jstring _jstringParentContextId;
-						public:
-							FailedContextClr2Java(JNIEnv *env, jobject jobjectFailedContext);
-							virtual void OnError(String^ message);
-							virtual String^ GetId();
-							virtual String^ GetEvaluatorId();
-							virtual String^ GetParentId();
-							virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
-							virtual IActiveContextClr2Java^ GetParentContext();
-					};
-
-					public ref class ContextMessageClr2Java : public IContextMessageClr2Java {
-							jobject  _jobjectContextMessage;
-							JavaVM* _jvm;
-							jbyteArray _jarrayMessage;
-							jstring _jstringId;
-							jstring _jstringSourceId;
-						public:
-							ContextMessageClr2Java(JNIEnv *env, jobject jobjectContextMessage);
-							virtual void OnError(String^ message);
-							virtual array<byte>^ Get();
-							virtual String^ GetId();
-							virtual String^ GetMessageSourceId();
-					};
-				}
-			}
-		}
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  public ref class CommonUtilities {
+					  public:
+						  static IEvaluatorDescriptor^ RetrieveEvaluatorDescriptor(jobject object, JavaVM* jvm);
+					  };
+
+					  public ref class AllocatedEvaluatorClr2Java : public IAllocatedEvaluaotrClr2Java {
+						  jobject  _jobjectAllocatedEvaluator;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+						  jstring _jstringNameServerInfo;
+					  public:
+						  AllocatedEvaluatorClr2Java(JNIEnv *env, jobject jallocatedEvaluator);
+						  virtual void SubmitContextAndTask(String^ contextConfigStr, String^ taskConfigStr);
+						  virtual void SubmitContext(String^ contextConfigStr);
+						  virtual void SubmitContextAndService(String^ contextConfigStr, String^ serviceConfigStr);
+						  virtual void SubmitContextAndServiceAndTask(String^ contextConfigStr, String^ serviceConfigStr, String^ taskConfigStr);
+						  virtual void OnError(String^ message);
+						  virtual void Close();
+						  virtual String^ GetId();
+						  virtual String^ GetNameServerInfo();
+						  virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
+					  };
+
+					  public ref class ActiveContextClr2Java : public IActiveContextClr2Java {
+						  jobject _jobjectActiveContext;
+						  jstring _jstringId;
+						  jstring _jstringEvaluatorId;
+						  JavaVM* _jvm;
+					  public:
+						  ActiveContextClr2Java(JNIEnv *env, jobject jallocatedEvaluator);
+						  virtual void SubmitTask(String^ taskConfigStr);
+						  virtual void Close();
+						  virtual void OnError(String^ message);
+						  virtual String^ GetId();
+						  virtual String^ GetEvaluatorId();
+						  virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
+					  };
+
+					  public ref class EvaluatorRequestorClr2Java : public IEvaluatorRequestorClr2Java {
+						  jobject  _jobjectEvaluatorRequestor;
+						  JavaVM* _jvm;
+					  public:
+						  EvaluatorRequestorClr2Java(JNIEnv *env, jobject jevaluatorRequestor);
+						  virtual void OnError(String^ message);
+						  virtual void Submit(IEvaluatorRequest^ request);
+					  };
+
+					  public ref class TaskMessageClr2Java : public ITaskMessageClr2Java {
+						  jobject  _jobjectTaskMessage;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+					  public:
+						  TaskMessageClr2Java(JNIEnv *env, jobject jtaskMessage);
+						  virtual void OnError(String^ message);
+						  virtual String^ GetId();
+					  };
+
+					  public ref class FailedTaskClr2Java : public IFailedTaskClr2Java {
+						  jobject  _jobjectFailedTask;
+						  JavaVM* _jvm;
+					  public:
+						  FailedTaskClr2Java(JNIEnv *env, jobject jfailedTask);
+						  virtual void OnError(String^ message);
+						  virtual IActiveContextClr2Java^ GetActiveContext();
+						  virtual String^ GetString();
+					  };
+
+					  public ref class RunningTaskClr2Java : public IRunningTaskClr2Java {
+						  jobject  _jobjectRunningTask;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+					  public:
+						  RunningTaskClr2Java(JNIEnv *env, jobject jrunningTask);
+						  virtual void OnError(String^ message);
+						  virtual IActiveContextClr2Java^ GetActiveContext();
+						  virtual String^ GetId();
+						  virtual void Send(array<byte>^ message);
+					  };
+
+					  public ref class FailedEvaluatorClr2Java : public IFailedEvaluatorClr2Java {
+						  jobject  _jobjectFailedEvaluator;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+					  public:
+						  FailedEvaluatorClr2Java(JNIEnv *env, jobject jfailedEvaluator);
+						  virtual void OnError(String^ message);
+						  virtual IEvaluatorRequestorClr2Java^ GetEvaluatorRequestor();
+						  virtual String^ GetId();
+					  };
+
+					  public ref class HttpServerClr2Java : public IHttpServerBridgeClr2Java {
+						  jobject _jhttpServerEventBridge;
+						  JavaVM* _jvm;
+					  public:
+						  HttpServerClr2Java(JNIEnv *env, jobject jhttpServerEventBridge);
+						  virtual void OnError(String^ message);
+						  virtual String^ GetQueryString();
+						  virtual void SetUriSpecification(String^ uriSpecification);
+						  virtual void SetQueryResult(String^ queryResult);
+						  virtual array<byte>^ GetQueryRequestData();
+						  virtual void SetQueryResponseData(array<byte>^ responseData);
+					  };
+
+					  public ref class CompletedTaskClr2Java : public ICompletedTaskClr2Java {
+						  jobject  _jobjectCompletedTask;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+					  public:
+						  CompletedTaskClr2Java(JNIEnv *env, jobject jcompletedTask);
+						  virtual void OnError(String^ message);
+						  virtual IActiveContextClr2Java^ GetActiveContext();
+						  virtual String^ GetId();
+					  };
+
+					  public ref class SuspendedTaskClr2Java : public ISuspendedTaskClr2Java {
+						  jobject  _jobjectSuspendedTask;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+					  public:
+						  SuspendedTaskClr2Java(JNIEnv *env, jobject jobjectSuspendedTask);
+						  virtual void OnError(String^ message);
+						  virtual IActiveContextClr2Java^ GetActiveContext();
+						  virtual String^ GetId();
+						  virtual array<byte>^ Get();
+					  };
+
+					  public ref class CompletedEvaluatorClr2Java : public ICompletedEvaluatorClr2Java {
+						  jobject  _jobjectCompletedEvaluator;
+						  JavaVM* _jvm;
+						  jstring _jstringId;
+					  public:
+						  CompletedEvaluatorClr2Java(JNIEnv *env, jobject jobjectCompletedEvaluator);
+						  virtual void OnError(String^ message);
+						  virtual String^ GetId();
+					  };
+
+					  public ref class ClosedContextClr2Java : public IClosedContextClr2Java {
+						  jobject  _jobjectClosedContext;
+						  JavaVM* _jvm;
+						  jstring _jstringContextId;
+						  jstring _jstringEvaluatorId;
+					  public:
+						  ClosedContextClr2Java(JNIEnv *env, jobject jobjectClosedContext);
+						  virtual void OnError(String^ message);
+						  virtual String^ GetId();
+						  virtual String^ GetEvaluatorId();
+						  virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
+						  virtual IActiveContextClr2Java^ GetParentContext();
+					  };
+
+					  public ref class FailedContextClr2Java : public IFailedContextClr2Java {
+						  jobject  _jobjectFailedContext;
+						  JavaVM* _jvm;
+						  jstring _jstringContextId;
+						  jstring _jstringEvaluatorId;
+						  jstring _jstringParentContextId;
+					  public:
+						  FailedContextClr2Java(JNIEnv *env, jobject jobjectFailedContext);
+						  virtual void OnError(String^ message);
+						  virtual String^ GetId();
+						  virtual String^ GetEvaluatorId();
+						  virtual String^ GetParentId();
+						  virtual IEvaluatorDescriptor^ GetEvaluatorDescriptor();
+						  virtual IActiveContextClr2Java^ GetParentContext();
+					  };
+
+					  public ref class ContextMessageClr2Java : public IContextMessageClr2Java {
+						  jobject  _jobjectContextMessage;
+						  JavaVM* _jvm;
+						  jbyteArray _jarrayMessage;
+						  jstring _jstringId;
+						  jstring _jstringSourceId;
+					  public:
+						  ContextMessageClr2Java(JNIEnv *env, jobject jobjectContextMessage);
+						  virtual void OnError(String^ message);
+						  virtual array<byte>^ Get();
+						  virtual String^ GetId();
+						  virtual String^ GetMessageSourceId();
+					  };
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CommonUtilities.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CommonUtilities.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CommonUtilities.cpp
index 2a397bc..5de6e75 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CommonUtilities.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CommonUtilities.cpp
@@ -20,34 +20,36 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>CommonUtilities");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>CommonUtilities");
+					  };
 
-					IEvaluatorDescriptor^ CommonUtilities::RetrieveEvaluatorDescriptor(jobject object, JavaVM* jvm) {
-						ManagedLog::LOGGER->LogStart("CommonUtilities::GetEvaluatorDescriptor");
-						JNIEnv *env = RetrieveEnv(jvm);
-						jclass jclassActiveContext = env->GetObjectClass (object);
-						jmethodID jmidGetEvaluatorDescriptor = env->GetMethodID(jclassActiveContext, "getEvaluatorDescriptorSring", "()Ljava/lang/String;");
+					  IEvaluatorDescriptor^ CommonUtilities::RetrieveEvaluatorDescriptor(jobject object, JavaVM* jvm) {
+						  ManagedLog::LOGGER->LogStart("CommonUtilities::GetEvaluatorDescriptor");
+						  JNIEnv *env = RetrieveEnv(jvm);
+						  jclass jclassActiveContext = env->GetObjectClass(object);
+						  jmethodID jmidGetEvaluatorDescriptor = env->GetMethodID(jclassActiveContext, "getEvaluatorDescriptorSring", "()Ljava/lang/String;");
 
-						if (jmidGetEvaluatorDescriptor == NULL) {
-							ManagedLog::LOGGER->Log("jmidGetEvaluatorDescriptor is NULL");
-							return nullptr;
-						}
-						jstring jevaluatorDescriptorString = (jstring)env -> CallObjectMethod(
-																									 object,
-																									 jmidGetEvaluatorDescriptor);
-						String^ evaluatorDescriptorString = ManagedStringFromJavaString(env, jevaluatorDescriptorString);
-						ManagedLog::LOGGER->LogStop("InteropUtil::GetEvaluatorDescriptor");
+						  if (jmidGetEvaluatorDescriptor == NULL) {
+							  ManagedLog::LOGGER->Log("jmidGetEvaluatorDescriptor is NULL");
+							  return nullptr;
+						  }
+						  jstring jevaluatorDescriptorString = (jstring)env->CallObjectMethod(
+							  object,
+							  jmidGetEvaluatorDescriptor);
+						  String^ evaluatorDescriptorString = ManagedStringFromJavaString(env, jevaluatorDescriptorString);
+						  ManagedLog::LOGGER->LogStop("InteropUtil::GetEvaluatorDescriptor");
 
-						return gcnew EvaluatorDescriptorImpl(evaluatorDescriptorString);
-					}
-				}
-			}
-		}
+						  return gcnew EvaluatorDescriptorImpl(evaluatorDescriptorString);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedEvaluatorClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedEvaluatorClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedEvaluatorClr2Java.cpp
index 5d9b124..c961881 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedEvaluatorClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedEvaluatorClr2Java.cpp
@@ -20,41 +20,43 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					CompletedEvaluatorClr2Java::CompletedEvaluatorClr2Java(JNIEnv *env, jobject jCompletedEvaluator) {
-						ManagedLog::LOGGER->LogStart("CompletedEvaluatorClr2Java::CompletedEvaluatorClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectCompletedEvaluator = reinterpret_cast<jobject>(env->NewGlobalRef(jCompletedEvaluator));
+					  CompletedEvaluatorClr2Java::CompletedEvaluatorClr2Java(JNIEnv *env, jobject jCompletedEvaluator) {
+						  ManagedLog::LOGGER->LogStart("CompletedEvaluatorClr2Java::CompletedEvaluatorClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectCompletedEvaluator = reinterpret_cast<jobject>(env->NewGlobalRef(jCompletedEvaluator));
 
-						jclass jclassCompletedEvaluator = env->GetObjectClass (_jobjectCompletedEvaluator);
-						jfieldID jidEvaluatorId = env->GetFieldID(jclassCompletedEvaluator, "evaluatorId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectCompletedEvaluator, jidEvaluatorId)));
-						ManagedLog::LOGGER->LogStop("CompletedEvaluatorClr2Java::CompletedEvaluatorClr2Java");
-					}
+						  jclass jclassCompletedEvaluator = env->GetObjectClass(_jobjectCompletedEvaluator);
+						  jfieldID jidEvaluatorId = env->GetFieldID(jclassCompletedEvaluator, "evaluatorId", "Ljava/lang/String;");
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectCompletedEvaluator, jidEvaluatorId)));
+						  ManagedLog::LOGGER->LogStop("CompletedEvaluatorClr2Java::CompletedEvaluatorClr2Java");
+					  }
 
-					void CompletedEvaluatorClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("CompletedEvaluatorClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectCompletedEvaluator);
-					}
+					  void CompletedEvaluatorClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("CompletedEvaluatorClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectCompletedEvaluator);
+					  }
 
-					String^ CompletedEvaluatorClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("CompletedEvaluatorClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
-				}
-			}
-		}
+					  String^ CompletedEvaluatorClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("CompletedEvaluatorClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedTaskClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedTaskClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedTaskClr2Java.cpp
index 10a1166..be9fe31 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedTaskClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/CompletedTaskClr2Java.cpp
@@ -20,52 +20,54 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					CompletedTaskClr2Java::CompletedTaskClr2Java(JNIEnv *env, jobject jobjectCompletedTask) {
-						ManagedLog::LOGGER->LogStart("CompletedTaskClr2Java::CompletedTaskClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectCompletedTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectCompletedTask));
+					  CompletedTaskClr2Java::CompletedTaskClr2Java(JNIEnv *env, jobject jobjectCompletedTask) {
+						  ManagedLog::LOGGER->LogStart("CompletedTaskClr2Java::CompletedTaskClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectCompletedTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectCompletedTask));
 
-						jclass jclassCompletedTask = env->GetObjectClass (_jobjectCompletedTask);
-						jfieldID jidTaskId = env->GetFieldID(jclassCompletedTask, "taskId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectCompletedTask, jidTaskId)));
-						ManagedLog::LOGGER->LogStop("CompletedTaskClr2Java::CompletedTaskClr2Java");
-					}
+						  jclass jclassCompletedTask = env->GetObjectClass(_jobjectCompletedTask);
+						  jfieldID jidTaskId = env->GetFieldID(jclassCompletedTask, "taskId", "Ljava/lang/String;");
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectCompletedTask, jidTaskId)));
+						  ManagedLog::LOGGER->LogStop("CompletedTaskClr2Java::CompletedTaskClr2Java");
+					  }
 
-					void CompletedTaskClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("CompletedTaskClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectCompletedTask);
-					}
+					  void CompletedTaskClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("CompletedTaskClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectCompletedTask);
+					  }
 
-					IActiveContextClr2Java^ CompletedTaskClr2Java::GetActiveContext() {
-						ManagedLog::LOGGER->LogStart("CompletedTaskClr2Java::GetActiveContext");
-						JNIEnv *env = RetrieveEnv(_jvm);
+					  IActiveContextClr2Java^ CompletedTaskClr2Java::GetActiveContext() {
+						  ManagedLog::LOGGER->LogStart("CompletedTaskClr2Java::GetActiveContext");
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassCompletedTask = env->GetObjectClass (_jobjectCompletedTask);
-						jfieldID jidActiveContext = env->GetFieldID(jclassCompletedTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
-						jobject jobjectActiveContext = env->GetObjectField(_jobjectCompletedTask, jidActiveContext);
-						ManagedLog::LOGGER->LogStop("CompletedTaskClr2Java::GetActiveContext");
-						return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
-					}
+						  jclass jclassCompletedTask = env->GetObjectClass(_jobjectCompletedTask);
+						  jfieldID jidActiveContext = env->GetFieldID(jclassCompletedTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
+						  jobject jobjectActiveContext = env->GetObjectField(_jobjectCompletedTask, jidActiveContext);
+						  ManagedLog::LOGGER->LogStop("CompletedTaskClr2Java::GetActiveContext");
+						  return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
+					  }
 
-					String^ CompletedTaskClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("CompletedTaskClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
-				}
-			}
-		}
+					  String^ CompletedTaskClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("CompletedTaskClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file


[07/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedTask.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedTask.cs
new file mode 100644
index 0000000..119ec98
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedTask.cs
@@ -0,0 +1,141 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    public class FailedTask : IFailedTask
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(FailedTask));
+        
+        public FailedTask(IFailedTaskClr2Java failedTaskClr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            Parse(failedTaskClr2Java);
+            FailedTaskClr2Java = failedTaskClr2Java;
+            ActiveContextClr2Java = failedTaskClr2Java.GetActiveContext();
+        }
+
+        public Optional<string> Reason { get; set; }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public string Id { get; set; }
+
+        public string Message { get; set; }
+
+        public Optional<string> Description { get; set; }
+
+        public Optional<Exception> Cause { get; set; }
+
+        public Optional<byte[]> Data { get; set; }
+
+        [DataMember]
+        private IFailedTaskClr2Java FailedTaskClr2Java { get; set; }
+
+        [DataMember]
+        private IActiveContextClr2Java ActiveContextClr2Java { get; set; }
+
+        /// <summary>
+        /// Access the context the task ran (and crashed) on, if it could be recovered.
+        /// An ActiveContext is given when the task fails but the context remains alive.
+        /// On context failure, the context also fails and is surfaced via the FailedContext event.
+        /// Note that receiving an ActiveContext here is no guarantee that the context (and evaluator)
+        /// are in a consistent state. Application developers need to investigate the reason available
+        /// via getCause() to make that call.
+        /// return the context the Task ran on.
+        /// </summary>
+        public Optional<IActiveContext> GetActiveContext()
+        {
+            IActiveContext activeContext = new ActiveContext(ActiveContextClr2Java);
+            return ActiveContextClr2Java == null ? Optional<IActiveContext>.Empty() : Optional<IActiveContext>.Of(activeContext);
+        }
+
+        public Exception AsError()
+        {
+            throw new NotImplementedException();
+        }
+
+        private void Parse(IFailedTaskClr2Java failedTaskClr2Java)
+        {
+            string serializedInfo = failedTaskClr2Java.GetString();
+            LOGGER.Log(Level.Verbose, "serialized failed task: " + serializedInfo);
+            Dictionary<string, string> settings = new Dictionary<string, string>();
+            string[] components = serializedInfo.Split(',');
+            foreach (string component in components)
+            {
+                string[] pair = component.Trim().Split('=');
+                if (pair == null || pair.Length != 2)
+                {
+                    Exceptions.Throw(new ArgumentException("invalid component to be used as key-value pair:", component), LOGGER);
+                }
+                settings.Add(pair[0], pair[1]);
+            }
+
+            string id;
+            if (!settings.TryGetValue("Identifier", out id))
+            {
+                Exceptions.Throw(new ArgumentException("cannot find Identifier entry."), LOGGER);
+            }
+            Id = id;
+
+            string msg;
+            if (!settings.TryGetValue("Message", out msg))
+            {
+                LOGGER.Log(Level.Verbose, "no Message in Failed Task.");
+                msg = string.Empty;
+            }
+            Message = msg;
+
+            string description;
+            if (!settings.TryGetValue("Description", out description))
+            {
+                LOGGER.Log(Level.Verbose, "no Description in Failed Task.");
+                description = string.Empty;
+            }
+            Description = string.IsNullOrWhiteSpace(description) ? Optional<string>.Empty() : Optional<string>.Of(description);
+
+            string cause;
+            if (!settings.TryGetValue("Cause", out cause))
+            {
+                LOGGER.Log(Level.Verbose, "no Cause in Failed Task.");
+                cause = string.Empty;
+            }
+            Reason = string.IsNullOrWhiteSpace(cause) ? Optional<string>.Empty() : Optional<string>.Of(cause);
+
+            string rawData;
+            if (!settings.TryGetValue("Data", out rawData))
+            {
+                LOGGER.Log(Level.Verbose, "no Data in Failed Task.");
+                rawData = string.Empty;
+            }
+            Data = string.IsNullOrWhiteSpace(rawData) ? Optional<byte[]>.Empty() : Optional<byte[]>.Of(ByteUtilities.StringToByteArrays(rawData));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/RunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/RunningTask.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/RunningTask.cs
new file mode 100644
index 0000000..a38f6d5
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/RunningTask.cs
@@ -0,0 +1,98 @@
+/**
+ * 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.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    public class RunningTask : IRunningTask
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(RunningTask));
+        private IRunningTaskClr2Java _runningTaskClr2Java;
+        private IActiveContextClr2Java _activeContextClr2Java;
+
+        public RunningTask(IRunningTaskClr2Java runningTaskClr2Java)
+        {
+            using (LOGGER.LogFunction("RunningTask::RunningTask"))
+            {
+                _runningTaskClr2Java = runningTaskClr2Java;
+                _activeContextClr2Java = runningTaskClr2Java.GetActiveContext();
+            }
+        }
+
+        public Context.IActiveContext ActiveContext
+        {
+            get
+            {
+                return new ActiveContext(_activeContextClr2Java);
+            }
+            
+            set
+            {
+                ActiveContext = value;
+            }
+        }
+
+        public string Id
+        {
+            get
+            {
+                return _runningTaskClr2Java.GetId();
+            }
+
+            set
+            {
+                Id = value;
+            }
+        }
+
+        public void Send(byte[] message)
+        {
+            _runningTaskClr2Java.Send(message);
+        }
+
+        public void OnNext(byte[] message)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Suspend(byte[] message)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Suspend()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Dispose(byte[] message)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Dispose()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/SuspendedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/SuspendedTask.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/SuspendedTask.cs
new file mode 100644
index 0000000..a694289
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/SuspendedTask.cs
@@ -0,0 +1,83 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Task;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class SuspendedTask : ISuspendedTask
+    {
+        internal SuspendedTask(ISuspendedTaskClr2Java suspendedTaskClr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            SuspendedTaskClr2Java = suspendedTaskClr2Java;
+            ActiveContextClr2Java = suspendedTaskClr2Java.GetActiveContext();
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public byte[] Message
+        {
+            get
+            {
+                return SuspendedTaskClr2Java.Get();
+            }
+
+            set
+            {
+            }
+        }
+
+        public string Id
+        {
+            get
+            {
+                return SuspendedTaskClr2Java.GetId();
+            }
+
+            set
+            {
+            }
+        }
+
+        public IActiveContext ActiveContext
+        {
+            get
+            {
+                return new ActiveContext(ActiveContextClr2Java);
+            }
+
+            set
+            {
+            }
+        }
+
+        [DataMember]
+        private ISuspendedTaskClr2Java SuspendedTaskClr2Java { get; set; }
+
+        [DataMember]
+        private IActiveContextClr2Java ActiveContextClr2Java { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/TaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/TaskMessage.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/TaskMessage.cs
new file mode 100644
index 0000000..b905a92
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/TaskMessage.cs
@@ -0,0 +1,65 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Task;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    /// <summary>
+    /// TaskMessage which wraps ITaskMessageClr2Java
+    /// </summary>
+    [DataContract]
+    internal class TaskMessage : ITaskMessage
+    {
+        private ITaskMessageClr2Java _taskMessageClr2Java;
+        private byte[] _message;
+        private string _instanceId;
+
+        public TaskMessage(ITaskMessageClr2Java clr2Java, byte[] message)
+        {
+            _instanceId = Guid.NewGuid().ToString("N");
+            _taskMessageClr2Java = clr2Java;
+            _message = message;
+        }
+
+        [DataMember]
+        public string InstanceId
+        {
+            get { return _instanceId; }
+            set { _instanceId = value; }
+        }
+
+        [DataMember]
+        public string TaskId
+        {
+            get { return _taskMessageClr2Java.GetId(); }
+            set { }
+        }
+
+        [DataMember]
+        public byte[] Message
+        {
+            get { return _message; }
+            set { _message = value; } 
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpMessage.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpMessage.cs
new file mode 100644
index 0000000..2a64852
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpMessage.cs
@@ -0,0 +1,61 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    [DataContract]
+    public class HttpMessage : IHttpMessage
+    {
+        public HttpMessage(IHttpServerBridgeClr2Java httpServerBridgeClr2Java)
+        {
+            HttpServerBridgeClr2Java = httpServerBridgeClr2Java;
+        }
+
+        [DataMember]
+        private IHttpServerBridgeClr2Java HttpServerBridgeClr2Java { get; set; }
+
+        public string GetRequestString()
+        {
+            return HttpServerBridgeClr2Java.GetQueryString();
+        }
+
+        public void SetQueryResult(string responseString)
+        {
+            HttpServerBridgeClr2Java.SetQueryResult(responseString);
+        }
+
+        public byte[] GetQueryReuestData()
+        {
+            return HttpServerBridgeClr2Java.GetQueryRequestData();            
+        }
+
+        public void SetQueryResponseData(byte[] responseData)
+        {
+            HttpServerBridgeClr2Java.SetQueryResponseData(responseData);
+        }
+
+        public void SetUriSpecification(string uriSpecification)
+        {
+            HttpServerBridgeClr2Java.SetUriSpecification(uriSpecification);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerHandler.cs
new file mode 100644
index 0000000..8dba521
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerHandler.cs
@@ -0,0 +1,164 @@
+/**
+ * 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.Common.Avro;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Net;
+using Org.Apache.REEF.Tang.Annotations;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    /// <summary>
+    ///  HttpServerHandler, the handler for all CLR http events
+    /// </summary>
+    public class HttpServerHandler : IObserver<IHttpMessage>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(HttpServerHandler));
+
+        private static readonly string SPEC = "SPEC";
+
+        private IDictionary<string, IHttpHandler> eventHandlers = new Dictionary<string, IHttpHandler>();
+
+        private HttpServerPort httpServerPort;
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="HttpServerHandler" /> class.
+        /// </summary>
+        /// <param name="httpEventHandlers">The HTTP event handlers.</param>
+        /// <param name="httpServerPort">The HTTP server port.</param>
+        [Inject]
+        public HttpServerHandler([Parameter(Value = typeof(DriverBridgeConfigurationOptions.HttpEventHandlers))] ISet<IHttpHandler> httpEventHandlers,
+                                 HttpServerPort httpServerPort)
+        {
+            LOGGER.Log(Level.Info, "Constructing HttpServerHandler");       
+            foreach (var h in httpEventHandlers)
+            {
+                string spec = h.GetSpecification();
+                if (spec.Contains(":"))
+                {
+                    Exceptions.Throw(new ArgumentException("spec cannot contain :"), "The http spec given is " + spec, LOGGER);
+                }
+                LOGGER.Log(Level.Info, "HttpHandler spec:" + spec);   
+                eventHandlers.Add(spec.ToLower(CultureInfo.CurrentCulture), h);
+            }
+            this.httpServerPort = httpServerPort;
+        }
+
+        /// <summary>
+        /// Called when receving an http request from Java side
+        /// </summary>
+        /// <param name="httpMessage">The HTTP message.</param>
+        public void OnNext(IHttpMessage httpMessage)
+        {
+            LOGGER.Log(Level.Info, "HttpHandler OnNext is called");
+            string requestString = httpMessage.GetRequestString();
+
+            if (requestString != null && requestString.Equals(SPEC))
+            {
+                LOGGER.Log(Level.Info, "HttpHandler OnNext, requestString:" + requestString);
+                LOGGER.Log(Level.Info, "HttpHandler OnNext, port number:" + httpServerPort.PortNumber);
+
+                httpMessage.SetUriSpecification(GetAllSpecifications());
+            }
+            else
+            {
+                LOGGER.Log(Level.Info, "HttpHandler OnNext, handling http request.");
+                byte[] byteData = httpMessage.GetQueryReuestData();                    
+                AvroHttpRequest avroHttpRequest = AvroHttpSerializer.FromBytes(byteData);
+                LOGGER.Log(Level.Info, "HttpHandler OnNext, requestData:" + avroHttpRequest);
+
+                string spec = GetSpecification(avroHttpRequest.PathInfo);
+                if (spec != null)
+                {
+                    LOGGER.Log(Level.Info, "HttpHandler OnNext, target:" + spec);
+                    ReefHttpRequest request = ToHttpRequest(avroHttpRequest);
+                    ReefHttpResponse response = new ReefHttpResponse();
+
+                    IHttpHandler handler;
+                    eventHandlers.TryGetValue(spec.ToLower(CultureInfo.CurrentCulture), out handler);
+
+                    byte[] responseData;
+                    if (handler != null)
+                    {
+                        LOGGER.Log(Level.Info, "HttpHandler OnNext, get eventHandler:" + handler.GetSpecification());
+                        handler.OnHttpRequest(request, response);
+                        responseData = response.OutputStream;
+                    }
+                    else
+                    {
+                        responseData =
+                            ByteUtilities.StringToByteArrays(string.Format(CultureInfo.CurrentCulture,
+                                                                           "No event handler found at CLR side for {0}.",
+                                                                           spec));
+                    }
+                    httpMessage.SetQueryResponseData(responseData);
+                }
+            }
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        private string GetAllSpecifications()
+        {
+            return string.Join(":", eventHandlers.Keys.ToArray());
+        }
+
+        private string GetSpecification(string requestUri)
+        {
+            if (requestUri != null)
+            {
+                string[] parts = requestUri.Split('/');
+
+                if (parts.Length > 1)
+                {
+                    return parts[1];
+                }
+            }
+            return null;            
+        }
+
+        private ReefHttpRequest ToHttpRequest(AvroHttpRequest avroRequest)
+        {
+            ReefHttpRequest httpRequest = new ReefHttpRequest();
+            httpRequest.PathInfo = avroRequest.PathInfo;
+            httpRequest.InputStream = avroRequest.InputStream;
+            httpRequest.Url = avroRequest.RequestUrl;
+            httpRequest.Querystring = avroRequest.QueryString;
+
+            HttpMethod m;
+            HttpMethod.TryParse(avroRequest.HttpMethod, true, out m);
+            httpRequest.Method = m;
+            return httpRequest;
+        }    
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerPort.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerPort.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerPort.cs
new file mode 100644
index 0000000..d0067e7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/HttpServerPort.cs
@@ -0,0 +1,33 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class HttpServerPort
+    {
+        [Inject]
+        public HttpServerPort()
+        {            
+        }
+
+        public int PortNumber { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpHandler.cs
new file mode 100644
index 0000000..409c974
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpHandler.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 Org.Apache.REEF.Driver.Bridge;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public interface IHttpHandler
+    {
+        /// <summary>
+        /// Define the specification of the handler. ":" is not allowed in the specification.
+        /// </summary>
+        /// <returns>string specification</returns>
+        string GetSpecification();
+
+        /// <summary>
+        /// Called when Http request is sent
+        /// </summary>
+        /// <param name="requet">The requet.</param>
+        /// <param name="resonse">The resonse.</param>
+        void OnHttpRequest(ReefHttpRequest requet, ReefHttpResponse resonse);  
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpMessage.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpMessage.cs
new file mode 100644
index 0000000..155d7ab
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/IHttpMessage.cs
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public interface IHttpMessage
+    {
+        string GetRequestString();
+        
+        void SetQueryResult(string responseString);
+
+        byte[] GetQueryReuestData();
+
+        void SetQueryResponseData(byte[] responseData);
+        
+        void SetUriSpecification(string uriSpecification);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpRequest.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpRequest.cs
new file mode 100644
index 0000000..97c0465
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpRequest.cs
@@ -0,0 +1,49 @@
+/**
+ * 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.Globalization;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public enum HttpMethod
+    {
+        Post,
+        Put,
+        Get,
+        Delete
+    }
+
+    public class ReefHttpRequest
+    {
+        public HttpMethod Method { get; set; }
+
+        public string Url { get; set; }
+
+        public string Querystring { get; set; }
+
+        public byte[] InputStream { get; set; }
+
+        public string PathInfo { get; set; }
+
+        public string Tostring()
+        {
+            return string.Format(CultureInfo.InvariantCulture, "Url: {0}, query string {1}", Url, Querystring);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpResponse.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpResponse.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpResponse.cs
new file mode 100644
index 0000000..73b64cc
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ReefHttpResponse.cs
@@ -0,0 +1,30 @@
+/**
+ * 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.Net;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class ReefHttpResponse
+    {
+        public byte[] OutputStream { get; set; }
+
+        public HttpStatusCode Status { get; set; }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 ebb56b5..a00c261 100644
--- a/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/ClientManager.cs
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-using Org.Apache.REEF.Common.ProtoBuf.ClienRuntimeProto;
 using System;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 
 // TODO
 namespace Org.Apache.REEF.Driver

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfiguration.cs b/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfiguration.cs
new file mode 100644
index 0000000..1bcea1b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfiguration.cs
@@ -0,0 +1,93 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Common.Events;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Util;
+using System;
+using System.Diagnostics.CodeAnalysis;
+using Org.Apache.REEF.Common.Tasks.Events;
+
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    public class ContextConfiguration : ConfigurationModuleBuilder
+    {
+        /// <summary>
+        ///  The identifier of the context.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly RequiredParameter<string> Identifier = new RequiredParameter<string>();
+
+        /// <summary>
+        ///  for context start. 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<IContextStart>> OnContextStart = new OptionalImpl<IObserver<IContextStart>>();
+
+        /// <summary>
+        /// for context stop. 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<IContextStop>> OnContextStop = new OptionalImpl<IObserver<IContextStop>>();
+
+        /// <summary>
+        ///  to be informed right before a Task enters its call() method.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IObserver<ITaskStart>> OnTaskStart = new OptionalImpl<IObserver<ITaskStart>>();
+
+        /// <summary>
+        ///  to be informed right after a Task exits its call() method.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IObserver<ITaskStop>> OnTaskStop = new OptionalImpl<IObserver<ITaskStop>>();
+
+        /// <summary>
+        ///  Source of messages to be called whenever the evaluator is about to make a heartbeat.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IContextMessageSource> OnSendMessage = new OptionalImpl<IContextMessageSource>();
+
+        /// <summary>
+        ///   Driver has sent the context a message, and this parameter is used to register a handler on the context for processing that message.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IContextMessageHandler> OnMessage = new OptionalImpl<IContextMessageHandler>();
+
+        public static ConfigurationModule ConfigurationModule
+        {
+            get
+            {
+                return new ContextConfiguration()
+                    .BindNamedParameter(GenericType<ContextConfigurationOptions.ContextIdentifier>.Class, Identifier)
+                    .BindSetEntry(GenericType<ContextConfigurationOptions.StartHandlers>.Class, OnContextStart)
+                    .BindSetEntry(GenericType<ContextConfigurationOptions.StopHandlers>.Class, OnContextStop)
+                    .BindSetEntry(GenericType<ContextConfigurationOptions.ContextMessageSources>.Class, OnSendMessage)
+                    .BindSetEntry(GenericType<ContextConfigurationOptions.ContextMessageHandlers>.Class, OnMessage)
+                    .BindSetEntry(GenericType<TaskConfigurationOptions.StartHandlers>.Class, OnTaskStart)
+                    .BindSetEntry(GenericType<TaskConfigurationOptions.StopHandlers>.Class, OnTaskStop)
+                    .Build();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfigurationOptions.cs
new file mode 100644
index 0000000..48eba08
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/ContextConfigurationOptions.cs
@@ -0,0 +1,61 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Common.Events;
+using Org.Apache.REEF.Driver.Defaults;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Tang.Formats;
+using System;
+using System.Collections.Generic;
+using Org.Apache.REEF.Driver.Context.Defaults;
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    /// <summary>
+    ///  Configuration parameters for ContextConfiguration module.
+    /// </summary>
+    public class ContextConfigurationOptions : ConfigurationModuleBuilder 
+    {
+        [NamedParameter(documentation: "The identifier for the context.")]
+        public class ContextIdentifier : Name<string>
+        {
+        }
+
+        [NamedParameter(documentation: "The set of event handlers for the ContextStart event", defaultClasses: new[] { typeof(DefaultContextStartHandler) })]
+        public class StartHandlers : Name<ISet<IObserver<IContextStart>>>
+        {
+        }
+
+        [NamedParameter(documentation: "The set of event handlers for the ContextStop event", defaultClasses: new[] { typeof(DefaultContextStopHandler) })]
+        public class StopHandlers : Name<ISet<IObserver<IContextStop>>>
+        {
+        }
+
+        [NamedParameter(documentation: "The set of ContextMessageSource implementations called during heartbeats.", defaultClasses: new[] { typeof(DefaultContextMessageSource) })]
+        public class ContextMessageSources : Name<ISet<IContextMessageSource>>
+        {
+        }
+
+        [NamedParameter(documentation: "The set of Context message handlers.")]
+        public class ContextMessageHandlers : Name<ISet<IContextMessageHandler>>
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextMessageSource.cs b/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextMessageSource.cs
new file mode 100644
index 0000000..1c42990
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextMessageSource.cs
@@ -0,0 +1,42 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Context.Defaults
+{
+    /// <summary>
+    /// Default ContextMessageSource: return nothing.
+    /// </summary>
+    public class DefaultContextMessageSource : IContextMessageSource
+    {
+        public Optional<Common.Context.ContextMessage> Message
+        {
+            get
+            {
+                return Optional<Common.Context.ContextMessage>.Empty();
+            }
+
+            set
+            {
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStartHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStartHandler.cs
new file mode 100644
index 0000000..1d5262e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStartHandler.cs
@@ -0,0 +1,48 @@
+/**
+ * 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.Common.Events;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Context.Defaults
+{
+   /// <summary>
+    /// Default handler for ContextStart
+   /// </summary>
+    public class DefaultContextStartHandler : IObserver<IContextStart>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextStartHandler));
+
+        public void OnNext(IContextStart contextStart)
+        {
+            LOGGER.Log(Level.Info, "DefaultContextStartHandler received for context: " + contextStart.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStopHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStopHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStopHandler.cs
new file mode 100644
index 0000000..ccbf28b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/Defaults/DefaultContextStopHandler.cs
@@ -0,0 +1,48 @@
+/**
+ * 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.Common.Events;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Context.Defaults
+{
+    /// <summary>
+    /// Default event handler for ContextStop
+    /// </summary>
+    public class DefaultContextStopHandler : IObserver<IContextStop>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextStopHandler));
+
+        public void OnNext(IContextStop contextStop)
+        {
+            LOGGER.Log(Level.Info, "DefaultContextStopHandler received for context: " + contextStop.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..4538112
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/EvaluatorContext.cs
@@ -0,0 +1,147 @@
+/**
+ * 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.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Driver.Bridge.Events;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    public class EvaluatorContext : IActiveContext
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorContext));
+        
+        private string _identifier;
+
+        private Optional<string> _parentId;
+
+        private EvaluatorManager _evaluatorManager;
+
+        private bool _disposed = false;
+
+        public EvaluatorContext(EvaluatorManager evaluatorManager, string id, Optional<string> parentId)
+        {
+            _identifier = id;
+            _parentId = parentId;
+            _evaluatorManager = evaluatorManager;
+        }
+
+        public string Id
+        {
+            get
+            {
+                return _identifier;
+            }
+
+            set
+            {
+            }
+        }
+
+        public string EvaluatorId
+        {
+            get
+            {
+                return _evaluatorManager.Id;
+            }
+
+            set
+            {
+            }
+        }
+
+        public Optional<string> ParentId
+        {
+            get
+            {
+                return _parentId;
+            }
+
+            set
+            {
+            }
+        }
+
+        public IEvaluatorDescriptor EvaluatorDescriptor
+        {
+            get
+            {
+                return _evaluatorManager.EvaluatorDescriptor;
+            }
+
+            set
+            {
+            }
+        }
+
+        public void Dispose()
+        {
+            if (_disposed)
+            {
+                var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Active context [{0}] already closed", _identifier));
+                Exceptions.Throw(e, LOGGER);
+            }
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Submit close context: RunningEvaluator id [{0}] for context id [{1}]", EvaluatorId, Id));
+            RemoveContextProto removeContextProto = new RemoveContextProto();
+            removeContextProto.context_id = Id;
+            ContextControlProto contextControlProto = new ContextControlProto();
+            contextControlProto.remove_context = removeContextProto;
+            _evaluatorManager.Handle(contextControlProto);
+            _disposed = true;
+        }
+
+        public ClosedContext GetClosedContext(IActiveContext parentContext)
+        {
+            //return new ClosedContext(parentContext, EvaluatorId, Id, ParentId, EvaluatorDescriptor);
+            throw new NotImplementedException();
+        }
+
+        public FailedContext GetFailedContext(Optional<IActiveContext> parentContext, Exception cause)
+        {
+            //return new FailedContext(parentContext, Id, cause, EvaluatorId, ParentId, EvaluatorDescriptor);
+            throw new NotImplementedException();
+        }
+
+        public void SubmitTask(IConfiguration taskConf)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void SubmitContext(IConfiguration contextConfiguration)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void SendMessage(byte[] message)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/IActiveContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/IActiveContext.cs b/lang/cs/Org.Apache.REEF.Driver/Context/IActiveContext.cs
new file mode 100644
index 0000000..87ae9d2
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/IActiveContext.cs
@@ -0,0 +1,29 @@
+/**
+ * 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.Common;
+using System;
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    public interface IActiveContext : IDisposable, IContext, ITaskSubmittable, IContextSubmittable
+    {
+        void SendMessage(byte[] message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/IClosedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/IClosedContext.cs b/lang/cs/Org.Apache.REEF.Driver/Context/IClosedContext.cs
new file mode 100644
index 0000000..1fc0213
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/IClosedContext.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    public interface IClosedContext : IContext
+    {
+        IActiveContext ParentContext { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/IContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/IContext.cs b/lang/cs/Org.Apache.REEF.Driver/Context/IContext.cs
new file mode 100644
index 0000000..fd6006c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/IContext.cs
@@ -0,0 +1,45 @@
+/**
+ * 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.Driver.Evaluator;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    /// <summary>
+    /// A common base interface for Contexts, available or failed.
+    /// </summary>
+    public interface IContext : IIdentifiable
+    {
+        /// <summary>
+        /// the identifier of the Evaluator this EvaluatorContext is instantiated on.
+        /// </summary>
+        string EvaluatorId { get; set; }
+
+        /// <summary>
+        /// ID of the parent context, if there is any.
+        /// </summary>
+        Optional<string> ParentId { get; set; }
+
+        /// <summary>
+        /// descriptor of the Evaluator this Context is on.
+        /// </summary>
+        IEvaluatorDescriptor EvaluatorDescriptor { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Context/IFailedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Context/IFailedContext.cs b/lang/cs/Org.Apache.REEF.Driver/Context/IFailedContext.cs
new file mode 100644
index 0000000..6e07788
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Context/IFailedContext.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Driver.Context
+{
+    public interface IFailedContext : IContext
+    {
+         Optional<IActiveContext> ParentContext { get; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..2c08d0b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Contract/IBridgeContract.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Contract
+{
+    public interface IBridgeContract
+    {
+        string InstanceId { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseHandler.cs
new file mode 100644
index 0000000..a47a2b1
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseHandler.cs
@@ -0,0 +1,53 @@
+/**
+ * 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.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default handler for close messages from the client: logging it
+    /// </summary>
+    public class DefaultClientCloseHandler : IObserver<byte[]>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientCloseHandler));
+
+        [Inject]
+        public DefaultClientCloseHandler()
+        {
+        }
+
+        public void OnNext(byte[] value)
+        {
+            LOGGER.Log(Level.Info, "Closing the Client");
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseWithMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseWithMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseWithMessageHandler.cs
new file mode 100644
index 0000000..0dbb6f0
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientCloseWithMessageHandler.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Utilities;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default handler for close messages from the client: Throw an Exception.
+    /// </summary>
+    public class DefaultClientCloseWithMessageHandler : IObserver<byte[]>
+    {
+        [Inject]
+        public DefaultClientCloseWithMessageHandler()
+        {
+        }
+        
+        public void OnNext(byte[] value)
+        {
+            Exceptions.Throw(new InvalidOperationException("No handler bound for client Close With Message event:" + ByteUtilities.ByteArrarysToString(value)), 
+                Logger.GetLogger(typeof(DefaultClientCloseWithMessageHandler)));
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientMessageHandler.cs
new file mode 100644
index 0000000..ca5ac0e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultClientMessageHandler.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// DDefault event handler for Client messages: Logging it.
+    /// </summary>
+    public class DefaultClientMessageHandler : IObserver<byte[]>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientMessageHandler));
+        
+        [Inject]
+        public DefaultClientMessageHandler()
+        {
+        }
+
+        public void OnNext(byte[] value)
+        {
+            LOGGER.Log(Level.Info, "Received message: " + ByteUtilities.ByteArrarysToString(value));
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextActiveHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextActiveHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextActiveHandler.cs
new file mode 100644
index 0000000..7bb27ad
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextActiveHandler.cs
@@ -0,0 +1,56 @@
+/**
+ * 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.Driver.Context;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default handler for ActiveContext: Close it.
+    /// </summary>
+    public class DefaultContextActiveHandler : IObserver<IActiveContext>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextActiveHandler));
+        
+        [Inject]
+        public DefaultContextActiveHandler()
+        {
+        }
+
+        public void OnNext(IActiveContext value)
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received ActiveContext :[{0}], closing it", value.Id));
+            value.Dispose();
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextClosureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextClosureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextClosureHandler.cs
new file mode 100644
index 0000000..aa957c7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextClosureHandler.cs
@@ -0,0 +1,55 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default event handler for ClosedContext: Logging it.
+    /// </summary>
+    public class DefaultContextClosureHandler : IObserver<IClosedContext>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextClosureHandler));
+        
+        [Inject]
+        public DefaultContextClosureHandler()
+        {
+        }
+
+        public void OnNext(IClosedContext value)
+        {
+            LOGGER.Log(Level.Info, "Received ClosedContext :" + value.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextFailureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextFailureHandler.cs
new file mode 100644
index 0000000..d8014c6
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextFailureHandler.cs
@@ -0,0 +1,51 @@
+/**
+ * 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.Driver.Context;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    ///  Default event handler used for FailedContext: It crashes the driver.
+    /// </summary>
+    public class DefaultContextFailureHandler : IObserver<IFailedContext>
+    {
+        [Inject]
+        public DefaultContextFailureHandler()
+        {
+        }
+
+        public void OnNext(IFailedContext value)
+        {
+            throw new InvalidOperationException("No handler bound for FailedContext: " + value.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextMessageHandler.cs
new file mode 100644
index 0000000..0e6715c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultContextMessageHandler.cs
@@ -0,0 +1,55 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// efault event handler for ContextMessage: Logging it.
+    /// </summary>
+    public class DefaultContextMessageHandler : IObserver<IContextMessage>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextMessageHandler));
+
+        [Inject]
+        public DefaultContextMessageHandler()
+        {
+        }
+
+        public void OnNext(IContextMessage value)
+        {
+            LOGGER.Log(Level.Info, "Received ContextMessage: " + ByteUtilities.ByteArrarysToString(value.Message));
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultCustomTraceListener.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultCustomTraceListener.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultCustomTraceListener.cs
new file mode 100644
index 0000000..a1f897b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultCustomTraceListener.cs
@@ -0,0 +1,45 @@
+/**
+ * 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;
+using System.Diagnostics;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    public class DefaultCustomTraceListener : TraceListener
+    {
+        private readonly TraceListener _listener; 
+
+        [Inject]
+        public DefaultCustomTraceListener()
+        {
+            _listener = new ConsoleTraceListener();
+        }
+
+        public override void Write(string message)
+        {
+            _listener.Write(message);
+        }
+
+        public override void WriteLine(string message)
+        {
+            _listener.WriteLine(message);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartContextActiveHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartContextActiveHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartContextActiveHandler.cs
new file mode 100644
index 0000000..5ceb271
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartContextActiveHandler.cs
@@ -0,0 +1,56 @@
+/**
+ * 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.Driver.Context;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default handler for ActiveContext received during driver restart: Close it.
+    /// </summary>
+    public class DefaultDriverRestartContextActiveHandler : IObserver<IActiveContext>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartContextActiveHandler));
+        
+        [Inject]
+        public DefaultDriverRestartContextActiveHandler()
+        {
+        }
+
+        public void OnNext(IActiveContext value)
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received ActiveContext during driver restart:[{0}], closing it", value.Id));
+            value.Dispose();
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartHandler.cs
new file mode 100644
index 0000000..1500b70
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartHandler.cs
@@ -0,0 +1,55 @@
+/**
+ * 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.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Wake.Time;
+using System;
+using Org.Apache.REEF.Wake.Time.Event;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    ///  Default event handler for driver restart: Logging it.
+    /// </summary>
+    public class DefaultDriverRestartHandler : IObserver<StartTime>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartHandler));
+        
+        [Inject]
+        public DefaultDriverRestartHandler()
+        {
+        }
+
+        public void OnNext(StartTime startTime)
+        {
+            LOGGER.Log(Level.Info, "Driver restarted at" + new DateTime(startTime.TimeStamp));
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartTaskRunningHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartTaskRunningHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartTaskRunningHandler.cs
new file mode 100644
index 0000000..c202933
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultDriverRestartTaskRunningHandler.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    ///  Default event handler for TaskRuntime received during driver restart: Logging it.
+    /// </summary>
+    public class DefaultDriverRestartTaskRunningHandler : IObserver<IRunningTask>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartTaskRunningHandler));
+        
+        [Inject]
+        public DefaultDriverRestartTaskRunningHandler()
+        {
+        }
+
+        public void OnNext(IRunningTask runningTask)
+        {
+            LOGGER.Log(Level.Info, "Received TaskRuntime during driver restart: " + runningTask.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}


[12/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/events/IContextStop.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/events/IContextStop.cs b/lang/cs/Org.Apache.REEF.Common/events/IContextStop.cs
deleted file mode 100644
index bdc5a73..0000000
--- a/lang/cs/Org.Apache.REEF.Common/events/IContextStop.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Common.Events
-{
-    public interface IContextStop
-    {
-        string Id { get; set; }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/exceptions/EvaluatorException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/exceptions/EvaluatorException.cs b/lang/cs/Org.Apache.REEF.Common/exceptions/EvaluatorException.cs
deleted file mode 100644
index 33248ae..0000000
--- a/lang/cs/Org.Apache.REEF.Common/exceptions/EvaluatorException.cs
+++ /dev/null
@@ -1,75 +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 Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Utilities;
-using System;
-
-namespace Org.Apache.REEF.Common.Exceptions
-{
-    public class EvaluatorException : System.Exception, IIdentifiable
-    {
-        private readonly string _evaluatorId;
-
-        public EvaluatorException(string evaluatorId)
-        {
-            _evaluatorId = evaluatorId;
-            RunningTask = null;
-        }
-
-        public EvaluatorException(string evaluatorId, string message, System.Exception cause)
-            : base(message, cause)
-        {
-            _evaluatorId = evaluatorId;
-            RunningTask = null;
-        }
-
-        public EvaluatorException(string evaluatorId, string message)
-            : this(evaluatorId, message, (IRunningTask)null)
-        {
-        }
-
-        public EvaluatorException(string evaluatorId, string message, IRunningTask runningTask)
-            : base(message)
-        {
-            _evaluatorId = evaluatorId;
-            RunningTask = runningTask;
-        }
-
-        public EvaluatorException(string evaluatorId, System.Exception cause)
-            : this(evaluatorId, cause, null)
-        {
-        }
-
-        public EvaluatorException(string evaluatorId, Exception cause, IRunningTask runningTask)
-            : base(string.Empty, cause)
-        {
-            _evaluatorId = evaluatorId;
-            RunningTask = runningTask;
-        }
-
-        public IRunningTask RunningTask { get; set; }
-
-        public string Id
-        {
-            get { return _evaluatorId; }
-            set { }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/exceptions/JobException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/exceptions/JobException.cs b/lang/cs/Org.Apache.REEF.Common/exceptions/JobException.cs
deleted file mode 100644
index 0cceecc..0000000
--- a/lang/cs/Org.Apache.REEF.Common/exceptions/JobException.cs
+++ /dev/null
@@ -1,58 +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 Org.Apache.REEF.Utilities;
-using System;
-
-namespace Org.Apache.REEF.Common
-{
-    public class JobException : Exception, IIdentifiable
-    {
-        private string _jobId;
-
-        public JobException(string jobId)
-        {
-            _jobId = jobId;
-        }
-
-        public JobException(string jobId, string message, Exception cause) 
-            : base(message, cause)
-        {
-            _jobId = jobId;
-        }
-
-        public JobException(string jobId, string message)
-            : base(message)
-        {
-            _jobId = jobId;
-        }
-
-        public JobException(string jobId, Exception cause)
-            : base(string.Empty, cause)
-        {
-            _jobId = jobId;
-        }
-
-        public string Id
-        {
-            get { return _jobId; }
-            set { }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/io/INameClient.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/io/INameClient.cs b/lang/cs/Org.Apache.REEF.Common/io/INameClient.cs
deleted file mode 100644
index 941d023..0000000
--- a/lang/cs/Org.Apache.REEF.Common/io/INameClient.cs
+++ /dev/null
@@ -1,71 +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.Net;
-
-namespace Org.Apache.REEF.Common.io
-{
-    /// <summary>
-    /// Client for the Reef name service. 
-    /// Used to register, unregister, and lookup IP Addresses of known hosts.
-    /// </summary>
-    public interface INameClient : IDisposable
-    {
-        /// <summary>
-        /// Registers the identifier with the NameService.  
-        /// Overwrites the previous mapping if the identifier has already 
-        /// been registered.
-        /// </summary>
-        /// <param name="id">The key used to map the remote endpoint</param>
-        /// <param name="endpoint">The endpoint to map</param>
-        void Register(string id, IPEndPoint endpoint);
-
-        /// <summary>
-        /// Unregisters the remote identifier with the NameService
-        /// </summary>
-        /// <param name="id">The identifier to unregister</param>
-        void Unregister(string id);
-
-        /// <summary>
-        /// Looks up the IPEndpoint for the registered identifier.
-        /// </summary>
-        /// <param name="id">The identifier to look up</param>
-        /// <returns>The mapped IPEndpoint for the identifier, or null if
-        /// the identifier has not been registered with the NameService</returns>
-        IPEndPoint Lookup(string id);
-
-        /// <summary>
-        /// Looks up the IPEndpoint for each of the registered identifiers in the list.
-        /// </summary>
-        /// <param name="ids">The list of identifiers to look up</param>
-        /// <returns>The list of NameAssignments representing a pair of identifer
-        /// and mapped IPEndpoint for that identifier.  If any of the requested identifiers
-        /// are not registered with the NameService, their corresponding NameAssignment
-        /// IPEndpoint value will be null.</returns>
-        List<NameAssignment> Lookup(List<string> ids);
-
-        /// <summary>
-        /// Restart the name client in case of failure.
-        /// </summary>
-        /// <param name="serverEndpoint">The new server endpoint to connect to</param>
-        void Restart(IPEndPoint serverEndpoint);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/io/NameAssignment.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/io/NameAssignment.cs b/lang/cs/Org.Apache.REEF.Common/io/NameAssignment.cs
deleted file mode 100644
index 8751244..0000000
--- a/lang/cs/Org.Apache.REEF.Common/io/NameAssignment.cs
+++ /dev/null
@@ -1,60 +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.Net;
-using System.Net.Sockets;
-
-namespace Org.Apache.REEF.Common.io
-{
-    /// <summary>
-    /// Tuple containing the string identifier and IPEndpoint.
-    /// Used by NameServer and NameClient
-    /// </summary>
-    public class NameAssignment
-    {
-        public NameAssignment(string id, IPEndPoint endpoint)
-        {
-            Identifier = id;
-            Endpoint = endpoint;
-        }
-
-        public NameAssignment(string id, string address, int port)
-        {
-            Identifier = id;
-            IPAddress ipAddress;
-            if (!IPAddress.TryParse(address, out ipAddress))
-            {
-                IPHostEntry hostEntry = Dns.GetHostEntry(address);
-                foreach (var ip in hostEntry.AddressList)
-                {
-                    if (ip.AddressFamily == AddressFamily.InterNetwork)
-                    {
-                        ipAddress = ip;
-                        break;
-                    }
-                }
-            }
-            Endpoint = new IPEndPoint(ipAddress, port);
-        }
-
-        public string Identifier { get; set; }
-
-        public IPEndPoint Endpoint { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/io/NamingConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/io/NamingConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/io/NamingConfiguration.cs
deleted file mode 100644
index 9a73267..0000000
--- a/lang/cs/Org.Apache.REEF.Common/io/NamingConfiguration.cs
+++ /dev/null
@@ -1,45 +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.Diagnostics.CodeAnalysis;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Util;
-
-namespace Org.Apache.REEF.Common.io
-{
-    public class NamingConfiguration : ConfigurationModuleBuilder
-    {
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredParameter<string> NameServerAddress = new RequiredParameter<string>();
-
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredParameter<int> NameServerPort = new RequiredParameter<int>();
-
-        public static ConfigurationModule ConfigurationModule
-        {
-            get
-            {
-                return new NamingConfiguration()
-                    .BindNamedParameter(GenericType<NamingConfigurationOptions.NameServerAddress>.Class, NameServerAddress)
-                    .BindNamedParameter(GenericType<NamingConfigurationOptions.NameServerPort>.Class, NameServerPort)
-                    .Build();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/io/NamingConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/io/NamingConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/io/NamingConfigurationOptions.cs
deleted file mode 100644
index e1096cd..0000000
--- a/lang/cs/Org.Apache.REEF.Common/io/NamingConfigurationOptions.cs
+++ /dev/null
@@ -1,36 +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 Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Common.io
-{
-    public class NamingConfigurationOptions
-    {
-        [NamedParameter("IP address of NameServer")]
-        public class NameServerAddress : Name<string>
-        {
-        }
-
-        [NamedParameter("Port of NameServer")]
-        public class NameServerPort : Name<int>
-        {
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ClientRuntime.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ClientRuntime.pb.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ClientRuntime.pb.cs
deleted file mode 100644
index 970dcc3..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ClientRuntime.pb.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-// Generated from: client_runtime.proto
-// Note: requires additional types generated from: reef_service_protos.proto
-
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-
-namespace Org.Apache.REEF.Common.ProtoBuf.ClienRuntimeProto{
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobSubmissionProto")]
-  public partial class JobSubmissionProto : global::ProtoBuf.IExtensible
-  {
-    public JobSubmissionProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private string _remote_id;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"remote_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string remote_id
-    {
-      get { return _remote_id; }
-      set { _remote_id = value; }
-    }
-    private string _configuration;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string configuration
-    {
-      get { return _configuration; }
-      set { _configuration = value; }
-    }
-    private string _user_name;
-    [global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"user_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string user_name
-    {
-      get { return _user_name; }
-      set { _user_name = value; }
-    }
-    private SIZE _driver_size = SIZE.SMALL;
-    [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"driver_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(SIZE.SMALL)]
-    public SIZE driver_size
-    {
-      get { return _driver_size; }
-      set { _driver_size = value; }
-    }
-    private int _driver_memory = default(int);
-    [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"driver_memory", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int driver_memory
-    {
-      get { return _driver_memory; }
-      set { _driver_memory = value; }
-    }
-    private int _priority = default(int);
-    [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"priority", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int priority
-    {
-      get { return _priority; }
-      set { _priority = value; }
-    }
-    private string _queue = "";
-    [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"queue", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string queue
-    {
-      get { return _queue; }
-      set { _queue = value; }
-    }
-    private readonly global::System.Collections.Generic.List<FileResourceProto> _global_file = new global::System.Collections.Generic.List<FileResourceProto>();
-    [global::ProtoBuf.ProtoMember(11, Name=@"global_file", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<FileResourceProto> global_file
-    {
-      get { return _global_file; }
-    }
-  
-    private readonly global::System.Collections.Generic.List<FileResourceProto> _local_File = new global::System.Collections.Generic.List<FileResourceProto>();
-    [global::ProtoBuf.ProtoMember(12, Name=@"local_File", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<FileResourceProto> local_File
-    {
-      get { return _local_File; }
-    }
-  
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobControlProto")]
-  public partial class JobControlProto : global::ProtoBuf.IExtensible
-  {
-    public JobControlProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private Signal _signal = Signal.SIG_TERMINATE;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"signal", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(Signal.SIG_TERMINATE)]
-    public Signal signal
-    {
-      get { return _signal; }
-      set { _signal = value; }
-    }
-    private byte[] _message = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] message
-    {
-      get { return _message; }
-      set { _message = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-    [global::ProtoBuf.ProtoContract(Name=@"Signal")]
-    public enum Signal
-    {
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"SIG_TERMINATE", Value=1)]
-      SIG_TERMINATE = 1,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"SIG_SUSPEND", Value=2)]
-      SIG_SUSPEND = 2,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"SIG_RESUME", Value=3)]
-      SIG_RESUME = 3
-    }
-  
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/DriverRuntime.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/DriverRuntime.pb.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/DriverRuntime.pb.cs
deleted file mode 100644
index 6a12cf1..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/DriverRuntime.pb.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-// Generated from: driver_runtime.proto
-// Note: requires additional types generated from: reef_service_protos.proto
-
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-
-namespace Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto
-{
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"DriverProcessRegistrationProto")]
-  public partial class DriverProcessRegistrationProto : global::ProtoBuf.IExtensible
-  {
-    public DriverProcessRegistrationProto() {}
-    
-    private string _remote_identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"remote_identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string remote_identifier
-    {
-      get { return _remote_identifier; }
-      set { _remote_identifier = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NodeDescriptorProto")]
-  public partial class NodeDescriptorProto : global::ProtoBuf.IExtensible
-  {
-    public NodeDescriptorProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private string _host_name;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"host_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string host_name
-    {
-      get { return _host_name; }
-      set { _host_name = value; }
-    }
-    private int _port;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"port", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public int port
-    {
-      get { return _port; }
-      set { _port = value; }
-    }
-    private int _memory_size;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"memory_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public int memory_size
-    {
-      get { return _memory_size; }
-      set { _memory_size = value; }
-    }
-    private string _rack_name = "";
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"rack_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string rack_name
-    {
-      get { return _rack_name; }
-      set { _rack_name = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceAllocationProto")]
-  public partial class ResourceAllocationProto : global::ProtoBuf.IExtensible
-  {
-    public ResourceAllocationProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private int _resource_memory;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"resource_memory", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public int resource_memory
-    {
-      get { return _resource_memory; }
-      set { _resource_memory = value; }
-    }
-    private string _node_id;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"node_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string node_id
-    {
-      get { return _node_id; }
-      set { _node_id = value; }
-    }
-    private int _virtual_cores = default(int);
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"virtual_cores", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int virtual_cores
-    {
-      get { return _virtual_cores; }
-      set { _virtual_cores = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceStatusProto")]
-  public partial class ResourceStatusProto : global::ProtoBuf.IExtensible
-  {
-    public ResourceStatusProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private State _state;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public State state
-    {
-      get { return _state; }
-      set { _state = value; }
-    }
-    private string _diagnostics = "";
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"diagnostics", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string diagnostics
-    {
-      get { return _diagnostics; }
-      set { _diagnostics = value; }
-    }
-    private int _exit_code = default(int);
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"exit_code", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int exit_code
-    {
-      get { return _exit_code; }
-      set { _exit_code = value; }
-    }
-    private bool _is_from_previous_driver = default(bool);
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"is_from_previous_driver", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(default(bool))]
-    public bool is_from_previous_driver
-    {
-      get { return _is_from_previous_driver; }
-      set { _is_from_previous_driver = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RuntimeStatusProto")]
-  public partial class RuntimeStatusProto : global::ProtoBuf.IExtensible
-  {
-    public RuntimeStatusProto() {}
-    
-    private string _name;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string name
-    {
-      get { return _name; }
-      set { _name = value; }
-    }
-    private State _state;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public State state
-    {
-      get { return _state; }
-      set { _state = value; }
-    }
-    private RuntimeErrorProto _error = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"error", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public RuntimeErrorProto error
-    {
-      get { return _error; }
-      set { _error = value; }
-    }
-    private int _outstanding_container_requests = default(int);
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"outstanding_container_requests", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int outstanding_container_requests
-    {
-      get { return _outstanding_container_requests; }
-      set { _outstanding_container_requests = value; }
-    }
-    private readonly global::System.Collections.Generic.List<string> _container_allocation = new global::System.Collections.Generic.List<string>();
-    [global::ProtoBuf.ProtoMember(6, Name=@"container_allocation", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<string> container_allocation
-    {
-      get { return _container_allocation; }
-    }
-  
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceRequestProto")]
-  public partial class ResourceRequestProto : global::ProtoBuf.IExtensible
-  {
-    public ResourceRequestProto() {}
-    
-    private int _memory_size = default(int);
-    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"memory_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int memory_size
-    {
-      get { return _memory_size; }
-      set { _memory_size = value; }
-    }
-    private int _priority = default(int);
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"priority", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int priority
-    {
-      get { return _priority; }
-      set { _priority = value; }
-    }
-    private int _virtual_cores = default(int);
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"virtual_cores", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    [global::System.ComponentModel.DefaultValue(default(int))]
-    public int virtual_cores
-    {
-      get { return _virtual_cores; }
-      set { _virtual_cores = value; }
-    }
-    private int _resource_count;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"resource_count", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public int resource_count
-    {
-      get { return _resource_count; }
-      set { _resource_count = value; }
-    }
-    private readonly global::System.Collections.Generic.List<string> _node_name = new global::System.Collections.Generic.List<string>();
-    [global::ProtoBuf.ProtoMember(6, Name=@"node_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<string> node_name
-    {
-      get { return _node_name; }
-    }
-  
-    private readonly global::System.Collections.Generic.List<string> _rack_name = new global::System.Collections.Generic.List<string>();
-    [global::ProtoBuf.ProtoMember(7, Name=@"rack_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<string> rack_name
-    {
-      get { return _rack_name; }
-    }
-  
-    private bool _relax_locality = default(bool);
-    [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"relax_locality", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(default(bool))]
-    public bool relax_locality
-    {
-      get { return _relax_locality; }
-      set { _relax_locality = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceReleaseProto")]
-  public partial class ResourceReleaseProto : global::ProtoBuf.IExtensible
-  {
-    public ResourceReleaseProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ResourceLaunchProto")]
-  public partial class ResourceLaunchProto : global::ProtoBuf.IExtensible
-  {
-    public ResourceLaunchProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private string _remote_id;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"remote_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string remote_id
-    {
-      get { return _remote_id; }
-      set { _remote_id = value; }
-    }
-    private string _evaluator_conf;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"evaluator_conf", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string evaluator_conf
-    {
-      get { return _evaluator_conf; }
-      set { _evaluator_conf = value; }
-    }
-    private ProcessType _type;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public ProcessType type
-    {
-      get { return _type; }
-      set { _type = value; }
-    }
-    private readonly global::System.Collections.Generic.List<FileResourceProto> _file = new global::System.Collections.Generic.List<FileResourceProto>();
-    [global::ProtoBuf.ProtoMember(10, Name=@"file", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<FileResourceProto> file
-    {
-      get { return _file; }
-    }
-  
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/EvaluatorRunTime.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/EvaluatorRunTime.pb.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/EvaluatorRunTime.pb.cs
deleted file mode 100644
index 2e7ae9d..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/EvaluatorRunTime.pb.cs
+++ /dev/null
@@ -1,305 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-// Generated from: evaluator_runtime.proto
-// Note: requires additional types generated from: reef_service_protos.proto
-namespace Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto
-{
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StopEvaluatorProto")]
-  public partial class StopEvaluatorProto : global::ProtoBuf.IExtensible
-  {
-    public StopEvaluatorProto() {}
-    
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"KillEvaluatorProto")]
-  public partial class KillEvaluatorProto : global::ProtoBuf.IExtensible
-  {
-    public KillEvaluatorProto() {}
-    
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StartTaskProto")]
-  public partial class StartTaskProto : global::ProtoBuf.IExtensible
-  {
-    public StartTaskProto() {}
-    
-    private string _context_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string context_id
-    {
-      get { return _context_id; }
-      set { _context_id = value; }
-    }
-    private string _configuration;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string configuration
-    {
-      get { return _configuration; }
-      set { _configuration = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"AddContextProto")]
-  public partial class AddContextProto : global::ProtoBuf.IExtensible
-  {
-    public AddContextProto() {}
-    
-    private string _parent_context_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"parent_context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string parent_context_id
-    {
-      get { return _parent_context_id; }
-      set { _parent_context_id = value; }
-    }
-    private string _context_configuration;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"context_configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string context_configuration
-    {
-      get { return _context_configuration; }
-      set { _context_configuration = value; }
-    }
-    private string _service_configuration = "";
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"service_configuration", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string service_configuration
-    {
-      get { return _service_configuration; }
-      set { _service_configuration = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RemoveContextProto")]
-  public partial class RemoveContextProto : global::ProtoBuf.IExtensible
-  {
-    public RemoveContextProto() {}
-    
-    private string _context_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string context_id
-    {
-      get { return _context_id; }
-      set { _context_id = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StopTaskProto")]
-  public partial class StopTaskProto : global::ProtoBuf.IExtensible
-  {
-    public StopTaskProto() {}
-    
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SuspendTaskProto")]
-  public partial class SuspendTaskProto : global::ProtoBuf.IExtensible
-  {
-    public SuspendTaskProto() {}
-    
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextMessageProto")]
-  public partial class ContextMessageProto : global::ProtoBuf.IExtensible
-  {
-    public ContextMessageProto() {}
-    
-    private string _context_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string context_id
-    {
-      get { return _context_id; }
-      set { _context_id = value; }
-    }
-    private byte[] _message;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public byte[] message
-    {
-      get { return _message; }
-      set { _message = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextControlProto")]
-  public partial class ContextControlProto : global::ProtoBuf.IExtensible
-  {
-    public ContextControlProto() {}
-    
-    private byte[] _task_message = null;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"task_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] task_message
-    {
-      get { return _task_message; }
-      set { _task_message = value; }
-    }
-    private ContextMessageProto _context_message = null;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"context_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public ContextMessageProto context_message
-    {
-      get { return _context_message; }
-      set { _context_message = value; }
-    }
-    private AddContextProto _add_context = null;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"add_context", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public AddContextProto add_context
-    {
-      get { return _add_context; }
-      set { _add_context = value; }
-    }
-    private RemoveContextProto _remove_context = null;
-    [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"remove_context", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public RemoveContextProto remove_context
-    {
-      get { return _remove_context; }
-      set { _remove_context = value; }
-    }
-    private StartTaskProto _start_task = null;
-    [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"start_task", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public StartTaskProto start_task
-    {
-      get { return _start_task; }
-      set { _start_task = value; }
-    }
-    private StopTaskProto _stop_task = null;
-    [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"stop_task", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public StopTaskProto stop_task
-    {
-      get { return _stop_task; }
-      set { _stop_task = value; }
-    }
-    private SuspendTaskProto _suspend_task = null;
-    [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"suspend_task", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public SuspendTaskProto suspend_task
-    {
-      get { return _suspend_task; }
-      set { _suspend_task = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EvaluatorHeartbeatProto")]
-  public partial class EvaluatorHeartbeatProto : global::ProtoBuf.IExtensible
-  {
-    public EvaluatorHeartbeatProto() {}
-    
-    private long _timestamp;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public long timestamp
-    {
-      get { return _timestamp; }
-      set { _timestamp = value; }
-    }
-    private EvaluatorStatusProto _evaluator_status;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"evaluator_status", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public EvaluatorStatusProto evaluator_status
-    {
-      get { return _evaluator_status; }
-      set { _evaluator_status = value; }
-    }
-    private readonly global::System.Collections.Generic.List<ContextStatusProto> _context_status = new global::System.Collections.Generic.List<ContextStatusProto>();
-    [global::ProtoBuf.ProtoMember(3, Name=@"context_status", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<ContextStatusProto> context_status
-    {
-      get { return _context_status; }
-    }
-  
-    private TaskStatusProto _task_status = null;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"task_status", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public TaskStatusProto task_status
-    {
-      get { return _task_status; }
-      set { _task_status = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-
-    private bool _recovery;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name = @"recovery", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public bool recovery
-    {
-        get { return _recovery; }
-        set { _recovery = value; }
-    }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EvaluatorControlProto")]
-  public partial class EvaluatorControlProto : global::ProtoBuf.IExtensible
-  {
-    public EvaluatorControlProto() {}
-    
-    private long _timestamp;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public long timestamp
-    {
-      get { return _timestamp; }
-      set { _timestamp = value; }
-    }
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private ContextControlProto _context_control = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"context_control", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public ContextControlProto context_control
-    {
-      get { return _context_control; }
-      set { _context_control = value; }
-    }
-    private KillEvaluatorProto _kill_evaluator = null;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"kill_evaluator", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public KillEvaluatorProto kill_evaluator
-    {
-      get { return _kill_evaluator; }
-      set { _kill_evaluator = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefProtocol.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefProtocol.pb.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefProtocol.pb.cs
deleted file mode 100644
index 1ade6de..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefProtocol.pb.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-// Generated from: reef_protocol.proto
-// Note: requires additional types generated from: client_runtime.proto
-// Note: requires additional types generated from: evaluator_runtime.proto
-// Note: requires additional types generated from: reef_service_protos.proto
-using Org.Apache.REEF.Common.ProtoBuf.ClienRuntimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-
-namespace Org.Apache.REEF.Common.ProtoBuf.ReefProtocol
-{
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"REEFMessage")]
-  public partial class REEFMessage : global::ProtoBuf.IExtensible
-  {
-    public REEFMessage() {}
-    
-    private JobSubmissionProto _jobSubmission = null;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"jobSubmission", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public JobSubmissionProto jobSubmission
-    {
-      get { return _jobSubmission; }
-      set { _jobSubmission = value; }
-    }
-    private JobControlProto _jobControl = null;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"jobControl", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public JobControlProto jobControl
-    {
-      get { return _jobControl; }
-      set { _jobControl = value; }
-    }
-    private RuntimeErrorProto _runtimeError = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"runtimeError", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public RuntimeErrorProto runtimeError
-    {
-      get { return _runtimeError; }
-      set { _runtimeError = value; }
-    }
-    private JobStatusProto _jobStatus = null;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"jobStatus", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public JobStatusProto jobStatus
-    {
-      get { return _jobStatus; }
-      set { _jobStatus = value; }
-    }
-    private EvaluatorControlProto _evaluatorControl = null;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"evaluatorControl", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public EvaluatorControlProto evaluatorControl
-    {
-      get { return _evaluatorControl; }
-      set { _evaluatorControl = value; }
-    }
-    private EvaluatorHeartbeatProto _evaluatorHeartBeat = null;
-    [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"evaluatorHeartBeat", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public EvaluatorHeartbeatProto evaluatorHeartBeat
-    {
-      get { return _evaluatorHeartBeat; }
-      set { _evaluatorHeartBeat = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefService.pb.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefService.pb.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefService.pb.cs
deleted file mode 100644
index 383467e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/ReefService.pb.cs
+++ /dev/null
@@ -1,393 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-// Generated from: reef_service_protos.proto
-namespace Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto
-
-{
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"FileResourceProto")]
-  public partial class FileResourceProto : global::ProtoBuf.IExtensible
-  {
-    public FileResourceProto() {}
-    
-    private FileType _type;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public FileType type
-    {
-      get { return _type; }
-      set { _type = value; }
-    }
-    private string _name;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string name
-    {
-      get { return _name; }
-      set { _name = value; }
-    }
-    private string _path;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"path", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string path
-    {
-      get { return _path; }
-      set { _path = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RuntimeErrorProto")]
-  public partial class RuntimeErrorProto : global::ProtoBuf.IExtensible
-  {
-    public RuntimeErrorProto() {}
-    
-    private string _name;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string name
-    {
-      get { return _name; }
-      set { _name = value; }
-    }
-    private string _message;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string message
-    {
-      get { return _message; }
-      set { _message = value; }
-    }
-    private byte[] _exception = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"exception", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] exception
-    {
-      get { return _exception; }
-      set { _exception = value; }
-    }
-    private string _identifier = "";
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobStatusProto")]
-  public partial class JobStatusProto : global::ProtoBuf.IExtensible
-  {
-    public JobStatusProto() {}
-    
-    private string _identifier;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"identifier", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string identifier
-    {
-      get { return _identifier; }
-      set { _identifier = value; }
-    }
-    private State _state;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public State state
-    {
-      get { return _state; }
-      set { _state = value; }
-    }
-    private byte[] _message = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] message
-    {
-      get { return _message; }
-      set { _message = value; }
-    }
-    private byte[] _exception = null;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"exception", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] exception
-    {
-      get { return _exception; }
-      set { _exception = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextStatusProto")]
-  public partial class ContextStatusProto : global::ProtoBuf.IExtensible
-  {
-    public ContextStatusProto() {}
-    
-    private ContextStatusProto.State _context_state;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"context_state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public ContextStatusProto.State context_state
-    {
-      get { return _context_state; }
-      set { _context_state = value; }
-    }
-    private string _context_id;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string context_id
-    {
-      get { return _context_id; }
-      set { _context_id = value; }
-    }
-    private string _parent_id = "";
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"parent_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue("")]
-    public string parent_id
-    {
-      get { return _parent_id; }
-      set { _parent_id = value; }
-    }
-    private byte[] _error = null;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"error", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] error
-    {
-      get { return _error; }
-      set { _error = value; }
-    }
-    private bool _recovery = false;
-    [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name = @"recovery", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(false)]
-    public bool recovery
-    {
-        get { return _recovery; }
-        set { _recovery = value; }
-    }
-    private readonly global::System.Collections.Generic.List<ContextStatusProto.ContextMessageProto> _context_message = new global::System.Collections.Generic.List<ContextStatusProto.ContextMessageProto>();
-    [global::ProtoBuf.ProtoMember(7, Name=@"context_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<ContextStatusProto.ContextMessageProto> context_message
-    {
-      get { return _context_message; }
-    }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ContextMessageProto")]
-  public partial class ContextMessageProto : global::ProtoBuf.IExtensible
-  {
-    public ContextMessageProto() {}
-    
-    private string _source_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"source_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string source_id
-    {
-      get { return _source_id; }
-      set { _source_id = value; }
-    }
-    private byte[] _message;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public byte[] message
-    {
-      get { return _message; }
-      set { _message = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-    [global::ProtoBuf.ProtoContract(Name=@"State")]
-    public enum State
-    {
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"READY", Value=0)]
-      READY = 0,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"DONE", Value=1)]
-      DONE = 1,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"FAIL", Value=2)]
-      FAIL = 2
-    }
-  
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"TaskStatusProto")]
-  public partial class TaskStatusProto : global::ProtoBuf.IExtensible
-  {
-    public TaskStatusProto() {}
-    
-    private string _task_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"task_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string task_id
-    {
-      get { return _task_id; }
-      set { _task_id = value; }
-    }
-    private string _context_id;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"context_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string context_id
-    {
-      get { return _context_id; }
-      set { _context_id = value; }
-    }
-    private State _state;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public State state
-    {
-      get { return _state; }
-      set { _state = value; }
-    }
-    private byte[] _result = null;
-    [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"result", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] result
-    {
-      get { return _result; }
-      set { _result = value; }
-    }
-    private bool _recovery = false;
-    [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name = @"recovery", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(false)]
-    public bool recovery
-    {
-        get { return _recovery; }
-        set { _recovery = value; }
-    }
-    private readonly global::System.Collections.Generic.List<TaskStatusProto.TaskMessageProto> _task_message = new global::System.Collections.Generic.List<TaskStatusProto.TaskMessageProto>();
-    [global::ProtoBuf.ProtoMember(6, Name=@"task_message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public global::System.Collections.Generic.List<TaskStatusProto.TaskMessageProto> task_message
-    {
-      get { return _task_message; }
-    }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"TaskMessageProto")]
-  public partial class TaskMessageProto : global::ProtoBuf.IExtensible
-  {
-    public TaskMessageProto() {}
-    
-    private string _source_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"source_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string source_id
-    {
-      get { return _source_id; }
-      set { _source_id = value; }
-    }
-    private byte[] _message;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"message", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public byte[] message
-    {
-      get { return _message; }
-      set { _message = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-  [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EvaluatorStatusProto")]
-  public partial class EvaluatorStatusProto : global::ProtoBuf.IExtensible
-  {
-    public EvaluatorStatusProto() {}
-    
-    private string _evaluator_id;
-    [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"evaluator_id", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    public string evaluator_id
-    {
-      get { return _evaluator_id; }
-      set { _evaluator_id = value; }
-    }
-    private State _state;
-    [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"state", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
-    public State state
-    {
-      get { return _state; }
-      set { _state = value; }
-    }
-    private byte[] _error = null;
-    [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"error", DataFormat = global::ProtoBuf.DataFormat.Default)]
-    [global::System.ComponentModel.DefaultValue(null)]
-    public byte[] error
-    {
-      get { return _error; }
-      set { _error = value; }
-    }
-    private global::ProtoBuf.IExtension extensionObject;
-    global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
-      { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
-  }
-  
-    [global::ProtoBuf.ProtoContract(Name=@"State")]
-    public enum State
-    {
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"INIT", Value=0)]
-      INIT = 0,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"RUNNING", Value=1)]
-      RUNNING = 1,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"DONE", Value=2)]
-      DONE = 2,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"SUSPEND", Value=3)]
-      SUSPEND = 3,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"FAILED", Value=4)]
-      FAILED = 4,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"KILLED", Value=5)]
-      KILLED = 5
-    }
-  
-    [global::ProtoBuf.ProtoContract(Name=@"FileType")]
-    public enum FileType
-    {
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"PLAIN", Value=0)]
-      PLAIN = 0,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"LIB", Value=1)]
-      LIB = 1,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"ARCHIVE", Value=2)]
-      ARCHIVE = 2
-    }
-  
-    [global::ProtoBuf.ProtoContract(Name=@"SIZE")]
-    public enum SIZE
-    {
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"SMALL", Value=0)]
-      SMALL = 0,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"MEDIUM", Value=1)]
-      MEDIUM = 1,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"LARGE", Value=2)]
-      LARGE = 2,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"XLARGE", Value=3)]
-      XLARGE = 3
-    }
-  
-    [global::ProtoBuf.ProtoContract(Name=@"ProcessType")]
-    public enum ProcessType
-    {
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"JVM", Value=0)]
-      JVM = 0,
-            
-      [global::ProtoBuf.ProtoEnum(Name=@"CLR", Value=1)]
-      CLR = 1
-    }
-  
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/Serializer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/Serializer.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/Serializer.cs
deleted file mode 100644
index 6bd90e8..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/Serializer.cs
+++ /dev/null
@@ -1,130 +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 Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Utilities;
-
-using ProtoBuf;
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.IO;
-using System.Text;
-
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1403:FileMayOnlyContainASingleNamespace", Justification = "Serializers for all protobuf types")]
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Serializers for all protobuf types")]
-
-namespace Org.Apache.REEF.Common.ProtoBuf.ReefProtocol
-{
-    /// <summary>
-    /// Add serializer/deserializer to REEFMessage
-    /// </summary>
-    public partial class REEFMessage
-    {
-        public REEFMessage(EvaluatorHeartbeatProto evaluatorHeartbeatProto)
-        {
-            _evaluatorHeartBeat = evaluatorHeartbeatProto;
-        }
-
-        public static REEFMessage Deserialize(byte[] bytes)
-        {
-            REEFMessage pbuf = null;
-            using (var s = new MemoryStream(bytes))
-            {
-                pbuf = Serializer.Deserialize<REEFMessage>(s);
-            }
-            return pbuf;
-        }
-
-        public byte[] Serialize()
-        {
-            byte[] b = null;
-            using (var s = new MemoryStream())
-            {
-                Serializer.Serialize<REEFMessage>(s, this);
-                b = new byte[s.Position];
-                var fullBuffer = s.GetBuffer();
-                Array.Copy(fullBuffer, b, b.Length);
-            }
-            return b;
-        }
-    }
-}
-
-namespace Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto
-{
-    /// <summary>
-    /// Add serializer/deserializer to EvaluatorHeartbeatProto
-    /// </summary>
-    public partial class EvaluatorHeartbeatProto
-    {
-        public static EvaluatorHeartbeatProto Deserialize(byte[] bytes)
-        {
-            EvaluatorHeartbeatProto pbuf = null;
-            using (var s = new MemoryStream(bytes))
-            {
-                pbuf = Serializer.Deserialize<EvaluatorHeartbeatProto>(s);
-            }
-            return pbuf;
-        }
-
-        public byte[] Serialize()
-        {
-            byte[] b = null;
-            using (var s = new MemoryStream())
-            {
-                Serializer.Serialize<EvaluatorHeartbeatProto>(s, this);
-                b = new byte[s.Position];
-                var fullBuffer = s.GetBuffer();
-                Array.Copy(fullBuffer, b, b.Length);
-            }
-            return b;
-        }
-
-        public override string ToString()
-        {
-            string contextStatus = string.Empty;
-            string taskStatusMessage = string.Empty;
-            foreach (ContextStatusProto contextStatusProto in context_status)
-            {
-                contextStatus += string.Format(CultureInfo.InvariantCulture, "evaluator {0} has context {1} in state {2} with recovery flag {3}",
-                                               evaluator_status.evaluator_id,
-                                               contextStatusProto.context_id,
-                                               contextStatusProto.context_state,
-                                               contextStatusProto.recovery);
-            }
-            if (task_status != null && task_status.task_message != null && task_status.task_message.Count > 0)
-            {
-                foreach (TaskStatusProto.TaskMessageProto taskMessageProto in task_status.task_message)
-                {
-                    taskStatusMessage += ByteUtilities.ByteArrarysToString(taskMessageProto.message);
-                }
-            }
-            return string.Format(CultureInfo.InvariantCulture, "EvaluatorHeartbeatProto: task_id=[{0}], task_status=[{1}], task_message=[{2}], evaluator_status=[{3}], context_status=[{4}], timestamp=[{5}], recoveryFlag =[{6}]",
-                task_status == null ? string.Empty : task_status.task_id,
-                task_status == null ? string.Empty : task_status.state.ToString(),
-                taskStatusMessage,
-                evaluator_status.state.ToString(),
-                contextStatus,
-                timestamp,
-                recovery);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/EvaluatorHeartbeatProtoCodec.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/EvaluatorHeartbeatProtoCodec.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/EvaluatorHeartbeatProtoCodec.cs
deleted file mode 100644
index 0f997a4..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/EvaluatorHeartbeatProtoCodec.cs
+++ /dev/null
@@ -1,41 +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 Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Wake.Remote;
-
-namespace Org.Apache.REEF.Common.ProtoBuf.ReefProtocol
-{
-    public class EvaluatorHeartbeatProtoCodec : ICodec<EvaluatorHeartbeatProto>
-    {
-        public byte[] Encode(EvaluatorHeartbeatProto obj)
-        {
-            EvaluatorHeartbeatProto pbuf = new EvaluatorHeartbeatProto();
-
-            pbuf.evaluator_status = obj.evaluator_status;
-            return pbuf.Serialize();
-        }
-
-        public EvaluatorHeartbeatProto Decode(byte[] data)
-        {
-            EvaluatorHeartbeatProto pbuf = EvaluatorHeartbeatProto.Deserialize(data);
-            return pbuf;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/REEFMessageCodec.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/REEFMessageCodec.cs b/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/REEFMessageCodec.cs
deleted file mode 100644
index 41109e3..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/cs/codec/REEFMessageCodec.cs
+++ /dev/null
@@ -1,37 +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 Org.Apache.REEF.Wake.Remote;
-
-namespace Org.Apache.REEF.Common.ProtoBuf.ReefProtocol
-{
-    public class REEFMessageCodec : ICodec<REEFMessage>
-    {
-        public byte[] Encode(REEFMessage obj)
-        {
-            return obj.Serialize();
-        }
-
-        public REEFMessage Decode(byte[] data)
-        {
-            REEFMessage pbuf = REEFMessage.Deserialize(data);
-            return pbuf;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/proto/client_runtime.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/client_runtime.proto b/lang/cs/Org.Apache.REEF.Common/protobuf/proto/client_runtime.proto
deleted file mode 100644
index 3d1f927..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/client_runtime.proto
+++ /dev/null
@@ -1,56 +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.
- */
-option java_package = "org.apache.reef.proto";
-option java_outer_classname = "ClientRuntimeProtocol";
-option java_generic_services = true;
-option java_generate_equals_and_hash = true;
-
-import "reef_service_protos.proto";
-
-// Messages from REEF Client -> Driver Runtime
-
-message JobSubmissionProto {
-	required string identifier     = 1; // the job identifier
-	required string remote_id      = 2; // the remote identifier
-	required string configuration  = 5; // the runtime configuration
-	required string user_name      = 6; // the user name
-
-  optional SIZE   driver_size    = 7;
-  optional int32  driver_memory  = 8;
-  optional int32  priority       = 9;
-  optional string queue          = 10;
-
-	repeated FileResourceProto global_file = 11; // files that should be placed on the driver and all subsequent evaluators
-	repeated FileResourceProto local_File  = 12; // files that should be placed on the driver only
-
-}
-
-enum Signal {
-	SIG_TERMINATE = 1;
-	SIG_SUSPEND   = 2;
-	SIG_RESUME    = 3;
-}
-
-message JobControlProto {
-	required string identifier = 1;
-	optional Signal signal     = 2;
-	optional bytes message     = 3;
-}
-
-

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/protobuf/proto/driver_runtime.proto
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/driver_runtime.proto b/lang/cs/Org.Apache.REEF.Common/protobuf/proto/driver_runtime.proto
deleted file mode 100644
index 2b21ac7..0000000
--- a/lang/cs/Org.Apache.REEF.Common/protobuf/proto/driver_runtime.proto
+++ /dev/null
@@ -1,90 +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.
- */
-option java_package = "org.apache.reef.proto";
-option java_outer_classname = "DriverRuntimeProtocol";
-option java_generic_services = true;
-option java_generate_equals_and_hash = true;
-
-
-import "reef_service_protos.proto";
-
-// Messages from Driver Runtime -> Driver Process
-
-message DriverProcessRegistrationProto {
-	required string remote_identifier = 1;
-}
-
-
-message NodeDescriptorProto {
-	required string identifier = 1;
-	required string host_name  = 2; // e.g., IP address
-	required int32 port        = 3; // e.g., IP port
-	required int32 memory_size = 4;
-	optional string rack_name  = 5; // e.g., /default-rack
-}
-
-message ResourceAllocationProto {
-	required string identifier     = 1; // e.g., the container id, or the thread id
-	required int32 resource_memory = 2; // megabytes
-	required string node_id        = 3;
-}
-
-message ResourceStatusProto {
-	required string identifier   = 1;
-	required State  state        = 2;
-	optional string diagnostics  = 3;
-	optional int32  exit_code    = 4;
-	optional bool is_from_previous_driver = 5;
-}
-
-message RuntimeStatusProto {
-   required string name  = 1;   // e.g., local, yarn21
-   required State  state = 2;
-   optional RuntimeErrorProto error = 3; // runtime (e.g., YARN) error
-
-   optional int32 outstanding_container_requests = 5;
-   repeated string container_allocation = 6;
-}
-
-//////////////////////////////////////////////////////
-// Messages from Driver Process -> Driver Runtime
-
-message ResourceRequestProto {
-	// optional SIZE resource_size   = 1; // Removed in REEF 0.3 in favor of memory_size.
-    optional int32 memory_size = 2; // Memory size of the evaluator in MB
-    optional int32 priority       = 3;
-
-    required int32 resource_count = 5;
-	repeated string node_name     = 6; // a list of specific nodes
-	repeated string rack_name     = 7; // a list of specific racks
-
-    optional bool relax_locality = 10;
-}
-
-message ResourceReleaseProto {
-	required string identifier = 1;
-}
-
-message ResourceLaunchProto {
-	required string identifier      = 1;
-	required string remote_id       = 2;
-	required string evaluator_conf  = 3;
-    required ProcessType type       = 4;
-	repeated FileResourceProto file = 10;
-}


[09/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/IRunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/IRunningTask.cs b/lang/cs/Org.Apache.REEF.Common/tasks/IRunningTask.cs
deleted file mode 100644
index 1e76d1d..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/IRunningTask.cs
+++ /dev/null
@@ -1,53 +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 Org.Apache.REEF.Utilities;
-using System;
-
-namespace Org.Apache.REEF.Common.Task
-{
-    /// <summary>
-    /// Represents a running Task
-    /// </summary>
-    public interface IRunningTask : IIdentifiable, IDisposable
-    {
-        /// <summary>
-        /// Sends the message to the running task.
-        /// </summary>
-        /// <param name="message"></param>
-        void OnNext(byte[] message);
-
-        /// <summary>
-        ///  Signal the task to suspend.
-        /// </summary>
-        /// <param name="message">a message that is sent to the Task.</param>
-        void Suspend(byte[] message);
-
-        /// <summary>
-        /// Sends the message to the running task.
-        /// </summary>
-        void Suspend();
-
-        /// <summary>
-        /// Signal the task to shut down.
-        /// </summary>
-        /// <param name="message">a message that is sent to the Task.</param>
-        void Dispose(byte[] message);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/ITask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/ITask.cs b/lang/cs/Org.Apache.REEF.Common/tasks/ITask.cs
deleted file mode 100644
index 42cc10e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/ITask.cs
+++ /dev/null
@@ -1,28 +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;
-
-namespace Org.Apache.REEF.Tasks
-{
-    public interface ITask : IDisposable
-    {
-        byte[] Call(byte[] memento);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/ITaskMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/ITaskMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/tasks/ITaskMessageSource.cs
deleted file mode 100644
index 141ba89..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/ITaskMessageSource.cs
+++ /dev/null
@@ -1,31 +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 Org.Apache.REEF.Tasks.Defaults;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Tasks
-{
-    [DefaultImplementation(typeof(DefaultTaskMessageSource))]
-    public interface ITaskMessageSource
-    {
-        Optional<TaskMessage> Message { get; set; }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfiguration.cs
deleted file mode 100644
index cd82d2a..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfiguration.cs
+++ /dev/null
@@ -1,148 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Tang.Util;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static readonly field, typical usage in configurations")]
-
-namespace Org.Apache.REEF.Tasks
-{
-    public class TaskConfiguration : ConfigurationModuleBuilder
-    {
-        // this is a hack for getting the task identifier for now
-        public const string TaskIdentifier = "TaskConfigurationOptions+Identifier";
-
-        /// <summary>
-        ///  The identifier of the task.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredParameter<string> Identifier = new RequiredParameter<string>();
-
-        /// <summary>
-        /// The task to instantiate.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredImpl<ITask> Task = new RequiredImpl<ITask>();
-
-        /// <summary>
-        /// for task suspension. Defaults to task 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<ISuspendEvent>> OnSuspend = new OptionalImpl<IObserver<ISuspendEvent>>();
-
-        /// <summary>
-        /// for messages from the driver. Defaults to task failure if not bound.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IDriverMessageHandler> OnMessage = new OptionalImpl<IDriverMessageHandler>();
-
-        /// <summary>
-        /// for closure requests from the driver. Defaults to task 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<ICloseEvent>> OnClose = new OptionalImpl<IObserver<ICloseEvent>>();
-
-        /// <summary>
-        /// Message source invoked upon each evaluator heartbeat.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<ITaskMessageSource> OnSendMessage = new OptionalImpl<ITaskMessageSource>();
-
-        /// <summary>
-        /// to receive TaskStart after the Task.call() method was called.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IObserver<ITaskStart>> OnTaskStart = new OptionalImpl<IObserver<ITaskStart>>();
-
-        /// <summary>
-        /// to receive TaskStop after the Task.call() method returned.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IObserver<ITaskStop>> OnTaskStop = new OptionalImpl<IObserver<ITaskStop>>();
-
-        /// <summary>
-        /// The memento to be passed to Task.call().
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalParameter<string> Memento = new OptionalParameter<string>();
-
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskConfiguration));
-
-        public TaskConfiguration()
-            : base()
-        {
-        }
-
-        public TaskConfiguration(string configString)
-        {
-            TangConfig = new AvroConfigurationSerializer().FromString(configString);
-            AvroConfiguration avroConfiguration = AvroConfiguration.GetAvroConfigurationFromEmbeddedString(configString);
-            foreach (ConfigurationEntry config in avroConfiguration.Bindings)
-            {
-                if (config.key.Contains(TaskIdentifier))
-                {
-                    TaskId = config.value;
-                }
-            }
-            if (string.IsNullOrWhiteSpace(TaskId))
-            {
-                string msg = "Required parameter TaskId not provided.";
-                LOGGER.Log(Level.Error, msg);
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException(msg), LOGGER);
-            }
-        }
-
-        public static ConfigurationModule ConfigurationModule
-        {
-            get
-            {
-                return new TaskConfiguration()
-                    .BindImplementation(GenericType<ITask>.Class, Task)
-                    .BindImplementation(GenericType<ITaskMessageSource>.Class, OnSendMessage)
-                    .BindImplementation(GenericType<IDriverMessageHandler>.Class, OnMessage)
-                    .BindNamedParameter(GenericType<TaskConfigurationOptions.Identifier>.Class, Identifier)
-                    .BindNamedParameter(GenericType<TaskConfigurationOptions.Memento>.Class, Memento)
-                    .BindNamedParameter(GenericType<TaskConfigurationOptions.CloseHandler>.Class, OnClose)
-                    .BindNamedParameter(GenericType<TaskConfigurationOptions.SuspendHandler>.Class, OnSuspend)
-                    .BindSetEntry(GenericType<TaskConfigurationOptions.StartHandlers>.Class, OnTaskStart)
-                    .BindSetEntry(GenericType<TaskConfigurationOptions.StopHandlers>.Class, OnTaskStop)
-                    .Build();
-            }
-        }
-
-        public string TaskId { get;  private set; }
-
-        public IList<KeyValuePair<string, string>> Configurations { get; private set; }
-
-        public IConfiguration TangConfig { get; private set; }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.InvariantCulture, "TaskConfiguration - configurations: {0}", TangConfig.ToString());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfigurationOptions.cs
deleted file mode 100644
index db50d78..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/TaskConfigurationOptions.cs
+++ /dev/null
@@ -1,69 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Tasks
-{
-    public class TaskConfigurationOptions
-    {
-        [NamedParameter("The Identifier of the Task", "taskid", "Task")]
-        public class Identifier : Name<string>
-        {
-        }
-
-        [NamedParameter(documentation: "The memento to be used for the Task")]
-        public class Memento : Name<string>
-        {
-        }
-
-        [NamedParameter("TaskMessageSource", "messagesource", null)]
-        public class TaskMessageSources : Name<ISet<ITaskMessageSource>>
-        {
-        }
-
-        [NamedParameter(documentation: "The set of event handlers for the TaskStart event.")]
-        public class StartHandlers : Name<ISet<IObserver<ITaskStart>>>
-        {
-        }
-
-        [NamedParameter(documentation: "The set of event handlers for the TaskStop event.")]
-        public class StopHandlers : Name<ISet<IObserver<ITaskStop>>>
-        {
-        }
-
-        [NamedParameter(documentation: "The event handler that receives the close event.")]
-        public class CloseHandler : Name<IObserver<ICloseEvent>>
-        {
-        }
-
-        [NamedParameter(documentation: "The event handler that receives the suspend event.")]
-        public class SuspendHandler : Name<IObserver<ISuspendEvent>>
-        {
-        }
-
-        [NamedParameter(documentation: "The event handler that receives messages from the driver.")]
-        public class MessageHandler : Name<IObserver<IDriverMessage>>
-        {
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/TaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/TaskMessage.cs b/lang/cs/Org.Apache.REEF.Common/tasks/TaskMessage.cs
deleted file mode 100644
index bc96016..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/TaskMessage.cs
+++ /dev/null
@@ -1,68 +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 Org.Apache.REEF.Utilities;
-using System;
-using Org.Apache.REEF.Utilities.Logging;
-
-namespace Org.Apache.REEF.Tasks
-{
-    public class TaskMessage : IMessage
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskMessage));
-        private readonly string _messageSourcId;
-        private readonly byte[] _bytes;
-
-        private TaskMessage(string messageSourceId, byte[] bytes)
-        {
-            _messageSourcId = messageSourceId;
-            _bytes = bytes;
-        }
-
-        public string MessageSourceId
-        {
-            get { return _messageSourcId; }
-        }
-
-        public byte[] Message
-        {
-            get { return _bytes; }
-            set { }
-        }
-
-        /// <summary>
-        ///  From byte[] message to a TaskMessage
-        /// </summary>
-        /// <param name="messageSourceId">messageSourceId The message's sourceID. This will be accessible in the Driver for routing</param>
-        /// <param name="message">The actual content of the message, serialized into a byte[]</param>
-        /// <returns>a new TaskMessage with the given content</returns>
-        public static TaskMessage From(string messageSourceId, byte[] message)
-        {
-            if (string.IsNullOrEmpty(messageSourceId))
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("messageSourceId"), LOGGER);
-            }
-            if (message == null)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("bytes"), LOGGER);
-            }
-            return new TaskMessage(messageSourceId, message);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultDriverMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultDriverMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultDriverMessageHandler.cs
deleted file mode 100644
index 3749f2b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultDriverMessageHandler.cs
+++ /dev/null
@@ -1,42 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Tasks.Defaults
-{
-    public class DefaultDriverMessageHandler : IDriverMessageHandler
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverMessageHandler));
-
-        [Inject]
-        public DefaultDriverMessageHandler()
-        {
-        }
-
-        public void Handle(IDriverMessage message)
-        {
-            Exceptions.Throw(new InvalidOperationException("No DriverMessage handler bound. Message received" + message), LOGGER);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultTaskMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultTaskMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultTaskMessageSource.cs
deleted file mode 100644
index 4549ab5..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/defaults/DefaultTaskMessageSource.cs
+++ /dev/null
@@ -1,49 +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 Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Tasks.Defaults
-{
-    public class DefaultTaskMessageSource : ITaskMessageSource
-    {
-        [Inject]
-        public DefaultTaskMessageSource()
-        {
-        }
-
-        public Optional<TaskMessage> Message
-        {
-            get
-            {
-                TaskMessage defaultTaskMessage = TaskMessage.From(
-                    "defaultSourceId", 
-                    ByteUtilities.StringToByteArrays("default message generated at " + DateTime.Now.ToString(CultureInfo.InvariantCulture)));
-                return Optional<TaskMessage>.Of(defaultTaskMessage);
-            }
-
-            set
-            {
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/events/ICloseEvent.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/events/ICloseEvent.cs b/lang/cs/Org.Apache.REEF.Common/tasks/events/ICloseEvent.cs
deleted file mode 100644
index e9737c3..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/events/ICloseEvent.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Tasks.Events
-{
-    public interface ICloseEvent
-    {
-        Optional<byte[]> Value { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/events/IDriverMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/events/IDriverMessage.cs b/lang/cs/Org.Apache.REEF.Common/tasks/events/IDriverMessage.cs
deleted file mode 100644
index a1ead6d..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/events/IDriverMessage.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Tasks.Events
-{
-    public interface IDriverMessage
-    {
-        Optional<byte[]> Message { get; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/events/ISuspendEvent.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/events/ISuspendEvent.cs b/lang/cs/Org.Apache.REEF.Common/tasks/events/ISuspendEvent.cs
deleted file mode 100644
index 1926c75..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/events/ISuspendEvent.cs
+++ /dev/null
@@ -1,25 +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.
- */
-
-namespace Org.Apache.REEF.Tasks.Events
-{
-    public interface ISuspendEvent
-    {
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStart.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStart.cs b/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStart.cs
deleted file mode 100644
index 7b15609..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStart.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Tasks.Events
-{
-    public interface ITaskStart
-    {
-        string Id { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStop.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStop.cs b/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStop.cs
deleted file mode 100644
index 62e9254..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/events/ITaskStop.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Tasks.Events
-{
-    public interface ITaskStop
-    {
-        string Id { get; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeLogger.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeLogger.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeLogger.cs
new file mode 100644
index 0000000..3e2dada
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/BridgeLogger.cs
@@ -0,0 +1,65 @@
+/**
+ * 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.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    /// <summary>
+    /// A wrapper around the general Logger class used specifically for 
+    /// logging in CPP bridge code. 
+    /// This is enabled when trace leve is above Level.Info (included)
+    /// </summary>
+    public class BridgeLogger
+    {
+        private Logger _logger;
+
+        public BridgeLogger(string name)
+        {
+            _logger = Logger.GetLogger(name);
+        }
+
+        public static BridgeLogger GetLogger(string className)
+        {
+            return new BridgeLogger(className);
+        }
+
+        public void Log(string message)
+        {
+            _logger.Log(Level.Info, message);
+        }
+
+        public void LogStart(string message)
+        {
+            _logger.Log(Level.Start, message);
+        }
+
+        public void LogStop(string message)
+        {
+            _logger.Log(Level.Stop, message);
+        }
+
+        public void LogError(string message, Exception e)
+        {
+            _logger.Log(Level.Error, message, e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IActiveContextClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IActiveContextClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IActiveContextClr2Java.cs
new file mode 100644
index 0000000..6ef03f9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IActiveContextClr2Java.cs
@@ -0,0 +1,36 @@
+/**
+ * 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.Driver.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IActiveContextClr2Java : IClr2Java
+    {
+        void SubmitTask(string taskConfigStr);
+        
+        void Close();
+
+        string GetId();
+
+        string GetEvaluatorId();
+
+        IEvaluatorDescriptor GetEvaluatorDescriptor();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IAllocatedEvaluaotrClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IAllocatedEvaluaotrClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IAllocatedEvaluaotrClr2Java.cs
new file mode 100644
index 0000000..0e24bc3
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IAllocatedEvaluaotrClr2Java.cs
@@ -0,0 +1,42 @@
+/**
+ * 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.Driver.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IAllocatedEvaluaotrClr2Java : IClr2Java
+    {
+        void SubmitContextAndTask(string contextConfigStr, string taskConfigStr);
+
+        void SubmitContext(string contextConfigStr);
+
+        void SubmitContextAndService(string contextConfigStr, string serviceConfigStr);
+
+        void SubmitContextAndServiceAndTask(string contextConfigStr, string serviceConfigStr, string taskConfigStr);
+
+        void Close();
+
+        string GetId();
+
+        string GetNameServerInfo();
+
+        IEvaluatorDescriptor GetEvaluatorDescriptor();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClosedContextClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClosedContextClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClosedContextClr2Java.cs
new file mode 100644
index 0000000..7677a41
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClosedContextClr2Java.cs
@@ -0,0 +1,34 @@
+/**
+ * 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.Driver.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IClosedContextClr2Java : IClr2Java
+    {        
+        string GetId();
+
+        string GetEvaluatorId();
+
+        IEvaluatorDescriptor GetEvaluatorDescriptor();
+
+        IActiveContextClr2Java GetParentContext();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClr2Java.cs
new file mode 100644
index 0000000..b6c9154
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IClr2Java.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IClr2Java
+    {
+        void OnError(string message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedEvaluatorClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedEvaluatorClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedEvaluatorClr2Java.cs
new file mode 100644
index 0000000..99e37d7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedEvaluatorClr2Java.cs
@@ -0,0 +1,30 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface ICompletedEvaluatorClr2Java : IClr2Java
+    {
+        /// <summary>
+        /// evaluator id
+        /// </summary>
+        /// <returns>id of the completed evaluator</returns>
+        string GetId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedTaskClr2Java.cs
new file mode 100644
index 0000000..5eb2686
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ICompletedTaskClr2Java.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface ICompletedTaskClr2Java : IClr2Java
+    {
+        IActiveContextClr2Java GetActiveContext();
+        
+        string GetId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IContextMessageClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IContextMessageClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IContextMessageClr2Java.cs
new file mode 100644
index 0000000..9af42b7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IContextMessageClr2Java.cs
@@ -0,0 +1,30 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IContextMessageClr2Java : IClr2Java
+    {
+        byte[] Get();
+
+        string GetId();
+
+        string GetMessageSourceId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IEvaluatorRequestorClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IEvaluatorRequestorClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IEvaluatorRequestorClr2Java.cs
new file mode 100644
index 0000000..940ed43
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IEvaluatorRequestorClr2Java.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Driver.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IEvaluatorRequestorClr2Java : IClr2Java
+    {
+        void Submit(IEvaluatorRequest evaluatorRequest);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedContextClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedContextClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedContextClr2Java.cs
new file mode 100644
index 0000000..1b22645
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedContextClr2Java.cs
@@ -0,0 +1,36 @@
+/**
+ * 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.Driver.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IFailedContextClr2Java : IClr2Java
+    {        
+        string GetId();
+
+        string GetEvaluatorId();
+
+        string GetParentId();
+
+        IEvaluatorDescriptor GetEvaluatorDescriptor();
+
+        IActiveContextClr2Java GetParentContext();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedEvaluatorClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedEvaluatorClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedEvaluatorClr2Java.cs
new file mode 100644
index 0000000..12b007d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedEvaluatorClr2Java.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IFailedEvaluatorClr2Java
+    {
+        IEvaluatorRequestorClr2Java GetEvaluatorRequestor();
+
+        string GetId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedTaskClr2Java.cs
new file mode 100644
index 0000000..384502e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IFailedTaskClr2Java.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IFailedTaskClr2Java : IClr2Java
+    {
+        IActiveContextClr2Java GetActiveContext();
+
+        string GetString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IHttpServerBridgeClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IHttpServerBridgeClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IHttpServerBridgeClr2Java.cs
new file mode 100644
index 0000000..3b13aed
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IHttpServerBridgeClr2Java.cs
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IHttpServerBridgeClr2Java : IClr2Java
+    {
+        string GetQueryString();
+
+        void SetQueryResult(string queryResult);
+
+        byte[] GetQueryRequestData();
+
+        void SetQueryResponseData(byte[] responseData);
+
+        void SetUriSpecification(string uriSpecification);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IRunningTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IRunningTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IRunningTaskClr2Java.cs
new file mode 100644
index 0000000..e807e04
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/IRunningTaskClr2Java.cs
@@ -0,0 +1,30 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface IRunningTaskClr2Java : IClr2Java
+    {
+        IActiveContextClr2Java GetActiveContext();
+
+        string GetId();
+
+        void Send(byte[] message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ISuspendedTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ISuspendedTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ISuspendedTaskClr2Java.cs
new file mode 100644
index 0000000..95bfa8b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ISuspendedTaskClr2Java.cs
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface ISuspendedTaskClr2Java : IClr2Java
+    {
+        /// <summary>
+        /// get active context the task is running in
+        /// </summary>
+        /// <returns>active context</returns>
+        IActiveContextClr2Java GetActiveContext();
+
+        /// <summary>
+        /// get suspsended task id
+        /// </summary>
+        /// <returns>suspsended task id</returns>
+        string GetId();
+
+        /// <summary>
+        /// get the message
+        /// </summary>
+        /// <returns>suspended task message</returns>
+        byte[] Get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ITaskMessageClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ITaskMessageClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ITaskMessageClr2Java.cs
new file mode 100644
index 0000000..3e3abb3
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Clr2java/ITaskMessageClr2Java.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Bridge.Clr2java
+{
+    public interface ITaskMessageClr2Java : IClr2Java
+    {
+        string GetId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
new file mode 100644
index 0000000..8ccade9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
@@ -0,0 +1,174 @@
+/**
+ * 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.IO;
+using System.Linq;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class ClrClientHelper
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClrClientHelper));
+
+        public static void Run(HashSet<string> appDlls, IConfiguration driverBridgeConfig, DriverSubmissionSettings driverSubmissionSettings, string reefJar = Constants.BridgeJarFileName, string runCommand = "run.cmd", string clrFolder = ".", string className = Constants.BridgeLaunchClass)
+        {
+            using (LOGGER.LogFunction("ClrHandlerHelper::Run"))
+            {
+                if (driverSubmissionSettings.Submit)
+                {
+                    ClrHandlerHelper.CopyDllsToAppDirectory(appDlls);
+                    UpdateJarFileWithAssemblies(reefJar);
+                }
+
+                using (LOGGER.LogScope("ClrHandlerHelper::serialize driverBridgeConfig to clrRuntimeConfigFile"))
+                {
+                    string clrRuntimeConfigFile = Path.Combine(clrFolder, Constants.DriverBridgeConfiguration);
+                    new AvroConfigurationSerializer().ToFile(driverBridgeConfig, clrRuntimeConfigFile);
+                    LOGGER.Log(Level.Info, "CLR driver bridge configurations written to " + clrRuntimeConfigFile);
+                }
+
+                ProcessStartInfo startInfo = new ProcessStartInfo();
+                if (driverSubmissionSettings.RunOnYarn)
+                {
+                    startInfo.FileName = runCommand;
+                    startInfo.Arguments = className + " " + clrFolder +
+                                          driverSubmissionSettings.ToComamndLineArguments();
+                }
+                else
+                {
+                    startInfo.FileName = GetJavaBinary();
+                    string loggingPrefix = string.Empty;
+                    if (driverSubmissionSettings.JavaLogLevel == JavaLoggingSetting.VERBOSE_TO_CLR)
+                    {
+                        loggingPrefix = Constants.JavaToCLRLoggingConfig + " ";
+                    }
+                    else if (driverSubmissionSettings.JavaLogLevel == JavaLoggingSetting.VERBOSE)
+                    {
+                        loggingPrefix = Constants.JavaVerboseLoggingConfig + " ";
+                    }
+                    startInfo.Arguments = loggingPrefix + @"-classpath " + reefJar + " " + Constants.BridgeLaunchClass +
+                                          " " + clrFolder + " " + driverSubmissionSettings.ToComamndLineArguments();
+                }
+                startInfo.RedirectStandardOutput = true;
+                startInfo.UseShellExecute = false;
+                startInfo.CreateNoWindow = false;
+                LOGGER.Log(Level.Info, "Executing\r\n" + startInfo.FileName + "\r\n" + startInfo.Arguments);
+                using (Process process = Process.Start(startInfo))
+                {
+                    process.WaitForExit();
+                }
+            }
+        }
+
+        public static void UpdateJarFileWithAssemblies(string reefJar)
+        {
+            using (LOGGER.LogFunction("ClrHandlerHelper::UpdateJarFileWithAssemblies"))
+            {
+                string assembliesList = ClrHandlerHelper.GetAssembliesListForReefDriverApp();
+                if (!File.Exists(reefJar))
+                {
+                    throw new InvalidOperationException("cannot find reef jar file: " + reefJar);
+                }
+                ProcessStartInfo startInfo = new ProcessStartInfo()
+                    {
+                        FileName = GetJarBinary(),
+                        Arguments = @"uf " + reefJar + " " + assembliesList,
+                        RedirectStandardOutput = true,
+                        RedirectStandardError = true,
+                        UseShellExecute = false,
+                        CreateNoWindow = true
+                    };
+
+                LOGGER.Log(Level.Info, "updating jar file with \r\n" + startInfo.FileName + "\r\n" + startInfo.Arguments);
+                using (Process process = Process.Start(startInfo))
+                {
+                    StreamReader outReader = process.StandardOutput;
+                    StreamReader errorReader = process.StandardError;
+                    string output = outReader.ReadToEnd();
+                    string error = errorReader.ReadToEnd();
+                    process.WaitForExit();
+                    if (process.ExitCode != 0)
+                    {
+                        throw new InvalidOperationException("Failed to update jar file with stdout :" + output +
+                                                            "and stderr:" + error);
+                    }
+                }
+                LOGGER.Log(Level.Info, "jar file updated.");
+            }
+        }
+
+        public static void ExtractConfigfileFromJar(string reefJar, IList<string> configFiles, string dropFolder)
+        {
+                var configFileNames = string.Join(" ", configFiles.ToArray());
+                ProcessStartInfo startInfo = new ProcessStartInfo()
+                {
+                    FileName = GetJarBinary(),
+                    Arguments = @"xf " + reefJar + " " + configFileNames,
+                    RedirectStandardOutput = true,
+                    RedirectStandardError = true,
+                    UseShellExecute = false,
+                    CreateNoWindow = true
+                };
+
+                LOGGER.Log(Level.Info, "extracting files from jar file with \r\n" + startInfo.FileName + "\r\n" + startInfo.Arguments);
+                using (Process process = Process.Start(startInfo))
+                {
+                    StreamReader outReader = process.StandardOutput;
+                    StreamReader errorReader = process.StandardError;
+                    string output = outReader.ReadToEnd();
+                    string error = errorReader.ReadToEnd();
+                    process.WaitForExit();
+                    if (process.ExitCode != 0)
+                    {
+                        throw new InvalidOperationException("Failed to extract files from jar file with stdout :" + output +
+                                                            "and stderr:" + error);
+                    }
+                }
+                LOGGER.Log(Level.Info, "files are extracted.");
+        }
+        
+        private static string GetJarBinary()
+        {
+            string javaHome = Environment.GetEnvironmentVariable("JAVA_HOME");
+            if (string.IsNullOrWhiteSpace(javaHome))
+            {
+                LOGGER.Log(Level.Info, "JAVA_HOME not set. Please set JAVA_HOME environment variable first. Exiting...");
+                Environment.Exit(1);
+            }
+            return Path.Combine(javaHome, "bin", "jar.exe");
+        }
+
+        private static string GetJavaBinary()
+        {
+            string javaHome = Environment.GetEnvironmentVariable("JAVA_HOME");
+            if (string.IsNullOrWhiteSpace(javaHome))
+            {
+                LOGGER.Log(Level.Info, "JAVA_HOME not set. Please set JAVA_HOME environment variable first. Exiting...");
+                Environment.Exit(1);
+            }
+            return Path.Combine(javaHome, "bin", "java.exe");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrHandlerHelper.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrHandlerHelper.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrHandlerHelper.cs
new file mode 100644
index 0000000..8d9020c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrHandlerHelper.cs
@@ -0,0 +1,178 @@
+/**
+ * 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.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Exceptions;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Implementations;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Tang.Protobuf;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using Org.Apache.REEF.Tang.Implementations.Tang;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class ClrHandlerHelper
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClrHandlerHelper));
+
+        public static string[] ReefAssemblies
+        {
+            get
+            {
+                return new[] { "Microsoft.Hadoop.Avro.dll", "Org.Apache.REEF.Driver.dll", "Org.Apache.REEF.Common.dll", "Org.Apache.REEF.Utilities.dll", "Org.Apache.REEF.Network.dll", "Org.Apache.REEF.Tang.dll", "Org.Apache.REEF.Wake.dll", "Newtonsoft.Json.dll", "protobuf-net.dll" };
+            }
+        }
+
+        internal static int MemoryGranularity { get; set; }
+
+        public static ulong CreateHandler(object handler)
+        {
+            GCHandle gc = GCHandle.Alloc(handler);
+            IntPtr intPtr = GCHandle.ToIntPtr(gc);
+            ulong ul = (ulong)intPtr.ToInt64();
+            return ul;
+        }
+
+        public static void FreeHandle(ulong handle)
+        {
+            GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+            gc.Free();
+        }
+
+        public static void SetMemoryGranuality(int granularity)
+        {
+            if (granularity <= 0)
+            {
+                var e = new ArgumentException("granularity must be a positive value, provided: " + granularity);
+                Exceptions.Throw(e, LOGGER);
+            }
+            MemoryGranularity = granularity;
+        }
+
+        public static ulong CreateNullHandler()
+        {
+            return Constants.NullHandler;
+        }
+
+        public static ISet<string> GetCommandLineArguments()
+        {
+            using (LOGGER.LogFunction("ClrHandlerHelper::GetCommandLineArguments"))
+            {
+                string bridgeConfiguration = Path.Combine(Directory.GetCurrentDirectory(), "reef", "global",
+                                                          Constants.DriverBridgeConfiguration);
+
+                if (!File.Exists(bridgeConfiguration))
+                {
+                    string error = "Configuraiton file not found: " + bridgeConfiguration;
+                    LOGGER.Log(Level.Error, error);
+                    Exceptions.Throw(new InvalidOperationException(error), LOGGER);
+                }
+                CommandLineArguments arguments;
+                IInjector injector;
+                try
+                {
+                    IConfiguration driverBridgeConfiguration =
+                        new AvroConfigurationSerializer().FromFile(bridgeConfiguration);
+                    injector = TangFactory.GetTang().NewInjector(driverBridgeConfiguration);
+                    arguments = injector.GetInstance<CommandLineArguments>();
+                }
+                catch (InjectionException e)
+                {
+                    string error = "Cannot inject command line arguments from driver bridge configuration. ";
+                    Exceptions.Caught(e, Level.Error, error, LOGGER);
+                    // return empty string set
+                    return new HashSet<string>();
+                }
+                return arguments.Arguments;
+            }
+        }
+
+        public static void SupplyAdditionalClassPath(params string[] classPaths)
+        {
+            string path = Path.Combine(Directory.GetCurrentDirectory(), Constants.GlobalUserSuppliedJavaLibraries);
+            File.Delete(path);
+            File.WriteAllText(path, string.Join(",", classPaths));
+        }
+
+        public static void GenerateClassHierarchy(HashSet<string> clrDlls)
+        {
+            using (LOGGER.LogFunction("ClrHandlerHelper::GenerateClassHierarchy"))
+            {
+                IClassHierarchy ns = TangFactory.GetTang().GetClassHierarchy(clrDlls.ToArray());
+                ProtocolBufferClassHierarchy.Serialize(Constants.ClassHierarachyBin, ns);
+
+                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Class hierarchy written to [{0}].", Path.Combine(Directory.GetCurrentDirectory(), Constants.ClassHierarachyBin)));
+            }
+        }
+
+        public static string GetAssembliesListForReefDriverApp()
+        {
+            using (LOGGER.LogFunction("ClrHandlerHelper::GetAssembliesListForReefDriverApp"))
+            {
+                string executionDirectory = Directory.GetCurrentDirectory();
+                IList<string> assemblies =
+                    Directory.GetFiles(Path.Combine(executionDirectory, Constants.DriverAppDirectory), "*.dll")
+                             .Select(f => string.Format(CultureInfo.InvariantCulture, "\"{0}\"", Constants.DriverAppDirectory + @"\" + Path.GetFileName(f))).ToList();
+
+                foreach (string reefAssembly in ReefAssemblies)
+                {
+                    if (!File.Exists(reefAssembly))
+                    {
+                        var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Assembly [{0}] needed for REEF driver not found in {1}", reefAssembly, executionDirectory));
+                        Exceptions.Throw(e, LOGGER);
+                    }
+                    File.Copy(reefAssembly, Path.Combine(executionDirectory, Constants.DriverAppDirectory, reefAssembly), overwrite: true);
+                    assemblies.Add(string.Format(CultureInfo.InvariantCulture, "\"{0}\"", Constants.DriverAppDirectory + @"\" + reefAssembly));
+                }
+                return string.Join(" ", assemblies);
+            }
+        }
+
+        public static void CopyDllsToAppDirectory(HashSet<string> dlls)
+        {
+            using (LOGGER.LogFunction("ClrHandlerHelper::CopyDllsToAppDirectory"))
+            {
+                string executionDirectory = Directory.GetCurrentDirectory();
+                Directory.CreateDirectory(Path.Combine(executionDirectory, Constants.DriverAppDirectory));
+                foreach (string dll in dlls)
+                {
+                    string dllFile = dll;
+                    if (!dll.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
+                    {
+                        dllFile += ".dll";
+                    }
+                    if (!File.Exists(dllFile))
+                    {
+                        var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Assembly [{0}] for REEF application not found in {1}", dllFile, executionDirectory));
+                        Exceptions.Throw(e, LOGGER);
+                    }
+                    File.Copy(dllFile, Path.Combine(executionDirectory, Constants.DriverAppDirectory, dllFile), overwrite: true);
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandler.cs
new file mode 100644
index 0000000..15b957d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandler.cs
@@ -0,0 +1,53 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class ClrSystemHandler<T> : IObserver<T>, IObservable<T>
+    {
+        List<IObserver<T>> userHandlers = new List<IObserver<T>>();
+
+        public void OnNext(T value)
+        {
+            foreach (var observer in userHandlers)
+            {
+                observer.OnNext(value);
+            }
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        public IDisposable Subscribe(IObserver<T> observer)
+        {
+            userHandlers.Add(observer);
+            return null;
+        }
+    }
+}


[06/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorAllocationHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorAllocationHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorAllocationHandler.cs
new file mode 100644
index 0000000..9216b64
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorAllocationHandler.cs
@@ -0,0 +1,57 @@
+/**
+ * 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.Common.Evaluator;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default handler for AllocatedEvaluator: close it.
+    /// </summary>
+    public class DefaultEvaluatorAllocationHandler : IObserver<IAllocatedEvaluator>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultEvaluatorAllocationHandler));
+        
+        [Inject]
+        public DefaultEvaluatorAllocationHandler()
+        {
+        }
+
+        public void OnNext(IAllocatedEvaluator value)
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received AllocatedEvaluator : {0}, closing", value.Id));
+            value.Dispose();
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorCompletionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorCompletionHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorCompletionHandler.cs
new file mode 100644
index 0000000..fcea53d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorCompletionHandler.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Driver.Evaluator;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default event handler for CompletedEvaluator: Logging it.
+    /// </summary>
+    public class DefaultEvaluatorCompletionHandler : IObserver<ICompletedEvaluator>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultEvaluatorCompletionHandler));
+        
+        [Inject]
+        public DefaultEvaluatorCompletionHandler()
+        {
+        }
+
+        public void OnNext(ICompletedEvaluator value)
+        {
+            LOGGER.Log(Level.Info, "Received CompletedEvaluator: " + value.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorFailureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorFailureHandler.cs
new file mode 100644
index 0000000..82cfd26
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorFailureHandler.cs
@@ -0,0 +1,55 @@
+/**
+ * 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.Driver.Evaluator;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    ///  Default event handler used for FailedEvaluator: It crashes the driver.
+    /// </summary>
+    public class DefaultEvaluatorFailureHandler : IObserver<IFailedEvaluator>
+    {        
+        [Inject]
+        public DefaultEvaluatorFailureHandler()
+        {
+        }
+
+        public void OnNext(IFailedEvaluator value)
+        {
+            var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Evaluator {0} failed, and no handler is bound for FailedEvaluator.", value.Id));
+            Exceptions.Throw(e, Logger.GetLogger(typeof(DefaultEvaluatorFailureHandler)));
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorRequestorHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorRequestorHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorRequestorHandler.cs
new file mode 100644
index 0000000..465baa7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultEvaluatorRequestorHandler.cs
@@ -0,0 +1,61 @@
+/**
+ * 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.Driver.Bridge;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default handler for close messages from the client: logging it
+    /// </summary>
+    public class DefaultEvaluatorRequestorHandler : IObserver<IEvaluatorRequestor>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientCloseHandler));
+
+        [Inject]
+        public DefaultEvaluatorRequestorHandler()
+        {
+        }
+
+        public void OnNext(IEvaluatorRequestor value)
+        {
+            LOGGER.Log(Level.Info, "Default evaluator requstor: requesting 1 evaluator with 512 MB");
+            int evaluatorsNumber = 1;
+            int memory = 512;
+            string rack = "WonderlandRack";
+            EvaluatorRequest request = new EvaluatorRequest(evaluatorsNumber, memory, rack);
+
+            value.Submit(request);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultHttpHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultHttpHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultHttpHandler.cs
new file mode 100644
index 0000000..831eebe
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultHttpHandler.cs
@@ -0,0 +1,49 @@
+/**
+ * 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.Net;
+using Org.Apache.REEF.Driver.Bridge;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    public class DefaultHttpHandler : IHttpHandler
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultHttpHandler));
+
+        [Inject]
+        public DefaultHttpHandler()
+        {
+        }
+
+        public string GetSpecification()
+        {
+            return "Ping";
+        }
+
+        public void OnHttpRequest(ReefHttpRequest requet, ReefHttpResponse response) 
+        {
+            LOGGER.Log(Level.Info, "OnHttpRequest in DefaultHttpHandler is called.");
+            response.Status = HttpStatusCode.OK;
+            response.OutputStream = ByteUtilities.StringToByteArrays("Byte array returned from DefaultHttpHandler in CLR!!!");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskCompletionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskCompletionHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskCompletionHandler.cs
new file mode 100644
index 0000000..53eb832
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskCompletionHandler.cs
@@ -0,0 +1,60 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// efault event handler for CompletedTask: Log it and close the context.
+    /// </summary>
+    public class DefaultTaskCompletionHandler : IObserver<ICompletedTask>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskCompletionHandler));
+        
+        [Inject]
+        public DefaultTaskCompletionHandler()
+        {
+        }
+
+        public void OnNext(ICompletedTask value)
+        {
+            IActiveContext activeContext = value.ActiveContext;
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received CompletedTask: {0} :: CLOSING context: {1}", value.Id, activeContext.Id));
+            activeContext.Dispose();
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskFailureHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskFailureHandler.cs
new file mode 100644
index 0000000..7235a1b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskFailureHandler.cs
@@ -0,0 +1,53 @@
+/**
+ * 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.Common.Tasks;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Globalization;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default event handler used for FailedTask: It crashes the driver.
+    /// </summary>
+    public class DefaultTaskFailureHandler : IObserver<IFailedTask>
+    {
+        [Inject]
+        public DefaultTaskFailureHandler()
+        {
+        }
+
+        public void OnNext(IFailedTask value)
+        {
+            throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task {0} has failed, and no handler was bound for IFailedTask", value.Id) );
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskMessageHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskMessageHandler.cs
new file mode 100644
index 0000000..b67dad9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskMessageHandler.cs
@@ -0,0 +1,55 @@
+/**
+ * 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.Common.Tasks;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default event handler for TaskMessage: Logging it.
+    /// </summary>
+    public class DefaultTaskMessageHandler : IObserver<ITaskMessage>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskMessageHandler));
+        
+        [Inject]
+        public DefaultTaskMessageHandler()
+        {
+        }
+
+        public void OnNext(ITaskMessage value)
+        {
+            LOGGER.Log(Level.Info, "Default TaskMessage handler received message: " + value.Message);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskRunningHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskRunningHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskRunningHandler.cs
new file mode 100644
index 0000000..e356b0e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskRunningHandler.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    ///  Default event handler for TaskRuntime: Logging it.
+    /// </summary>
+    public class DefaultTaskRunningHandler : IObserver<IRunningTask>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskRunningHandler));
+        
+        [Inject]
+        public DefaultTaskRunningHandler()
+        {
+        }
+
+        public void OnNext(IRunningTask runningTask)
+        {
+            LOGGER.Log(Level.Info, "Received TaskRuntime: " + runningTask.Id);
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskSuspensionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskSuspensionHandler.cs b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskSuspensionHandler.cs
new file mode 100644
index 0000000..9be7147
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Defaults/DefaultTaskSuspensionHandler.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Common;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using Org.Apache.REEF.Driver.Task;
+
+namespace Org.Apache.REEF.Driver.Defaults
+{
+    /// <summary>
+    /// Default event handler used for SuspendedTask: It crashes the driver.
+    /// </summary>
+    public class DefaultTaskSuspensionHandler : IObserver<ISuspendedTask>
+    {
+        [Inject]
+        public DefaultTaskSuspensionHandler()
+        {
+        }
+
+        public void OnNext(ISuspendedTask value)
+        {
+            Exceptions.Throw(new InvalidOperationException("No handler bound for SuspendedTask: " + value.Id), Logger.GetLogger(typeof(DefaultTaskSuspensionHandler)));
+        }
+
+        public void OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/DriverConfigGenerator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/DriverConfigGenerator.cs b/lang/cs/Org.Apache.REEF.Driver/DriverConfigGenerator.cs
index 08cccc0..407ce1a 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverConfigGenerator.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverConfigGenerator.cs
@@ -20,9 +20,10 @@
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
-using Org.Apache.REEF.Driver.bridge;
+using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Utilities.Logging;
 using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
 using Org.Apache.REEF.Tang.Implementations.Configuration;
 using Org.Apache.REEF.Tang.Interface;
 using Org.Apache.REEF.Tang.Protobuf;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 5c3c19c..a54cf0c 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverManager.cs
@@ -22,10 +22,6 @@ using Org.Apache.REEF.Common.Api;
 using Org.Apache.REEF.Common.Catalog;
 using Org.Apache.REEF.Common.Evaluator;
 using Org.Apache.REEF.Common.Exceptions;
-using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefProtocol;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Evaluator;
 using Org.Apache.REEF.Utilities;
@@ -39,6 +35,7 @@ using Org.Apache.REEF.Wake.Time.Runtime.Event;
 using System;
 using System.Collections.Generic;
 using System.Globalization;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
 using Org.Apache.REEF.Tang.Implementations.InjectionPlan;
 
 namespace Org.Apache.REEF.Driver

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 d329ee6..9bb92ed 100644
--- a/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/DriverRuntimeConfiguration.cs
@@ -20,7 +20,6 @@
 using Org.Apache.REEF.Common;
 using Org.Apache.REEF.Common.Api;
 using Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Common.Client;
 using Org.Apache.REEF.Common.Evaluator;
 using Org.Apache.REEF.Driver.Evaluator;
 using Org.Apache.REEF.Tang.Formats;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..0833431
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorDescriptorImpl.cs
@@ -0,0 +1,218 @@
+/**
+ * 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.Common.Catalog;
+using Org.Apache.REEF.Common.Evaluator;
+using Org.Apache.REEF.Driver.Bridge;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    public class EvaluatorDescriptorImpl : IEvaluatorDescriptor
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorDescriptorImpl));
+        
+        private INodeDescriptor _nodeDescriptor;
+
+        private EvaluatorType _type;
+
+        private int _megaBytes;
+
+        private int _virtualCore;
+
+        private string _rack = "default_rack";
+
+        public EvaluatorDescriptorImpl(string serializedString)
+        {
+            FromString(serializedString);
+        }
+
+        public EvaluatorDescriptorImpl(INodeDescriptor nodeDescriptor, EvaluatorType type, int megaBytes, int core)
+        {
+            _nodeDescriptor = nodeDescriptor;
+            _type = type;
+            _megaBytes = megaBytes;
+            _virtualCore = core;
+        }
+
+        public INodeDescriptor NodeDescriptor 
+        {
+            get
+            {
+                return _nodeDescriptor;
+            }
+
+            set
+            {
+            }
+        }
+
+        public EvaluatorType EvaluatorType
+        {
+            get
+            {
+                return _type;
+            }
+
+            set
+            {
+            }
+        }
+
+        public int Memory
+        {
+            get
+            {
+                return _megaBytes;
+            }
+
+            set
+            {
+            }
+        }
+
+        public int VirtualCore
+        {
+            get
+            {
+                return _virtualCore;
+            }
+
+            set
+            {
+            }
+        }
+
+        public string Rack
+        {
+            get
+            {
+                return _rack;
+            }
+
+            set
+            {
+            }
+        }
+
+        public void FromString(string str)
+        {
+            Dictionary<string, string> settings = new Dictionary<string, string>();
+            string[] components = str.Split(',');
+            foreach (string component in components)
+            {
+                string[] pair = component.Trim().Split('=');
+                if (pair == null || pair.Length != 2)
+                {
+                    var e = new ArgumentException("invalid component to be used as key-value pair:", component);
+                    Exceptions.Throw(e, LOGGER);
+                }
+                settings.Add(pair[0], pair[1]);
+            }
+            string ipAddress;
+            if (!settings.TryGetValue("IP", out ipAddress))
+            {
+                Exceptions.Throw(new ArgumentException("cannot find IP entry"), LOGGER); 
+            }
+            ipAddress = ipAddress.Split('/').Last();
+            string port;
+            if (!settings.TryGetValue("Port", out port))
+            {
+                Exceptions.Throw(new ArgumentException("cannot find Port entry"), LOGGER); 
+            }
+            int portNumber = 0;
+            int.TryParse(port, out portNumber);
+            string hostName;
+            if (!settings.TryGetValue("HostName", out hostName))
+            {
+                Exceptions.Throw(new ArgumentException("cannot find HostName entry"), LOGGER); 
+            }
+            string memory;
+            if (!settings.TryGetValue("Memory", out memory))
+            {
+                Exceptions.Throw(new ArgumentException("cannot find Memory entry"), LOGGER);
+            }
+            int memoryInMegaBytes = 0;
+            int.TryParse(memory, out memoryInMegaBytes);
+
+            string core;
+            if (!settings.TryGetValue("Core", out core))
+            {
+                Exceptions.Throw(new ArgumentException("cannot find Core entry"), LOGGER);
+            }
+            int vCore = 0;
+            int.TryParse(core, out vCore);
+
+            IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(ipAddress), portNumber);
+
+            _nodeDescriptor = new NodeDescriptorImpl();
+            _nodeDescriptor.InetSocketAddress = ipEndPoint;
+            _nodeDescriptor.HostName = hostName;        
+            _type = EvaluatorType.CLR;
+            _megaBytes = memoryInMegaBytes;
+            _virtualCore = vCore;
+        }
+
+        public void SetType(EvaluatorType type)
+        {
+            lock (this)
+            {
+                if (_type != EvaluatorType.UNDECIDED)
+                {
+                    var e = new InvalidOperationException("Cannot change a set evaluator type: " + _type);
+                    Exceptions.Throw(e, LOGGER);
+                }
+                _type = type;
+            }
+        }
+
+        public override bool Equals(object obj)
+        {
+            EvaluatorDescriptorImpl other = obj as EvaluatorDescriptorImpl;
+            if (other == null)
+            {
+                return false;
+            }
+
+            return EquivalentMemory(other);
+            // we don't care about rack now;
+            // && string.Equals(_rack, other.Rack, StringComparison.OrdinalIgnoreCase);
+        }
+
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
+        private bool EquivalentMemory(EvaluatorDescriptorImpl other)
+        {
+            int granularity = ClrHandlerHelper.MemoryGranularity == 0
+                                  ? Constants.DefaultMemoryGranularity
+                                  : ClrHandlerHelper.MemoryGranularity;
+            int m1 = (Memory - 1) / granularity;
+            int m2 = (other.Memory - 1 ) / granularity;
+            return (m1 == m2);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequest.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequest.cs
new file mode 100644
index 0000000..3132bc7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequest.cs
@@ -0,0 +1,107 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Common.Catalog;
+using Org.Apache.REEF.Common.Catalog.Capabilities;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    [DataContract]
+    public class EvaluatorRequest : IEvaluatorRequest
+    {
+        public EvaluatorRequest() 
+            : this(0, 0, 1, string.Empty, Guid.NewGuid().ToString("N"))
+        {
+        }
+
+        public EvaluatorRequest(int number, int megaBytes) 
+            : this(number, megaBytes, 1, string.Empty, Guid.NewGuid().ToString("N"))
+        {
+        }
+
+        public EvaluatorRequest(int number, int megaBytes, int core)
+            : this(number, megaBytes, core, string.Empty, Guid.NewGuid().ToString("N"))
+        {
+        }
+
+        public EvaluatorRequest(int number, int megaBytes, string rack)
+            : this(number, megaBytes, 1, rack, Guid.NewGuid().ToString("N"))
+        {
+        }
+
+        public EvaluatorRequest(int number, int megaBytes, int core, string rack)
+            : this(number, megaBytes, core, rack, Guid.NewGuid().ToString("N"))
+        {
+        }
+
+        public EvaluatorRequest(int number, int megaBytes, int core, string rack, string evaluatorBatchId)
+        {
+            Number = number;
+            MemoryMegaBytes = megaBytes;
+            VirtualCore = core;
+            Rack = rack;
+            EvaluatorBatchId = evaluatorBatchId;
+        }
+
+        public EvaluatorRequest(int number, int megaBytes, int core, List<ICapability> capabilitieses, IResourceCatalog catalog)
+        {
+            Number = number;
+            MemoryMegaBytes = megaBytes;
+            Capabilities = capabilitieses;
+            VirtualCore = core;
+            Catalog = catalog;
+            EvaluatorBatchId = Guid.NewGuid().ToString("N");
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        [DataMember]
+        public int MemoryMegaBytes { get; set; }
+
+        [DataMember]
+        public int Number { get; set; }
+        
+        [DataMember]
+        public int VirtualCore { get; set; }
+
+        [DataMember]
+        public string Rack { get; set; }
+
+        [DataMember]
+        public string EvaluatorBatchId { get; set; }
+
+        public List<ICapability> Capabilities { get; set; }
+
+        public IResourceCatalog Catalog { get; set; }
+
+        public static EvaluatorRequestBuilder NewBuilder()
+        {
+            return new EvaluatorRequestBuilder();
+        }
+
+        public static EvaluatorRequestBuilder NewBuilder(EvaluatorRequest request)
+        {
+            return new EvaluatorRequestBuilder(request);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequestBuilder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequestBuilder.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequestBuilder.cs
new file mode 100644
index 0000000..e51e799
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/EvaluatorRequestBuilder.cs
@@ -0,0 +1,60 @@
+/**
+ * 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.Common.Catalog.Capabilities;
+using Org.Apache.REEF.Common.Catalog;
+using Org.Apache.REEF.Driver.Bridge;
+using System.Collections.Generic;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    public class EvaluatorRequestBuilder
+    {
+        public EvaluatorRequestBuilder(EvaluatorRequest request)
+        {
+            foreach (ICapability capability in request.Capabilities)
+            {
+                Capabilities.Add(capability);
+            }
+            Number = request.Number;
+            Catalog = request.Catalog;
+            MegaBytes = request.MemoryMegaBytes;
+            VirtualCore = request.VirtualCore;
+        }
+
+        internal EvaluatorRequestBuilder()
+        {
+        }
+
+        public int Number { get; set; }
+
+        public List<ICapability> Capabilities { get; set; }
+
+        public IResourceCatalog Catalog { get; set; }
+
+        public int MegaBytes { get; set; }
+
+        public int VirtualCore { get; set; }
+
+        public EvaluatorRequest Build()
+        {
+            return new EvaluatorRequest(Number, MegaBytes, VirtualCore, Capabilities, Catalog);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/IAllocatedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/IAllocatedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IAllocatedEvaluator.cs
new file mode 100644
index 0000000..794987f
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IAllocatedEvaluator.cs
@@ -0,0 +1,55 @@
+/**
+ * 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.Common;
+using Org.Apache.REEF.Common.Evaluator;
+using Org.Apache.REEF.Utilities;
+using System;
+using System.Net;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    /// <summary>
+    /// Represents an Evaluator that is allocated, but is not running yet.
+    /// </summary>
+    public interface IAllocatedEvaluator : IDisposable, IIdentifiable, IContextSubmittable, IContextAndTaskSubmittable
+    {
+        EvaluatorType Type { get; set; }
+
+        string NameServerInfo { get; set; }
+
+        string EvaluatorBatchId { get; set; }
+
+        IEvaluatorDescriptor GetEvaluatorDescriptor();
+
+        /// <summary>
+        /// Puts the given file into the working directory of the Evaluator.
+        /// </summary>
+        /// <param name="file">the file to be copied</param>
+        void AddFile(string file);
+
+        /// <summary>
+        /// Puts the given file into the working directory of the Evaluator and adds it to its classpath.
+        /// </summary>
+        /// <param name="file">the file to be copied</param>
+        void AddLibrary(string file);
+
+        void AddFileResource(string file);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/ICompletedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/ICompletedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/ICompletedEvaluator.cs
new file mode 100644
index 0000000..a4b3a69
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/ICompletedEvaluator.cs
@@ -0,0 +1,30 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    /// <summary>
+    /// Represents an Evaluator that has completed
+    /// </summary>
+    public interface ICompletedEvaluator : IIdentifiable
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorDescriptor.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorDescriptor.cs
new file mode 100644
index 0000000..9fadbd9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorDescriptor.cs
@@ -0,0 +1,57 @@
+/**
+ * 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.Common.Catalog;
+using Org.Apache.REEF.Common.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    /// <summary>
+    ///  Metadata about an Evaluator.
+    /// </summary>
+    public interface IEvaluatorDescriptor
+    {
+        /// <summary>
+        ///  NodeDescriptor of the node where this Evaluator is running.
+        /// </summary>
+        INodeDescriptor NodeDescriptor { get; set; }
+
+        /// <summary>
+        /// type of Evaluator.
+        /// </summary>
+        EvaluatorType EvaluatorType { get; set; }
+
+        /// <summary>
+        /// the amount of memory allocated to this Evaluator.
+        /// </summary>
+        int Memory { get; set; }
+
+        /// <summary>
+        /// the virtual core allocated to this Evaluator.
+        /// </summary>
+        int VirtualCore { get; set; }
+
+        /// <summary>
+        /// rack on which the evaluator was allocated
+        /// </summary>
+        string Rack { get; set; }
+
+        void FromString(string str);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequest .cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequest .cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequest .cs
new file mode 100644
index 0000000..635c1f4
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequest .cs	
@@ -0,0 +1,42 @@
+/**
+ * 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.Common.Catalog.Capabilities;
+using Org.Apache.REEF.Common.Catalog;
+using System.Collections.Generic;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    public interface IEvaluatorRequest
+    {
+        int MemoryMegaBytes { get; set; }
+
+        int Number { get;  set; }
+
+        int VirtualCore { get; set; }
+
+        string Rack { get; set; }
+
+        string EvaluatorBatchId { get; set; }
+
+        List<ICapability> Capabilities { get; set; }
+
+        IResourceCatalog Catalog { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequestor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequestor.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequestor.cs
new file mode 100644
index 0000000..ac374ce
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IEvaluatorRequestor.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.Collections.Generic;
+
+using Org.Apache.REEF.Common.Catalog;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    /// <summary>
+    /// Interface through which Evaluators can be requested.
+    /// </summary>
+    public interface IEvaluatorRequestor
+    {
+        /// <summary>
+        /// Access to the {@link ResourceCatalog} for the cluster this Factory has access to
+        /// </summary>
+        IResourceCatalog ResourceCatalog { get; set; }
+
+        /// <summary>
+        /// Map between user evaluator id and evaluator information
+        /// </summary>
+        //IDictionary<string, IEvaluatorDescriptor> Evaluators { get; }
+
+        /// <summary>
+        /// Submit the request for new evaluator. The response will surface in the AllocatedEvaluator message handler.
+        /// </summary>
+        /// <param name="request"></param>
+        void Submit(IEvaluatorRequest request);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Evaluator/IFailedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Evaluator/IFailedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IFailedEvaluator.cs
new file mode 100644
index 0000000..d514e97
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Evaluator/IFailedEvaluator.cs
@@ -0,0 +1,42 @@
+/**
+ * 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.Common.Exceptions;
+using Org.Apache.REEF.Driver.Bridge;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities;
+using System.Collections.Generic;
+using Org.Apache.REEF.Driver.Bridge.Events;
+
+namespace Org.Apache.REEF.Driver.Evaluator
+{
+    /// <summary>
+    /// Represents an Evaluator that became unavailable.
+    /// </summary>
+    public interface IFailedEvaluator : IIdentifiable
+    {
+        EvaluatorException EvaluatorException { get; set; }
+
+        List<FailedContext> FailedContexts { get; set; }
+
+        Optional<IFailedTask> FailedTask { get; set; }
+
+        IEvaluatorRequestor GetEvaluatorRequetor();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 b8ebef9..ed5c5ac 100644
--- a/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/EvaluatorManager.cs
@@ -21,9 +21,6 @@ using Org.Apache.REEF.Common.Api;
 using Org.Apache.REEF.Common.Catalog;
 using Org.Apache.REEF.Common.Evaluator;
 using Org.Apache.REEF.Common.Exceptions;
-using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Context;
 using Org.Apache.REEF.Driver.Evaluator;
@@ -39,8 +36,9 @@ using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
 using System.Text;
-
-using TaskMessage = Org.Apache.REEF.Tasks.TaskMessage;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Driver.Bridge.Events;
+using TaskMessage = Org.Apache.REEF.Common.Tasks.TaskMessage;
 
 namespace Org.Apache.REEF.Driver
 {

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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 8512128..0adf8e0 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
@@ -27,7 +27,7 @@ under the License.
     <AssemblyName>Org.Apache.REEF.Driver</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..</SolutionDir>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
     <RestorePackages>true</RestorePackages>
   </PropertyGroup>
   <Import Project="$(SolutionDir)\build.props" />
@@ -89,83 +89,83 @@ under the License.
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="bridge\BridgeLogger.cs" />
-    <Compile Include="bridge\clr2java\IActiveContextClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IAllocatedEvaluaotrClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IClosedContextClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IClr2Java.cs" />
-    <Compile Include="bridge\clr2java\ICompletedEvaluatorClr2Java.cs" />
-    <Compile Include="bridge\clr2java\ICompletedTaskClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IContextMessageClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IEvaluatorRequestorClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IFailedContextClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IFailedEvaluatorClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IFailedTaskClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IHttpServerBridgeClr2Java.cs" />
-    <Compile Include="bridge\clr2java\IRunningTaskClr2Java.cs" />
-    <Compile Include="bridge\clr2java\ISuspendedTaskClr2Java.cs" />
-    <Compile Include="bridge\clr2java\ITaskMessageClr2Java.cs" />
-    <Compile Include="bridge\ClrClientHelper.cs" />
-    <Compile Include="bridge\ClrHandlerHelper.cs" />
-    <Compile Include="bridge\ClrSystemHandler.cs" />
-    <Compile Include="bridge\ClrSystemHandlerWrapper.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" />
-    <Compile Include="bridge\events\ClosedContext.cs" />
-    <Compile Include="bridge\events\CompletedEvaluator.cs" />
-    <Compile Include="bridge\events\CompletedTask.cs" />
-    <Compile Include="bridge\events\ContextMessage.cs" />
-    <Compile Include="bridge\events\EvaluatorRequstor.cs" />
-    <Compile Include="bridge\events\FailedContext.cs" />
-    <Compile Include="bridge\events\FailedEvaluator.cs" />
-    <Compile Include="bridge\events\FailedTask.cs" />
-    <Compile Include="bridge\events\RunningTask.cs" />
-    <Compile Include="bridge\events\SuspendedTask.cs" />
-    <Compile Include="bridge\events\TaskMessage.cs" />
-    <Compile Include="bridge\HttpMessage.cs" />
-    <Compile Include="bridge\HttpServerHandler.cs" />
-    <Compile Include="bridge\HttpServerPort.cs" />
-    <Compile Include="bridge\IHttpHandler.cs" />
-    <Compile Include="bridge\IHttpMessage.cs" />
-    <Compile Include="bridge\ReefHttpRequest.cs" />
-    <Compile Include="bridge\ReefHttpResponse.cs" />
+    <Compile Include="Bridge\BridgeLogger.cs" />
+    <Compile Include="Bridge\Clr2java\IActiveContextClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IAllocatedEvaluaotrClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IClosedContextClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\ICompletedEvaluatorClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\ICompletedTaskClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IContextMessageClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IEvaluatorRequestorClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IFailedContextClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IFailedEvaluatorClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IFailedTaskClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IHttpServerBridgeClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\IRunningTaskClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\ISuspendedTaskClr2Java.cs" />
+    <Compile Include="Bridge\Clr2java\ITaskMessageClr2Java.cs" />
+    <Compile Include="Bridge\ClrClientHelper.cs" />
+    <Compile Include="Bridge\ClrHandlerHelper.cs" />
+    <Compile Include="Bridge\ClrSystemHandler.cs" />
+    <Compile Include="Bridge\ClrSystemHandlerWrapper.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" />
+    <Compile Include="Bridge\Events\ClosedContext.cs" />
+    <Compile Include="Bridge\Events\CompletedEvaluator.cs" />
+    <Compile Include="Bridge\Events\CompletedTask.cs" />
+    <Compile Include="Bridge\Events\ContextMessage.cs" />
+    <Compile Include="Bridge\Events\EvaluatorRequstor.cs" />
+    <Compile Include="Bridge\Events\FailedContext.cs" />
+    <Compile Include="Bridge\Events\FailedEvaluator.cs" />
+    <Compile Include="Bridge\Events\FailedTask.cs" />
+    <Compile Include="Bridge\Events\RunningTask.cs" />
+    <Compile Include="Bridge\Events\SuspendedTask.cs" />
+    <Compile Include="Bridge\Events\TaskMessage.cs" />
+    <Compile Include="Bridge\HttpMessage.cs" />
+    <Compile Include="Bridge\HttpServerHandler.cs" />
+    <Compile Include="Bridge\HttpServerPort.cs" />
+    <Compile Include="Bridge\IHttpHandler.cs" />
+    <Compile Include="Bridge\IHttpMessage.cs" />
+    <Compile Include="Bridge\ReefHttpRequest.cs" />
+    <Compile Include="Bridge\ReefHttpResponse.cs" />
     <Compile Include="ClientManager.cs" />
     <Compile Include="Constants.cs" />
-    <Compile Include="context\ContextConfiguration.cs" />
-    <Compile Include="context\ContextConfigurationOptions.cs" />
-    <Compile Include="context\defaults\DefaultContextMessageSource.cs" />
-    <Compile Include="context\defaults\DefaultContextStartHandler.cs" />
-    <Compile Include="context\defaults\DefaultContextStopHandler.cs" />
-    <Compile Include="context\EvaluatorContext.cs" />
-    <Compile Include="context\IActiveContext.cs" />
-    <Compile Include="context\IClosedContext.cs" />
-    <Compile Include="context\IContext.cs" />
-    <Compile Include="context\IFailedContext.cs" />
-    <Compile Include="contract\IBridgeContract.cs" />
-    <Compile Include="defaults\DefaultClientCloseHandler.cs" />
-    <Compile Include="defaults\DefaultClientCloseWithMessageHandler.cs" />
-    <Compile Include="defaults\DefaultClientMessageHandler.cs" />
-    <Compile Include="defaults\DefaultContextActiveHandler.cs" />
-    <Compile Include="defaults\DefaultContextClosureHandler.cs" />
-    <Compile Include="defaults\DefaultContextFailureHandler.cs" />
-    <Compile Include="defaults\DefaultContextMessageHandler.cs" />
-    <Compile Include="defaults\DefaultCustomTraceListener.cs" />
-    <Compile Include="defaults\DefaultDriverRestartContextActiveHandler.cs" />
-    <Compile Include="defaults\DefaultDriverRestartHandler.cs" />
-    <Compile Include="defaults\DefaultDriverRestartTaskRunningHandler.cs" />
-    <Compile Include="defaults\DefaultEvaluatorAllocationHandler.cs" />
-    <Compile Include="defaults\DefaultEvaluatorCompletionHandler.cs" />
-    <Compile Include="defaults\DefaultEvaluatorFailureHandler.cs" />
-    <Compile Include="defaults\DefaultEvaluatorRequestorHandler.cs" />
-    <Compile Include="defaults\DefaultHttpHandler.cs" />
-    <Compile Include="defaults\DefaultTaskCompletionHandler.cs" />
-    <Compile Include="defaults\DefaultTaskFailureHandler.cs" />
-    <Compile Include="defaults\DefaultTaskMessageHandler.cs" />
-    <Compile Include="defaults\DefaultTaskRunningHandler.cs" />
-    <Compile Include="defaults\DefaultTaskSuspensionHandler.cs" />
+    <Compile Include="Context\ContextConfiguration.cs" />
+    <Compile Include="Context\ContextConfigurationOptions.cs" />
+    <Compile Include="Context\Defaults\DefaultContextMessageSource.cs" />
+    <Compile Include="Context\Defaults\DefaultContextStartHandler.cs" />
+    <Compile Include="Context\Defaults\DefaultContextStopHandler.cs" />
+    <Compile Include="Context\EvaluatorContext.cs" />
+    <Compile Include="Context\IActiveContext.cs" />
+    <Compile Include="Context\IClosedContext.cs" />
+    <Compile Include="Context\IContext.cs" />
+    <Compile Include="Context\IFailedContext.cs" />
+    <Compile Include="Contract\IBridgeContract.cs" />
+    <Compile Include="Defaults\DefaultClientCloseHandler.cs" />
+    <Compile Include="Defaults\DefaultClientCloseWithMessageHandler.cs" />
+    <Compile Include="Defaults\DefaultClientMessageHandler.cs" />
+    <Compile Include="Defaults\DefaultContextActiveHandler.cs" />
+    <Compile Include="Defaults\DefaultContextClosureHandler.cs" />
+    <Compile Include="Defaults\DefaultContextFailureHandler.cs" />
+    <Compile Include="Defaults\DefaultContextMessageHandler.cs" />
+    <Compile Include="Defaults\DefaultCustomTraceListener.cs" />
+    <Compile Include="Defaults\DefaultDriverRestartContextActiveHandler.cs" />
+    <Compile Include="Defaults\DefaultDriverRestartHandler.cs" />
+    <Compile Include="Defaults\DefaultDriverRestartTaskRunningHandler.cs" />
+    <Compile Include="Defaults\DefaultEvaluatorAllocationHandler.cs" />
+    <Compile Include="Defaults\DefaultEvaluatorCompletionHandler.cs" />
+    <Compile Include="Defaults\DefaultEvaluatorFailureHandler.cs" />
+    <Compile Include="Defaults\DefaultEvaluatorRequestorHandler.cs" />
+    <Compile Include="Defaults\DefaultHttpHandler.cs" />
+    <Compile Include="Defaults\DefaultTaskCompletionHandler.cs" />
+    <Compile Include="Defaults\DefaultTaskFailureHandler.cs" />
+    <Compile Include="Defaults\DefaultTaskMessageHandler.cs" />
+    <Compile Include="Defaults\DefaultTaskRunningHandler.cs" />
+    <Compile Include="Defaults\DefaultTaskSuspensionHandler.cs" />
     <Compile Include="DriverConfigGenerator.cs" />
     <Compile Include="DriverConfigurationSettings.cs" />
     <Compile Include="DriverManager.cs" />
@@ -173,25 +173,25 @@ under the License.
     <Compile Include="DriverRuntimeConfigurationOptions.cs" />
     <Compile Include="DriverSubmissionSettings.cs" />
     <Compile Include="EvaluatorManager.cs" />
-    <Compile Include="evaluator\EvaluatorDescriptorImpl.cs" />
-    <Compile Include="evaluator\EvaluatorRequest.cs" />
-    <Compile Include="evaluator\EvaluatorRequestBuilder.cs" />
-    <Compile Include="evaluator\IAllocatedEvaluator.cs" />
-    <Compile Include="evaluator\ICompletedEvaluator.cs" />
-    <Compile Include="evaluator\IEvaluatorDescriptor.cs" />
-    <Compile Include="evaluator\IEvaluatorRequest .cs" />
-    <Compile Include="evaluator\IEvaluatorRequestor.cs" />
-    <Compile Include="evaluator\IFailedEvaluator.cs" />
+    <Compile Include="Evaluator\EvaluatorDescriptorImpl.cs" />
+    <Compile Include="Evaluator\EvaluatorRequest.cs" />
+    <Compile Include="Evaluator\EvaluatorRequestBuilder.cs" />
+    <Compile Include="Evaluator\IAllocatedEvaluator.cs" />
+    <Compile Include="Evaluator\ICompletedEvaluator.cs" />
+    <Compile Include="Evaluator\IEvaluatorDescriptor.cs" />
+    <Compile Include="Evaluator\IEvaluatorRequest .cs" />
+    <Compile Include="Evaluator\IEvaluatorRequestor.cs" />
+    <Compile Include="Evaluator\IFailedEvaluator.cs" />
     <Compile Include="FailedJob.cs" />
     <Compile Include="IDriver.cs" />
     <Compile Include="IStartHandler.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="task\ICompletedTask.cs" />
-    <Compile Include="task\IFailedTask.cs" />
-    <Compile Include="task\IRunningTask.cs" />
-    <Compile Include="task\ISuspendedTask.cs" />
-    <Compile Include="task\ITaskMessage.cs" />
-    <Compile Include="task\RunningTaskImpl.cs" />
+    <Compile Include="Task\ICompletedTask.cs" />
+    <Compile Include="Task\IFailedTask.cs" />
+    <Compile Include="Task\IRunningTask.cs" />
+    <Compile Include="Task\ISuspendedTask.cs" />
+    <Compile Include="Task\ITaskMessage.cs" />
+    <Compile Include="Task\RunningTaskImpl.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="packages.config" />
@@ -209,7 +209,7 @@ under the License.
       <Project>{79e7f89a-1dfb-45e1-8d43-d71a954aeb98}</Project>
       <Name>Org.Apache.REEF.Utilities</Name>
     </ProjectReference>
-    <ProjectReference Include="..\Org.Apache.REEF.Wake\Org.Apache.REEF.Wake.csproj">
+    <ProjectReference Include="$(SolutionDir)\Org.Apache.REEF.Wake\Org.Apache.REEF.Wake.csproj">
       <Project>{cdfb3464-4041-42b1-9271-83af24cd5008}</Project>
       <Name>Org.Apache.REEF.Wake</Name>
     </ProjectReference>

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Task/ICompletedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Task/ICompletedTask.cs b/lang/cs/Org.Apache.REEF.Driver/Task/ICompletedTask.cs
new file mode 100644
index 0000000..bfd15c7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/ICompletedTask.cs
@@ -0,0 +1,29 @@
+/**
+ * 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.Driver.Context;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Task
+{
+    public interface ICompletedTask : IMessage, IIdentifiable
+    {
+         IActiveContext ActiveContext { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Task/IFailedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Task/IFailedTask.cs b/lang/cs/Org.Apache.REEF.Driver/Task/IFailedTask.cs
new file mode 100644
index 0000000..6d12993
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/IFailedTask.cs
@@ -0,0 +1,30 @@
+/**
+ * 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.Common.Api;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Task
+{
+    public interface IFailedTask : IAbstractFailure
+    {
+        Optional<IActiveContext> GetActiveContext();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Task/IRunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Task/IRunningTask.cs b/lang/cs/Org.Apache.REEF.Driver/Task/IRunningTask.cs
new file mode 100644
index 0000000..f1c4ea0
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/IRunningTask.cs
@@ -0,0 +1,65 @@
+/**
+ * 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.Driver.Context;
+using Org.Apache.REEF.Utilities;
+using System;
+
+namespace Org.Apache.REEF.Driver.Task
+{
+    /// <summary>
+    /// Represents a running Task
+    /// </summary>
+    public interface IRunningTask : IIdentifiable, IDisposable
+    {
+        /// <summary>
+        /// the context the task is running on.
+        /// </summary>
+        IActiveContext ActiveContext { get; set; }
+
+        /// <summary>
+        /// Sends the message to the running task.
+        /// </summary>
+        /// <param name="message"></param>
+        void OnNext(byte[] message);
+
+        /// <summary>
+        /// Sends the message
+        /// </summary>
+        /// <param name="message"></param>
+        void Send(byte[] message);
+
+        /// <summary>
+        ///  Signal the task to suspend.
+        /// </summary>
+        /// <param name="message">a message that is sent to the Task.</param>
+        void Suspend(byte[] message);
+
+        /// <summary>
+        /// Sends the message to the running task.
+        /// </summary>
+        void Suspend();
+
+        /// <summary>
+        /// Signal the task to shut down.
+        /// </summary>
+        /// <param name="message">a message that is sent to the Task.</param>
+        void Dispose(byte[] message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Task/ISuspendedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Task/ISuspendedTask.cs b/lang/cs/Org.Apache.REEF.Driver/Task/ISuspendedTask.cs
new file mode 100644
index 0000000..6478c8f
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/ISuspendedTask.cs
@@ -0,0 +1,29 @@
+/**
+ * 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.Driver.Context;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Task
+{
+    public interface ISuspendedTask : IMessage, IIdentifiable
+    {
+        IActiveContext ActiveContext { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Task/ITaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Task/ITaskMessage.cs b/lang/cs/Org.Apache.REEF.Driver/Task/ITaskMessage.cs
new file mode 100644
index 0000000..e06c8f3
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/ITaskMessage.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Driver.Task
+{
+    public interface ITaskMessage
+    {
+        byte[] Message { get; set; }
+
+        string TaskId { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..abb771e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Task/RunningTaskImpl.cs
@@ -0,0 +1,127 @@
+/**
+ * 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.Common;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Utilities.Logging;
+using System.Globalization;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+
+namespace Org.Apache.REEF.Driver.Task
+{
+   public class RunningTaskImpl : IRunningTask
+   {
+       private static readonly Logger LOGGER = Logger.GetLogger(typeof(RunningTaskImpl));
+       
+       private string _id;
+
+       private EvaluatorManager _evaluatorManager;
+
+       private EvaluatorContext _evaluatorContext;
+
+       public RunningTaskImpl(EvaluatorManager evaluatorManager, 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;
+       }
+
+       public string Id
+       {
+           get
+           {
+               return _id;
+           }
+
+           set
+           {
+           }
+       }
+
+       public IActiveContext ActiveContext
+       {
+           get
+           {
+               return _evaluatorContext;
+           }
+
+           set
+           {
+           }
+       }
+
+       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()
+       {
+           return "TaskRuntime with taskId = " + _id;
+       }
+
+       public override int GetHashCode()
+       {
+           return _id.GetHashCode();
+       }
+
+       public void Send(byte[] message)
+       {
+           LOGGER.Log(Level.Info, "RunningTaskImpl.Send() is called");
+       }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/BridgeLogger.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/BridgeLogger.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/BridgeLogger.cs
deleted file mode 100644
index 3e2dada..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/BridgeLogger.cs
+++ /dev/null
@@ -1,65 +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.Utilities.Logging;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    /// <summary>
-    /// A wrapper around the general Logger class used specifically for 
-    /// logging in CPP bridge code. 
-    /// This is enabled when trace leve is above Level.Info (included)
-    /// </summary>
-    public class BridgeLogger
-    {
-        private Logger _logger;
-
-        public BridgeLogger(string name)
-        {
-            _logger = Logger.GetLogger(name);
-        }
-
-        public static BridgeLogger GetLogger(string className)
-        {
-            return new BridgeLogger(className);
-        }
-
-        public void Log(string message)
-        {
-            _logger.Log(Level.Info, message);
-        }
-
-        public void LogStart(string message)
-        {
-            _logger.Log(Level.Start, message);
-        }
-
-        public void LogStop(string message)
-        {
-            _logger.Log(Level.Stop, message);
-        }
-
-        public void LogError(string message, Exception e)
-        {
-            _logger.Log(Level.Error, message, e);
-        }
-    }
-}


[13/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs
new file mode 100644
index 0000000..27b965c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs
@@ -0,0 +1,149 @@
+/**
+ * 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.CodeAnalysis;
+using System.Globalization;
+using Org.Apache.REEF.Common.Tasks.Events;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Tang.Util;
+using Org.Apache.REEF.Utilities.Logging;
+
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static readonly field, typical usage in configurations")]
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    public class TaskConfiguration : ConfigurationModuleBuilder
+    {
+        // this is a hack for getting the task identifier for now
+        public const string TaskIdentifier = "TaskConfigurationOptions+Identifier";
+
+        /// <summary>
+        ///  The identifier of the task.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly RequiredParameter<string> Identifier = new RequiredParameter<string>();
+
+        /// <summary>
+        /// The task to instantiate.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly RequiredImpl<ITask> Task = new RequiredImpl<ITask>();
+
+        /// <summary>
+        /// for task suspension. Defaults to task 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<ISuspendEvent>> OnSuspend = new OptionalImpl<IObserver<ISuspendEvent>>();
+
+        /// <summary>
+        /// for messages from the driver. Defaults to task failure if not bound.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IDriverMessageHandler> OnMessage = new OptionalImpl<IDriverMessageHandler>();
+
+        /// <summary>
+        /// for closure requests from the driver. Defaults to task 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<ICloseEvent>> OnClose = new OptionalImpl<IObserver<ICloseEvent>>();
+
+        /// <summary>
+        /// Message source invoked upon each evaluator heartbeat.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<ITaskMessageSource> OnSendMessage = new OptionalImpl<ITaskMessageSource>();
+
+        /// <summary>
+        /// to receive TaskStart after the Task.call() method was called.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IObserver<ITaskStart>> OnTaskStart = new OptionalImpl<IObserver<ITaskStart>>();
+
+        /// <summary>
+        /// to receive TaskStop after the Task.call() method returned.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalImpl<IObserver<ITaskStop>> OnTaskStop = new OptionalImpl<IObserver<ITaskStop>>();
+
+        /// <summary>
+        /// The memento to be passed to Task.call().
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalParameter<string> Memento = new OptionalParameter<string>();
+
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskConfiguration));
+
+        public TaskConfiguration()
+            : base()
+        {
+        }
+
+        public TaskConfiguration(string configString)
+        {
+            TangConfig = new AvroConfigurationSerializer().FromString(configString);
+            AvroConfiguration avroConfiguration = AvroConfiguration.GetAvroConfigurationFromEmbeddedString(configString);
+            foreach (ConfigurationEntry config in avroConfiguration.Bindings)
+            {
+                if (config.key.Contains(TaskIdentifier))
+                {
+                    TaskId = config.value;
+                }
+            }
+            if (string.IsNullOrWhiteSpace(TaskId))
+            {
+                string msg = "Required parameter TaskId not provided.";
+                LOGGER.Log(Level.Error, msg);
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException(msg), LOGGER);
+            }
+        }
+
+        public static ConfigurationModule ConfigurationModule
+        {
+            get
+            {
+                return new TaskConfiguration()
+                    .BindImplementation(GenericType<ITask>.Class, Task)
+                    .BindImplementation(GenericType<ITaskMessageSource>.Class, OnSendMessage)
+                    .BindImplementation(GenericType<IDriverMessageHandler>.Class, OnMessage)
+                    .BindNamedParameter(GenericType<TaskConfigurationOptions.Identifier>.Class, Identifier)
+                    .BindNamedParameter(GenericType<TaskConfigurationOptions.Memento>.Class, Memento)
+                    .BindNamedParameter(GenericType<TaskConfigurationOptions.CloseHandler>.Class, OnClose)
+                    .BindNamedParameter(GenericType<TaskConfigurationOptions.SuspendHandler>.Class, OnSuspend)
+                    .BindSetEntry(GenericType<TaskConfigurationOptions.StartHandlers>.Class, OnTaskStart)
+                    .BindSetEntry(GenericType<TaskConfigurationOptions.StopHandlers>.Class, OnTaskStop)
+                    .Build();
+            }
+        }
+
+        public string TaskId { get;  private set; }
+
+        public IList<KeyValuePair<string, string>> Configurations { get; private set; }
+
+        public IConfiguration TangConfig { get; private set; }
+
+        public override string ToString()
+        {
+            return string.Format(CultureInfo.InvariantCulture, "TaskConfiguration - configurations: {0}", TangConfig.ToString());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs
new file mode 100644
index 0000000..9d2f2e2
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs
@@ -0,0 +1,69 @@
+/**
+ * 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.Common.Tasks.Events;
+using Org.Apache.REEF.Tang.Annotations;
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    public class TaskConfigurationOptions
+    {
+        [NamedParameter("The Identifier of the Task", "taskid", "Task")]
+        public class Identifier : Name<string>
+        {
+        }
+
+        [NamedParameter(documentation: "The memento to be used for the Task")]
+        public class Memento : Name<string>
+        {
+        }
+
+        [NamedParameter("TaskMessageSource", "messagesource", null)]
+        public class TaskMessageSources : Name<ISet<ITaskMessageSource>>
+        {
+        }
+
+        [NamedParameter(documentation: "The set of event handlers for the TaskStart event.")]
+        public class StartHandlers : Name<ISet<IObserver<ITaskStart>>>
+        {
+        }
+
+        [NamedParameter(documentation: "The set of event handlers for the TaskStop event.")]
+        public class StopHandlers : Name<ISet<IObserver<ITaskStop>>>
+        {
+        }
+
+        [NamedParameter(documentation: "The event handler that receives the close event.")]
+        public class CloseHandler : Name<IObserver<ICloseEvent>>
+        {
+        }
+
+        [NamedParameter(documentation: "The event handler that receives the suspend event.")]
+        public class SuspendHandler : Name<IObserver<ISuspendEvent>>
+        {
+        }
+
+        [NamedParameter(documentation: "The event handler that receives messages from the driver.")]
+        public class MessageHandler : Name<IObserver<IDriverMessage>>
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs
new file mode 100644
index 0000000..494f59f
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs
@@ -0,0 +1,68 @@
+/**
+ * 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.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    public class TaskMessage : IMessage
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskMessage));
+        private readonly string _messageSourcId;
+        private readonly byte[] _bytes;
+
+        private TaskMessage(string messageSourceId, byte[] bytes)
+        {
+            _messageSourcId = messageSourceId;
+            _bytes = bytes;
+        }
+
+        public string MessageSourceId
+        {
+            get { return _messageSourcId; }
+        }
+
+        public byte[] Message
+        {
+            get { return _bytes; }
+            set { }
+        }
+
+        /// <summary>
+        ///  From byte[] message to a TaskMessage
+        /// </summary>
+        /// <param name="messageSourceId">messageSourceId The message's sourceID. This will be accessible in the Driver for routing</param>
+        /// <param name="message">The actual content of the message, serialized into a byte[]</param>
+        /// <returns>a new TaskMessage with the given content</returns>
+        public static TaskMessage From(string messageSourceId, byte[] message)
+        {
+            if (string.IsNullOrEmpty(messageSourceId))
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("messageSourceId"), LOGGER);
+            }
+            if (message == null)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("bytes"), LOGGER);
+            }
+            return new TaskMessage(messageSourceId, message);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs b/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs
deleted file mode 100644
index 50fd6b7..0000000
--- a/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs
+++ /dev/null
@@ -1,142 +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 Org.Apache.REEF.Utilities;
-using System;
-using System.Globalization;
-using Org.Apache.REEF.Utilities.Logging;
-
-namespace Org.Apache.REEF.Common.Api
-{
-    public abstract class AbstractFailure : IFailure
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(AbstractFailure));
-
-        public AbstractFailure()
-        {
-        }
-
-        /// <summary>
-        /// Most detailed error message constructor that takes all parameters possible.
-        /// </summary>
-        /// <param name="id">Identifier of the entity that produced the error. Cannot be null.</param>
-        /// <param name="message">One-line error message. Cannot be null.</param>
-        /// <param name="description">Long error description. Can be null.</param>
-        /// <param name="cause">Exception that caused the error. Can be null.</param>
-        /// <param name="data">byte array that contains serialized version of the error. Can be null.</param>
-        public AbstractFailure(string id, string message, string description, Exception cause, byte[] data)
-        {
-            if (string.IsNullOrEmpty(id))
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("id"), LOGGER);
-            }
-            if (string.IsNullOrEmpty(message))
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("message"), LOGGER);
-            }
-            Id = id;
-            Message = message;
-            Description = Optional<string>.OfNullable(string.IsNullOrEmpty(description) ? GetStackTrace(cause) : description);
-            Cause = Optional<Exception>.OfNullable(cause);
-            Data = Optional<byte[]>.OfNullable(data);
-        }
-
-        /// <summary>
-        ///  Build error message given the entity ID and the short error message.
-        /// </summary>
-        /// <param name="id"></param>
-        /// <param name="message"></param>
-        public AbstractFailure(string id, string message)
-            : this(id, message, null, null, null)
-        {
-        }
-
-        /// <summary>
-        ///  Build error message given the failed entity ID and  Exception.
-        ///  Populates the message with the Exception.getMessage() result, and stores
-        ///  the exception stack trace in the description.
-        /// </summary>
-        /// <param name="id"></param>
-        /// <param name="cause"></param>
-        public AbstractFailure(string id, Exception cause)
-        {
-            if (string.IsNullOrEmpty(id))
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("id"), LOGGER);
-            }
-            Id = id;
-            Message = cause.Message;
-            Description = Optional<string>.Of(GetStackTrace(cause));
-            Cause = Optional<Exception>.Of(cause);
-            Data = Optional<byte[]>.Empty();
-        }
-
-        /// <summary>
-        /// Build error message given the entity ID plus short and long error message.
-        /// </summary>
-        /// <param name="id"></param>
-        /// <param name="message"></param>
-        /// <param name="description"></param>
-        public AbstractFailure(string id, string message, string description)
-            : this(id, message, description, null, null)
-        {
-        }
-
-        /// <summary>
-        /// Identifier of the entity that produced the error. Cannot be null.
-        /// </summary>
-        public string Id { get; set; }
-
-        public string Message { get; set; }
-
-        public Optional<string> Description { get; set; }
-
-        public Optional<string> Reason { get; set; }
-
-        public Optional<Exception> Cause { get; set; }
-
-        public Optional<byte[]> Data { get; set; }
-
-        public Exception AsError()
-        {
-            return Cause.IsPresent() ? Cause.Value : new InvalidOperationException(ToString());
-        }
-
-        /// <summary>
-        ///  Helper function: produce the string that contains the given exception's stack trace. Returns null if the argument is null.
-        /// </summary>
-        /// <param name="ex"></param>
-        public string GetStackTrace(Exception ex)
-        {
-            if (ex == null)
-            {
-                return null;
-            }
-            else
-            {
-                return ex.StackTrace;
-            }
-        }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.InvariantCulture, "{0} with id={1} failed: {2}", GetType(), Id, Message);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs b/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs
deleted file mode 100644
index fd94b62..0000000
--- a/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs
+++ /dev/null
@@ -1,25 +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.
- */
-
-namespace Org.Apache.REEF.Common.Api
-{
-    public interface IAbstractFailure : IFailure
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs b/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs
deleted file mode 100644
index 454bdf4..0000000
--- a/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs
+++ /dev/null
@@ -1,57 +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 Org.Apache.REEF.Utilities;
-using System;
-
-namespace Org.Apache.REEF.Common.Api
-{
-    /// <summary>
-    /// Common interface for all error messages in REEF.
-    /// Most of its functionality is generic and implemented in the AbstractFailure class.
-    /// </summary>
-    public interface IFailure : IIdentifiable
-    {
-        /// <summary>
-        /// One-line error message. Should never be null.
-        /// </summary>
-        string Message { get; set; }
-
-        /// <summary>
-        ///  Optional long error description.
-        /// </summary>
-        Optional<string> Description { get; set; }
-
-        /// <summary>
-        /// Exception that caused the error, or null.
-        /// </summary>
-        Optional<string> Reason { get; set; }
-
-        /// <summary>
-        /// Optional serialized version of the error message.
-        /// </summary>
-        Optional<byte[]> Data { get; set; }
-
-        /// <summary>
-        /// Return the original Java Exception, or generate a new one if it does not exists.
-        /// ALWAYS returns an exception, never null
-        /// </summary>
-        Exception AsError();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 3287407..0000000
--- a/lang/cs/Org.Apache.REEF.Common/api/IResourceLaunchHandler.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto;
-using System;
-
-namespace Org.Apache.REEF.Common.Api
-{
-    public interface IResourceLaunchHandler : IObserver<ResourceLaunchProto>
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 5d807ad..0000000
--- a/lang/cs/Org.Apache.REEF.Common/api/IResourceReleaseHandler.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto;
-using System;
-
-namespace Org.Apache.REEF.Common.Api
-{
-    public interface IResourceReleaseHandler : IObserver<ResourceReleaseProto>
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 4932e5e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/api/IResourceRequestHandler.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto;
-using System;
-
-namespace Org.Apache.REEF.Common.Api
-{
-    public interface IResourceRequestHandler : IObserver<ResourceRequestProto>
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs
deleted file mode 100644
index 2f0ae95..0000000
--- a/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//<auto-generated />
-namespace Org.Apache.REEF.Common.Avro
-{
-    using System.Collections.Generic;
-    using System.Runtime.Serialization;
-
-    /// <summary>
-    /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroDriverInfo.
-    /// </summary>
-    [DataContract(Namespace = "org.apache.reef.webserver")]
-    [KnownType(typeof(List<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo>))]
-    public partial class AvroDriverInfo
-    {
-        private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroDriverInfo"",""fields"":[{""name"":""remoteId"",""type"":""string""},{""name"":""startTime"",""type"":""string""},{""name"":""services"",""type"":{""type"":""array"",""items"":{""type"":""record"",""name"":""org.apache.reef.webserver.AvroReefServiceInfo"",""fields"":[{""name"":""serviceName"",""type"":""string""},{""name"":""serviceInfo"",""type"":""string""}]}}}]}";
-
-        /// <summary>
-        /// Gets the schema.
-        /// </summary>
-        public static string Schema
-        {
-            get
-            {
-                return JsonSchema;
-            }
-        }
-      
-        /// <summary>
-        /// Gets or sets the remoteId field.
-        /// </summary>
-        [DataMember]
-        public string remoteId { get; set; }
-              
-        /// <summary>
-        /// Gets or sets the startTime field.
-        /// </summary>
-        [DataMember]
-        public string startTime { get; set; }
-              
-        /// <summary>
-        /// Gets or sets the services field.
-        /// </summary>
-        [DataMember]
-        public IList<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo> services { get; set; }
-                
-        /// <summary>
-        /// Initializes a new instance of the <see cref="AvroDriverInfo"/> class.
-        /// </summary>
-        public AvroDriverInfo()
-        {
-        }
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="AvroDriverInfo"/> class.
-        /// </summary>
-        /// <param name="remoteId">The remoteId.</param>
-        /// <param name="startTime">The startTime.</param>
-        /// <param name="services">The services.</param>
-        public AvroDriverInfo(string remoteId, string startTime, IList<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo> services)
-        {
-            this.remoteId = remoteId;
-            this.startTime = startTime;
-            this.services = services;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs
deleted file mode 100644
index 3767c2b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//<auto-generated />
-namespace Org.Apache.REEF.Common.Avro
-{
-    using System.Runtime.Serialization;
-
-    /// <summary>
-    /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroHttpRequest.
-    /// </summary>
-    [DataContract(Namespace = "org.apache.reef.webserver")]
-    public partial class AvroHttpRequest
-    {
-        private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroHttpRequest"",""fields"":[{""name"":""requestUrl"",""type"":""string""},{""name"":""pathInfo"",""type"":""string""},{""name"":""queryString"",""type"":""string""},{""name"":""httpMethod"",""type"":""string""},{""name"":""inputStream"",""type"":""bytes""}]}";
-
-        /// <summary>
-        /// Gets the schema.
-        /// </summary>
-        public static string Schema
-        {
-            get
-            {
-                return JsonSchema;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the requestUrl field.
-        /// </summary>
-        [DataMember]
-        public string RequestUrl { get; set; }
-
-        /// <summary>
-        /// Gets or sets the pathInfo field.
-        /// </summary>
-        [DataMember]
-        public string PathInfo { get; set; }
-
-        /// <summary>
-        /// Gets or sets the queryString field.
-        /// </summary>
-        [DataMember]
-        public string QueryString { get; set; }
-
-        /// <summary>
-        /// Gets or sets the httpMethod field.
-        /// </summary>
-        [DataMember]
-        public string HttpMethod { get; set; }
-
-        /// <summary>
-        /// Gets or sets the inputStream field.
-        /// </summary>
-        [DataMember]
-        public byte[] InputStream { get; set; }
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="AvroHttpRequest"/> class.
-        /// </summary>
-        public AvroHttpRequest()
-        {
-        }
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="AvroHttpRequest"/> class.
-        /// </summary>
-        /// <param name="requestUrl">The requestUrl.</param>
-        /// <param name="pathInfo">The pathInfo.</param>
-        /// <param name="queryString">The queryString.</param>
-        /// <param name="httpMethod">The httpMethod.</param>
-        /// <param name="inputStream">The inputStream.</param>
-        public AvroHttpRequest(string requestUrl, string pathInfo, string queryString, string httpMethod, byte[] inputStream)
-        {
-            RequestUrl = requestUrl;
-            PathInfo = pathInfo;
-            QueryString = queryString;
-            HttpMethod = httpMethod;
-            InputStream = inputStream;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 2d1fb53..0000000
--- a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpSerializer.cs
+++ /dev/null
@@ -1,36 +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 Microsoft.Hadoop.Avro;
-using System.IO;
-
-namespace Org.Apache.REEF.Common.Avro
-{
-    public class AvroHttpSerializer
-    {
-        public static AvroHttpRequest FromBytes(byte[] serializedBytes)
-        {
-            var serializer = AvroSerializer.Create<AvroHttpRequest>();
-            using (var stream = new MemoryStream(serializedBytes))
-            {
-                return serializer.Deserialize(stream);
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs
deleted file mode 100644
index a3c0007..0000000
--- a/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs
+++ /dev/null
@@ -1,52 +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 Org.Apache.REEF.Utilities;
-
-using Newtonsoft.Json;
-
-namespace Org.Apache.REEF.Common.Avro
-{
-    /// <summary>
-    /// Wrapper class for serialize/deserialize Avro json. This avoids having to reference Avro dll in every project 
-    /// </summary>
-    /// <typeparam name="T"> the deserialized type</typeparam>
-    public class AvroJsonSerializer<T>
-    {
-        public static T FromString(string str)
-        {
-            return JsonConvert.DeserializeObject<T>(str);
-        }
-
-        public static string ToString(T obj)
-        {
-            return JsonConvert.SerializeObject(obj);
-        }
-
-        public static T FromBytes(byte[] bytes)
-        {
-            return FromString(ByteUtilities.ByteArrarysToString(bytes));
-        }
-
-        public static byte[] ToBytes(T obj)
-        {
-            return ByteUtilities.StringToByteArrays(JsonConvert.SerializeObject(obj));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs
deleted file mode 100644
index 9b65c62..0000000
--- a/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//<auto-generated />
-namespace Org.Apache.REEF.Common.Avro
-{
-    using System.Runtime.Serialization;
-
-    /// <summary>
-    /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroReefServiceInfo.
-    /// </summary>
-    [DataContract(Namespace = "org.apache.reef.webserver")]
-    public partial class AvroReefServiceInfo
-    {
-        private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroReefServiceInfo"",""fields"":[{""name"":""serviceName"",""type"":""string""},{""name"":""serviceInfo"",""type"":""string""}]}";
-
-        /// <summary>
-        /// Gets the schema.
-        /// </summary>
-        public static string Schema
-        {
-            get
-            {
-                return JsonSchema;
-            }
-        }
-      
-        /// <summary>
-        /// Gets or sets the serviceName field.
-        /// </summary>
-        [DataMember]
-        public string serviceName { get; set; }
-              
-        /// <summary>
-        /// Gets or sets the serviceInfo field.
-        /// </summary>
-        [DataMember]
-        public string serviceInfo { get; set; }
-                
-        /// <summary>
-        /// Initializes a new instance of the <see cref="AvroReefServiceInfo"/> class.
-        /// </summary>
-        public AvroReefServiceInfo()
-        {
-        }
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="AvroReefServiceInfo"/> class.
-        /// </summary>
-        /// <param name="serviceName">The serviceName.</param>
-        /// <param name="serviceInfo">The serviceInfo.</param>
-        public AvroReefServiceInfo(string serviceName, string serviceInfo)
-        {
-            this.serviceName = serviceName;
-            this.serviceInfo = serviceInfo;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs b/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs
deleted file mode 100644
index 967995a..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs
+++ /dev/null
@@ -1,36 +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.Net;
-
-using Org.Apache.REEF.Common.Capabilities;
-
-namespace Org.Apache.REEF.Common.Catalog
-{
-    public interface INodeDescriptor
-    {
-        IPEndPoint InetSocketAddress { get; set; }
-
-        string HostName { get; set; }
-
-        CPU Cpu { get; set; }
-
-        RAM Ram { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs b/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs
deleted file mode 100644
index 5e6bb32..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs
+++ /dev/null
@@ -1,25 +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.
- */
-
-namespace Org.Apache.REEF.Common.Catalog
-{
-    public interface IRackDescriptor : IResourceCatalog
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs b/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs
deleted file mode 100644
index c972f73..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs
+++ /dev/null
@@ -1,37 +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 Org.Apache.REEF.Common.Capabilities;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Common.Catalog
-{
-    public interface IResourceCatalog
-    {
-        string Name { get; set; }
-
-        ICollection<ICapability> Capabilities { get; set; }
-
-        ICollection<INodeDescriptor> Nodes { get; set; }
-
-        ICollection<IRackDescriptor> Racks { get; set; }
-
-        INodeDescriptor GetNode(string nodeId);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs
deleted file mode 100644
index 696248b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs
+++ /dev/null
@@ -1,116 +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 Org.Apache.REEF.Common.Capabilities;
-using System.Collections.Generic;
-using System.Net;
-
-namespace Org.Apache.REEF.Common.Catalog
-{
-    public class NodeDescriptorImpl : INodeDescriptor
-    {
-        private RackDescriptorImpl _rack;
-
-        private string _id;
-
-        private IPEndPoint _address;
-
-        private RAM _ram;
-
-        private IList<ICapability> _capabilities;
-
-        public NodeDescriptorImpl()
-        {
-        }
-
-        public NodeDescriptorImpl(string id, IPEndPoint addresss, RackDescriptorImpl rack, RAM ram)
-        {
-            _id = id;
-            _address = addresss;
-            _rack = rack;
-            _ram = ram;
-            _capabilities = new List<ICapability>();
-            _rack.AddNodeDescriptor(this);
-        }
-
-        public RackDescriptorImpl Rack 
-        {
-            get
-            {
-                return _rack;
-            }
-        }
-
-        public string Id
-        {
-            get
-            {
-                return _id;
-            }
-        }
-
-        public string HostName { get; set; }
-
-        public CPU Cpu
-        {
-            get
-            {
-                return new CPU(1);
-            }
-
-            set
-            {
-            }
-        }
-
-        public RAM Ram
-        {
-            get
-            {
-                return _ram;
-            }
-
-            set
-            {
-                _ram = value;
-            }
-        }
-
-        public IList<ICapability> Capabilities
-        {
-            get
-            {
-                return _capabilities;
-            }
-        }
-
-        public IPEndPoint InetSocketAddress
-        {
-            get
-            {
-                return _address;
-            }
-
-            set
-            {
-                _address = value;
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs
deleted file mode 100644
index b6d89d8..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs
+++ /dev/null
@@ -1,75 +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 Org.Apache.REEF.Common.Capabilities;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Org.Apache.REEF.Common.Catalog
-{
-    public class RackDescriptorImpl : IRackDescriptor
-    {
-        public RackDescriptorImpl(string name)
-        {
-            Name = name;
-            Capabilities = new List<ICapability>();
-            Nodes = new List<INodeDescriptor>();
-        }
-
-        public string Name { get; set; }
-
-        public ICollection<ICapability> Capabilities { get; set; }
-
-        public ICollection<INodeDescriptor> Nodes { get; set; }
-
-        public ICollection<IRackDescriptor> Racks { get; set; }
-
-        public INodeDescriptor GetNode(string nodeId)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void AddNodeDescriptor(NodeDescriptorImpl node)
-        {
-            Nodes.Add(node);
-        }
-
-        public override string ToString()
-        {
-            StringBuilder stringBuilder = new StringBuilder();
-            stringBuilder.Append("Rack " + Name);
-            foreach (INodeDescriptor nodeDescriptor in Nodes)
-            {
-                stringBuilder.Append(Environment.NewLine + nodeDescriptor);
-            }
-            return stringBuilder.ToString();
-        }
-
-        public override int GetHashCode()
-        {
-            return Name.GetHashCode();
-        }
-
-        public override bool Equals(object obj)
-        {
-            return base.Equals(obj);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs b/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs
deleted file mode 100644
index 7d9e7ca..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs
+++ /dev/null
@@ -1,95 +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 Org.Apache.REEF.Common.Capabilities;
-using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Net;
-using System.Text;
-
-namespace Org.Apache.REEF.Common.Catalog
-{
-    public class ResourceCatalogImpl : IResourceCatalog
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ResourceCatalogImpl));
-        
-        private static string defaultRackName = "default-rack";
-
-        private Dictionary<string, RackDescriptorImpl> _racks = new Dictionary<string, RackDescriptorImpl>();
- 
-        private Dictionary<string, NodeDescriptorImpl> _nodes = new Dictionary<string, NodeDescriptorImpl>();
-
-        public string Name { get; set; }
-
-        public ICollection<ICapability> Capabilities { get; set; }
-
-        public ICollection<INodeDescriptor> Nodes { get; set; }
-
-        public ICollection<IRackDescriptor> Racks { get; set; }
-
-        public INodeDescriptor GetNode(string nodeId)
-        {
-            return _nodes[nodeId];
-        }
-
-        public void Handle(NodeDescriptorProto node)
-        {
-            string rackName = node.rack_name == null ? node.rack_name : defaultRackName;
-            string message = string.Format(
-                CultureInfo.InvariantCulture,
-                "Catalog new node: id[{0}], rack[{1}], host[{2}], port[{3}], memory[{4}]",
-                node.identifier,
-                rackName,
-                node.host_name,
-                node.port,
-                node.memory_size);
-            LOGGER.Log(Level.Info, message);
-            if (!string.IsNullOrWhiteSpace(rackName) && !_racks.ContainsKey(rackName))
-            {
-                RackDescriptorImpl newRack = new RackDescriptorImpl(rackName);
-                _racks.Add(rackName, newRack);
-            }
-            RackDescriptorImpl rack = _racks[rackName];
-            IPAddress ipAddress = null;
-            IPAddress.TryParse(node.host_name, out ipAddress);
-            if (ipAddress == null)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("cannot parse host ipaddress: " + node.host_name), LOGGER);
-            }
-            IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, node.port);
-            RAM ram = new RAM(node.memory_size);
-            NodeDescriptorImpl nodeDescriptor = new NodeDescriptorImpl(node.identifier, ipEndPoint, rack, ram);
-            _nodes.Add(nodeDescriptor.Id, nodeDescriptor);
-        }
-
-        public override string ToString()
-        {
-            StringBuilder stringBuilder = new StringBuilder();
-            stringBuilder.Append("=== Resource Catalog ===");
-            foreach (IRackDescriptor rackDescriptor in Racks)
-            {
-                stringBuilder.Append(Environment.NewLine + rackDescriptor);
-            }
-            return stringBuilder.ToString();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs b/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs
deleted file mode 100644
index 599db2e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs
+++ /dev/null
@@ -1,60 +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.Globalization;
-using Org.Apache.REEF.Common.Api;
-using Org.Apache.REEF.Utilities.Logging;
-
-namespace Org.Apache.REEF.Common.Capabilities
-{
-    public class CPU : ICapability
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(CPU));
-
-        private int _cores;
-
-        public CPU(int cores)
-        {
-            if (cores <= 0)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("cores cannot be non-positive"), LOGGER);
-            }
-            _cores = cores;
-        }
-
-        public int Cores
-        {
-            get
-            {
-                return _cores;
-            }
-        }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.InvariantCulture, "CPU Cores = [{0}]", Cores);
-        }
-
-        public override int GetHashCode()
-        {
-            return Cores.GetHashCode();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs b/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs
deleted file mode 100644
index 4c838f7..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs
+++ /dev/null
@@ -1,25 +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.
- */
-
-namespace Org.Apache.REEF.Common.Capabilities
-{
-    public interface ICapability
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs b/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs
deleted file mode 100644
index 68f5a08..0000000
--- a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs
+++ /dev/null
@@ -1,51 +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.Globalization;
-
-namespace Org.Apache.REEF.Common.Capabilities
-{
-    public class RAM : ICapability
-    {
-        private int _megaBytes;
-
-        public RAM(int megaBytes)
-        {
-            _megaBytes = megaBytes;
-        }
-
-        public int MegaBytes
-        {
-            get
-            {
-                return _megaBytes;
-            }
-        }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.InvariantCulture, "RAM(in mega bytes) = [{0}]", MegaBytes);
-        }
-
-        public override int GetHashCode()
-        {
-            return MegaBytes.GetHashCode();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs b/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs
deleted file mode 100644
index 7f9b226..0000000
--- a/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs
+++ /dev/null
@@ -1,66 +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.Utilities.Logging;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public class ContextMessage
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextMessage));
-        private readonly string _messageSourcId;
-        private readonly byte[] _bytes;
-
-        private ContextMessage(string messageSourceId, byte[] bytes)
-        {
-            _messageSourcId = messageSourceId;
-            _bytes = bytes;
-        }
-
-        public string MessageSourceId
-        {
-            get { return _messageSourcId; }
-        }
-
-        public byte[] Bytes
-        {
-            get { return _bytes; }
-        }
-
-        /// <summary>
-        /// construt a new new ContextMessage with the given content.
-        /// </summary>
-        /// <param name="messageSourceId">The message's sourceID. This will be accessible in the Driver for routing.</param>
-        /// <param name="bytes">The actual content of the message, serialized into a byte[]</param>
-        /// <returns>new ContextMessage with the given content.</returns>
-        public static ContextMessage From(string messageSourceId, byte[] bytes)
-        {
-            if (string.IsNullOrEmpty(messageSourceId))
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("messageSourceId"), LOGGER);
-            }
-            if (bytes == null)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("bytes"), LOGGER);
-            }
-            return new ContextMessage(messageSourceId, bytes);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs b/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs
deleted file mode 100644
index 7d7a298..0000000
--- a/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public interface IContextMessage : IMessage, IIdentifiable
-    {
-        string MessageSourceId { get; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs
deleted file mode 100644
index 044d0af..0000000
--- a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs
+++ /dev/null
@@ -1,27 +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;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public interface IContextMessageHandler : IObserver<byte[]>
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs
deleted file mode 100644
index d1eb08c..0000000
--- a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public interface IContextMessageSource
-    {
-        Optional<ContextMessage> Message { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs
deleted file mode 100644
index 26049e6..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs
+++ /dev/null
@@ -1,45 +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 Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public class DefaultLocalHttpDriverConnection : IDriverConnection
-    {
-        private readonly Uri _queryUri;
-
-        [Inject]
-        public DefaultLocalHttpDriverConnection()
-        {
-            _queryUri = new Uri(
-                    string.Concat(
-                    Constants.LocalHttpEndpointBaseUri,
-                    Constants.HttpReefUriSpecification,
-                    Constants.HttpDriverUriTarget));
-        }
-
-        public DriverInformation GetDriverInformation(string applicationId)
-        {
-            // application id not needed for local runtime
-            return DriverInformation.GetDriverInformationFromHttp(_queryUri);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index e0076e7..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnClusterHttpDriverConnection.cs
+++ /dev/null
@@ -1,44 +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 Org.Apache.REEF.Tang.Annotations;
-using System;
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public class DefaultYarnClusterHttpDriverConnection : IDriverConnection
-    {
-        [Inject]
-        public DefaultYarnClusterHttpDriverConnection()
-        {
-        }
-
-        public DriverInformation GetDriverInformation(string applicationId)
-        {
-            // e.g., http://headnodehost:9014/proxy/application_1407519727821_0012/reef/v1/driver
-            Uri queryUri = new Uri(
-                string.Concat(
-                Constants.HDInsightClusterHttpEndpointBaseUri,
-                applicationId,
-                Constants.HttpReefUriSpecification,
-                Constants.HttpDriverUriTarget));
-            return DriverInformation.GetDriverInformationFromHttp(queryUri);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs
deleted file mode 100644
index 9a4974c..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs
+++ /dev/null
@@ -1,46 +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 Org.Apache.REEF.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public class DefaultYarnOneBoxHttpDriverConnection : IDriverConnection
-    {
-        [Inject]
-        public DefaultYarnOneBoxHttpDriverConnection()
-        {
-        }
-
-        public DriverInformation GetDriverInformation(string applicationId)
-        {
-            // e.g., http://yingdac1:8088/proxy/application_1407519727821_0012/reef/v1/driver
-            string oneBoxHost = string.Format(CultureInfo.InvariantCulture, "http://{0}:8088/proxy/", Environment.MachineName);
-            Uri queryUri = new Uri(
-                string.Concat(
-                oneBoxHost,
-                applicationId,
-                Constants.HttpReefUriSpecification,
-                Constants.HttpDriverUriTarget));
-            return DriverInformation.GetDriverInformationFromHttp(queryUri);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs
deleted file mode 100644
index 055784e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs
+++ /dev/null
@@ -1,136 +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 Org.Apache.REEF.Common.Avro;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Text;
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public class DriverInformation
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DriverInformation));
-        
-        private string _rid;
-
-        private string _startTime;
-
-        private string _nameServerId;
-
-        private IList<AvroReefServiceInfo> _services;
-
-        public DriverInformation(string rid, string startTime, IList<AvroReefServiceInfo> services)
-        {
-            _rid = rid;
-            _startTime = startTime;
-            _services = services;
-
-            if (_services == null)
-            {
-                LOGGER.Log(Level.Warning, "no services information from driver.");
-            }
-            else
-            {
-                AvroReefServiceInfo nameServerInfo =
-                  _services.FirstOrDefault(
-                      s => s.serviceName.Equals(Constants.NameServerServiceName, StringComparison.OrdinalIgnoreCase));
-                if (nameServerInfo != null)
-                {
-                    _nameServerId = nameServerInfo.serviceInfo;
-                }
-            }  
-        }
-
-        public string DriverRemoteIdentifier
-        {
-            get
-            {
-                return _rid;
-            }
-        }
-
-        public string DriverStartTime
-        {
-            get
-            {
-                return _startTime;
-            }
-        }
-
-        public string NameServerId
-        {
-            get
-            {
-                return _nameServerId;
-            }
-        }
-
-        public static DriverInformation GetDriverInformationFromHttp(Uri queryUri)
-        {
-            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(queryUri);
-            request.AllowAutoRedirect = false;
-            request.KeepAlive = false;
-            request.ContentType = "text/html";
-
-            string driverInfomation;
-            AvroDriverInfo info = null;
-            try
-            {
-                using (HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse())
-                {
-                    Stream stream = webResponse.GetResponseStream();
-                    if (stream == null)
-                    {
-                        return null;
-                    }
-                    using (StreamReader streamReader = new StreamReader(stream, Encoding.UTF8))
-                    {
-                        driverInfomation = streamReader.ReadToEnd();
-                        LOGGER.Log(Level.Verbose, "Http response line: " + driverInfomation);
-                        info = AvroJsonSerializer<AvroDriverInfo>.FromString(driverInfomation);
-                    }
-                }
-            }
-            catch (WebException)
-            {
-                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "In RECOVERY mode, cannot connect to [{0}] for driver information, will try again later.", queryUri));
-                return null;
-            }
-            catch (Exception e)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, string.Format(CultureInfo.InvariantCulture, "Cannot read content from {0}.", queryUri), LOGGER);
-            }
-
-            if (info != null)
-            {
-                LOGGER.Log(
-                    Level.Verbose, 
-                    string.Format(CultureInfo.InvariantCulture, "Driver information extracted with remote identier [{0}], start time [{1}], and servics [{2}]", info.remoteId, info.startTime, info.services));
-                return new DriverInformation(info.remoteId, info.startTime, info.services);
-            }
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs
deleted file mode 100644
index 22ffa67..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs
+++ /dev/null
@@ -1,39 +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.
- */
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public enum EvaluatorOperationState
-    {
-        /// <summary>
-        /// default state
-        /// </summary>
-        UNINITIATED = 0,
-
-        /// <summary>
-        /// normal operational state
-        /// </summary>
-        OPERATIONAL = 1,
-
-        /// <summary>
-        /// in the process of recovering 
-        /// </summary>
-        RECOVERY = 2
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs
deleted file mode 100644
index 2db37a8..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs
+++ /dev/null
@@ -1,39 +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.
- */
-
-namespace Org.Apache.REEF.Common.evaluator
-{
-    public enum EvaluatorRuntimeState
-    {
-        /// <summary>
-        /// default state
-        /// </summary>
-        UNINITIATED = 0,
-
-        /// <summary>
-        /// normal operational state
-        /// </summary>
-        RUNNING = 1,
-
-        /// <summary>
-        /// in the process of recovering 
-        /// </summary>
-        RECOVERY = 2
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs
deleted file mode 100644
index 4269dd2..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs
+++ /dev/null
@@ -1,39 +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.
- */
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public enum EvaluatorType
-    {
-        /// <summary>
-        /// default  type
-        /// </summary>
-        UNDECIDED = 0,
-
-        /// <summary>
-        /// Indicates an Evaluator that runs on the JVM
-        /// </summary>
-        JVM = 1,
-
-        /// <summary>
-        /// Indicates an Evaluator that runs on the CLR
-        /// </summary>
-        CLR = 2
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs
deleted file mode 100644
index 10c6d6e..0000000
--- a/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Common.Evaluator
-{
-    public interface IDriverConnection
-    {
-        DriverInformation GetDriverInformation(string applicationId);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs b/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs
deleted file mode 100644
index 924f2c4..0000000
--- a/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Common.Events
-{
-    public interface IContextStart
-    {
-        string Id { get; set; }
-    }
-}
\ No newline at end of file


[18/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ContextMessageClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ContextMessageClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ContextMessageClr2Java.cpp
index b036c8b..c385e46 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ContextMessageClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/ContextMessageClr2Java.cpp
@@ -20,59 +20,61 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
-					ContextMessageClr2Java::ContextMessageClr2Java(JNIEnv *env, jobject jobjectContextMessage) {
-						ManagedLog::LOGGER->LogStart("ContextMessageClr2Java::ContextMessageClr2Java");
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
+					  ContextMessageClr2Java::ContextMessageClr2Java(JNIEnv *env, jobject jobjectContextMessage) {
+						  ManagedLog::LOGGER->LogStart("ContextMessageClr2Java::ContextMessageClr2Java");
 
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectContextMessage = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectContextMessage));
-						jclass jclassContextMessage = env->GetObjectClass (_jobjectContextMessage);
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectContextMessage = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectContextMessage));
+						  jclass jclassContextMessage = env->GetObjectClass(_jobjectContextMessage);
 
-						jfieldID jidId = env->GetFieldID(jclassContextMessage, "contextMessageId", "Ljava/lang/String;");
-						jfieldID jidSourceId = env->GetFieldID(jclassContextMessage, "messageSourceId", "Ljava/lang/String;");
-						jfieldID jidMessage = env->GetFieldID(jclassContextMessage, "message", "()[B");
+						  jfieldID jidId = env->GetFieldID(jclassContextMessage, "contextMessageId", "Ljava/lang/String;");
+						  jfieldID jidSourceId = env->GetFieldID(jclassContextMessage, "messageSourceId", "Ljava/lang/String;");
+						  jfieldID jidMessage = env->GetFieldID(jclassContextMessage, "message", "()[B");
 
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectContextMessage, jidId)));
-						_jstringSourceId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectContextMessage, jidSourceId)));
-						_jarrayMessage = reinterpret_cast<jbyteArray>(env->NewGlobalRef(env->GetObjectField(_jobjectContextMessage, jidMessage)));
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectContextMessage, jidId)));
+						  _jstringSourceId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectContextMessage, jidSourceId)));
+						  _jarrayMessage = reinterpret_cast<jbyteArray>(env->NewGlobalRef(env->GetObjectField(_jobjectContextMessage, jidMessage)));
 
-						ManagedLog::LOGGER->LogStop("ContextMessageClr2Java::ContextMessageClr2Java");
-					}
+						  ManagedLog::LOGGER->LogStop("ContextMessageClr2Java::ContextMessageClr2Java");
+					  }
 
-					String^ ContextMessageClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("ContextMessageClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
+					  String^ ContextMessageClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("ContextMessageClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
 
-					String^ ContextMessageClr2Java::GetMessageSourceId() {
-						ManagedLog::LOGGER->Log("ContextMessageClr2Java::GetMessageSourceId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringSourceId);
-					}
+					  String^ ContextMessageClr2Java::GetMessageSourceId() {
+						  ManagedLog::LOGGER->Log("ContextMessageClr2Java::GetMessageSourceId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringSourceId);
+					  }
 
-					array<byte>^ ContextMessageClr2Java::Get() {
-						ManagedLog::LOGGER->Log("ContextMessageClr2Java::Get");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedByteArrayFromJavaByteArray(env, _jarrayMessage);
-					}
+					  array<byte>^ ContextMessageClr2Java::Get() {
+						  ManagedLog::LOGGER->Log("ContextMessageClr2Java::Get");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedByteArrayFromJavaByteArray(env, _jarrayMessage);
+					  }
 
-					void ContextMessageClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("ContextMessageClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectContextMessage);
-					}
-				}
-			}
-		}
+					  void ContextMessageClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("ContextMessageClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectContextMessage);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/EvaluatorRequestorClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/EvaluatorRequestorClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/EvaluatorRequestorClr2Java.cpp
index f863a40..2daed9e 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/EvaluatorRequestorClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/EvaluatorRequestorClr2Java.cpp
@@ -20,52 +20,54 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					EvaluatorRequestorClr2Java::EvaluatorRequestorClr2Java(JNIEnv *env, jobject jevaluatorRequestor) {
-						ManagedLog::LOGGER->LogStart("EvaluatorRequestorClr2Java::EvaluatorRequestorClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectEvaluatorRequestor = reinterpret_cast<jobject>(env->NewGlobalRef(jevaluatorRequestor));
-						ManagedLog::LOGGER->LogStop("EvaluatorRequestorClr2Java::EvaluatorRequestorClr2Java");
-					}
+					  EvaluatorRequestorClr2Java::EvaluatorRequestorClr2Java(JNIEnv *env, jobject jevaluatorRequestor) {
+						  ManagedLog::LOGGER->LogStart("EvaluatorRequestorClr2Java::EvaluatorRequestorClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectEvaluatorRequestor = reinterpret_cast<jobject>(env->NewGlobalRef(jevaluatorRequestor));
+						  ManagedLog::LOGGER->LogStop("EvaluatorRequestorClr2Java::EvaluatorRequestorClr2Java");
+					  }
 
-					void EvaluatorRequestorClr2Java::Submit(IEvaluatorRequest^ request) {
-						ManagedLog::LOGGER->LogStart("EvaluatorRequestorClr2Java::Submit");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassEvaluatorRequestor = env->GetObjectClass (_jobjectEvaluatorRequestor);
-						jmethodID jmidSubmit = env->GetMethodID(jclassEvaluatorRequestor, "submit", "(IIILjava/lang/String;)V");
+					  void EvaluatorRequestorClr2Java::Submit(IEvaluatorRequest^ request) {
+						  ManagedLog::LOGGER->LogStart("EvaluatorRequestorClr2Java::Submit");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassEvaluatorRequestor = env->GetObjectClass(_jobjectEvaluatorRequestor);
+						  jmethodID jmidSubmit = env->GetMethodID(jclassEvaluatorRequestor, "submit", "(IIILjava/lang/String;)V");
 
-						if (jmidSubmit == NULL) {
-							fprintf(stdout, " jmidSubmit is NULL\n");
-							fflush (stdout);
-							return;
-						}
-						env -> CallObjectMethod(
-							_jobjectEvaluatorRequestor,
-							jmidSubmit,
-							request -> Number,
-							request -> MemoryMegaBytes,
-				request -> VirtualCore,
-							JavaStringFromManagedString(env, request -> Rack));
-						ManagedLog::LOGGER->LogStop("EvaluatorRequestorClr2Java::Submit");
-					}
+						  if (jmidSubmit == NULL) {
+							  fprintf(stdout, " jmidSubmit is NULL\n");
+							  fflush(stdout);
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectEvaluatorRequestor,
+							  jmidSubmit,
+							  request->Number,
+							  request->MemoryMegaBytes,
+							  request->VirtualCore,
+							  JavaStringFromManagedString(env, request->Rack));
+						  ManagedLog::LOGGER->LogStop("EvaluatorRequestorClr2Java::Submit");
+					  }
 
-					void EvaluatorRequestorClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("EvaluatorRequestorClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectEvaluatorRequestor);
-					}
-				}
-			}
-		}
+					  void EvaluatorRequestorClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("EvaluatorRequestorClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectEvaluatorRequestor);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedContextClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedContextClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedContextClr2Java.cpp
index 58c322e..5a96202 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedContextClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedContextClr2Java.cpp
@@ -20,77 +20,79 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
-					FailedContextClr2Java::FailedContextClr2Java(JNIEnv *env, jobject jobjectFailedContext) {
-						ManagedLog::LOGGER->LogStart("FailedContextClr2Java::FailedContextClr2Java");
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
+					  FailedContextClr2Java::FailedContextClr2Java(JNIEnv *env, jobject jobjectFailedContext) {
+						  ManagedLog::LOGGER->LogStart("FailedContextClr2Java::FailedContextClr2Java");
 
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectFailedContext = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectFailedContext));
-						jclass jclassFailedContext = env->GetObjectClass (_jobjectFailedContext);
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectFailedContext = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectFailedContext));
+						  jclass jclassFailedContext = env->GetObjectClass(_jobjectFailedContext);
 
-						jfieldID jidContextId = env->GetFieldID(jclassFailedContext, "contextId", "Ljava/lang/String;");
-						jfieldID jidEvaluatorId = env->GetFieldID(jclassFailedContext, "evaluatorId", "Ljava/lang/String;");
-						jfieldID jidParentId = env->GetFieldID(jclassFailedContext, "parentContextId", "Ljava/lang/String;");
+						  jfieldID jidContextId = env->GetFieldID(jclassFailedContext, "contextId", "Ljava/lang/String;");
+						  jfieldID jidEvaluatorId = env->GetFieldID(jclassFailedContext, "evaluatorId", "Ljava/lang/String;");
+						  jfieldID jidParentId = env->GetFieldID(jclassFailedContext, "parentContextId", "Ljava/lang/String;");
 
-						_jstringContextId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedContext, jidContextId)));
-						_jstringEvaluatorId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedContext, jidEvaluatorId)));
-						_jstringParentContextId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedContext, jidParentId)));
+						  _jstringContextId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedContext, jidContextId)));
+						  _jstringEvaluatorId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedContext, jidEvaluatorId)));
+						  _jstringParentContextId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedContext, jidParentId)));
 
-						ManagedLog::LOGGER->LogStop("FailedContextClr2Java::FailedContextClr2Java");
-					}
+						  ManagedLog::LOGGER->LogStop("FailedContextClr2Java::FailedContextClr2Java");
+					  }
 
-					IActiveContextClr2Java^ FailedContextClr2Java::GetParentContext() {
-						ManagedLog::LOGGER->LogStart("FailedContextClr2Java::GetParentContext");
+					  IActiveContextClr2Java^ FailedContextClr2Java::GetParentContext() {
+						  ManagedLog::LOGGER->LogStart("FailedContextClr2Java::GetParentContext");
 
-						JNIEnv *env = RetrieveEnv(_jvm);
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassFailedContext = env->GetObjectClass(_jobjectFailedContext);
-						jfieldID jidParentContext = env->GetFieldID(jclassFailedContext, "parentContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
-						jobject jobjectParentContext = env->GetObjectField(_jobjectFailedContext, jidParentContext);
-						ManagedLog::LOGGER->LogStop("FailedContextClr2Java::GetParentContext");
+						  jclass jclassFailedContext = env->GetObjectClass(_jobjectFailedContext);
+						  jfieldID jidParentContext = env->GetFieldID(jclassFailedContext, "parentContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
+						  jobject jobjectParentContext = env->GetObjectField(_jobjectFailedContext, jidParentContext);
+						  ManagedLog::LOGGER->LogStop("FailedContextClr2Java::GetParentContext");
 
-						return gcnew ActiveContextClr2Java(env, jobjectParentContext);
-					}
+						  return gcnew ActiveContextClr2Java(env, jobjectParentContext);
+					  }
 
-					String^ FailedContextClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("FailedContextClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringContextId);
-					}
+					  String^ FailedContextClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("FailedContextClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringContextId);
+					  }
 
-					String^ FailedContextClr2Java::GetEvaluatorId() {
-						ManagedLog::LOGGER->Log("FailedContextClr2Java::GetEvaluatorId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringEvaluatorId);
-					}
+					  String^ FailedContextClr2Java::GetEvaluatorId() {
+						  ManagedLog::LOGGER->Log("FailedContextClr2Java::GetEvaluatorId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringEvaluatorId);
+					  }
 
-					String^ FailedContextClr2Java::GetParentId() {
-						ManagedLog::LOGGER->Log("FailedContextClr2Java::GetParentId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringParentContextId);
-					}
+					  String^ FailedContextClr2Java::GetParentId() {
+						  ManagedLog::LOGGER->Log("FailedContextClr2Java::GetParentId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringParentContextId);
+					  }
 
-					IEvaluatorDescriptor^ FailedContextClr2Java::GetEvaluatorDescriptor() {
-						ManagedLog::LOGGER->LogStart("FailedContextClr2Java::GetEvaluatorDescriptor");
-						return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectFailedContext, _jvm);
-					}
+					  IEvaluatorDescriptor^ FailedContextClr2Java::GetEvaluatorDescriptor() {
+						  ManagedLog::LOGGER->LogStart("FailedContextClr2Java::GetEvaluatorDescriptor");
+						  return CommonUtilities::RetrieveEvaluatorDescriptor(_jobjectFailedContext, _jvm);
+					  }
 
-					void FailedContextClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("FailedContextClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectFailedContext);
-					}
-				}
-			}
-		}
+					  void FailedContextClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("FailedContextClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectFailedContext);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedEvaluatorClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedEvaluatorClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedEvaluatorClr2Java.cpp
index 71f7a1b..615e09f 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedEvaluatorClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedEvaluatorClr2Java.cpp
@@ -22,53 +22,55 @@ using namespace JavaClrBridge;
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					FailedEvaluatorClr2Java::FailedEvaluatorClr2Java(JNIEnv *env, jobject jobjectFailedEvaluator) {
-						ManagedLog::LOGGER->LogStart("FailedEvaluatorClr2Java::FailedEvaluatorClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectFailedEvaluator = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectFailedEvaluator));
+					  FailedEvaluatorClr2Java::FailedEvaluatorClr2Java(JNIEnv *env, jobject jobjectFailedEvaluator) {
+						  ManagedLog::LOGGER->LogStart("FailedEvaluatorClr2Java::FailedEvaluatorClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectFailedEvaluator = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectFailedEvaluator));
 
-						jclass jclassFailedEvaluator = env->GetObjectClass(_jobjectFailedEvaluator);
-						jfieldID jidEvaluatorId = env->GetFieldID(jclassFailedEvaluator, "evaluatorId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedEvaluator, jidEvaluatorId)));
-						ManagedLog::LOGGER->LogStop("FailedEvaluatorClr2Java::FailedEvaluatorClr2Java");
-					}
+						  jclass jclassFailedEvaluator = env->GetObjectClass(_jobjectFailedEvaluator);
+						  jfieldID jidEvaluatorId = env->GetFieldID(jclassFailedEvaluator, "evaluatorId", "Ljava/lang/String;");
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectFailedEvaluator, jidEvaluatorId)));
+						  ManagedLog::LOGGER->LogStop("FailedEvaluatorClr2Java::FailedEvaluatorClr2Java");
+					  }
 
-					IEvaluatorRequestorClr2Java^ FailedEvaluatorClr2Java::GetEvaluatorRequestor() {
-						ManagedLog::LOGGER->LogStart("FailedEvaluatorClr2Java::GetEvaluatorRequestor");
-						JNIEnv *env = RetrieveEnv(_jvm);
+					  IEvaluatorRequestorClr2Java^ FailedEvaluatorClr2Java::GetEvaluatorRequestor() {
+						  ManagedLog::LOGGER->LogStart("FailedEvaluatorClr2Java::GetEvaluatorRequestor");
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassFailedEvaluator = env->GetObjectClass(_jobjectFailedEvaluator);
-						jfieldID jidEvaluatorRequestor = env->GetFieldID(jclassFailedEvaluator, "evaluatorRequestorBridge", "Lorg/apache/reef/javabridge/EvaluatorRequestorBridge;");
-						jobject jobjectEvaluatorRequestor = env->GetObjectField(_jobjectFailedEvaluator, jidEvaluatorRequestor);
-						ManagedLog::LOGGER->LogStop("FailedEvaluatorClr2Java::GetEvaluatorRequestor");
-						return gcnew EvaluatorRequestorClr2Java(env, jobjectEvaluatorRequestor);
-					}
+						  jclass jclassFailedEvaluator = env->GetObjectClass(_jobjectFailedEvaluator);
+						  jfieldID jidEvaluatorRequestor = env->GetFieldID(jclassFailedEvaluator, "evaluatorRequestorBridge", "Lorg/apache/reef/javabridge/EvaluatorRequestorBridge;");
+						  jobject jobjectEvaluatorRequestor = env->GetObjectField(_jobjectFailedEvaluator, jidEvaluatorRequestor);
+						  ManagedLog::LOGGER->LogStop("FailedEvaluatorClr2Java::GetEvaluatorRequestor");
+						  return gcnew EvaluatorRequestorClr2Java(env, jobjectEvaluatorRequestor);
+					  }
 
-					String^ FailedEvaluatorClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("FailedEvaluatorClr2Java::GetId");
+					  String^ FailedEvaluatorClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("FailedEvaluatorClr2Java::GetId");
 
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
 
-					void FailedEvaluatorClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("FailedEvaluatorClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectFailedEvaluator);
-					}
-				}
-			}
-		}
+					  void FailedEvaluatorClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("FailedEvaluatorClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectFailedEvaluator);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedTaskClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedTaskClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedTaskClr2Java.cpp
index 15db236..b27b13d 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedTaskClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/FailedTaskClr2Java.cpp
@@ -20,62 +20,64 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					FailedTaskClr2Java::FailedTaskClr2Java(JNIEnv *env, jobject jobjectFailedTask) {
-						ManagedLog::LOGGER->LogStart("FailedTaskClr2Java::AllocatedEvaluatorClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectFailedTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectFailedTask));
-						ManagedLog::LOGGER->LogStop("FailedTaskClr2Java::AllocatedEvaluatorClr2Java");
-					}
+					  FailedTaskClr2Java::FailedTaskClr2Java(JNIEnv *env, jobject jobjectFailedTask) {
+						  ManagedLog::LOGGER->LogStart("FailedTaskClr2Java::AllocatedEvaluatorClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectFailedTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectFailedTask));
+						  ManagedLog::LOGGER->LogStop("FailedTaskClr2Java::AllocatedEvaluatorClr2Java");
+					  }
 
-					IActiveContextClr2Java^ FailedTaskClr2Java::GetActiveContext() {
-						ManagedLog::LOGGER->LogStart("FailedTaskClr2Java::GetActiveContext");
+					  IActiveContextClr2Java^ FailedTaskClr2Java::GetActiveContext() {
+						  ManagedLog::LOGGER->LogStart("FailedTaskClr2Java::GetActiveContext");
 
-						JNIEnv *env = RetrieveEnv(_jvm);
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassFailedTask = env->GetObjectClass(_jobjectFailedTask);
-						jfieldID jidActiveContext = env->GetFieldID(jclassFailedTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
-						jobject jobjectActiveContext = env->GetObjectField(_jobjectFailedTask, jidActiveContext);
+						  jclass jclassFailedTask = env->GetObjectClass(_jobjectFailedTask);
+						  jfieldID jidActiveContext = env->GetFieldID(jclassFailedTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
+						  jobject jobjectActiveContext = env->GetObjectField(_jobjectFailedTask, jidActiveContext);
 
-						ManagedLog::LOGGER->LogStop("FailedTaskClr2Java::GetActiveContext");
-						return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
-					}
+						  ManagedLog::LOGGER->LogStop("FailedTaskClr2Java::GetActiveContext");
+						  return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
+					  }
 
-					String^ FailedTaskClr2Java::GetString() {
-						ManagedLog::LOGGER->LogStart("FailedTaskClr2Java::GetString");
-						JNIEnv *env = RetrieveEnv(_jvm);
+					  String^ FailedTaskClr2Java::GetString() {
+						  ManagedLog::LOGGER->LogStart("FailedTaskClr2Java::GetString");
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassFailedTask = env->GetObjectClass (_jobjectFailedTask);
-						jmethodID jmidGetFailedTaskString = env->GetMethodID(jclassFailedTask, "getFailedTaskString", "()Ljava/lang/String;");
+						  jclass jclassFailedTask = env->GetObjectClass(_jobjectFailedTask);
+						  jmethodID jmidGetFailedTaskString = env->GetMethodID(jclassFailedTask, "getFailedTaskString", "()Ljava/lang/String;");
 
-						if (jmidGetFailedTaskString == NULL) {
-							ManagedLog::LOGGER->LogStart("jmidGetFailedTaskString is NULL");
-							return nullptr;
-						}
-						jstring jFailedTaskString = (jstring)env -> CallObjectMethod(
-																					_jobjectFailedTask,
-																					jmidGetFailedTaskString);
-						ManagedLog::LOGGER->LogStop("FailedTaskClr2Java::GetString");
-						return ManagedStringFromJavaString(env, jFailedTaskString);
-					}
+						  if (jmidGetFailedTaskString == NULL) {
+							  ManagedLog::LOGGER->LogStart("jmidGetFailedTaskString is NULL");
+							  return nullptr;
+						  }
+						  jstring jFailedTaskString = (jstring)env->CallObjectMethod(
+							  _jobjectFailedTask,
+							  jmidGetFailedTaskString);
+						  ManagedLog::LOGGER->LogStop("FailedTaskClr2Java::GetString");
+						  return ManagedStringFromJavaString(env, jFailedTaskString);
+					  }
 
-					void FailedTaskClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("FailedTaskClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectFailedTask);
-					}
-				}
-			}
-		}
+					  void FailedTaskClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("FailedTaskClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectFailedTask);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/HttpServerClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/HttpServerClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/HttpServerClr2Java.cpp
index 78ab38a..f8a819d 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/HttpServerClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/HttpServerClr2Java.cpp
@@ -20,118 +20,120 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					HttpServerClr2Java::HttpServerClr2Java(JNIEnv *env, jobject jhttpServerEventBridge) {
-						ManagedLog::LOGGER->LogStart("HttpServerClr2Java::HttpServerClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jhttpServerEventBridge = reinterpret_cast<jobject>(env->NewGlobalRef(jhttpServerEventBridge));
-						ManagedLog::LOGGER->LogStop("HttpServerClr2Java::HttpServerClr2Java");
-					}
+					  HttpServerClr2Java::HttpServerClr2Java(JNIEnv *env, jobject jhttpServerEventBridge) {
+						  ManagedLog::LOGGER->LogStart("HttpServerClr2Java::HttpServerClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jhttpServerEventBridge = reinterpret_cast<jobject>(env->NewGlobalRef(jhttpServerEventBridge));
+						  ManagedLog::LOGGER->LogStop("HttpServerClr2Java::HttpServerClr2Java");
+					  }
 
-					String^ HttpServerClr2Java::GetQueryString() {
-						ManagedLog::LOGGER->LogStart("HttpServerClr2Java::GetQueryString");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclasshttpServerEventBridge = env->GetObjectClass (_jhttpServerEventBridge);
-						jmethodID jmidgetQueryString = env->GetMethodID(jclasshttpServerEventBridge, "getQueryString", "()Ljava/lang/String;");
-						if (jmidgetQueryString == NULL) {
-							fprintf(stdout, " jmidgetQueryString is NULL\n");
-							fflush (stdout);
-							return nullptr;
-						}
-						jstring jQueryString = (jstring) env->CallObjectMethod(
-																		 _jhttpServerEventBridge,
-																		 jmidgetQueryString);
+					  String^ HttpServerClr2Java::GetQueryString() {
+						  ManagedLog::LOGGER->LogStart("HttpServerClr2Java::GetQueryString");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclasshttpServerEventBridge = env->GetObjectClass(_jhttpServerEventBridge);
+						  jmethodID jmidgetQueryString = env->GetMethodID(jclasshttpServerEventBridge, "getQueryString", "()Ljava/lang/String;");
+						  if (jmidgetQueryString == NULL) {
+							  fprintf(stdout, " jmidgetQueryString is NULL\n");
+							  fflush(stdout);
+							  return nullptr;
+						  }
+						  jstring jQueryString = (jstring)env->CallObjectMethod(
+							  _jhttpServerEventBridge,
+							  jmidgetQueryString);
 
-						ManagedLog::LOGGER->LogStop("HttpServerClr2Java::GetQueryString");
-						return ManagedStringFromJavaString(env, jQueryString);
-					}
+						  ManagedLog::LOGGER->LogStop("HttpServerClr2Java::GetQueryString");
+						  return ManagedStringFromJavaString(env, jQueryString);
+					  }
 
-					array<byte>^ HttpServerClr2Java::GetQueryRequestData() {
-						ManagedLog::LOGGER->LogStart("HttpServerClr2Java::GetQueryRequestData");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclasshttpServerEventBridge = env->GetObjectClass (_jhttpServerEventBridge);
-						jmethodID jmidgetQueryBytes = env->GetMethodID(jclasshttpServerEventBridge, "getQueryRequestData", "()[B");
+					  array<byte>^ HttpServerClr2Java::GetQueryRequestData() {
+						  ManagedLog::LOGGER->LogStart("HttpServerClr2Java::GetQueryRequestData");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclasshttpServerEventBridge = env->GetObjectClass(_jhttpServerEventBridge);
+						  jmethodID jmidgetQueryBytes = env->GetMethodID(jclasshttpServerEventBridge, "getQueryRequestData", "()[B");
 
-						if (jmidgetQueryBytes == NULL) {
-							ManagedLog::LOGGER->Log("jmidgetQueryBytes is NULL");
-							return nullptr;
-						}
-						jbyteArray jQueryBytes = (jbyteArray) env->CallObjectMethod(
-																			 _jhttpServerEventBridge,
-																			 jmidgetQueryBytes);
+						  if (jmidgetQueryBytes == NULL) {
+							  ManagedLog::LOGGER->Log("jmidgetQueryBytes is NULL");
+							  return nullptr;
+						  }
+						  jbyteArray jQueryBytes = (jbyteArray)env->CallObjectMethod(
+							  _jhttpServerEventBridge,
+							  jmidgetQueryBytes);
 
-						ManagedLog::LOGGER->LogStop("HttpServerClr2Java::GetQueryRequestData");
-						return ManagedByteArrayFromJavaByteArray(env, jQueryBytes);
-					}
+						  ManagedLog::LOGGER->LogStop("HttpServerClr2Java::GetQueryRequestData");
+						  return ManagedByteArrayFromJavaByteArray(env, jQueryBytes);
+					  }
 
-					void HttpServerClr2Java::SetQueryResult(String^ queryResult) {
-						ManagedLog::LOGGER->LogStart("HttpServerClr2Java::SetQueryResult");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclasshttpServerEventBridge = env->GetObjectClass (_jhttpServerEventBridge);
-						jmethodID jmidsetQueryResult = env->GetMethodID(jclasshttpServerEventBridge, "setQueryResult", "(Ljava/lang/String;)V");
+					  void HttpServerClr2Java::SetQueryResult(String^ queryResult) {
+						  ManagedLog::LOGGER->LogStart("HttpServerClr2Java::SetQueryResult");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclasshttpServerEventBridge = env->GetObjectClass(_jhttpServerEventBridge);
+						  jmethodID jmidsetQueryResult = env->GetMethodID(jclasshttpServerEventBridge, "setQueryResult", "(Ljava/lang/String;)V");
 
-						if (jmidsetQueryResult == NULL) {
-							ManagedLog::LOGGER->Log("jmidsetQueryResult is NULL");
-							return;
-						}
-						env->CallObjectMethod(
-							_jhttpServerEventBridge,
-							jmidsetQueryResult,
-							JavaStringFromManagedString(env, queryResult));
-						ManagedLog::LOGGER->LogStop("HttpServerClr2Java::SetQueryResult");
-					}
+						  if (jmidsetQueryResult == NULL) {
+							  ManagedLog::LOGGER->Log("jmidsetQueryResult is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jhttpServerEventBridge,
+							  jmidsetQueryResult,
+							  JavaStringFromManagedString(env, queryResult));
+						  ManagedLog::LOGGER->LogStop("HttpServerClr2Java::SetQueryResult");
+					  }
 
-					void HttpServerClr2Java::SetQueryResponseData(array<byte>^ queryResponseData) {
-						ManagedLog::LOGGER->LogStart("HttpServerClr2Java::SetQueryResponseData");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclasshttpServerEventBridge = env->GetObjectClass (_jhttpServerEventBridge);
-						jmethodID jmidsetQueryResult = env->GetMethodID(jclasshttpServerEventBridge, "setQueryResponseData", "([B)V");
+					  void HttpServerClr2Java::SetQueryResponseData(array<byte>^ queryResponseData) {
+						  ManagedLog::LOGGER->LogStart("HttpServerClr2Java::SetQueryResponseData");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclasshttpServerEventBridge = env->GetObjectClass(_jhttpServerEventBridge);
+						  jmethodID jmidsetQueryResult = env->GetMethodID(jclasshttpServerEventBridge, "setQueryResponseData", "([B)V");
 
-						if (jmidsetQueryResult == NULL) {
-							ManagedLog::LOGGER->Log("jmidsetQueryResult is NULL");
-							return;
-						}
-						env->CallObjectMethod(
-							_jhttpServerEventBridge,
-							jmidsetQueryResult,
-							JavaByteArrayFromManagedByteArray(env, queryResponseData));
-						ManagedLog::LOGGER->LogStop("HttpServerClr2Java::SetQueryResponseData");
-					}
+						  if (jmidsetQueryResult == NULL) {
+							  ManagedLog::LOGGER->Log("jmidsetQueryResult is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jhttpServerEventBridge,
+							  jmidsetQueryResult,
+							  JavaByteArrayFromManagedByteArray(env, queryResponseData));
+						  ManagedLog::LOGGER->LogStop("HttpServerClr2Java::SetQueryResponseData");
+					  }
 
-					void HttpServerClr2Java::SetUriSpecification(String^ uriSpecification) {
-						ManagedLog::LOGGER->LogStart("HttpServerClr2Java::SetUriSpecification");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclasshttpServerEventBridge = env->GetObjectClass (_jhttpServerEventBridge);
-						jmethodID jmidsetUriSpecification = env->GetMethodID(jclasshttpServerEventBridge, "setUriSpecification", "(Ljava/lang/String;)V");
+					  void HttpServerClr2Java::SetUriSpecification(String^ uriSpecification) {
+						  ManagedLog::LOGGER->LogStart("HttpServerClr2Java::SetUriSpecification");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclasshttpServerEventBridge = env->GetObjectClass(_jhttpServerEventBridge);
+						  jmethodID jmidsetUriSpecification = env->GetMethodID(jclasshttpServerEventBridge, "setUriSpecification", "(Ljava/lang/String;)V");
 
-						if (jmidsetUriSpecification == NULL) {
-							ManagedLog::LOGGER->Log("jmidsetUriSpecification is NULL");
-							return;
-						}
-						env->CallObjectMethod(
-							_jhttpServerEventBridge,
-							jmidsetUriSpecification,
-							JavaStringFromManagedString(env, uriSpecification));
-						ManagedLog::LOGGER->LogStop("HttpServerClr2Java::SetUriSpecification");
-					}
+						  if (jmidsetUriSpecification == NULL) {
+							  ManagedLog::LOGGER->Log("jmidsetUriSpecification is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jhttpServerEventBridge,
+							  jmidsetUriSpecification,
+							  JavaStringFromManagedString(env, uriSpecification));
+						  ManagedLog::LOGGER->LogStop("HttpServerClr2Java::SetUriSpecification");
+					  }
 
-					void HttpServerClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("HttpServerClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jhttpServerEventBridge);
-					}
-				}
-			}
-		}
+					  void HttpServerClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("HttpServerClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jhttpServerEventBridge);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/JavaClrBridge.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/JavaClrBridge.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/JavaClrBridge.cpp
index 2bd5c74..2b8c7da 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/JavaClrBridge.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/JavaClrBridge.cpp
@@ -31,7 +31,7 @@ using namespace System::IO;
 using namespace System::Collections::Generic;
 using namespace System::Runtime::InteropServices;
 using namespace System::Reflection;
-using namespace Org::Apache::REEF::Driver::Bridge;
+using namespace Org::Apache::REEF::Driver::Bridge::Clr2java;
 
 ref class ManagedLog {
   internal:

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/RunningTaskClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/RunningTaskClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/RunningTaskClr2Java.cpp
index 0bf4b73..dfc8ae3 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/RunningTaskClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/RunningTaskClr2Java.cpp
@@ -20,73 +20,75 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
-					RunningTaskClr2Java::RunningTaskClr2Java(JNIEnv *env, jobject jobjectRunningTask) {
-						ManagedLog::LOGGER->LogStart("RunningTaskClr2Java::RunningTaskClr2Java");
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
+					  RunningTaskClr2Java::RunningTaskClr2Java(JNIEnv *env, jobject jobjectRunningTask) {
+						  ManagedLog::LOGGER->LogStart("RunningTaskClr2Java::RunningTaskClr2Java");
 
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectRunningTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectRunningTask));
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectRunningTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectRunningTask));
 
-						jclass jclassRunningTask = env->GetObjectClass (_jobjectRunningTask);
-						jmethodID jmidGetId = env->GetMethodID(jclassRunningTask, "getId", "()Ljava/lang/String;");
+						  jclass jclassRunningTask = env->GetObjectClass(_jobjectRunningTask);
+						  jmethodID jmidGetId = env->GetMethodID(jclassRunningTask, "getId", "()Ljava/lang/String;");
 
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env -> CallObjectMethod(_jobjectRunningTask, jmidGetId)));
-						ManagedLog::LOGGER->LogStop("RunningTaskClr2Java::RunningTaskClr2Java");
-					}
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->CallObjectMethod(_jobjectRunningTask, jmidGetId)));
+						  ManagedLog::LOGGER->LogStop("RunningTaskClr2Java::RunningTaskClr2Java");
+					  }
 
-					IActiveContextClr2Java^ RunningTaskClr2Java::GetActiveContext() {
-						ManagedLog::LOGGER->LogStart("RunningTaskClr2Java::GetActiveContext");
+					  IActiveContextClr2Java^ RunningTaskClr2Java::GetActiveContext() {
+						  ManagedLog::LOGGER->LogStart("RunningTaskClr2Java::GetActiveContext");
 
-						JNIEnv *env = RetrieveEnv(_jvm);
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassRunningTask = env->GetObjectClass(_jobjectRunningTask);
-						jfieldID jidActiveContext = env->GetFieldID(jclassRunningTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
-						jobject jobjectActiveContext = env->GetObjectField(_jobjectRunningTask, jidActiveContext);
-						ManagedLog::LOGGER->LogStop("RunningTaskClr2Java::GetActiveContext");
+						  jclass jclassRunningTask = env->GetObjectClass(_jobjectRunningTask);
+						  jfieldID jidActiveContext = env->GetFieldID(jclassRunningTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
+						  jobject jobjectActiveContext = env->GetObjectField(_jobjectRunningTask, jidActiveContext);
+						  ManagedLog::LOGGER->LogStop("RunningTaskClr2Java::GetActiveContext");
 
-						return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
-					}
+						  return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
+					  }
 
-					String^ RunningTaskClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("RunningTaskClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
+					  String^ RunningTaskClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("RunningTaskClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
 
-					void RunningTaskClr2Java::Send(array<byte>^ message) {
-						ManagedLog::LOGGER->LogStart("RunningTaskClr2Java::Send");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassRunningTask = env->GetObjectClass(_jobjectRunningTask);
-						jmethodID jmidSend = env->GetMethodID(jclassRunningTask, "send", "([B)V");
+					  void RunningTaskClr2Java::Send(array<byte>^ message) {
+						  ManagedLog::LOGGER->LogStart("RunningTaskClr2Java::Send");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassRunningTask = env->GetObjectClass(_jobjectRunningTask);
+						  jmethodID jmidSend = env->GetMethodID(jclassRunningTask, "send", "([B)V");
 
 
-						if (jmidSend == NULL) {
-							ManagedLog::LOGGER->Log("jmidSend is NULL");
-							return;
-						}
-						env->CallObjectMethod(
-							_jobjectRunningTask,
-							jmidSend,
-							JavaByteArrayFromManagedByteArray(env, message));
-						ManagedLog::LOGGER->LogStop("RunningTaskClr2Java::Send");
-					}
+						  if (jmidSend == NULL) {
+							  ManagedLog::LOGGER->Log("jmidSend is NULL");
+							  return;
+						  }
+						  env->CallObjectMethod(
+							  _jobjectRunningTask,
+							  jmidSend,
+							  JavaByteArrayFromManagedByteArray(env, message));
+						  ManagedLog::LOGGER->LogStop("RunningTaskClr2Java::Send");
+					  }
 
-					void RunningTaskClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("RunningTaskClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectRunningTask);
-					}
-				}
-			}
-		}
+					  void RunningTaskClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("RunningTaskClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectRunningTask);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/SuspendedTaskClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/SuspendedTaskClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/SuspendedTaskClr2Java.cpp
index e03aa57..e052d24 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/SuspendedTaskClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/SuspendedTaskClr2Java.cpp
@@ -20,66 +20,68 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					SuspendedTaskClr2Java::SuspendedTaskClr2Java(JNIEnv *env, jobject jobjectSuspendedTask) {
-						ManagedLog::LOGGER->LogStart("SuspendedTaskClr2Java::SuspendedTaskClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectSuspendedTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectSuspendedTask));
+					  SuspendedTaskClr2Java::SuspendedTaskClr2Java(JNIEnv *env, jobject jobjectSuspendedTask) {
+						  ManagedLog::LOGGER->LogStart("SuspendedTaskClr2Java::SuspendedTaskClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectSuspendedTask = reinterpret_cast<jobject>(env->NewGlobalRef(jobjectSuspendedTask));
 
-						jclass jclassSuspendedTask = env->GetObjectClass (_jobjectSuspendedTask);
-						jfieldID jidTaskId = env->GetFieldID(jclassSuspendedTask, "taskId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectSuspendedTask, jidTaskId)));
-						ManagedLog::LOGGER->LogStop("SuspendedTaskClr2Java::SuspendedTaskClr2Java");
-					}
+						  jclass jclassSuspendedTask = env->GetObjectClass(_jobjectSuspendedTask);
+						  jfieldID jidTaskId = env->GetFieldID(jclassSuspendedTask, "taskId", "Ljava/lang/String;");
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectSuspendedTask, jidTaskId)));
+						  ManagedLog::LOGGER->LogStop("SuspendedTaskClr2Java::SuspendedTaskClr2Java");
+					  }
 
-					IActiveContextClr2Java^ SuspendedTaskClr2Java::GetActiveContext() {
-						ManagedLog::LOGGER->LogStart("SuspendedTaskClr2Java::GetActiveContext");
-						JNIEnv *env = RetrieveEnv(_jvm);
+					  IActiveContextClr2Java^ SuspendedTaskClr2Java::GetActiveContext() {
+						  ManagedLog::LOGGER->LogStart("SuspendedTaskClr2Java::GetActiveContext");
+						  JNIEnv *env = RetrieveEnv(_jvm);
 
-						jclass jclassSuspendedTask = env->GetObjectClass (_jobjectSuspendedTask);
-						jfieldID jidActiveContext = env->GetFieldID(jclassSuspendedTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
-						jobject jobjectActiveContext = env->GetObjectField(_jobjectSuspendedTask, jidActiveContext);
-						ManagedLog::LOGGER->LogStop("SuspendedTaskClr2Java::GetActiveContext");
-						return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
-					}
+						  jclass jclassSuspendedTask = env->GetObjectClass(_jobjectSuspendedTask);
+						  jfieldID jidActiveContext = env->GetFieldID(jclassSuspendedTask, "jactiveContext", "Lorg/apache/reef/javabridge/ActiveContextBridge;");
+						  jobject jobjectActiveContext = env->GetObjectField(_jobjectSuspendedTask, jidActiveContext);
+						  ManagedLog::LOGGER->LogStop("SuspendedTaskClr2Java::GetActiveContext");
+						  return gcnew ActiveContextClr2Java(env, jobjectActiveContext);
+					  }
 
-					String^ SuspendedTaskClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("SuspendedTaskClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
+					  String^ SuspendedTaskClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("SuspendedTaskClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
 
-					array<byte>^ SuspendedTaskClr2Java::Get() {
-						ManagedLog::LOGGER->Log("SuspendedTaskClr2Java::Get");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						jclass jclassSuspendedTask = env->GetObjectClass (_jobjectSuspendedTask);
-						jmethodID jmidGet = env->GetMethodID(jclassSuspendedTask, "get", "()[B");
+					  array<byte>^ SuspendedTaskClr2Java::Get() {
+						  ManagedLog::LOGGER->Log("SuspendedTaskClr2Java::Get");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  jclass jclassSuspendedTask = env->GetObjectClass(_jobjectSuspendedTask);
+						  jmethodID jmidGet = env->GetMethodID(jclassSuspendedTask, "get", "()[B");
 
-						if (jmidGet == NULL) {
-							ManagedLog::LOGGER->Log("jmidGet is NULL");
-							return nullptr;
-						}
-						jbyteArray jMessage = (jbyteArray) env->CallObjectMethod(_jobjectSuspendedTask, jmidGet);
-						return ManagedByteArrayFromJavaByteArray(env, jMessage);
-					}
+						  if (jmidGet == NULL) {
+							  ManagedLog::LOGGER->Log("jmidGet is NULL");
+							  return nullptr;
+						  }
+						  jbyteArray jMessage = (jbyteArray)env->CallObjectMethod(_jobjectSuspendedTask, jmidGet);
+						  return ManagedByteArrayFromJavaByteArray(env, jMessage);
+					  }
 
-					void SuspendedTaskClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("SuspendedTaskClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectSuspendedTask);
-					}
-				}
-			}
-		}
+					  void SuspendedTaskClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("SuspendedTaskClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectSuspendedTask);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/TaskMessageClr2Java.cpp
----------------------------------------------------------------------
diff --git a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/TaskMessageClr2Java.cpp b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/TaskMessageClr2Java.cpp
index 57834b7..1ee79e9 100644
--- a/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/TaskMessageClr2Java.cpp
+++ b/lang/cpp/reef-bridge-clr/src/main/Cpp/CppBridge/JavaClrBridge/TaskMessageClr2Java.cpp
@@ -20,41 +20,43 @@
 
 namespace Org {
   namespace Apache {
-		namespace REEF {
-			namespace Driver {
-				namespace Bridge {
-					ref class ManagedLog {
-						internal:
-							static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
-					};
+	  namespace REEF {
+		  namespace Driver {
+			  namespace Bridge {
+				  namespace Clr2java {
+					  ref class ManagedLog {
+					  internal:
+						  static BridgeLogger^ LOGGER = BridgeLogger::GetLogger("<C++>");
+					  };
 
-					TaskMessageClr2Java::TaskMessageClr2Java(JNIEnv *env, jobject jtaskMessage) {
-						ManagedLog::LOGGER->LogStart("TaskMessageClr2Java::TaskMessageClr2Java");
-						pin_ptr<JavaVM*> pJavaVm = &_jvm;
-						if (env->GetJavaVM(pJavaVm) != 0) {
-							ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
-						}
-						_jobjectTaskMessage = reinterpret_cast<jobject>(env->NewGlobalRef(jtaskMessage));
+					  TaskMessageClr2Java::TaskMessageClr2Java(JNIEnv *env, jobject jtaskMessage) {
+						  ManagedLog::LOGGER->LogStart("TaskMessageClr2Java::TaskMessageClr2Java");
+						  pin_ptr<JavaVM*> pJavaVm = &_jvm;
+						  if (env->GetJavaVM(pJavaVm) != 0) {
+							  ManagedLog::LOGGER->LogError("Failed to get JavaVM", nullptr);
+						  }
+						  _jobjectTaskMessage = reinterpret_cast<jobject>(env->NewGlobalRef(jtaskMessage));
 
-						jclass jclassTaskMessage = env->GetObjectClass (_jobjectTaskMessage);
-						jfieldID jidTaskId = env->GetFieldID(jclassTaskMessage, "taskId", "Ljava/lang/String;");
-						_jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectTaskMessage, jidTaskId)));
-						ManagedLog::LOGGER->LogStop("TaskMessageClr2Java::TaskMessageClr2Java");
-					}
+						  jclass jclassTaskMessage = env->GetObjectClass(_jobjectTaskMessage);
+						  jfieldID jidTaskId = env->GetFieldID(jclassTaskMessage, "taskId", "Ljava/lang/String;");
+						  _jstringId = reinterpret_cast<jstring>(env->NewGlobalRef(env->GetObjectField(_jobjectTaskMessage, jidTaskId)));
+						  ManagedLog::LOGGER->LogStop("TaskMessageClr2Java::TaskMessageClr2Java");
+					  }
 
-					void TaskMessageClr2Java::OnError(String^ message) {
-						ManagedLog::LOGGER->Log("TaskMessageClr2Java::OnError");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						HandleClr2JavaError(env, message, _jobjectTaskMessage);
-					}
+					  void TaskMessageClr2Java::OnError(String^ message) {
+						  ManagedLog::LOGGER->Log("TaskMessageClr2Java::OnError");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  HandleClr2JavaError(env, message, _jobjectTaskMessage);
+					  }
 
-					String^ TaskMessageClr2Java::GetId() {
-						ManagedLog::LOGGER->Log("TaskMessageClr2Java::GetId");
-						JNIEnv *env = RetrieveEnv(_jvm);
-						return ManagedStringFromJavaString(env, _jstringId);
-					}
-				}
-			}
-		}
+					  String^ TaskMessageClr2Java::GetId() {
+						  ManagedLog::LOGGER->Log("TaskMessageClr2Java::GetId");
+						  JNIEnv *env = RetrieveEnv(_jvm);
+						  return ManagedStringFromJavaString(env, _jstringId);
+					  }
+				  }
+			  }
+		  }
+	  }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Client/CLRBridgeClient.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Client/CLRBridgeClient.cs b/lang/cs/Org.Apache.REEF.Client/CLRBridgeClient.cs
index 9dbd970..84e5b68 100644
--- a/lang/cs/Org.Apache.REEF.Client/CLRBridgeClient.cs
+++ b/lang/cs/Org.Apache.REEF.Client/CLRBridgeClient.cs
@@ -19,7 +19,6 @@
 
 using Org.Apache.REEF.Common.Evaluator;
 using Org.Apache.REEF.Driver;
-using Org.Apache.REEF.Driver.bridge;
 using Org.Apache.REEF.Driver.Bridge;
 using Org.Apache.REEF.Driver.Defaults;
 using Org.Apache.REEF.Examples.HelloCLRBridge.Handlers;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Api/AbstractFailure.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Api/AbstractFailure.cs b/lang/cs/Org.Apache.REEF.Common/Api/AbstractFailure.cs
new file mode 100644
index 0000000..50fd6b7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Api/AbstractFailure.cs
@@ -0,0 +1,142 @@
+/**
+ * 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.Utilities;
+using System;
+using System.Globalization;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Api
+{
+    public abstract class AbstractFailure : IFailure
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(AbstractFailure));
+
+        public AbstractFailure()
+        {
+        }
+
+        /// <summary>
+        /// Most detailed error message constructor that takes all parameters possible.
+        /// </summary>
+        /// <param name="id">Identifier of the entity that produced the error. Cannot be null.</param>
+        /// <param name="message">One-line error message. Cannot be null.</param>
+        /// <param name="description">Long error description. Can be null.</param>
+        /// <param name="cause">Exception that caused the error. Can be null.</param>
+        /// <param name="data">byte array that contains serialized version of the error. Can be null.</param>
+        public AbstractFailure(string id, string message, string description, Exception cause, byte[] data)
+        {
+            if (string.IsNullOrEmpty(id))
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("id"), LOGGER);
+            }
+            if (string.IsNullOrEmpty(message))
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("message"), LOGGER);
+            }
+            Id = id;
+            Message = message;
+            Description = Optional<string>.OfNullable(string.IsNullOrEmpty(description) ? GetStackTrace(cause) : description);
+            Cause = Optional<Exception>.OfNullable(cause);
+            Data = Optional<byte[]>.OfNullable(data);
+        }
+
+        /// <summary>
+        ///  Build error message given the entity ID and the short error message.
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="message"></param>
+        public AbstractFailure(string id, string message)
+            : this(id, message, null, null, null)
+        {
+        }
+
+        /// <summary>
+        ///  Build error message given the failed entity ID and  Exception.
+        ///  Populates the message with the Exception.getMessage() result, and stores
+        ///  the exception stack trace in the description.
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="cause"></param>
+        public AbstractFailure(string id, Exception cause)
+        {
+            if (string.IsNullOrEmpty(id))
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("id"), LOGGER);
+            }
+            Id = id;
+            Message = cause.Message;
+            Description = Optional<string>.Of(GetStackTrace(cause));
+            Cause = Optional<Exception>.Of(cause);
+            Data = Optional<byte[]>.Empty();
+        }
+
+        /// <summary>
+        /// Build error message given the entity ID plus short and long error message.
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="message"></param>
+        /// <param name="description"></param>
+        public AbstractFailure(string id, string message, string description)
+            : this(id, message, description, null, null)
+        {
+        }
+
+        /// <summary>
+        /// Identifier of the entity that produced the error. Cannot be null.
+        /// </summary>
+        public string Id { get; set; }
+
+        public string Message { get; set; }
+
+        public Optional<string> Description { get; set; }
+
+        public Optional<string> Reason { get; set; }
+
+        public Optional<Exception> Cause { get; set; }
+
+        public Optional<byte[]> Data { get; set; }
+
+        public Exception AsError()
+        {
+            return Cause.IsPresent() ? Cause.Value : new InvalidOperationException(ToString());
+        }
+
+        /// <summary>
+        ///  Helper function: produce the string that contains the given exception's stack trace. Returns null if the argument is null.
+        /// </summary>
+        /// <param name="ex"></param>
+        public string GetStackTrace(Exception ex)
+        {
+            if (ex == null)
+            {
+                return null;
+            }
+            else
+            {
+                return ex.StackTrace;
+            }
+        }
+
+        public override string ToString()
+        {
+            return string.Format(CultureInfo.InvariantCulture, "{0} with id={1} failed: {2}", GetType(), Id, Message);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Api/IAbstractFailure.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Api/IAbstractFailure.cs b/lang/cs/Org.Apache.REEF.Common/Api/IAbstractFailure.cs
new file mode 100644
index 0000000..fd94b62
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IAbstractFailure.cs
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Api
+{
+    public interface IAbstractFailure : IFailure
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Api/IFailure.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Api/IFailure.cs b/lang/cs/Org.Apache.REEF.Common/Api/IFailure.cs
new file mode 100644
index 0000000..454bdf4
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IFailure.cs
@@ -0,0 +1,57 @@
+/**
+ * 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.Utilities;
+using System;
+
+namespace Org.Apache.REEF.Common.Api
+{
+    /// <summary>
+    /// Common interface for all error messages in REEF.
+    /// Most of its functionality is generic and implemented in the AbstractFailure class.
+    /// </summary>
+    public interface IFailure : IIdentifiable
+    {
+        /// <summary>
+        /// One-line error message. Should never be null.
+        /// </summary>
+        string Message { get; set; }
+
+        /// <summary>
+        ///  Optional long error description.
+        /// </summary>
+        Optional<string> Description { get; set; }
+
+        /// <summary>
+        /// Exception that caused the error, or null.
+        /// </summary>
+        Optional<string> Reason { get; set; }
+
+        /// <summary>
+        /// Optional serialized version of the error message.
+        /// </summary>
+        Optional<byte[]> Data { get; set; }
+
+        /// <summary>
+        /// Return the original Java Exception, or generate a new one if it does not exists.
+        /// ALWAYS returns an exception, never null
+        /// </summary>
+        Exception AsError();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..f2fcd22
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IResourceLaunchHandler.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Common.Protobuf.ReefProtocol;
+
+namespace Org.Apache.REEF.Common.Api
+{
+    public interface IResourceLaunchHandler : IObserver<ResourceLaunchProto>
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..b02cc3d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IResourceReleaseHandler.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Common.Protobuf.ReefProtocol;
+
+namespace Org.Apache.REEF.Common.Api
+{
+    public interface IResourceReleaseHandler : IObserver<ResourceReleaseProto>
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..5038858
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Api/IResourceRequestHandler.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Common.Protobuf.ReefProtocol;
+
+namespace Org.Apache.REEF.Common.Api
+{
+    public interface IResourceRequestHandler : IObserver<ResourceRequestProto>
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Avro/AvroDriverInfo.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Avro/AvroDriverInfo.cs b/lang/cs/Org.Apache.REEF.Common/Avro/AvroDriverInfo.cs
new file mode 100644
index 0000000..2f0ae95
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Avro/AvroDriverInfo.cs
@@ -0,0 +1,65 @@
+//<auto-generated />
+namespace Org.Apache.REEF.Common.Avro
+{
+    using System.Collections.Generic;
+    using System.Runtime.Serialization;
+
+    /// <summary>
+    /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroDriverInfo.
+    /// </summary>
+    [DataContract(Namespace = "org.apache.reef.webserver")]
+    [KnownType(typeof(List<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo>))]
+    public partial class AvroDriverInfo
+    {
+        private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroDriverInfo"",""fields"":[{""name"":""remoteId"",""type"":""string""},{""name"":""startTime"",""type"":""string""},{""name"":""services"",""type"":{""type"":""array"",""items"":{""type"":""record"",""name"":""org.apache.reef.webserver.AvroReefServiceInfo"",""fields"":[{""name"":""serviceName"",""type"":""string""},{""name"":""serviceInfo"",""type"":""string""}]}}}]}";
+
+        /// <summary>
+        /// Gets the schema.
+        /// </summary>
+        public static string Schema
+        {
+            get
+            {
+                return JsonSchema;
+            }
+        }
+      
+        /// <summary>
+        /// Gets or sets the remoteId field.
+        /// </summary>
+        [DataMember]
+        public string remoteId { get; set; }
+              
+        /// <summary>
+        /// Gets or sets the startTime field.
+        /// </summary>
+        [DataMember]
+        public string startTime { get; set; }
+              
+        /// <summary>
+        /// Gets or sets the services field.
+        /// </summary>
+        [DataMember]
+        public IList<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo> services { get; set; }
+                
+        /// <summary>
+        /// Initializes a new instance of the <see cref="AvroDriverInfo"/> class.
+        /// </summary>
+        public AvroDriverInfo()
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="AvroDriverInfo"/> class.
+        /// </summary>
+        /// <param name="remoteId">The remoteId.</param>
+        /// <param name="startTime">The startTime.</param>
+        /// <param name="services">The services.</param>
+        public AvroDriverInfo(string remoteId, string startTime, IList<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo> services)
+        {
+            this.remoteId = remoteId;
+            this.startTime = startTime;
+            this.services = services;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpRequest.cs b/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpRequest.cs
new file mode 100644
index 0000000..3767c2b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpRequest.cs
@@ -0,0 +1,79 @@
+//<auto-generated />
+namespace Org.Apache.REEF.Common.Avro
+{
+    using System.Runtime.Serialization;
+
+    /// <summary>
+    /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroHttpRequest.
+    /// </summary>
+    [DataContract(Namespace = "org.apache.reef.webserver")]
+    public partial class AvroHttpRequest
+    {
+        private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroHttpRequest"",""fields"":[{""name"":""requestUrl"",""type"":""string""},{""name"":""pathInfo"",""type"":""string""},{""name"":""queryString"",""type"":""string""},{""name"":""httpMethod"",""type"":""string""},{""name"":""inputStream"",""type"":""bytes""}]}";
+
+        /// <summary>
+        /// Gets the schema.
+        /// </summary>
+        public static string Schema
+        {
+            get
+            {
+                return JsonSchema;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the requestUrl field.
+        /// </summary>
+        [DataMember]
+        public string RequestUrl { get; set; }
+
+        /// <summary>
+        /// Gets or sets the pathInfo field.
+        /// </summary>
+        [DataMember]
+        public string PathInfo { get; set; }
+
+        /// <summary>
+        /// Gets or sets the queryString field.
+        /// </summary>
+        [DataMember]
+        public string QueryString { get; set; }
+
+        /// <summary>
+        /// Gets or sets the httpMethod field.
+        /// </summary>
+        [DataMember]
+        public string HttpMethod { get; set; }
+
+        /// <summary>
+        /// Gets or sets the inputStream field.
+        /// </summary>
+        [DataMember]
+        public byte[] InputStream { get; set; }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="AvroHttpRequest"/> class.
+        /// </summary>
+        public AvroHttpRequest()
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="AvroHttpRequest"/> class.
+        /// </summary>
+        /// <param name="requestUrl">The requestUrl.</param>
+        /// <param name="pathInfo">The pathInfo.</param>
+        /// <param name="queryString">The queryString.</param>
+        /// <param name="httpMethod">The httpMethod.</param>
+        /// <param name="inputStream">The inputStream.</param>
+        public AvroHttpRequest(string requestUrl, string pathInfo, string queryString, string httpMethod, byte[] inputStream)
+        {
+            RequestUrl = requestUrl;
+            PathInfo = pathInfo;
+            QueryString = queryString;
+            HttpMethod = httpMethod;
+            InputStream = inputStream;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..2d1fb53
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Avro/AvroHttpSerializer.cs
@@ -0,0 +1,36 @@
+/**
+ * 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 Microsoft.Hadoop.Avro;
+using System.IO;
+
+namespace Org.Apache.REEF.Common.Avro
+{
+    public class AvroHttpSerializer
+    {
+        public static AvroHttpRequest FromBytes(byte[] serializedBytes)
+        {
+            var serializer = AvroSerializer.Create<AvroHttpRequest>();
+            using (var stream = new MemoryStream(serializedBytes))
+            {
+                return serializer.Deserialize(stream);
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Avro/AvroJsonSerializer.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Avro/AvroJsonSerializer.cs b/lang/cs/Org.Apache.REEF.Common/Avro/AvroJsonSerializer.cs
new file mode 100644
index 0000000..a3c0007
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Avro/AvroJsonSerializer.cs
@@ -0,0 +1,52 @@
+/**
+ * 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.Utilities;
+
+using Newtonsoft.Json;
+
+namespace Org.Apache.REEF.Common.Avro
+{
+    /// <summary>
+    /// Wrapper class for serialize/deserialize Avro json. This avoids having to reference Avro dll in every project 
+    /// </summary>
+    /// <typeparam name="T"> the deserialized type</typeparam>
+    public class AvroJsonSerializer<T>
+    {
+        public static T FromString(string str)
+        {
+            return JsonConvert.DeserializeObject<T>(str);
+        }
+
+        public static string ToString(T obj)
+        {
+            return JsonConvert.SerializeObject(obj);
+        }
+
+        public static T FromBytes(byte[] bytes)
+        {
+            return FromString(ByteUtilities.ByteArrarysToString(bytes));
+        }
+
+        public static byte[] ToBytes(T obj)
+        {
+            return ByteUtilities.StringToByteArrays(JsonConvert.SerializeObject(obj));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Avro/AvroReefServiceInfo.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Avro/AvroReefServiceInfo.cs b/lang/cs/Org.Apache.REEF.Common/Avro/AvroReefServiceInfo.cs
new file mode 100644
index 0000000..9b65c62
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Avro/AvroReefServiceInfo.cs
@@ -0,0 +1,55 @@
+//<auto-generated />
+namespace Org.Apache.REEF.Common.Avro
+{
+    using System.Runtime.Serialization;
+
+    /// <summary>
+    /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroReefServiceInfo.
+    /// </summary>
+    [DataContract(Namespace = "org.apache.reef.webserver")]
+    public partial class AvroReefServiceInfo
+    {
+        private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroReefServiceInfo"",""fields"":[{""name"":""serviceName"",""type"":""string""},{""name"":""serviceInfo"",""type"":""string""}]}";
+
+        /// <summary>
+        /// Gets the schema.
+        /// </summary>
+        public static string Schema
+        {
+            get
+            {
+                return JsonSchema;
+            }
+        }
+      
+        /// <summary>
+        /// Gets or sets the serviceName field.
+        /// </summary>
+        [DataMember]
+        public string serviceName { get; set; }
+              
+        /// <summary>
+        /// Gets or sets the serviceInfo field.
+        /// </summary>
+        [DataMember]
+        public string serviceInfo { get; set; }
+                
+        /// <summary>
+        /// Initializes a new instance of the <see cref="AvroReefServiceInfo"/> class.
+        /// </summary>
+        public AvroReefServiceInfo()
+        {
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="AvroReefServiceInfo"/> class.
+        /// </summary>
+        /// <param name="serviceName">The serviceName.</param>
+        /// <param name="serviceInfo">The serviceInfo.</param>
+        public AvroReefServiceInfo(string serviceName, string serviceInfo)
+        {
+            this.serviceName = serviceName;
+            this.serviceInfo = serviceInfo;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/CPU.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/CPU.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/CPU.cs
new file mode 100644
index 0000000..4a26a3c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/CPU.cs
@@ -0,0 +1,59 @@
+/**
+ * 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.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Catalog.Capabilities
+{
+    public class CPU : ICapability
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(CPU));
+
+        private int _cores;
+
+        public CPU(int cores)
+        {
+            if (cores <= 0)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("cores cannot be non-positive"), LOGGER);
+            }
+            _cores = cores;
+        }
+
+        public int Cores
+        {
+            get
+            {
+                return _cores;
+            }
+        }
+
+        public override string ToString()
+        {
+            return string.Format(CultureInfo.InvariantCulture, "CPU Cores = [{0}]", Cores);
+        }
+
+        public override int GetHashCode()
+        {
+            return Cores.GetHashCode();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/ICapability.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/ICapability.cs b/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/ICapability.cs
new file mode 100644
index 0000000..1d1b7da
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Catalog/Capabilities/ICapability.cs
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Catalog.Capabilities
+{
+    public interface ICapability
+    {
+    }
+}


[04/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpMessage.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpMessage.cs
deleted file mode 100644
index 155d7ab..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/IHttpMessage.cs
+++ /dev/null
@@ -1,33 +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.
- */
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IHttpMessage
-    {
-        string GetRequestString();
-        
-        void SetQueryResult(string responseString);
-
-        byte[] GetQueryReuestData();
-
-        void SetQueryResponseData(byte[] responseData);
-        
-        void SetUriSpecification(string uriSpecification);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpRequest.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpRequest.cs
deleted file mode 100644
index 97c0465..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpRequest.cs
+++ /dev/null
@@ -1,49 +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.Globalization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public enum HttpMethod
-    {
-        Post,
-        Put,
-        Get,
-        Delete
-    }
-
-    public class ReefHttpRequest
-    {
-        public HttpMethod Method { get; set; }
-
-        public string Url { get; set; }
-
-        public string Querystring { get; set; }
-
-        public byte[] InputStream { get; set; }
-
-        public string PathInfo { get; set; }
-
-        public string Tostring()
-        {
-            return string.Format(CultureInfo.InvariantCulture, "Url: {0}, query string {1}", Url, Querystring);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpResponse.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpResponse.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpResponse.cs
deleted file mode 100644
index 73b64cc..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/ReefHttpResponse.cs
+++ /dev/null
@@ -1,30 +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.Net;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class ReefHttpResponse
-    {
-        public byte[] OutputStream { get; set; }
-
-        public HttpStatusCode Status { get; set; }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IActiveContextClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IActiveContextClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IActiveContextClr2Java.cs
deleted file mode 100644
index 3a57b0a..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IActiveContextClr2Java.cs
+++ /dev/null
@@ -1,36 +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 Org.Apache.REEF.Driver.Evaluator;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IActiveContextClr2Java : IClr2Java
-    {
-        void SubmitTask(string taskConfigStr);
-        
-        void Close();
-
-        string GetId();
-
-        string GetEvaluatorId();
-
-        IEvaluatorDescriptor GetEvaluatorDescriptor();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IAllocatedEvaluaotrClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IAllocatedEvaluaotrClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IAllocatedEvaluaotrClr2Java.cs
deleted file mode 100644
index 9bf6c09..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IAllocatedEvaluaotrClr2Java.cs
+++ /dev/null
@@ -1,42 +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 Org.Apache.REEF.Driver.Evaluator;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IAllocatedEvaluaotrClr2Java : IClr2Java
-    {
-        void SubmitContextAndTask(string contextConfigStr, string taskConfigStr);
-
-        void SubmitContext(string contextConfigStr);
-
-        void SubmitContextAndService(string contextConfigStr, string serviceConfigStr);
-
-        void SubmitContextAndServiceAndTask(string contextConfigStr, string serviceConfigStr, string taskConfigStr);
-
-        void Close();
-
-        string GetId();
-
-        string GetNameServerInfo();
-
-        IEvaluatorDescriptor GetEvaluatorDescriptor();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClosedContextClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClosedContextClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClosedContextClr2Java.cs
deleted file mode 100644
index 88b1ca2..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClosedContextClr2Java.cs
+++ /dev/null
@@ -1,34 +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 Org.Apache.REEF.Driver.Evaluator;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IClosedContextClr2Java : IClr2Java
-    {        
-        string GetId();
-
-        string GetEvaluatorId();
-
-        IEvaluatorDescriptor GetEvaluatorDescriptor();
-
-        IActiveContextClr2Java GetParentContext();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClr2Java.cs
deleted file mode 100644
index ec565cd..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IClr2Java.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IClr2Java
-    {
-        void OnError(string message);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedEvaluatorClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedEvaluatorClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedEvaluatorClr2Java.cs
deleted file mode 100644
index a80c2fd..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedEvaluatorClr2Java.cs
+++ /dev/null
@@ -1,30 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface ICompletedEvaluatorClr2Java : IClr2Java
-    {
-        /// <summary>
-        /// evaluator id
-        /// </summary>
-        /// <returns>id of the completed evaluator</returns>
-        string GetId();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedTaskClr2Java.cs
deleted file mode 100644
index 25024b3..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ICompletedTaskClr2Java.cs
+++ /dev/null
@@ -1,28 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface ICompletedTaskClr2Java : IClr2Java
-    {
-        IActiveContextClr2Java GetActiveContext();
-        
-        string GetId();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IContextMessageClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IContextMessageClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IContextMessageClr2Java.cs
deleted file mode 100644
index c98f03e..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IContextMessageClr2Java.cs
+++ /dev/null
@@ -1,30 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IContextMessageClr2Java : IClr2Java
-    {
-        byte[] Get();
-
-        string GetId();
-
-        string GetMessageSourceId();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IEvaluatorRequestorClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IEvaluatorRequestorClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IEvaluatorRequestorClr2Java.cs
deleted file mode 100644
index 2ff1198..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IEvaluatorRequestorClr2Java.cs
+++ /dev/null
@@ -1,28 +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 Org.Apache.REEF.Driver.Evaluator;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IEvaluatorRequestorClr2Java : IClr2Java
-    {
-        void Submit(IEvaluatorRequest evaluatorRequest);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedContextClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedContextClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedContextClr2Java.cs
deleted file mode 100644
index db145aa..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedContextClr2Java.cs
+++ /dev/null
@@ -1,36 +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 Org.Apache.REEF.Driver.Evaluator;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IFailedContextClr2Java : IClr2Java
-    {        
-        string GetId();
-
-        string GetEvaluatorId();
-
-        string GetParentId();
-
-        IEvaluatorDescriptor GetEvaluatorDescriptor();
-
-        IActiveContextClr2Java GetParentContext();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedEvaluatorClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedEvaluatorClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedEvaluatorClr2Java.cs
deleted file mode 100644
index 2199ab3..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedEvaluatorClr2Java.cs
+++ /dev/null
@@ -1,30 +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 Org.Apache.REEF.Driver.Bridge;
-
-namespace Org.Apache.REEF.Driver
-{
-    public interface IFailedEvaluatorClr2Java
-    {
-        IEvaluatorRequestorClr2Java GetEvaluatorRequestor();
-
-        string GetId();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedTaskClr2Java.cs
deleted file mode 100644
index eb9c7a7..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IFailedTaskClr2Java.cs
+++ /dev/null
@@ -1,28 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IFailedTaskClr2Java : IClr2Java
-    {
-        IActiveContextClr2Java GetActiveContext();
-
-        string GetString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IHttpServerBridgeClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IHttpServerBridgeClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IHttpServerBridgeClr2Java.cs
deleted file mode 100644
index 816aa35..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IHttpServerBridgeClr2Java.cs
+++ /dev/null
@@ -1,34 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IHttpServerBridgeClr2Java : IClr2Java
-    {
-        string GetQueryString();
-
-        void SetQueryResult(string queryResult);
-
-        byte[] GetQueryRequestData();
-
-        void SetQueryResponseData(byte[] responseData);
-
-        void SetUriSpecification(string uriSpecification);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IRunningTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IRunningTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IRunningTaskClr2Java.cs
deleted file mode 100644
index 4afbf2a..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/IRunningTaskClr2Java.cs
+++ /dev/null
@@ -1,30 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface IRunningTaskClr2Java : IClr2Java
-    {
-        IActiveContextClr2Java GetActiveContext();
-
-        string GetId();
-
-        void Send(byte[] message);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ISuspendedTaskClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ISuspendedTaskClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ISuspendedTaskClr2Java.cs
deleted file mode 100644
index 612bc10..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ISuspendedTaskClr2Java.cs
+++ /dev/null
@@ -1,42 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface ISuspendedTaskClr2Java : IClr2Java
-    {
-        /// <summary>
-        /// get active context the task is running in
-        /// </summary>
-        /// <returns>active context</returns>
-        IActiveContextClr2Java GetActiveContext();
-
-        /// <summary>
-        /// get suspsended task id
-        /// </summary>
-        /// <returns>suspsended task id</returns>
-        string GetId();
-
-        /// <summary>
-        /// get the message
-        /// </summary>
-        /// <returns>suspended task message</returns>
-        byte[] Get();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ITaskMessageClr2Java.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ITaskMessageClr2Java.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ITaskMessageClr2Java.cs
deleted file mode 100644
index 62ba763..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/clr2java/ITaskMessageClr2Java.cs
+++ /dev/null
@@ -1,26 +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.
- */
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public interface ITaskMessageClr2Java : IClr2Java
-    {
-        string GetId();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/ActiveContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/ActiveContext.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/ActiveContext.cs
deleted file mode 100644
index 9236141..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/ActiveContext.cs
+++ /dev/null
@@ -1,117 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class ActiveContext : IActiveContext
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ActiveContext));
-
-        private readonly AvroConfigurationSerializer _serializer;
-
-        public ActiveContext(IActiveContextClr2Java clr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            Clr2Java = clr2Java;
-            _serializer = new AvroConfigurationSerializer();
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public string Id
-        {
-            get
-            {
-                return Clr2Java.GetId();
-            }
-
-            set
-            {
-            }
-        }
-
-        public string EvaluatorId
-        {
-            get
-            {
-                return Clr2Java.GetEvaluatorId();
-            }
-
-            set
-            {
-            }
-        }
-
-        public Optional<string> ParentId { get; set; }
-
-        public IEvaluatorDescriptor EvaluatorDescriptor
-        {
-            get
-            {
-                return Clr2Java.GetEvaluatorDescriptor();
-            }
-
-            set
-            {
-            }
-        }
-
-        private IActiveContextClr2Java Clr2Java { get; set; }
-
-        public void SubmitTask(IConfiguration taskConfiguration)
-        {
-            LOGGER.Log(Level.Info, "ActiveContext::SubmitTask");
-            string task = _serializer.ToString(taskConfiguration);
-            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
-            Clr2Java.SubmitTask(task);
-        }
-
-        public void Dispose()
-        {
-            LOGGER.Log(Level.Info, "ActiveContext::Dispose");
-            Clr2Java.Close();
-        }
-
-        public void SubmitContext(IConfiguration contextConfiguration)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void SendMessage(byte[] message)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 10175e3..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/AllocatedEvaluator.cs
+++ /dev/null
@@ -1,175 +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 Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Net;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class AllocatedEvaluator : IAllocatedEvaluator
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(AllocatedEvaluator));
-        
-        private readonly AvroConfigurationSerializer _serializer;
-
-        private IEvaluatorDescriptor _evaluatorDescriptor;
-
-        public AllocatedEvaluator(IAllocatedEvaluaotrClr2Java clr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            _serializer = new AvroConfigurationSerializer();
-            Clr2Java = clr2Java;
-            Id = Clr2Java.GetId();
-            ProcessNewEvaluator();
-
-            NameServerInfo = Clr2Java.GetNameServerInfo();
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public string Id { get; set; }
-
-        public string EvaluatorBatchId { get; set; }
-
-        public EvaluatorType Type { get; set; }
-
-        public string NameServerInfo { get; set; }
-
-        [DataMember]
-        private IAllocatedEvaluaotrClr2Java Clr2Java { get; set; }
-
-        public void SubmitContext(IConfiguration contextConfiguration)
-        {
-            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContext");
-            string context = _serializer.ToString(contextConfiguration);
-            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
-            Clr2Java.SubmitContext(context);
-        }
-
-        public void SubmitContextAndTask(IConfiguration contextConfiguration, IConfiguration taskConfiguration)
-        {
-            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContextAndTask");
-
-            string context = _serializer.ToString(contextConfiguration);
-            string task = _serializer.ToString(taskConfiguration);
-
-            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
-            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
-
-            Clr2Java.SubmitContextAndTask(context, task);
-        }
-
-        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
-        {
-            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContextAndService");
-
-            string context = _serializer.ToString(contextConfiguration);
-            string service = _serializer.ToString(serviceConfiguration);
-
-            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
-            LOGGER.Log(Level.Info, "serialized serviceConfiguration: " + service);
-
-            Clr2Java.SubmitContextAndService(context, service);
-        }
-
-        public void SubmitContextAndServiceAndTask(IConfiguration contextConfiguration, IConfiguration serviceConfiguration, IConfiguration taskConfiguration)
-        {
-            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContextAndServiceAndTask");
-
-            string context = _serializer.ToString(contextConfiguration);
-            string service = _serializer.ToString(serviceConfiguration);
-            string task = _serializer.ToString(taskConfiguration);
-
-            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
-            LOGGER.Log(Level.Info, "serialized serviceConfiguration: " + service);
-            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
-
-            Clr2Java.SubmitContextAndServiceAndTask(context, service, task);
-        }
-
-        public IEvaluatorDescriptor GetEvaluatorDescriptor()
-        {
-            return _evaluatorDescriptor;
-        }
-
-        public void Dispose()
-        {
-            Clr2Java.Close();
-        }
-
-        public INodeDescriptor GetNodeDescriptor()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void AddFile(string file)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void AddLibrary(string file)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void AddFileResource(string file)
-        {
-            throw new NotImplementedException();
-        }
-
-        private void ProcessNewEvaluator()
-        {
-            _evaluatorDescriptor = Clr2Java.GetEvaluatorDescriptor();
-            lock (EvaluatorRequestor.Evaluators)
-            {
-                foreach (KeyValuePair<string, IEvaluatorDescriptor> pair in EvaluatorRequestor.Evaluators)
-                {
-                    if (pair.Value.Equals(_evaluatorDescriptor))
-                    {
-                        string key = pair.Key;
-                        EvaluatorRequestor.Evaluators.Remove(key);
-                        string assignedId = key.Substring(0, key.LastIndexOf('_'));
-                        string message = string.Format(
-                            CultureInfo.InvariantCulture,
-                            "Received evalautor [{0}] of memory {1}MB that matches request of {2}MB with batch id [{3}].",
-                            Id,
-                            _evaluatorDescriptor.Memory,
-                            pair.Value.Memory,
-                            assignedId);
-
-                        LOGGER.Log(Level.Verbose, message);
-                        EvaluatorBatchId = assignedId;
-                        break;
-                    }
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/ClosedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/ClosedContext.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/ClosedContext.cs
deleted file mode 100644
index 9ea7d41..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/ClosedContext.cs
+++ /dev/null
@@ -1,98 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities;
-using System;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class ClosedContext : IClosedContext
-    {
-        private string _id;
-
-        private string _evaluatorId;
-
-        public ClosedContext(IClosedContextClr2Java clr2java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            _id = clr2java.GetId();
-            _evaluatorId = clr2java.GetEvaluatorId();
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public string Id
-        {
-            get
-            {
-                return _id;
-            }
-
-            set
-            {
-            }
-        }
-
-        public string EvaluatorId
-        {
-            get
-            {
-                return _evaluatorId;
-            }
-
-            set
-            {
-            }
-        }
-
-        public Optional<string> ParentId { get; set; }
-
-        public IEvaluatorDescriptor EvaluatorDescriptor
-        {
-            get
-            {
-                return ClosedContextClr2JavaClr2Java.GetEvaluatorDescriptor();
-            }
-
-            set
-            {
-            }
-        }
-
-        public IActiveContext ParentContext
-        {
-            get
-            {
-                return new ActiveContext(ParentContextClr2Java);
-            }
-
-            set
-            {
-            }
-        }
-
-        private IActiveContextClr2Java ParentContextClr2Java { get; set; }
-
-        private IClosedContextClr2Java ClosedContextClr2JavaClr2Java { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedEvaluator.cs
deleted file mode 100644
index 7c8866d..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedEvaluator.cs
+++ /dev/null
@@ -1,60 +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 Org.Apache.REEF.Driver.Evaluator;
-using System;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class CompletedEvaluator : ICompletedEvaluator
-    {
-        private string _instanceId;
-
-        public CompletedEvaluator(ICompletedEvaluatorClr2Java clr2Java)
-        {
-            _instanceId = Guid.NewGuid().ToString("N");
-            CompletedEvaluatorClr2Java = clr2Java;
-        }
-
-        [DataMember]
-        public string InstanceId
-        {
-            get { return _instanceId; }
-            set { _instanceId = value; }
-        }
-
-        [DataMember]
-        public string Id
-        {
-            get
-            {
-                return CompletedEvaluatorClr2Java.GetId();
-            }
-
-            set
-            {
-            }
-        }
-
-        [DataMember]
-        public ICompletedEvaluatorClr2Java CompletedEvaluatorClr2Java { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedTask.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedTask.cs
deleted file mode 100644
index c9cf19f..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/CompletedTask.cs
+++ /dev/null
@@ -1,75 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class CompletedTask : ICompletedTask
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(CompletedTask));
-
-        internal CompletedTask(ICompletedTaskClr2Java completedTaskClr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            CompletedTaskClr2Java = completedTaskClr2Java;
-            ActiveContextClr2Java = completedTaskClr2Java.GetActiveContext();
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public byte[] Message { get; set; }
-
-        public string Id
-        {
-            get
-            {
-                return CompletedTaskClr2Java.GetId();
-            }
-
-            set
-            {
-            }
-        }
-
-        public IActiveContext ActiveContext
-        {
-            get
-            {
-                return new ActiveContext(ActiveContextClr2Java);
-            }
-
-            set
-            {
-            }
-        }
-
-        [DataMember]
-        private ICompletedTaskClr2Java CompletedTaskClr2Java { get; set; }
-
-        [DataMember]
-        private IActiveContextClr2Java ActiveContextClr2Java { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/ContextMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/ContextMessage.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/ContextMessage.cs
deleted file mode 100644
index 4afbcdc..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/ContextMessage.cs
+++ /dev/null
@@ -1,53 +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 Org.Apache.REEF.Common.Context;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class ContextMessage : IContextMessage
-    {
-        private readonly string _messageSourcId;
-        private readonly byte[] _bytes;
-        private readonly string _id;
-
-        public ContextMessage(IContextMessageClr2Java clr2Java)
-        {
-            _messageSourcId = clr2Java.GetMessageSourceId();
-            _bytes = clr2Java.Get();
-            _id = clr2Java.GetId();
-        }
-
-        public string Id
-        {
-            get { return _id; }
-            set { }
-        }
-
-        public string MessageSourceId
-        {
-            get { return _messageSourcId; }
-        }
-
-        public byte[] Message
-        {
-            get { return _bytes; }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/EvaluatorRequstor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/EvaluatorRequstor.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/EvaluatorRequstor.cs
deleted file mode 100644
index f63c42a..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/EvaluatorRequstor.cs
+++ /dev/null
@@ -1,95 +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 Org.Apache.REEF.Common.Catalog;
-using Org.Apache.REEF.Common.Evaluator;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class EvaluatorRequestor : IEvaluatorRequestor
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorRequestor));
-
-        private static Dictionary<string, IEvaluatorDescriptor> _evaluators;
-        
-        public EvaluatorRequestor(IEvaluatorRequestorClr2Java clr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            Clr2Java = clr2Java;
-        }
-
-        public static Dictionary<string, IEvaluatorDescriptor> Evaluators
-        {
-            get
-            {
-                if (_evaluators == null)
-                {
-                    _evaluators = new Dictionary<string, IEvaluatorDescriptor>();
-                }
-                return _evaluators;
-            }
-        }
-
-        public IResourceCatalog ResourceCatalog { get; set; }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        [DataMember]
-        private IEvaluatorRequestorClr2Java Clr2Java { get; set; }
-
-        public void Submit(IEvaluatorRequest request)
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Submitting request for {0} evaluators and {1} MB memory and  {2} core to rack {3}.", request.Number, request.MemoryMegaBytes, request.VirtualCore, request.Rack));
-
-            lock (Evaluators)
-            {
-                for (int i = 0; i < request.Number; i++)
-                {
-                    EvaluatorDescriptorImpl descriptor = new EvaluatorDescriptorImpl(new NodeDescriptorImpl(), EvaluatorType.CLR, request.MemoryMegaBytes, request.VirtualCore);
-                    descriptor.Rack = request.Rack;
-                    string key = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", request.EvaluatorBatchId, i);
-                    try
-                    {
-                        _evaluators.Add(key, descriptor);
-                    }
-                    catch (ArgumentException e)
-                    {
-                        Exceptions.Caught(e, Level.Error, string.Format(CultureInfo.InvariantCulture, "EvaluatorBatchId [{0}] already exists.", key), LOGGER);
-                        Exceptions.Throw(new InvalidOperationException("Cannot use evaluator id " + key, e), LOGGER);
-                    }
-                }
-            }
-            
-            Clr2Java.Submit(request);
-        }
-
-        public void Dispose()
-        {
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedContext.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedContext.cs
deleted file mode 100644
index 9e0dcc2..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedContext.cs
+++ /dev/null
@@ -1,110 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class FailedContext : IFailedContext
-    {
-        private string _id;
-
-        private string _evaluatorId;
-
-        private string _parentId;
-
-        public FailedContext(IFailedContextClr2Java clr2Java)
-        {
-            _id = clr2Java.GetId();
-            _evaluatorId = clr2Java.GetEvaluatorId();
-            _parentId = clr2Java.GetParentId();
-            FailedContextClr2Java = clr2Java;
-        }
-
-        public string Id
-        {
-            get
-            {
-                return _id;
-            }
-
-            set
-            {
-            }
-        }
-
-        public string EvaluatorId
-        {
-            get
-            {
-                return _evaluatorId;
-            }
-
-            set
-            {
-            }
-        }
-
-        public Optional<string> ParentId
-        {
-            get
-            {
-                return string.IsNullOrEmpty(_parentId) ? 
-                    Optional<string>.Empty() : 
-                    Optional<string>.Of(_parentId);
-            }
-
-            set
-            {
-            }
-        }
-
-        public IEvaluatorDescriptor EvaluatorDescriptor
-        {
-            get
-            {
-                return FailedContextClr2Java.GetEvaluatorDescriptor();
-            }
-
-            set
-            {
-            }
-        }
-
-        public Optional<IActiveContext> ParentContext
-        {
-            get
-            {
-                IActiveContextClr2Java context = FailedContextClr2Java.GetParentContext();
-                if (context != null)
-                {
-                    return Optional<IActiveContext>.Of(new ActiveContext(context));
-                }
-                else
-                {
-                    return Optional<IActiveContext>.Empty();
-                }
-            }
-        }
-
-        private IFailedContextClr2Java FailedContextClr2Java { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index a21c071..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedEvaluator.cs
+++ /dev/null
@@ -1,72 +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 Org.Apache.REEF.Common.Exceptions;
-using Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Evaluator;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class FailedEvaluator : IFailedEvaluator
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(FailedEvaluator));
-
-        public FailedEvaluator(IFailedEvaluatorClr2Java clr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            FailedEvaluatorClr2Java = clr2Java;
-            EvaluatorRequestorClr2Java = FailedEvaluatorClr2Java.GetEvaluatorRequestor();
-            Id = FailedEvaluatorClr2Java.GetId();
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public string Id { get; set; }
-
-        public EvaluatorException EvaluatorException { get; set; }
-
-        public List<FailedContext> FailedContexts { get; set; }
-
-        public Optional<IFailedTask> FailedTask { get; set; }
-
-        [DataMember]
-        private IFailedEvaluatorClr2Java FailedEvaluatorClr2Java { get; set; }
-
-        [DataMember]
-        private IEvaluatorRequestorClr2Java EvaluatorRequestorClr2Java { get; set; }
-
-        public IEvaluatorRequestor GetEvaluatorRequetor()
-        {
-            if (EvaluatorRequestorClr2Java == null)
-            {
-                Exceptions.Throw(new InvalidOperationException("EvaluatorRequestorClr2Java not initialized."), LOGGER);
-            }
-            return new EvaluatorRequestor(EvaluatorRequestorClr2Java);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedTask.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedTask.cs
deleted file mode 100644
index 0e0623a..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/FailedTask.cs
+++ /dev/null
@@ -1,140 +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 Org.Apache.REEF.Driver.Context;
-using Org.Apache.REEF.Driver.Task;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Diagnostics;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class FailedTask : IFailedTask
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(FailedTask));
-        
-        public FailedTask(IFailedTaskClr2Java failedTaskClr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            Parse(failedTaskClr2Java);
-            FailedTaskClr2Java = failedTaskClr2Java;
-            ActiveContextClr2Java = failedTaskClr2Java.GetActiveContext();
-        }
-
-        public Optional<string> Reason { get; set; }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public string Id { get; set; }
-
-        public string Message { get; set; }
-
-        public Optional<string> Description { get; set; }
-
-        public Optional<Exception> Cause { get; set; }
-
-        public Optional<byte[]> Data { get; set; }
-
-        [DataMember]
-        private IFailedTaskClr2Java FailedTaskClr2Java { get; set; }
-
-        [DataMember]
-        private IActiveContextClr2Java ActiveContextClr2Java { get; set; }
-
-        /// <summary>
-        /// Access the context the task ran (and crashed) on, if it could be recovered.
-        /// An ActiveContext is given when the task fails but the context remains alive.
-        /// On context failure, the context also fails and is surfaced via the FailedContext event.
-        /// Note that receiving an ActiveContext here is no guarantee that the context (and evaluator)
-        /// are in a consistent state. Application developers need to investigate the reason available
-        /// via getCause() to make that call.
-        /// return the context the Task ran on.
-        /// </summary>
-        public Optional<IActiveContext> GetActiveContext()
-        {
-            IActiveContext activeContext = new ActiveContext(ActiveContextClr2Java);
-            return ActiveContextClr2Java == null ? Optional<IActiveContext>.Empty() : Optional<IActiveContext>.Of(activeContext);
-        }
-
-        public Exception AsError()
-        {
-            throw new NotImplementedException();
-        }
-
-        private void Parse(IFailedTaskClr2Java failedTaskClr2Java)
-        {
-            string serializedInfo = failedTaskClr2Java.GetString();
-            LOGGER.Log(Level.Verbose, "serialized failed task: " + serializedInfo);
-            Dictionary<string, string> settings = new Dictionary<string, string>();
-            string[] components = serializedInfo.Split(',');
-            foreach (string component in components)
-            {
-                string[] pair = component.Trim().Split('=');
-                if (pair == null || pair.Length != 2)
-                {
-                    Exceptions.Throw(new ArgumentException("invalid component to be used as key-value pair:", component), LOGGER);
-                }
-                settings.Add(pair[0], pair[1]);
-            }
-
-            string id;
-            if (!settings.TryGetValue("Identifier", out id))
-            {
-                Exceptions.Throw(new ArgumentException("cannot find Identifier entry."), LOGGER);
-            }
-            Id = id;
-
-            string msg;
-            if (!settings.TryGetValue("Message", out msg))
-            {
-                LOGGER.Log(Level.Verbose, "no Message in Failed Task.");
-                msg = string.Empty;
-            }
-            Message = msg;
-
-            string description;
-            if (!settings.TryGetValue("Description", out description))
-            {
-                LOGGER.Log(Level.Verbose, "no Description in Failed Task.");
-                description = string.Empty;
-            }
-            Description = string.IsNullOrWhiteSpace(description) ? Optional<string>.Empty() : Optional<string>.Of(description);
-
-            string cause;
-            if (!settings.TryGetValue("Cause", out cause))
-            {
-                LOGGER.Log(Level.Verbose, "no Cause in Failed Task.");
-                cause = string.Empty;
-            }
-            Reason = string.IsNullOrWhiteSpace(cause) ? Optional<string>.Empty() : Optional<string>.Of(cause);
-
-            string rawData;
-            if (!settings.TryGetValue("Data", out rawData))
-            {
-                LOGGER.Log(Level.Verbose, "no Data in Failed Task.");
-                rawData = string.Empty;
-            }
-            Data = string.IsNullOrWhiteSpace(rawData) ? Optional<byte[]>.Empty() : Optional<byte[]>.Of(ByteUtilities.StringToByteArrays(rawData));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/RunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/RunningTask.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/RunningTask.cs
deleted file mode 100644
index 5c9e26c..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/RunningTask.cs
+++ /dev/null
@@ -1,97 +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.Driver.Task;
-using Org.Apache.REEF.Utilities.Logging;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    public class RunningTask : IRunningTask
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(RunningTask));
-        private IRunningTaskClr2Java _runningTaskClr2Java;
-        private IActiveContextClr2Java _activeContextClr2Java;
-
-        public RunningTask(IRunningTaskClr2Java runningTaskClr2Java)
-        {
-            using (LOGGER.LogFunction("RunningTask::RunningTask"))
-            {
-                _runningTaskClr2Java = runningTaskClr2Java;
-                _activeContextClr2Java = runningTaskClr2Java.GetActiveContext();
-            }
-        }
-
-        public Context.IActiveContext ActiveContext
-        {
-            get
-            {
-                return new ActiveContext(_activeContextClr2Java);
-            }
-            
-            set
-            {
-                ActiveContext = value;
-            }
-        }
-
-        public string Id
-        {
-            get
-            {
-                return _runningTaskClr2Java.GetId();
-            }
-
-            set
-            {
-                Id = value;
-            }
-        }
-
-        public void Send(byte[] message)
-        {
-            _runningTaskClr2Java.Send(message);
-        }
-
-        public void OnNext(byte[] message)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void Suspend(byte[] message)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void Suspend()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void Dispose(byte[] message)
-        {
-            throw new NotImplementedException();
-        }
-
-        public void Dispose()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/SuspendedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/SuspendedTask.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/SuspendedTask.cs
deleted file mode 100644
index 6c5535b..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/SuspendedTask.cs
+++ /dev/null
@@ -1,81 +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 Org.Apache.REEF.Driver.Context;
-using System;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    [DataContract]
-    internal class SuspendedTask : ISuspendedTask
-    {
-        internal SuspendedTask(ISuspendedTaskClr2Java suspendedTaskClr2Java)
-        {
-            InstanceId = Guid.NewGuid().ToString("N");
-            SuspendedTaskClr2Java = suspendedTaskClr2Java;
-            ActiveContextClr2Java = suspendedTaskClr2Java.GetActiveContext();
-        }
-
-        [DataMember]
-        public string InstanceId { get; set; }
-
-        public byte[] Message
-        {
-            get
-            {
-                return SuspendedTaskClr2Java.Get();
-            }
-
-            set
-            {
-            }
-        }
-
-        public string Id
-        {
-            get
-            {
-                return SuspendedTaskClr2Java.GetId();
-            }
-
-            set
-            {
-            }
-        }
-
-        public IActiveContext ActiveContext
-        {
-            get
-            {
-                return new ActiveContext(ActiveContextClr2Java);
-            }
-
-            set
-            {
-            }
-        }
-
-        [DataMember]
-        private ISuspendedTaskClr2Java SuspendedTaskClr2Java { get; set; }
-
-        [DataMember]
-        private IActiveContextClr2Java ActiveContextClr2Java { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/bridge/events/TaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/bridge/events/TaskMessage.cs b/lang/cs/Org.Apache.REEF.Driver/bridge/events/TaskMessage.cs
deleted file mode 100644
index 76250c3..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/bridge/events/TaskMessage.cs
+++ /dev/null
@@ -1,64 +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 Org.Apache.REEF.Driver.Task;
-using System;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.REEF.Driver.Bridge
-{
-    /// <summary>
-    /// TaskMessage which wraps ITaskMessageClr2Java
-    /// </summary>
-    [DataContract]
-    internal class TaskMessage : ITaskMessage
-    {
-        private ITaskMessageClr2Java _taskMessageClr2Java;
-        private byte[] _message;
-        private string _instanceId;
-
-        public TaskMessage(ITaskMessageClr2Java clr2Java, byte[] message)
-        {
-            _instanceId = Guid.NewGuid().ToString("N");
-            _taskMessageClr2Java = clr2Java;
-            _message = message;
-        }
-
-        [DataMember]
-        public string InstanceId
-        {
-            get { return _instanceId; }
-            set { _instanceId = value; }
-        }
-
-        [DataMember]
-        public string TaskId
-        {
-            get { return _taskMessageClr2Java.GetId(); }
-            set { }
-        }
-
-        [DataMember]
-        public byte[] Message
-        {
-            get { return _message; }
-            set { _message = value; } 
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/ContextConfiguration.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/ContextConfiguration.cs b/lang/cs/Org.Apache.REEF.Driver/context/ContextConfiguration.cs
deleted file mode 100644
index 2fae867..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/ContextConfiguration.cs
+++ /dev/null
@@ -1,93 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.Events;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Util;
-using System;
-using System.Diagnostics.CodeAnalysis;
-
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    public class ContextConfiguration : ConfigurationModuleBuilder
-    {
-        /// <summary>
-        ///  The identifier of the context.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly RequiredParameter<string> Identifier = new RequiredParameter<string>();
-
-        /// <summary>
-        ///  for context start. 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<IContextStart>> OnContextStart = new OptionalImpl<IObserver<IContextStart>>();
-
-        /// <summary>
-        /// for context stop. 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<IContextStop>> OnContextStop = new OptionalImpl<IObserver<IContextStop>>();
-
-        /// <summary>
-        ///  to be informed right before a Task enters its call() method.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IObserver<ITaskStart>> OnTaskStart = new OptionalImpl<IObserver<ITaskStart>>();
-
-        /// <summary>
-        ///  to be informed right after a Task exits its call() method.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IObserver<ITaskStop>> OnTaskStop = new OptionalImpl<IObserver<ITaskStop>>();
-
-        /// <summary>
-        ///  Source of messages to be called whenever the evaluator is about to make a heartbeat.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IContextMessageSource> OnSendMessage = new OptionalImpl<IContextMessageSource>();
-
-        /// <summary>
-        ///   Driver has sent the context a message, and this parameter is used to register a handler on the context for processing that message.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalImpl<IContextMessageHandler> OnMessage = new OptionalImpl<IContextMessageHandler>();
-
-        public static ConfigurationModule ConfigurationModule
-        {
-            get
-            {
-                return new ContextConfiguration()
-                    .BindNamedParameter(GenericType<ContextConfigurationOptions.ContextIdentifier>.Class, Identifier)
-                    .BindSetEntry(GenericType<ContextConfigurationOptions.StartHandlers>.Class, OnContextStart)
-                    .BindSetEntry(GenericType<ContextConfigurationOptions.StopHandlers>.Class, OnContextStop)
-                    .BindSetEntry(GenericType<ContextConfigurationOptions.ContextMessageSources>.Class, OnSendMessage)
-                    .BindSetEntry(GenericType<ContextConfigurationOptions.ContextMessageHandlers>.Class, OnMessage)
-                    .BindSetEntry(GenericType<TaskConfigurationOptions.StartHandlers>.Class, OnTaskStart)
-                    .BindSetEntry(GenericType<TaskConfigurationOptions.StopHandlers>.Class, OnTaskStop)
-                    .Build();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/context/ContextConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/context/ContextConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Driver/context/ContextConfigurationOptions.cs
deleted file mode 100644
index 632fdbc..0000000
--- a/lang/cs/Org.Apache.REEF.Driver/context/ContextConfigurationOptions.cs
+++ /dev/null
@@ -1,60 +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 Org.Apache.REEF.Common.Context;
-using Org.Apache.REEF.Common.Events;
-using Org.Apache.REEF.Driver.Defaults;
-using Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tang.Formats;
-using System;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Driver.Context
-{
-    /// <summary>
-    ///  Configuration parameters for ContextConfiguration module.
-    /// </summary>
-    public class ContextConfigurationOptions : ConfigurationModuleBuilder 
-    {
-        [NamedParameter(documentation: "The identifier for the context.")]
-        public class ContextIdentifier : Name<string>
-        {
-        }
-
-        [NamedParameter(documentation: "The set of event handlers for the ContextStart event", defaultClasses: new[] { typeof(DefaultContextStartHandler) })]
-        public class StartHandlers : Name<ISet<IObserver<IContextStart>>>
-        {
-        }
-
-        [NamedParameter(documentation: "The set of event handlers for the ContextStop event", defaultClasses: new[] { typeof(DefaultContextStopHandler) })]
-        public class StopHandlers : Name<ISet<IObserver<IContextStop>>>
-        {
-        }
-
-        [NamedParameter(documentation: "The set of ContextMessageSource implementations called during heartbeats.", defaultClasses: new[] { typeof(DefaultContextMessageSource) })]
-        public class ContextMessageSources : Name<ISet<IContextMessageSource>>
-        {
-        }
-
-        [NamedParameter(documentation: "The set of Context message handlers.")]
-        public class ContextMessageHandlers : Name<ISet<IContextMessageHandler>>
-        {
-        }
-    }
-}


[08/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..531ebbf
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrSystemHandlerWrapper.cs
@@ -0,0 +1,277 @@
+/**
+ * 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 System.IO;
+using System.Runtime.InteropServices;
+using Org.Apache.REEF.Common.Context;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Bridge.Events;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Implementations;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Wake.Time;
+using Org.Apache.REEF.Tang.Implementations.Tang;
+using Org.Apache.REEF.Wake.Time.Event;
+using ContextMessage = Org.Apache.REEF.Driver.Bridge.Events.ContextMessage;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class ClrSystemHandlerWrapper
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ClrSystemHandlerWrapper));
+
+        private static DriverBridge _driverBridge;
+
+        public static void Call_ClrSystemAllocatedEvaluatorHandler_OnNext(ulong handle, IAllocatedEvaluaotrClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemAllocatedEvaluatorHandler_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IAllocatedEvaluator> obj = (ClrSystemHandler<IAllocatedEvaluator>)gc.Target;
+                obj.OnNext(new AllocatedEvaluator(clr2Java)); 
+            }       
+        }
+
+        public static void Call_ClrSystemActiveContextHandler_OnNext(ulong handle, IActiveContextClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemActiveContextHandler_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IActiveContext> obj = (ClrSystemHandler<IActiveContext>)gc.Target;
+                obj.OnNext(new ActiveContext(clr2Java));
+            }            
+        }
+
+        public static void Call_ClrSystemDriverRestartActiveContextHandler_OnNext(ulong handle, IActiveContextClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemDriverRestartActiveContextHandler_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IActiveContext> obj = (ClrSystemHandler<IActiveContext>)gc.Target;
+                obj.OnNext(new ActiveContext(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemEvaluatorRequestor_OnNext(ulong handle, IEvaluatorRequestorClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemEvaluatorRequestor_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IEvaluatorRequestor> obj = (ClrSystemHandler<IEvaluatorRequestor>)gc.Target;
+                obj.OnNext(new EvaluatorRequestor(clr2Java));
+            }   
+        }
+
+        public static void Call_ClrSystemTaskMessage_OnNext(ulong handle, ITaskMessageClr2Java clr2Java, byte[] message)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemTaskMessage_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<ITaskMessage> obj = (ClrSystemHandler<ITaskMessage>)gc.Target;
+                obj.OnNext(new TaskMessage(clr2Java, message));
+            }   
+        }
+
+        public static void Call_ClrSystemFailedTask_OnNext(ulong handle, IFailedTaskClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemFailedTask_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IFailedTask> obj = (ClrSystemHandler<IFailedTask>)gc.Target;
+                obj.OnNext(new FailedTask(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemRunningTask_OnNext(ulong handle, IRunningTaskClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemRunningTask_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IRunningTask> obj = (ClrSystemHandler<IRunningTask>)gc.Target;
+                obj.OnNext(new RunningTask(clr2Java));
+            }        
+        }
+
+        public static void Call_ClrSystemDriverRestartRunningTask_OnNext(ulong handle, IRunningTaskClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemDriverRestartRunningTask_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IRunningTask> obj = (ClrSystemHandler<IRunningTask>)gc.Target;
+                obj.OnNext(new RunningTask(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemFailedEvaluator_OnNext(ulong handle, IFailedEvaluatorClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemFailedEvaluator_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IFailedEvaluator> obj = (ClrSystemHandler<IFailedEvaluator>)gc.Target;
+                obj.OnNext(new FailedEvaluator(clr2Java));
+            }     
+        }
+
+        public static void Call_ClrSystemCompletedTask_OnNext(ulong handle, ICompletedTaskClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemCompletedTask_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<ICompletedTask> obj = (ClrSystemHandler<ICompletedTask>)gc.Target;
+                obj.OnNext(new CompletedTask(clr2Java));
+            }         
+        }
+
+        public static void Call_ClrSystemSuspendedTask_OnNext(ulong handle, ISuspendedTaskClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemSuspendedTask_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<ISuspendedTask> obj = (ClrSystemHandler<ISuspendedTask>)gc.Target;
+                obj.OnNext(new SuspendedTask(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemCompletedEvaluator_OnNext(ulong handle, ICompletedEvaluatorClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemCompletedEvaluator_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<ICompletedEvaluator> obj = (ClrSystemHandler<ICompletedEvaluator>)gc.Target;
+                obj.OnNext(new CompletedEvaluator(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemHttpServer_OnNext(ulong handle, IHttpServerBridgeClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemHttpServer_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IHttpMessage> obj = (ClrSystemHandler<IHttpMessage>)gc.Target;
+                obj.OnNext(new HttpMessage(clr2Java));
+            }      
+        }
+
+        public static void Call_ClrSystemClosedContext_OnNext(ulong handle, IClosedContextClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemClosedContext_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IClosedContext> obj = (ClrSystemHandler<IClosedContext>)gc.Target;
+                obj.OnNext(new ClosedContext(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemFailedContext_OnNext(ulong handle, IFailedContextClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemFailedContext_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IFailedContext> obj = (ClrSystemHandler<IFailedContext>)gc.Target;
+                obj.OnNext(new FailedContext(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemContextMessage_OnNext(ulong handle, IContextMessageClr2Java clr2Java)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemContextMessage_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<IContextMessage> obj = (ClrSystemHandler<IContextMessage>)gc.Target;
+                obj.OnNext(new ContextMessage(clr2Java));
+            }
+        }
+
+        public static void Call_ClrSystemDriverRestart_OnNext(ulong handle)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemDriverRestart_OnNext"))
+            {
+                GCHandle gc = GCHandle.FromIntPtr((IntPtr)handle);
+                ClrSystemHandler<StartTime> obj = (ClrSystemHandler<StartTime>)gc.Target;
+                obj.OnNext(new StartTime(DateTime.Now.Ticks));
+            }
+        }
+
+        //Deprecate, remove after both Java and C# code gets checked in
+        public static ulong[] Call_ClrSystemStartHandler_OnStart(DateTime startTime)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemStartHandler_OnStart"))
+            {
+                LOGGER.Log(Level.Info, "*** Start time is " + startTime);
+                return GetHandlers(null);
+            }
+        }
+
+        public static ulong[] Call_ClrSystemStartHandler_OnStart(DateTime startTime, string httpServerPort)
+        {
+            using (LOGGER.LogFunction("ClrSystemHandlerWrapper::Call_ClrSystemStartHandler_OnStart"))
+            {
+                LOGGER.Log(Level.Info, "*** Start time is " + startTime);
+                LOGGER.Log(Level.Info, "*** httpServerPort: " + httpServerPort);
+                return GetHandlers(httpServerPort);
+            }   
+        }
+
+        private static ulong[] GetHandlers(string httpServerPortNumber)
+        {
+            IStartHandler startHandler;
+            IInjector injector = null;
+            string errorMessage;
+            string bridgeConfiguration = Path.Combine(Directory.GetCurrentDirectory(), "reef", "global", Constants.DriverBridgeConfiguration);
+            if (!File.Exists(bridgeConfiguration))
+            {
+                errorMessage = "Cannot find CLR Driver bridge configuration file " + bridgeConfiguration;
+                Exceptions.Throw(new InvalidOperationException(errorMessage), LOGGER);
+            }
+            try
+            {
+                IConfiguration driverBridgeConfiguration = new AvroConfigurationSerializer().FromFile(bridgeConfiguration);
+                injector = TangFactory.GetTang().NewInjector(driverBridgeConfiguration);
+            }
+            catch (Exception e)
+            {
+                errorMessage = "Failed to get injector from driver bridge configuration.";
+                Exceptions.CaughtAndThrow(new InvalidOperationException(errorMessage, e), Level.Error, errorMessage, LOGGER);
+            }
+
+            try
+            {
+                HttpServerPort port = injector.GetInstance<HttpServerPort>();
+                port.PortNumber = httpServerPortNumber == null ? 0 : int.Parse(httpServerPortNumber, CultureInfo.InvariantCulture);
+
+                startHandler = injector.GetInstance<IStartHandler>();
+                LOGGER.Log(Level.Info, "Start handler set to be " + startHandler.Identifier);
+                _driverBridge = injector.GetInstance<DriverBridge>();
+            }
+            catch (Exception e)
+            {
+                Exceptions.CaughtAndThrow(e, Level.Error, "Cannot get instance.", LOGGER);
+            }
+
+            return _driverBridge.Subscribe();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..1ecda50
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridge.cs
@@ -0,0 +1,322 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Linq;
+
+using Org.Apache.REEF.Wake.Time;
+using Org.Apache.REEF.Wake.Time.Event;
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    public class DriverBridge
+    {
+        private static Logger _logger;
+        
+        private static ClrSystemHandler<IAllocatedEvaluator> _allocatedEvaluatorSubscriber;
+
+        private static ClrSystemHandler<IEvaluatorRequestor> _evaluatorRequestorSubscriber;
+
+        private static ClrSystemHandler<ITaskMessage> _taskMessageSubscriber;
+
+        private static ClrSystemHandler<IActiveContext> _activeContextSubscriber;
+
+        private static ClrSystemHandler<IActiveContext> _driverRestartActiveContextSubscriber;
+
+        private static ClrSystemHandler<IFailedTask> _failedTaskSubscriber;
+
+        private static ClrSystemHandler<IRunningTask> _runningTaskSubscriber;
+
+        private static ClrSystemHandler<IRunningTask> _driverRestartRunningTaskSubscriber;
+
+        private static ClrSystemHandler<ISuspendedTask> _suspendedTaskSubscriber;
+
+        private static ClrSystemHandler<IFailedEvaluator> _failedEvaluatorSubscriber;
+
+        private static ClrSystemHandler<ICompletedEvaluator> _completedEvaluatorSubscriber;
+
+        private static ClrSystemHandler<IHttpMessage> _httpServerEventSubscriber;
+
+        private static ClrSystemHandler<ICompletedTask> _completedTaskSubscriber;
+
+        private static ClrSystemHandler<IClosedContext> _closedContextSubscriber;
+
+        private static ClrSystemHandler<IFailedContext> _failedContextSubscriber;
+
+        private static ClrSystemHandler<IContextMessage> _contextMessageSubscriber;
+
+        private static ClrSystemHandler<StartTime> _driverRestartSubscriber;
+
+        private IObserver<StartTime> _driverRestartHandler; 
+
+        private ISet<IObserver<IEvaluatorRequestor>> _evaluatorRequestHandlers;
+
+        private ISet<IObserver<IAllocatedEvaluator>> _allocatedEvaluatorHandlers;
+
+        private ISet<IObserver<IActiveContext>> _activeContextHandlers;
+
+        private ISet<IObserver<IActiveContext>> _driverRestartActiveContextHandlers;
+
+        private ISet<IObserver<ITaskMessage>> _taskMessageHandlers;
+
+        private ISet<IObserver<IFailedTask>> _failedTaskHandlers;
+
+        private ISet<IObserver<ISuspendedTask>> _suspendedTaskHandlers;
+
+        private ISet<IObserver<IRunningTask>> _runningTaskHandlers;
+
+        private ISet<IObserver<IRunningTask>> _driverRestartRunningTaskHandlers;
+
+        private ISet<IObserver<IFailedEvaluator>> _failedEvaluatorHandlers;
+
+        private ISet<IObserver<ICompletedEvaluator>> _completedEvaluatorHandlers;
+
+        private ISet<IObserver<IClosedContext>> _closedContextHandlers;
+
+        private ISet<IObserver<IFailedContext>> _failedContextHandlers;
+
+        private ISet<IObserver<IContextMessage>> _contextMessageHandlers;
+
+        private ISet<IObserver<ICompletedTask>> _completedTaskHandlers;
+
+        private HttpServerHandler _httpServerHandler;
+
+        [Inject]
+        public DriverBridge(
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.DriverRestartHandler))] IObserver<StartTime> driverRestartHandler,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.EvaluatorRequestHandlers))] ISet<IObserver<IEvaluatorRequestor>> evaluatorRequestHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.AllocatedEvaluatorHandlers))] ISet<IObserver<IAllocatedEvaluator>> allocatedEvaluatorHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.ActiveContextHandlers))] ISet<IObserver<IActiveContext>> activeContextHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.TaskMessageHandlers))] ISet<IObserver<ITaskMessage>> taskMessageHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.FailedTaskHandlers))] ISet<IObserver<IFailedTask>> failedTaskHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.FailedEvaluatorHandlers))] ISet<IObserver<IFailedEvaluator>> failedEvaluatorHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.CompletedEvaluatorHandlers))] ISet<IObserver<ICompletedEvaluator>> completedEvaluatorHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.RunningTaskHandlers))] ISet<IObserver<IRunningTask>> runningTaskHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.CompletedTaskHandlers))] ISet<IObserver<ICompletedTask>> completedTaskHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.SuspendedTaskHandlers))] ISet<IObserver<ISuspendedTask>> suspendedTaskHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.ClosedContextHandlers))] ISet<IObserver<IClosedContext>> closedContextHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.FailedContextHandlers))] ISet<IObserver<IFailedContext>> failedContextHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.ContextMessageHandlers))] ISet<IObserver<IContextMessage>> contextMessageHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.DriverRestartActiveContextHandlers))] ISet<IObserver<IActiveContext>> driverRestartActiveContextHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.DriverRestartRunningTaskHandlers))] ISet<IObserver<IRunningTask>> driverRestartRunningTaskHandlers,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.TraceListenersSet))] ISet<TraceListener> traceListeners,
+            [Parameter(Value = typeof(DriverBridgeConfigurationOptions.TraceLevel))] string traceLevel,
+            HttpServerHandler httpServerHandler)
+        {
+            foreach (TraceListener listener in traceListeners)
+            {
+                Logger.AddTraceListner(listener);
+            }
+            _logger = Logger.GetLogger(typeof(DriverBridge));
+            _logger.Log(Level.Info, "Constructing DriverBridge");
+
+            Level level;
+            if (!Enum.TryParse(traceLevel.ToString(CultureInfo.InvariantCulture), out level))
+            {
+                _logger.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Invalid trace level {0} provided, will by default use verbose level", traceLevel));
+            }
+            else
+            {
+                Logger.SetCustomLevel(level);
+            }
+            
+            _evaluatorRequestHandlers = evaluatorRequestHandlers;
+            _allocatedEvaluatorHandlers = allocatedEvaluatorHandlers;
+            _activeContextHandlers = activeContextHandlers;
+            _taskMessageHandlers = taskMessageHandlers;
+            _failedEvaluatorHandlers = failedEvaluatorHandlers;
+            _failedTaskHandlers = failedTaskHandlers;
+            _completedTaskHandlers = completedTaskHandlers;
+            _runningTaskHandlers = runningTaskHandlers;
+            _suspendedTaskHandlers = suspendedTaskHandlers;
+            _completedEvaluatorHandlers = completedEvaluatorHandlers;
+            _closedContextHandlers = closedContextHandlers;
+            _failedContextHandlers = failedContextHandlers;
+            _contextMessageHandlers = contextMessageHandlers;
+            _driverRestartHandler = driverRestartHandler;
+            _driverRestartActiveContextHandlers = driverRestartActiveContextHandlers;
+            _driverRestartRunningTaskHandlers = driverRestartRunningTaskHandlers;
+            _httpServerHandler = httpServerHandler;
+
+            _evaluatorRequestorSubscriber = new ClrSystemHandler<IEvaluatorRequestor>();
+            _allocatedEvaluatorSubscriber = new ClrSystemHandler<IAllocatedEvaluator>();
+            _completedEvaluatorSubscriber = new ClrSystemHandler<ICompletedEvaluator>();
+            _taskMessageSubscriber = new ClrSystemHandler<ITaskMessage>();
+            _activeContextSubscriber = new ClrSystemHandler<IActiveContext>();
+            _failedTaskSubscriber = new ClrSystemHandler<IFailedTask>();
+            _failedEvaluatorSubscriber = new ClrSystemHandler<IFailedEvaluator>();
+            _httpServerEventSubscriber = new ClrSystemHandler<IHttpMessage>();
+            _completedTaskSubscriber = new ClrSystemHandler<ICompletedTask>();
+            _runningTaskSubscriber = new ClrSystemHandler<IRunningTask>();
+            _suspendedTaskSubscriber = new ClrSystemHandler<ISuspendedTask>();
+            _closedContextSubscriber = new ClrSystemHandler<IClosedContext>();
+            _failedContextSubscriber = new ClrSystemHandler<IFailedContext>();
+            _contextMessageSubscriber = new ClrSystemHandler<IContextMessage>();
+            _driverRestartSubscriber = new ClrSystemHandler<StartTime>();
+            _driverRestartActiveContextSubscriber = new ClrSystemHandler<IActiveContext>();
+            _driverRestartRunningTaskSubscriber = new ClrSystemHandler<IRunningTask>();
+        }
+
+        public ulong[] Subscribe()
+        {
+            ulong[] handlers = Enumerable.Repeat(Constants.NullHandler, Constants.HandlersNumber).ToArray();
+
+            // subscribe to StartTime event for driver restart         
+            _driverRestartSubscriber.Subscribe(_driverRestartHandler);
+            _logger.Log(Level.Info, "subscribed to Driver restart handler: " + _driverRestartHandler);
+            handlers[Constants.Handlers[Constants.DriverRestartHandler]] = ClrHandlerHelper.CreateHandler(_driverRestartSubscriber);
+
+            // subscribe to Evaluator Requestor          
+            foreach (var handler in _evaluatorRequestHandlers)
+            {
+                _evaluatorRequestorSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IEvaluatorRequestor handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.EvaluatorRequestorHandler]] = ClrHandlerHelper.CreateHandler(_evaluatorRequestorSubscriber);
+
+            // subscribe to Allocated Evaluator
+            foreach (var handler in _allocatedEvaluatorHandlers)
+            {
+                _allocatedEvaluatorSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IAllocatedEvaluator handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.AllocatedEvaluatorHandler]] = ClrHandlerHelper.CreateHandler(_allocatedEvaluatorSubscriber);
+
+            // subscribe to TaskMessage
+            foreach (var handler in _taskMessageHandlers)
+            {
+                _taskMessageSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to ITaskMessage handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.TaskMessageHandler]] = ClrHandlerHelper.CreateHandler(_taskMessageSubscriber);
+
+            // subscribe to Active Context
+            foreach (var handler in _activeContextHandlers)
+            {
+                _activeContextSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IActiveContext handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.ActiveContextHandler]] = ClrHandlerHelper.CreateHandler(_activeContextSubscriber);
+
+            // subscribe to Failed Task
+            foreach (var handler in _failedTaskHandlers)
+            {
+                _failedTaskSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IFailedTask handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.FailedTaskHandler]] = ClrHandlerHelper.CreateHandler(_failedTaskSubscriber);
+
+            // subscribe to Running Task
+            foreach (var handler in _runningTaskHandlers)
+            {
+                _runningTaskSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IRunningask handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.RunningTaskHandler]] = ClrHandlerHelper.CreateHandler(_runningTaskSubscriber);
+
+            // subscribe to Completed Task
+            foreach (var handler in _completedTaskHandlers)
+            {
+                _completedTaskSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to ICompletedTask handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.CompletedTaskHandler]] = ClrHandlerHelper.CreateHandler(_completedTaskSubscriber);
+
+            // subscribe to Suspended Task
+            foreach (var handler in _suspendedTaskHandlers)
+            {
+                _suspendedTaskSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to ISuspendedTask handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.SuspendedTaskHandler]] = ClrHandlerHelper.CreateHandler(_suspendedTaskSubscriber);
+
+            // subscribe to Failed Evaluator
+            foreach (var handler in _failedEvaluatorHandlers)
+            {
+                _failedEvaluatorSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IFailedEvaluator handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.FailedEvaluatorHandler]] = ClrHandlerHelper.CreateHandler(_failedEvaluatorSubscriber);
+
+            // subscribe to Completed Evaluator
+            foreach (var handler in _completedEvaluatorHandlers)
+            {
+                _completedEvaluatorSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to ICompletedEvaluator handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.CompletedEvaluatorHandler]] = ClrHandlerHelper.CreateHandler(_completedEvaluatorSubscriber);
+
+            // subscribe to Closed Context
+            foreach (var handler in _closedContextHandlers)
+            {
+                _closedContextSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IClosedContext handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.ClosedContextHandler]] = ClrHandlerHelper.CreateHandler(_closedContextSubscriber);
+
+            // subscribe to Failed Context
+            foreach (var handler in _failedContextHandlers)
+            {
+                _failedContextSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IFailedContext handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.FailedContextHandler]] = ClrHandlerHelper.CreateHandler(_failedContextSubscriber);
+
+            // subscribe to Context Message
+            foreach (var handler in _contextMessageHandlers)
+            {
+                _contextMessageSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to IContextMesage handler: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.ContextMessageHandler]] = ClrHandlerHelper.CreateHandler(_contextMessageSubscriber);
+
+            // subscribe to Active Context received during driver restart
+            foreach (var handler in _driverRestartActiveContextHandlers)
+            {
+                _driverRestartActiveContextSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to handler for IActiveContext received during driver restart: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.DriverRestartActiveContextHandler]] = ClrHandlerHelper.CreateHandler(_driverRestartActiveContextSubscriber);
+
+            // subscribe to Running Task received during driver restart
+            foreach (var handler in _driverRestartRunningTaskHandlers)
+            {
+                _driverRestartRunningTaskSubscriber.Subscribe(handler);
+                _logger.Log(Level.Info, "subscribed to handler for IRunningTask received during driver restart: " + handler);
+            }
+            handlers[Constants.Handlers[Constants.DriverRestartRunningTaskHandler]] = ClrHandlerHelper.CreateHandler(_driverRestartRunningTaskSubscriber);
+
+            // subscribe to Http message
+            _httpServerEventSubscriber.Subscribe(_httpServerHandler);
+            _logger.Log(Level.Info, "subscribed to IHttpMessage handler  :" + _httpServerHandler);
+            handlers[Constants.Handlers[Constants.HttpServerHandler]] = ClrHandlerHelper.CreateHandler(_httpServerEventSubscriber);
+
+            return handlers;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..7b7b280
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfiguration.cs
@@ -0,0 +1,274 @@
+/**
+ * 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.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.Utilities.Logging;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Util;
+using Org.Apache.REEF.Wake.Time;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using Org.Apache.REEF.Wake.Time.Event;
+
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    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")]
+        public static readonly RequiredImpl<IStartHandler> OnDriverStarted = new RequiredImpl<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<StartTime>> OnDriverRestarted = new OptionalImpl<IObserver<StartTime>>();
+
+        /// <summary>
+        /// The event handler for requesting evaluator
+        /// </summary>
+        [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>> OnDirverRestartContextActive = 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>();
+
+        // 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)
+                .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.DriverRestartHandler>.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, OnDirverRestartContextActive)
+                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartRunningTaskHandlers>.Class, OnDriverRestartTaskRunning)
+                .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.TraceLevel>.Class, CustomTraceLevel)
+                .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/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfigurationOptions.cs
new file mode 100644
index 0000000..9bc2402
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/DriverBridgeConfigurationOptions.cs
@@ -0,0 +1,155 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Defaults;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Wake.Time;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+using Org.Apache.REEF.Wake.Time.Event;
+
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "allow name parameter class to be embedded")]
+
+namespace Org.Apache.REEF.Driver.Bridge
+{
+    /// <summary>
+    /// Hosts all named parameters for Drivers, including bridge handlers.
+    /// </summary>
+    public class DriverBridgeConfigurationOptions
+    {
+        // Level.Verbose (since enum is not suppoted for TANG, we use a string here)
+        private const string _verboseLevel = "Verbose";
+
+        [NamedParameter(documentation: "Called when driver is restarted, after CLR bridge is set up.", defaultClasses: new[] { typeof(DefaultDriverRestartHandler) })]
+        public class DriverRestartHandler : Name<IObserver<StartTime>>
+        {
+        }
+
+        [NamedParameter(documentation: "Called when evaluator is requested.", defaultClasses: new[] { typeof(DefaultEvaluatorRequestorHandler) })] 
+        public class EvaluatorRequestHandlers : Name<ISet<IObserver<IEvaluatorRequestor>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Called when an exception occurs on a running evaluator.", defaultClasses: new[] { typeof(DefaultEvaluatorFailureHandler) })]
+        public class FailedEvaluatorHandlers : Name<ISet<IObserver<IFailedEvaluator>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Called when an evaluator completes.", defaultClasses: new[] { typeof(DefaultEvaluatorCompletionHandler) })]
+        public class CompletedEvaluatorHandlers : Name<ISet<IObserver<ICompletedEvaluator>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Called when an allocated evaluator is given to the client.", defaultClasses: new[] { typeof(DefaultEvaluatorAllocationHandler) })]
+        public class AllocatedEvaluatorHandlers : Name<ISet<IObserver<IAllocatedEvaluator>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Running task handler.", defaultClasses: new[] { typeof(DefaultTaskRunningHandler) })]
+        public class RunningTaskHandlers : Name<ISet<IObserver<IRunningTask>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Running task during driver restart handler.", defaultClasses: new[] { typeof(DefaultDriverRestartTaskRunningHandler) })]
+        public class DriverRestartRunningTaskHandlers : Name<ISet<IObserver<IRunningTask>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Task exception handler.", defaultClasses: new[] { typeof(DefaultTaskFailureHandler) })]
+        public class FailedTaskHandlers : Name<ISet<IObserver<IFailedTask>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Task message handler.", defaultClasses: new[] { typeof(DefaultTaskMessageHandler) })]
+        public class TaskMessageHandlers : Name<ISet<IObserver<ITaskMessage>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Http Event Handlers.", defaultClasses: new[] { typeof(DefaultHttpHandler) })]
+        public class HttpEventHandlers : Name<ISet<IHttpHandler>>
+        {
+        }
+
+        [NamedParameter(documentation: "Completed task handler.", defaultClasses: new[] { typeof(DefaultTaskCompletionHandler) })]
+        public class CompletedTaskHandlers : Name<ISet<IObserver<ICompletedTask>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Suspended task handler.", defaultClasses: new[] { typeof(DefaultTaskSuspensionHandler) })]
+        public class SuspendedTaskHandlers : Name<ISet<IObserver<ISuspendedTask>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Handler for IActiveContext.", defaultClasses: new[] { typeof(DefaultContextActiveHandler) })]
+        public class ActiveContextHandlers : Name<ISet<IObserver<IActiveContext>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Handler for IActiveContext received during driver restart.", defaultClasses: new[] { typeof(DefaultDriverRestartContextActiveHandler) })]
+        public class DriverRestartActiveContextHandlers : Name<ISet<IObserver<IActiveContext>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Handler for ClosedContext.", defaultClasses: new[] { typeof(DefaultContextClosureHandler) })]
+        public class ClosedContextHandlers : Name<ISet<IObserver<IClosedContext>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Handler for FailedContext.", defaultClasses: new[] { typeof(DefaultContextFailureHandler) })]
+        public class FailedContextHandlers : Name<ISet<IObserver<IFailedContext>>>
+        {
+        }
+
+        [NamedParameter(documentation: "Handler for ContextMessage.", defaultClasses: new[] { typeof(DefaultContextMessageHandler) })]
+        public class ContextMessageHandlers : Name<ISet<IObserver<IContextMessage>>>
+        {
+        }
+
+        [NamedParameter("Command Line Arguments supplied by client", "CommandLineArguments", null)]
+        public class ArgumentSets : Name<ISet<string>>
+        {
+        }
+
+        [NamedParameter("Additional trace listners supplied by client", "TraceListeners", null, defaultClasses: new[] { typeof(DefaultCustomTraceListener) })]
+        public class TraceListenersSet : Name<ISet<TraceListener>>
+        {
+        }
+
+        [NamedParameter("Custom Trace Level", "TraceLevel", defaultValue: _verboseLevel)]
+        public class TraceLevel : Name<string>
+        {
+        }
+
+        //[NamedParameter(documentation: "Job message handler.", defaultClasses: new[] { typeof(DefaultClientMessageHandler) })]
+        //public class ClientMessageHandlers : Name<ISet<IObserver<byte[]>>>
+        //{
+        //}
+
+        //[NamedParameter(documentation: "Client close handler.", defaultClasses: new[] { typeof(DefaultClientCloseHandler) })]
+        //public class ClientCloseHandlers : Name<ISet<IObserver<byte[]>>>
+        //{
+        //}
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ActiveContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ActiveContext.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ActiveContext.cs
new file mode 100644
index 0000000..989483b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ActiveContext.cs
@@ -0,0 +1,118 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class ActiveContext : IActiveContext
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ActiveContext));
+
+        private readonly AvroConfigurationSerializer _serializer;
+
+        public ActiveContext(IActiveContextClr2Java clr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            Clr2Java = clr2Java;
+            _serializer = new AvroConfigurationSerializer();
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public string Id
+        {
+            get
+            {
+                return Clr2Java.GetId();
+            }
+
+            set
+            {
+            }
+        }
+
+        public string EvaluatorId
+        {
+            get
+            {
+                return Clr2Java.GetEvaluatorId();
+            }
+
+            set
+            {
+            }
+        }
+
+        public Optional<string> ParentId { get; set; }
+
+        public IEvaluatorDescriptor EvaluatorDescriptor
+        {
+            get
+            {
+                return Clr2Java.GetEvaluatorDescriptor();
+            }
+
+            set
+            {
+            }
+        }
+
+        private IActiveContextClr2Java Clr2Java { get; set; }
+
+        public void SubmitTask(IConfiguration taskConfiguration)
+        {
+            LOGGER.Log(Level.Info, "ActiveContext::SubmitTask");
+            string task = _serializer.ToString(taskConfiguration);
+            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
+            Clr2Java.SubmitTask(task);
+        }
+
+        public void Dispose()
+        {
+            LOGGER.Log(Level.Info, "ActiveContext::Dispose");
+            Clr2Java.Close();
+        }
+
+        public void SubmitContext(IConfiguration contextConfiguration)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void SendMessage(byte[] message)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..7db4be8
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/AllocatedEvaluator.cs
@@ -0,0 +1,175 @@
+/**
+ * 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.Globalization;
+using System.Runtime.Serialization;
+using Org.Apache.REEF.Common.Catalog;
+using Org.Apache.REEF.Common.Evaluator;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class AllocatedEvaluator : IAllocatedEvaluator
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(AllocatedEvaluator));
+        
+        private readonly AvroConfigurationSerializer _serializer;
+
+        private IEvaluatorDescriptor _evaluatorDescriptor;
+
+        public AllocatedEvaluator(IAllocatedEvaluaotrClr2Java clr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            _serializer = new AvroConfigurationSerializer();
+            Clr2Java = clr2Java;
+            Id = Clr2Java.GetId();
+            ProcessNewEvaluator();
+
+            NameServerInfo = Clr2Java.GetNameServerInfo();
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public string Id { get; set; }
+
+        public string EvaluatorBatchId { get; set; }
+
+        public EvaluatorType Type { get; set; }
+
+        public string NameServerInfo { get; set; }
+
+        [DataMember]
+        private IAllocatedEvaluaotrClr2Java Clr2Java { get; set; }
+
+        public void SubmitContext(IConfiguration contextConfiguration)
+        {
+            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContext");
+            string context = _serializer.ToString(contextConfiguration);
+            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
+            Clr2Java.SubmitContext(context);
+        }
+
+        public void SubmitContextAndTask(IConfiguration contextConfiguration, IConfiguration taskConfiguration)
+        {
+            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContextAndTask");
+
+            string context = _serializer.ToString(contextConfiguration);
+            string task = _serializer.ToString(taskConfiguration);
+
+            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
+            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
+
+            Clr2Java.SubmitContextAndTask(context, task);
+        }
+
+        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
+        {
+            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContextAndService");
+
+            string context = _serializer.ToString(contextConfiguration);
+            string service = _serializer.ToString(serviceConfiguration);
+
+            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
+            LOGGER.Log(Level.Info, "serialized serviceConfiguration: " + service);
+
+            Clr2Java.SubmitContextAndService(context, service);
+        }
+
+        public void SubmitContextAndServiceAndTask(IConfiguration contextConfiguration, IConfiguration serviceConfiguration, IConfiguration taskConfiguration)
+        {
+            LOGGER.Log(Level.Info, "AllocatedEvaluator::SubmitContextAndServiceAndTask");
+
+            string context = _serializer.ToString(contextConfiguration);
+            string service = _serializer.ToString(serviceConfiguration);
+            string task = _serializer.ToString(taskConfiguration);
+
+            LOGGER.Log(Level.Info, "serialized contextConfiguration: " + context);
+            LOGGER.Log(Level.Info, "serialized serviceConfiguration: " + service);
+            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
+
+            Clr2Java.SubmitContextAndServiceAndTask(context, service, task);
+        }
+
+        public IEvaluatorDescriptor GetEvaluatorDescriptor()
+        {
+            return _evaluatorDescriptor;
+        }
+
+        public void Dispose()
+        {
+            Clr2Java.Close();
+        }
+
+        public INodeDescriptor GetNodeDescriptor()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void AddFile(string file)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void AddLibrary(string file)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void AddFileResource(string file)
+        {
+            throw new NotImplementedException();
+        }
+
+        private void ProcessNewEvaluator()
+        {
+            _evaluatorDescriptor = Clr2Java.GetEvaluatorDescriptor();
+            lock (EvaluatorRequestor.Evaluators)
+            {
+                foreach (KeyValuePair<string, IEvaluatorDescriptor> pair in EvaluatorRequestor.Evaluators)
+                {
+                    if (pair.Value.Equals(_evaluatorDescriptor))
+                    {
+                        string key = pair.Key;
+                        EvaluatorRequestor.Evaluators.Remove(key);
+                        string assignedId = key.Substring(0, key.LastIndexOf('_'));
+                        string message = string.Format(
+                            CultureInfo.InvariantCulture,
+                            "Received evalautor [{0}] of memory {1}MB that matches request of {2}MB with batch id [{3}].",
+                            Id,
+                            _evaluatorDescriptor.Memory,
+                            pair.Value.Memory,
+                            assignedId);
+
+                        LOGGER.Log(Level.Verbose, message);
+                        EvaluatorBatchId = assignedId;
+                        break;
+                    }
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ClosedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ClosedContext.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ClosedContext.cs
new file mode 100644
index 0000000..693d520
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ClosedContext.cs
@@ -0,0 +1,99 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    public class ClosedContext : IClosedContext
+    {
+        private string _id;
+
+        private string _evaluatorId;
+
+        public ClosedContext(IClosedContextClr2Java clr2java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            _id = clr2java.GetId();
+            _evaluatorId = clr2java.GetEvaluatorId();
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public string Id
+        {
+            get
+            {
+                return _id;
+            }
+
+            set
+            {
+            }
+        }
+
+        public string EvaluatorId
+        {
+            get
+            {
+                return _evaluatorId;
+            }
+
+            set
+            {
+            }
+        }
+
+        public Optional<string> ParentId { get; set; }
+
+        public IEvaluatorDescriptor EvaluatorDescriptor
+        {
+            get
+            {
+                return ClosedContextClr2JavaClr2Java.GetEvaluatorDescriptor();
+            }
+
+            set
+            {
+            }
+        }
+
+        public IActiveContext ParentContext
+        {
+            get
+            {
+                return new ActiveContext(ParentContextClr2Java);
+            }
+
+            set
+            {
+            }
+        }
+
+        private IActiveContextClr2Java ParentContextClr2Java { get; set; }
+
+        private IClosedContextClr2Java ClosedContextClr2JavaClr2Java { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedEvaluator.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedEvaluator.cs
new file mode 100644
index 0000000..096599a
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedEvaluator.cs
@@ -0,0 +1,61 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Evaluator;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class CompletedEvaluator : ICompletedEvaluator
+    {
+        private string _instanceId;
+
+        public CompletedEvaluator(ICompletedEvaluatorClr2Java clr2Java)
+        {
+            _instanceId = Guid.NewGuid().ToString("N");
+            CompletedEvaluatorClr2Java = clr2Java;
+        }
+
+        [DataMember]
+        public string InstanceId
+        {
+            get { return _instanceId; }
+            set { _instanceId = value; }
+        }
+
+        [DataMember]
+        public string Id
+        {
+            get
+            {
+                return CompletedEvaluatorClr2Java.GetId();
+            }
+
+            set
+            {
+            }
+        }
+
+        [DataMember]
+        public ICompletedEvaluatorClr2Java CompletedEvaluatorClr2Java { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedTask.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedTask.cs
new file mode 100644
index 0000000..3fb76b2
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/CompletedTask.cs
@@ -0,0 +1,76 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class CompletedTask : ICompletedTask
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(CompletedTask));
+
+        internal CompletedTask(ICompletedTaskClr2Java completedTaskClr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            CompletedTaskClr2Java = completedTaskClr2Java;
+            ActiveContextClr2Java = completedTaskClr2Java.GetActiveContext();
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public byte[] Message { get; set; }
+
+        public string Id
+        {
+            get
+            {
+                return CompletedTaskClr2Java.GetId();
+            }
+
+            set
+            {
+            }
+        }
+
+        public IActiveContext ActiveContext
+        {
+            get
+            {
+                return new ActiveContext(ActiveContextClr2Java);
+            }
+
+            set
+            {
+            }
+        }
+
+        [DataMember]
+        private ICompletedTaskClr2Java CompletedTaskClr2Java { get; set; }
+
+        [DataMember]
+        private IActiveContextClr2Java ActiveContextClr2Java { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ContextMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ContextMessage.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ContextMessage.cs
new file mode 100644
index 0000000..afebc59
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/ContextMessage.cs
@@ -0,0 +1,54 @@
+/**
+ * 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.Common.Context;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    public class ContextMessage : IContextMessage
+    {
+        private readonly string _messageSourcId;
+        private readonly byte[] _bytes;
+        private readonly string _id;
+
+        public ContextMessage(IContextMessageClr2Java clr2Java)
+        {
+            _messageSourcId = clr2Java.GetMessageSourceId();
+            _bytes = clr2Java.Get();
+            _id = clr2Java.GetId();
+        }
+
+        public string Id
+        {
+            get { return _id; }
+            set { }
+        }
+
+        public string MessageSourceId
+        {
+            get { return _messageSourcId; }
+        }
+
+        public byte[] Message
+        {
+            get { return _bytes; }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/EvaluatorRequstor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/EvaluatorRequstor.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/EvaluatorRequstor.cs
new file mode 100644
index 0000000..0be5c9b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/EvaluatorRequstor.cs
@@ -0,0 +1,96 @@
+/**
+ * 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.Globalization;
+using System.Runtime.Serialization;
+using Org.Apache.REEF.Common.Catalog;
+using Org.Apache.REEF.Common.Evaluator;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class EvaluatorRequestor : IEvaluatorRequestor
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorRequestor));
+
+        private static Dictionary<string, IEvaluatorDescriptor> _evaluators;
+        
+        public EvaluatorRequestor(IEvaluatorRequestorClr2Java clr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            Clr2Java = clr2Java;
+        }
+
+        public static Dictionary<string, IEvaluatorDescriptor> Evaluators
+        {
+            get
+            {
+                if (_evaluators == null)
+                {
+                    _evaluators = new Dictionary<string, IEvaluatorDescriptor>();
+                }
+                return _evaluators;
+            }
+        }
+
+        public IResourceCatalog ResourceCatalog { get; set; }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        [DataMember]
+        private IEvaluatorRequestorClr2Java Clr2Java { get; set; }
+
+        public void Submit(IEvaluatorRequest request)
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Submitting request for {0} evaluators and {1} MB memory and  {2} core to rack {3}.", request.Number, request.MemoryMegaBytes, request.VirtualCore, request.Rack));
+
+            lock (Evaluators)
+            {
+                for (int i = 0; i < request.Number; i++)
+                {
+                    EvaluatorDescriptorImpl descriptor = new EvaluatorDescriptorImpl(new NodeDescriptorImpl(), EvaluatorType.CLR, request.MemoryMegaBytes, request.VirtualCore);
+                    descriptor.Rack = request.Rack;
+                    string key = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", request.EvaluatorBatchId, i);
+                    try
+                    {
+                        _evaluators.Add(key, descriptor);
+                    }
+                    catch (ArgumentException e)
+                    {
+                        Exceptions.Caught(e, Level.Error, string.Format(CultureInfo.InvariantCulture, "EvaluatorBatchId [{0}] already exists.", key), LOGGER);
+                        Exceptions.Throw(new InvalidOperationException("Cannot use evaluator id " + key, e), LOGGER);
+                    }
+                }
+            }
+            
+            Clr2Java.Submit(request);
+        }
+
+        public void Dispose()
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedContext.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedContext.cs b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedContext.cs
new file mode 100644
index 0000000..eb982c6
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedContext.cs
@@ -0,0 +1,111 @@
+/**
+ * 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.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    public class FailedContext : IFailedContext
+    {
+        private string _id;
+
+        private string _evaluatorId;
+
+        private string _parentId;
+
+        public FailedContext(IFailedContextClr2Java clr2Java)
+        {
+            _id = clr2Java.GetId();
+            _evaluatorId = clr2Java.GetEvaluatorId();
+            _parentId = clr2Java.GetParentId();
+            FailedContextClr2Java = clr2Java;
+        }
+
+        public string Id
+        {
+            get
+            {
+                return _id;
+            }
+
+            set
+            {
+            }
+        }
+
+        public string EvaluatorId
+        {
+            get
+            {
+                return _evaluatorId;
+            }
+
+            set
+            {
+            }
+        }
+
+        public Optional<string> ParentId
+        {
+            get
+            {
+                return string.IsNullOrEmpty(_parentId) ? 
+                    Optional<string>.Empty() : 
+                    Optional<string>.Of(_parentId);
+            }
+
+            set
+            {
+            }
+        }
+
+        public IEvaluatorDescriptor EvaluatorDescriptor
+        {
+            get
+            {
+                return FailedContextClr2Java.GetEvaluatorDescriptor();
+            }
+
+            set
+            {
+            }
+        }
+
+        public Optional<IActiveContext> ParentContext
+        {
+            get
+            {
+                IActiveContextClr2Java context = FailedContextClr2Java.GetParentContext();
+                if (context != null)
+                {
+                    return Optional<IActiveContext>.Of(new ActiveContext(context));
+                }
+                else
+                {
+                    return Optional<IActiveContext>.Empty();
+                }
+            }
+        }
+
+        private IFailedContextClr2Java FailedContextClr2Java { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..a63f953
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/Events/FailedEvaluator.cs
@@ -0,0 +1,72 @@
+/**
+ * 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.Runtime.Serialization;
+using Org.Apache.REEF.Common.Exceptions;
+using Org.Apache.REEF.Driver.Bridge.Clr2java;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Driver.Task;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Diagnostics;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Driver.Bridge.Events
+{
+    [DataContract]
+    internal class FailedEvaluator : IFailedEvaluator
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(FailedEvaluator));
+
+        public FailedEvaluator(IFailedEvaluatorClr2Java clr2Java)
+        {
+            InstanceId = Guid.NewGuid().ToString("N");
+            FailedEvaluatorClr2Java = clr2Java;
+            EvaluatorRequestorClr2Java = FailedEvaluatorClr2Java.GetEvaluatorRequestor();
+            Id = FailedEvaluatorClr2Java.GetId();
+        }
+
+        [DataMember]
+        public string InstanceId { get; set; }
+
+        public string Id { get; set; }
+
+        public EvaluatorException EvaluatorException { get; set; }
+
+        public List<FailedContext> FailedContexts { get; set; }
+
+        public Optional<IFailedTask> FailedTask { get; set; }
+
+        [DataMember]
+        private IFailedEvaluatorClr2Java FailedEvaluatorClr2Java { get; set; }
+
+        [DataMember]
+        private IEvaluatorRequestorClr2Java EvaluatorRequestorClr2Java { get; set; }
+
+        public IEvaluatorRequestor GetEvaluatorRequetor()
+        {
+            if (EvaluatorRequestorClr2Java == null)
+            {
+                Exceptions.Throw(new InvalidOperationException("EvaluatorRequestorClr2Java not initialized."), LOGGER);
+            }
+            return new EvaluatorRequestor(EvaluatorRequestorClr2Java);
+        }
+    }
+}


[10/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 9ed7a5c..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextRuntime.cs
+++ /dev/null
@@ -1,478 +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 Org.Apache.REEF.Common.Evaluator.Context;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    public 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;
-
-        // Convenience class to hold all the event handlers for the context as well as the service instances.
-        private readonly ContextLifeCycle _contextLifeCycle;
-
-        // The child context, if any.
-        private Optional<ContextRuntime> _childContext = Optional<ContextRuntime>.Empty();
-
-        // The parent context, if any.
-        private Optional<ContextRuntime> _parentContext = Optional<ContextRuntime>.Empty();
-
-        // The currently running task, if any.
-        private Optional<TaskRuntime> _task = Optional<TaskRuntime>.Empty();
-
-        private ContextStatusProto.State _contextState = ContextStatusProto.State.READY;
-
-        /// <summary>
-        /// Create a new ContextRuntime.
-        /// </summary>
-        /// <param name="serviceInjector"></param>
-        /// <param name="contextConfiguration">the Configuration for this context.</param>
-        /// <param name="parentContext"></param>
-        public ContextRuntime(
-                IInjector serviceInjector,
-                IConfiguration contextConfiguration,
-                Optional<ContextRuntime> parentContext)
-        {
-            ContextConfiguration config = contextConfiguration as ContextConfiguration;
-            if (config == null)
-            {
-                var e = new ArgumentException("contextConfiguration is not of type ContextConfiguration");
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-            }
-            _contextLifeCycle = new ContextLifeCycle(config.Id);
-            _serviceInjector = serviceInjector;
-            _parentContext = parentContext;
-            try
-            {
-                _contextInjector = serviceInjector.ForkInjector();
-            }
-            catch (Exception e)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
-
-                Optional<string> parentId = ParentContext.IsPresent() ?
-                    Optional<string>.Of(ParentContext.Value.Id) :
-                    Optional<string>.Empty();
-                ContextClientCodeException ex = new ContextClientCodeException(ContextClientCodeException.GetId(contextConfiguration), parentId, "Unable to spawn context", e);
-                
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
-            }
-            // Trigger the context start events on contextInjector.
-            _contextLifeCycle.Start();
-        }
-
-        /// <summary>
-        ///  Create a new ContextRuntime for the root context.
-        /// </summary>
-        /// <param name="serviceInjector"> </param> the serviceInjector to be used.
-        /// <param name="contextConfiguration"> the Configuration for this context.</param>
-        public ContextRuntime(
-            IInjector serviceInjector,
-            IConfiguration contextConfiguration)
-            : this(serviceInjector, contextConfiguration, Optional<ContextRuntime>.Empty())
-        {
-            LOGGER.Log(Level.Info, "Instantiating root context");
-        }
-
-        public string Id
-        {
-            get { return _contextLifeCycle.Id; }
-        }
-
-        public Optional<ContextRuntime> ParentContext
-        {
-            get { return _parentContext; }
-        }
-
-        /// <summary>
-        ///  Spawns a new context.
-        ///  The new context will have a serviceInjector that is created by forking the one in this object with the given
-        ///  serviceConfiguration. The contextConfiguration is used to fork the contextInjector from that new serviceInjector.
-        /// </summary>
-        /// <param name="contextConfiguration">the new context's context (local) Configuration.</param>
-        /// <param name="serviceConfiguration">the new context's service Configuration.</param>
-        /// <returns>a child context.</returns>
-        public ContextRuntime SpawnChildContext(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
-        {
-            ContextRuntime childContext = null;
-            lock (_contextLifeCycle)
-            {
-                if (_task.IsPresent())
-                {
-                    var e = new InvalidOperationException(
-                        string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                if (_childContext.IsPresent())
-                {
-                    var e = new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                try
-                {
-                    IInjector childServiceInjector = _serviceInjector.ForkInjector(new IConfiguration[] { serviceConfiguration });
-                    childContext = new ContextRuntime(childServiceInjector, contextConfiguration, Optional<ContextRuntime>.Of(this));
-                    _childContext = Optional<ContextRuntime>.Of(childContext);
-                    return childContext;
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
-
-                    Optional<string> parentId = ParentContext.IsPresent() ?
-                        Optional<string>.Of(ParentContext.Value.Id) :
-                        Optional<string>.Empty();
-                    ContextClientCodeException ex = new ContextClientCodeException(ContextClientCodeException.GetId(contextConfiguration), parentId, "Unable to spawn context", e);
-                    
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
-                }
-            }
-            return childContext;
-        }
-
-        /// <summary>
-        /// Spawns a new context without services of its own.
-        /// The new context will have a serviceInjector that is created by forking the one in this object. The
-        /// contextConfiguration is used to fork the contextInjector from that new serviceInjector.
-        /// </summary>
-        /// <param name="contextConfiguration">the new context's context (local) Configuration.</param>
-        /// <returns> a child context.</returns>
-        public ContextRuntime SpawnChildContext(IConfiguration contextConfiguration)
-        {
-            lock (_contextLifeCycle)
-            {
-                if (_task.IsPresent())
-                {
-                    var e = new InvalidOperationException(
-                        string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                if (_childContext.IsPresent())
-                {
-                    var e = new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                IInjector childServiceInjector = _serviceInjector.ForkInjector();
-                ContextRuntime childContext = new ContextRuntime(childServiceInjector, contextConfiguration, Optional<ContextRuntime>.Of(this));
-                _childContext = Optional<ContextRuntime>.Of(childContext);
-                return childContext;
-            }
-        }
-
-        /// <summary>
-        ///  Launches an Task on this context.
-        /// </summary>
-        /// <param name="taskConfiguration"></param>
-        /// <param name="contextId"></param>
-        /// <param name="heartBeatManager"></param>
-        public void StartTask(TaskConfiguration taskConfiguration, string contextId, HeartBeatManager heartBeatManager)
-        {
-            lock (_contextLifeCycle)
-            {
-                bool taskPresent = _task.IsPresent();
-                bool taskEnded = taskPresent && _task.Value.HasEnded();
-
-                LOGGER.Log(Level.Info, "ContextRuntime::StartTask(TaskConfiguration)" + "task is present: " + taskPresent + " task has ended: " + taskEnded);
-                if (taskPresent)
-                {
-                    LOGGER.Log(Level.Info, "Task state: " + _task.Value.GetTaskState());
-                }
-
-                if (taskEnded)
-                {
-                    // clean up state
-                    _task = Optional<TaskRuntime>.Empty();
-                    taskPresent = false;
-                }
-                if (taskPresent)
-                {
-                    var e = new InvalidOperationException(
-                        string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                if (_childContext.IsPresent())
-                {
-                    var e = new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                try
-                {
-                    IInjector taskInjector = _contextInjector.ForkInjector(new IConfiguration[] { taskConfiguration.TangConfig });
-                    LOGGER.Log(Level.Info, "Trying to inject task with configuration" + taskConfiguration.ToString());
-                    TaskRuntime taskRuntime = new TaskRuntime(taskInjector, contextId, taskConfiguration.TaskId, heartBeatManager); // taskInjector.getInstance(TaskRuntime.class);
-                    taskRuntime.Initialize();
-                    System.Threading.Tasks.Task.Run(new Action(taskRuntime.Start));                    
-                    _task = Optional<TaskRuntime>.Of(taskRuntime);
-                }
-                catch (Exception e)
-                {
-                    var ex = new TaskClientCodeException(taskConfiguration.TaskId, Id, "Unable to instantiate the new task", e);
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(ex, Level.Error, "Task start error.", LOGGER);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Close this context. If there is a child context, this recursively closes it before closing this context. If
-        /// there is an Task currently running, that will be closed.
-        /// </summary>
-        public void Dispose()
-        {
-            lock (_contextLifeCycle)
-            {
-                _contextState = ContextStatusProto.State.DONE;
-                if (_task.IsPresent())
-                {
-                    LOGGER.Log(Level.Warning, "Shutting down an task because the underlying context is being closed.");
-                    _task.Value.Close(null);
-                }
-                if (_childContext.IsPresent())
-                {
-                    LOGGER.Log(Level.Warning, "Closing a context because its parent context is being closed.");
-                    _childContext.Value.Dispose();
-                }
-                _contextLifeCycle.Close();
-                if (_parentContext.IsPresent())
-                {
-                    ParentContext.Value.ResetChildContext();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Issue a suspend call to the Task
-        /// Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
-        /// in the log.
-        /// </summary>
-        /// <param name="message"> the suspend message to deliver or null if there is none.</param>
-        public void SuspendTask(byte[] message)
-        {
-            lock (_contextLifeCycle)
-            {
-                if (!_task.IsPresent())
-                {
-                    LOGGER.Log(Level.Warning, "Received a suspend task while there was no task running. Ignored");
-                }
-                else
-                {
-                    _task.Value.Suspend(message);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Issue a close call to the Task
-        /// Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
-        /// in the log.
-        /// </summary>
-        /// <param name="message">the close  message to deliver or null if there is none.</param>
-        public void CloseTask(byte[] message)
-        {
-            lock (_contextLifeCycle)
-            {
-                if (!_task.IsPresent())
-                {
-                    LOGGER.Log(Level.Warning, "Received a close task while there was no task running. Ignored");
-                }
-                else
-                {
-                    _task.Value.Close(message);
-                }
-            }
-        }
-
-        /// <summary>
-        ///  Deliver a message to the Task
-        /// Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
-        /// in the log.
-        /// </summary>
-        /// <param name="message">the message to deliver or null if there is none.</param>
-        public void DeliverTaskMessage(byte[] message)
-        {
-            lock (_contextLifeCycle)
-            {
-                if (!_task.IsPresent())
-                {
-                    LOGGER.Log(Level.Warning, "Received an task message while there was no task running. Ignored");
-                }
-                else
-                {
-                    _task.Value.Deliver(message);
-                }
-            }
-        }
-
-        public void HandleContextMessaage(byte[] mesage)
-        {
-            _contextLifeCycle.HandleContextMessage(mesage);
-        }
-
-        /// <summary>
-        /// get state of the running Task
-        /// </summary>
-        /// <returns> the state of the running Task, if one is running.</returns>
-        public Optional<TaskStatusProto> GetTaskStatus()
-        {
-            lock (_contextLifeCycle)
-            {
-                if (_task.IsPresent())
-                {
-                    if (_task.Value.HasEnded())
-                    {
-                        _task = Optional<TaskRuntime>.Empty();
-                        return Optional<TaskStatusProto>.Empty();
-                    }
-                    else
-                    {
-                        TaskStatusProto taskStatusProto = _task.Value.GetStatusProto();
-                        if (taskStatusProto.state == State.RUNNING)
-                        {
-                            // only RUNNING status is allowed to rurn here, all other state pushed out to heartbeat 
-                            return Optional<TaskStatusProto>.Of(taskStatusProto);
-                        }
-                        var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task state must be RUNNING, but instead is in {0} state", taskStatusProto.state));
-                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                        return Optional<TaskStatusProto>.Empty();
-                    }
-                }
-                else
-                {
-                    return Optional<TaskStatusProto>.Empty();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Reset child context when parent is being closed
-        /// </summary>
-        public void ResetChildContext()
-        {
-            lock (_contextLifeCycle)
-            {
-                if (_childContext.IsPresent())
-                {
-                    _childContext = Optional<ContextRuntime>.Empty();
-                }
-                else
-                {
-                    var e = new InvalidOperationException("no child context set");
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-            }
-        }
-
-        /// <summary>
-        /// get context's status in protocol buffer
-        /// </summary>
-        /// <returns>this context's status in protocol buffer form.</returns>
-        public ContextStatusProto GetContextStatus()
-        {
-            lock (_contextLifeCycle)
-            {
-                ContextStatusProto contextStatusProto = new ContextStatusProto()
-                {
-                    context_id = Id,
-                    context_state = _contextState,
-                };
-                if (_parentContext.IsPresent())
-                {
-                    contextStatusProto.parent_id = _parentContext.Value.Id;
-                }
-
-                foreach (IContextMessageSource source in _contextLifeCycle.ContextMessageSources)
-                {
-                    Optional<ContextMessage> contextMessageOptional = source.Message;
-                    if (contextMessageOptional.IsPresent())
-                    {
-                        ContextStatusProto.ContextMessageProto contextMessageProto
-                            = new ContextStatusProto.ContextMessageProto()
-                            {
-                                source_id = contextMessageOptional.Value.MessageSourceId,
-                            };
-                        contextMessageProto.message = ByteUtilities.CopyBytesFrom(contextMessageOptional.Value.Bytes);
-                        contextStatusProto.context_message.Add(contextMessageProto);
-                    }
-                }
-                return contextStatusProto;
-            }
-        }
-    }
-}
-        ///// <summary>
-        ///// TODO: remove and use parameterless GetContextStatus above
-        ///// </summary>
-        ///// <returns>this context's status in protocol buffer form.</returns>
-        //public ContextStatusProto GetContextStatus(string contextId)
-        //{
-        //    ContextStatusProto contextStatusProto = new ContextStatusProto()
-        //    {
-        //        context_id = contextId,
-        //        context_state = _contextState,
-        //    };
-        //    return contextStatusProto;
-        //}
-
-        ////// TODO: remove and use injection
-        //public void StartTask(ITask task, HeartBeatManager heartBeatManager, string taskId, string contextId)
-        //{
-        //    lock (_contextLifeCycle)
-        //    {
-        //        if (_task.IsPresent() && _task.Value.HasEnded())
-        //        {
-        //            // clean up state
-        //            _task = Optional<TaskRuntime>.Empty();
-        //        }
-        //        if (_task.IsPresent())
-        //        {
-        //            throw new InvalidOperationException(
-        //                string.Format(CultureInfo.InvariantCulture, "Attempting to spawn a child context when an Task with id '{0}' is running", _task.Value.TaskId)); // note: java code is putting thread id here
-        //        }
-        //        if (_childContext.IsPresent())
-        //        {
-        //            throw new InvalidOperationException("Attempting to instantiate a child context on a context that is not the topmost active context.");
-        //        }
-        //        try
-        //        {
-        //            // final Injector taskInjector = contextInjector.forkInjector(taskConfiguration);
-        //            TaskRuntime taskRuntime  // taskInjector.getInstance(TaskRuntime.class);
-        //                = new TaskRuntime(task, heartBeatManager);
-        //            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Starting task '{0}'", taskId));
-        //            taskRuntime.Initialize(taskId, contextId);
-        //            taskRuntime.Start();
-        //            _task = Optional<TaskRuntime>.Of(taskRuntime);
-        //        }
-        //        catch (Exception e)
-        //        {
-        //            throw new InvalidOperationException("Unable to instantiate the new task");
-        //        }
-        //    }
-        //}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStartImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStartImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStartImpl.cs
deleted file mode 100644
index 7c62a0b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStartImpl.cs
+++ /dev/null
@@ -1,33 +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 Org.Apache.REEF.Common.Events;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    class ContextStartImpl : IContextStart
-    {
-        public ContextStartImpl(string id)
-        {
-            Id = id;
-        }
-
-        public string Id { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStopImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStopImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStopImpl.cs
deleted file mode 100644
index 4df40b6..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/ContextStopImpl.cs
+++ /dev/null
@@ -1,33 +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 Org.Apache.REEF.Common.Events;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    class ContextStopImpl : IContextStop
-    {
-        public ContextStopImpl(string id)
-        {
-            Id = id;
-        }
-        
-        public string Id { get; set; }   
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/RootContextLauncher.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/RootContextLauncher.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/RootContextLauncher.cs
deleted file mode 100644
index e7daecb..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/context/RootContextLauncher.cs
+++ /dev/null
@@ -1,126 +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 Org.Apache.REEF.Common.Evaluator.Context;
-using Org.Apache.REEF.Services;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Implementations;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Globalization;
-using Org.Apache.REEF.Tang.Implementations.Tang;
-
-namespace Org.Apache.REEF.Common.Context
-{
-    /// <summary>
-    ///  Helper class that encapsulates the root context configuration: With or without services and an initial task.
-    /// </summary>
-    public sealed class RootContextLauncher
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(RootContextLauncher));
-        
-        private readonly IInjector _rootServiceInjector = null;
-
-        private ContextRuntime _rootContext = null;
-
-        private ContextConfiguration _rootContextConfiguration = null;
-
-        public RootContextLauncher(ContextConfiguration rootContextConfig, Optional<ServiceConfiguration> rootServiceConfig, Optional<TaskConfiguration> rootTaskConfig)
-        {
-            _rootContextConfiguration = rootContextConfig;
-            _rootServiceInjector = InjectServices(rootServiceConfig);
-            RootTaskConfig = rootTaskConfig;
-        }
-
-        public Optional<TaskConfiguration> RootTaskConfig { get; set; }
-
-        public ContextConfiguration RootContextConfig
-        {
-            get { return _rootContextConfiguration; }
-            set { _rootContextConfiguration = value; }
-        }
-
-        public ContextRuntime GetRootContext()
-        {
-            if (_rootContext == null)
-            {
-                _rootContext = GetRootContext(_rootServiceInjector, _rootContextConfiguration);
-            }
-            return _rootContext;
-        }
-
-        private IInjector InjectServices(Optional<ServiceConfiguration> serviceConfig)
-        {
-            IInjector rootServiceInjector;
-
-            if (serviceConfig.IsPresent())
-            {
-                rootServiceInjector = TangFactory.GetTang().NewInjector(serviceConfig.Value.TangConfig);
-                InjectedServices services = null;
-                try
-                {
-                    services = rootServiceInjector.GetInstance<InjectedServices>();
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Failed to instantiate service.", LOGGER);
-                    InvalidOperationException ex = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Failed to inject service: encoutned error {1} with message [{0}] and stack trace:[{1}]", e, e.Message, e.StackTrace));
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
-                }
-                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "injected {0} service(s)", services.Services.Count));
-            }
-            else
-            {
-                rootServiceInjector = TangFactory.GetTang().NewInjector();
-                LOGGER.Log(Level.Info, "no service provided for injection.");
-            }
-            
-            return rootServiceInjector;
-        }
-
-        private ContextRuntime GetRootContext( 
-            IInjector rootServiceInjector,
-            IConfiguration rootContextConfiguration)
-        {
-            ContextRuntime result;
-            result = new ContextRuntime(rootServiceInjector, rootContextConfiguration);
-            return result;
-        }
-    }
-}
-//if (rootServiceInjector != null)
-//{
-//    try
-//    {
-//        rootServiceInjector = rootServiceInjector.ForkInjector(serviceConfigs);
-//    }
-//    catch (Exception e)
-//    {
-//        throw new ContextClientCodeException(ContextClientCodeException.GetId(rootContextConfiguration),
-//                                             Optional<String>.Empty(),
-//                                             "Unable to instatiate the root context", e);
-//    }
-//    result = new ContextRuntime(rootServiceInjector, rootContextConfiguration);
-//}
-//else
-//{
-//    result = new ContextRuntime(rootServiceInjector.ForkInjector(), rootContextConfiguration);
-//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/CloseEventImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/CloseEventImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/CloseEventImpl.cs
deleted file mode 100644
index fc50c73..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/CloseEventImpl.cs
+++ /dev/null
@@ -1,48 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Common
-{
-    public class CloseEventImpl : ICloseEvent
-    {
-        public CloseEventImpl()
-        {
-            Value = Optional<byte[]>.Empty();
-        }
-
-        public CloseEventImpl(byte[] bytes)
-        {
-            Value = Optional<byte[]>.OfNullable(bytes);
-        }
-
-        public Optional<byte[]> Value
-        {
-            get { return Value; }
-            set { value = Value; } 
-        }
-
-        public override string ToString()
-        {
-            return "CloseEvent{value=" + Value.ToString() + "}";
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/DriverMessageImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/DriverMessageImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/DriverMessageImpl.cs
deleted file mode 100644
index 2b00aa2..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/DriverMessageImpl.cs
+++ /dev/null
@@ -1,52 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Common.Runtime.Evaluator
-{
-    public class DriverMessageImpl : IDriverMessage
-    {
-        private Optional<byte[]> _value;
- 
-        public DriverMessageImpl()
-        {
-            _value = Optional<byte[]>.Empty();
-        }
-
-        public DriverMessageImpl(byte[] bytes)
-        {
-            _value = Optional<byte[]>.OfNullable(bytes);
-        }
-
-        public Optional<byte[]> Message
-        {
-            get
-            {
-                return _value;
-            }
-        }
-
-        public override string ToString()
-        {
-            return "DriverMessage [value=" + ByteUtilities.ByteArrarysToString(_value.Value) + "]";
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/SuspendEventImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/SuspendEventImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/SuspendEventImpl.cs
deleted file mode 100644
index a6bb52f..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/SuspendEventImpl.cs
+++ /dev/null
@@ -1,48 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Utilities;
-
-namespace Org.Apache.REEF.Common
-{
-    public class SuspendEventImpl : ICloseEvent
-    {
-        public SuspendEventImpl()
-        {
-            Value = Optional<byte[]>.Empty();
-        }
-
-        public SuspendEventImpl(byte[] bytes)
-        {
-            Value = Optional<byte[]>.OfNullable(bytes);
-        }
-
-        public Optional<byte[]> Value
-        {
-            get { return Value; }
-            set { value = Value; }
-        }
-
-        public override string ToString()
-        {
-            return "SuspendEvent{value=" + Value.ToString() + "}";
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskClientCodeException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskClientCodeException.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskClientCodeException.cs
deleted file mode 100644
index 22bdbd3..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskClientCodeException.cs
+++ /dev/null
@@ -1,65 +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.Interface;
-
-namespace Org.Apache.REEF.Common.Task
-{
-    public class TaskClientCodeException : Exception
-    {
-        private readonly string _taskId;
-
-        private readonly string _contextId;
-
-        /// <summary>
-        /// construct the exception that caused the Task to fail
-        /// </summary>
-        /// <param name="taskId"> the id of the failed task.</param>
-        /// <param name="contextId"> the id of the context the failed Task was executing in.</param>
-        /// <param name="message"> the error message </param>
-        /// <param name="cause"> the exception that caused the Task to fail.</param>
-        public TaskClientCodeException(
-                string taskId,
-                string contextId,
-                string message,
-                Exception cause)
-            : base(message, cause)
-        {
-            _taskId = taskId;
-            _contextId = contextId;
-        }
-
-        public string TaskId 
-        {
-            get { return _taskId; }
-        }
-
-        public string ContextId
-        {
-            get { return _contextId; }
-        }
-
-        public static string GetTaskIdentifier(IConfiguration c)
-        {
-            // TODO: update after TANG is available
-            return string.Empty;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskLifeCycle.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskLifeCycle.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskLifeCycle.cs
deleted file mode 100644
index 26e638d..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskLifeCycle.cs
+++ /dev/null
@@ -1,69 +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 Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Wake;
-using System;
-using System.Collections.Generic;
-
-namespace Org.Apache.REEF.Common
-{
-    public class TaskLifeCycle
-    {
-        private readonly HashSet<IObserver<ITaskStop>> _taskStopHandlers;
-        private readonly HashSet<IObserver<ITaskStart>> _taskStartHandlers;
-        private readonly ITaskStart _taskStart;
-        private readonly ITaskStop _taskStop;
-
-        // INJECT
-        public TaskLifeCycle(
-            HashSet<IObserver<ITaskStop>> taskStopHandlers,
-            HashSet<IObserver<ITaskStart>> taskStartHandlers,
-            TaskStartImpl taskStart,
-            TaskStopImpl taskStop)
-        {
-            _taskStartHandlers = taskStartHandlers;
-            _taskStopHandlers = taskStopHandlers;
-            _taskStart = taskStart;
-            _taskStop = taskStop;
-        }
-
-        public TaskLifeCycle()
-        {
-            _taskStartHandlers = new HashSet<IObserver<ITaskStart>>();
-            _taskStopHandlers = new HashSet<IObserver<ITaskStop>>();
-        }
-        
-        public void Start() 
-        {
-            foreach (IObserver<ITaskStart> startHandler in _taskStartHandlers) 
-            {
-                startHandler.OnNext(_taskStart);
-            }
-        }
-
-        public void Stop() 
-        {
-            foreach (IObserver<ITaskStop> stopHandler in _taskStopHandlers)
-            {
-                stopHandler.OnNext(_taskStop);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index d531df7..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskRuntime.cs
+++ /dev/null
@@ -1,328 +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 Org.Apache.REEF.Common.io;
-using Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Common.Runtime.Evaluator;
-using Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Exceptions;
-using Org.Apache.REEF.Tang.Interface;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Common
-{
-    public class TaskRuntime : IObserver<ICloseEvent>, IObserver<ISuspendEvent>, IObserver<IDriverMessage>
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskRuntime));
-        
-        private readonly ITask _task;
-
-        private readonly IInjector _injector;
-
-        // The memento given by the task configuration
-        private readonly Optional<byte[]> _memento;
-
-        private readonly HeartBeatManager _heartBeatManager;
-
-        private readonly TaskStatus _currentStatus;
-
-        private readonly INameClient _nameClient;
-
-        public TaskRuntime(IInjector taskInjector, string contextId, string taskId, HeartBeatManager heartBeatManager, string memento = null)
-        {
-            _injector = taskInjector;
-            _heartBeatManager = heartBeatManager;
-
-            Optional<ISet<ITaskMessageSource>> messageSources = Optional<ISet<ITaskMessageSource>>.Empty();
-            try
-            {
-                _task = _injector.GetInstance<ITask>();
-            }
-            catch (Exception e)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(new InvalidOperationException("Unable to inject task.", e), Level.Error, "Unable to inject task.", LOGGER);
-            }
-            try
-            {
-                ITaskMessageSource taskMessageSource = _injector.GetInstance<ITaskMessageSource>();
-                messageSources = Optional<ISet<ITaskMessageSource>>.Of(new HashSet<ITaskMessageSource>() { taskMessageSource });
-            }
-            catch (Exception e)
-            {
-                Org.Apache.REEF.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
-            {
-                _nameClient = _injector.GetInstance<INameClient>();
-                _heartBeatManager.EvaluatorSettings.NameClient = _nameClient;
-            }
-            catch (InjectionException)
-            {
-                LOGGER.Log(Level.Warning, "Cannot inject name client from task configuration.");
-                // do not rethrow since user is not required to provide name client
-            }
-
-            LOGGER.Log(Level.Info, "task message source injected");
-            _currentStatus = new TaskStatus(_heartBeatManager, contextId, taskId, messageSources);
-            _memento = memento == null ?
-                Optional<byte[]>.Empty() : Optional<byte[]>.Of(ByteUtilities.StringToByteArrays(memento));
-        }
-
-        public string TaskId
-        {
-            get { return _currentStatus.TaskId; }
-        }
-
-        public string ContextId
-        {
-            get { return _currentStatus.ContextId; }
-        }
-
-        public void Initialize()
-        {
-            _currentStatus.SetRunning();
-        }
-
-        /// <summary>
-        /// Run the task
-        /// </summary>
-        public void Start()
-        {
-            try
-            {
-                LOGGER.Log(Level.Info, "Call Task");
-                if (_currentStatus.IsNotRunning())
-                {
-                    var e = new InvalidOperationException("TaskRuntime not in Running state, instead it is in state " + _currentStatus.State);
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
-                }
-                byte[] result;
-                byte[] taskMemento = _memento.IsPresent() ? _memento.Value : null;
-                System.Threading.Tasks.Task<byte[]> runTask = new System.Threading.Tasks.Task<byte[]>(() => RunTask(taskMemento));
-                try
-                {
-                    runTask.Start();
-                    runTask.Wait();
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, "Exception thrown during task running.", LOGGER);
-                }
-                result = runTask.Result;
-
-                LOGGER.Log(Level.Info, "Task Call Finished");
-                if (_task != null)
-                {
-                    _task.Dispose();
-                }
-                _currentStatus.SetResult(result);
-                if (result != null && result.Length > 0)
-                {
-                    LOGGER.Log(Level.Info, "Task running result:\r\n" + System.Text.Encoding.Default.GetString(result));
-                }
-            }
-            catch (Exception e)
-            {
-                if (_task != null)
-                {
-                    _task.Dispose();
-                }
-                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Task failed caused by exception [{0}]", e));
-                _currentStatus.SetException(e);
-            }
-        }
-
-        public TaskState GetTaskState()
-        {
-            return _currentStatus.State;
-        }
-
-        /// <summary>
-        /// Called by heartbeat manager
-        /// </summary>
-        /// <returns>  current TaskStatusProto </returns>
-        public TaskStatusProto GetStatusProto()
-        {
-            return _currentStatus.ToProto();
-        }
-
-        public bool HasEnded()
-        {
-            return _currentStatus.HasEnded();
-        }
-
-        /// <summary>
-        /// get ID of the task.
-        /// </summary>
-        /// <returns>ID of the task.</returns>
-        public string GetActicityId()
-        {
-            return _currentStatus.TaskId;
-        }
-
-        public void Close(byte[] message)
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Trying to close Task {0}", TaskId));
-            if (_currentStatus.IsNotRunning())
-            {
-                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Trying to close an task that is in {0} state. Ignored.", _currentStatus.State));
-            }
-            else
-            {
-                try
-                {
-                    OnNext(new CloseEventImpl(message));
-                    _currentStatus.SetCloseRequested();
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Error during Close.", LOGGER);
-
-                    _currentStatus.SetException(
-                        new TaskClientCodeException(TaskId, ContextId, "Error during Close().", e));
-                }
-            }
-        }
-
-        public void Suspend(byte[] message)
-        {
-            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Trying to suspend Task {0}", TaskId));
-            
-            if (_currentStatus.IsNotRunning())
-            {
-                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Trying to supend an task that is in {0} state. Ignored.", _currentStatus.State));
-            }
-            else
-            {
-                try
-                {
-                    OnNext(new SuspendEventImpl(message));
-                    _currentStatus.SetSuspendRequested();
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Error during Suspend.", LOGGER);
-                    _currentStatus.SetException(
-                        new TaskClientCodeException(TaskId, ContextId, "Error during Suspend().", e));
-                }
-            }
-        }
-
-        public void Deliver(byte[] message)
-        {
-            if (_currentStatus.IsNotRunning())
-            {
-                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Trying to send a message to an task that is in {0} state. Ignored.", _currentStatus.State));
-            }
-            else
-            {
-                try
-                {
-                    OnNext(new DriverMessageImpl(message));
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Error during message delivery.", LOGGER);
-                    _currentStatus.SetException(
-                        new TaskClientCodeException(TaskId, ContextId, "Error during message delivery.", e));
-                }
-            }
-        }
-
-        public void OnNext(ICloseEvent value)
-        {
-            LOGGER.Log(Level.Info, "TaskRuntime::OnNext(ICloseEvent value)");
-            // TODO: send a heartbeat
-        }
-
-        void IObserver<ICloseEvent>.OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<IDriverMessage>.OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<IDriverMessage>.OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<ISuspendEvent>.OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<ISuspendEvent>.OnError(Exception error)
-        {
-            throw new NotImplementedException();
-        }
-
-        void IObserver<ICloseEvent>.OnCompleted()
-        {
-            throw new NotImplementedException();
-        }
-
-        public void OnNext(ISuspendEvent value)
-        {
-            LOGGER.Log(Level.Info, "TaskRuntime::OnNext(ISuspendEvent value)");
-            // TODO: send a heartbeat
-        }
-
-        public void OnNext(IDriverMessage value)
-        {
-            IDriverMessageHandler messageHandler = null;
-            LOGGER.Log(Level.Info, "TaskRuntime::OnNext(IDriverMessage value)");
-            try
-            {
-                messageHandler = _injector.GetInstance<IDriverMessageHandler>();
-            }
-            catch (Exception e)
-            {
-                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, "Received Driver message, but unable to inject handler for driver message ", LOGGER);
-            }
-            if (messageHandler != null)
-            {
-                try
-                {
-                    messageHandler.Handle(value);
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, "Exception throw when handling driver message: " + e, LOGGER);
-                    _currentStatus.RecordExecptionWithoutHeartbeat(e);
-                }
-            }
-        }
-
-        private byte[] RunTask(byte[] memento)
-        {
-            return _task.Call(memento);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStartImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStartImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStartImpl.cs
deleted file mode 100644
index ad8002b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStartImpl.cs
+++ /dev/null
@@ -1,34 +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 Org.Apache.REEF.Tasks.Events;
-
-namespace Org.Apache.REEF.Common
-{
-    public class TaskStartImpl : ITaskStart
-    {        
-        //INJECT
-        public TaskStartImpl(string id)
-        {
-            Id = id;
-        }
-
-        public string Id { get; set; } 
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskState.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskState.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskState.cs
deleted file mode 100644
index 258bc24..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskState.cs
+++ /dev/null
@@ -1,40 +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.
- */
-
-namespace Org.Apache.REEF.Common
-{
-    public enum TaskState
-    {
-        Init = 0,
-        
-        Running = 1,
-
-        CloseRequested = 2,
-
-        SuspendRequested = 3,
-
-        Suspended = 4,
-
-        Failed = 5,
-
-        Done = 6,
-
-        Killed = 7
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index ba00262..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStatus.cs
+++ /dev/null
@@ -1,330 +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 Org.Apache.REEF.Common.ProtoBuf.ReefServiceProto;
-using Org.Apache.REEF.Tasks;
-using Org.Apache.REEF.Utilities;
-using Org.Apache.REEF.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-
-namespace Org.Apache.REEF.Common
-{
-    public class TaskStatus
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskStatus));
-        private readonly TaskLifeCycle _taskLifeCycle;
-        private readonly HeartBeatManager _heartBeatManager;
-        private readonly Optional<ISet<ITaskMessageSource>> _evaluatorMessageSources;
-
-        private string _taskId;
-        private string _contextId;
-        private Optional<Exception> _lastException = Optional<Exception>.Empty();
-        private Optional<byte[]> _result = Optional<byte[]>.Empty();
-        private TaskState _state;
-
-        public TaskStatus(HeartBeatManager heartBeatManager, string contextId, string taskId, Optional<ISet<ITaskMessageSource>> evaluatorMessageSources)
-        {
-            _contextId = contextId;
-            _taskId = taskId;
-            _heartBeatManager = heartBeatManager;
-            _taskLifeCycle = new TaskLifeCycle();
-            _evaluatorMessageSources = evaluatorMessageSources;
-            State = TaskState.Init;
-        }
-
-        public TaskState State
-        {
-            get
-            {
-                return _state;
-            }
-
-            set
-            {
-                if (IsLegalStateTransition(_state, value))
-                {
-                    _state = value;
-                }
-                else
-                {
-                    string message = string.Format(CultureInfo.InvariantCulture, "Illegal state transition from [{0}] to [{1}]", _state, value);
-                    LOGGER.Log(Level.Error, message);
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException(message), LOGGER);
-                }
-            }
-        }
-
-        public string TaskId
-        {
-            get { return _taskId; }
-        }
-
-        public string ContextId
-        {
-            get { return _contextId; }
-        }
-
-        public void SetException(Exception e)
-        {
-            RecordExecptionWithoutHeartbeat(e);
-            Heartbeat();
-            _lastException = Optional<Exception>.Empty();
-        }
-
-        public void SetResult(byte[] result)
-        {
-            _result = Optional<byte[]>.OfNullable(result);
-            if (State == TaskState.Running)
-            {
-                State = TaskState.Done;
-            }
-            else if (State == TaskState.SuspendRequested)
-            {
-                State = TaskState.Suspended;
-            }
-            else if (State == TaskState.CloseRequested)
-            {
-                State = TaskState.Done;
-            }
-            _taskLifeCycle.Stop();
-            Heartbeat();
-        }
-
-        public void SetRunning()
-        {
-            LOGGER.Log(Level.Verbose, "TaskStatus::SetRunning");
-            if (_state == TaskState.Init)
-            {
-                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();
-                    State = TaskState.Running;
-                }
-                catch (Exception e)
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Cannot set task status to running.", LOGGER);
-                    SetException(e);
-                }
-            }
-        }
-
-        public void SetCloseRequested()
-        {
-            State = TaskState.CloseRequested;
-        }
-
-        public void SetSuspendRequested()
-        {
-            State = TaskState.SuspendRequested;
-        }
-
-        public void SetKilled()
-        {
-            State = TaskState.Killed;
-            Heartbeat();
-        }
-
-        public bool IsNotRunning()
-        {
-            return _state != TaskState.Running;
-        }
-
-        public bool HasEnded()
-        {
-            switch (_state)
-            {
-                case TaskState.Done:
-                case TaskState.Suspended:
-                case TaskState.Failed:
-                case TaskState.Killed:
-                    return true;
-                default:
-                    return false;
-            }
-        }
-
-        public TaskStatusProto ToProto()
-        {
-            Check();
-            TaskStatusProto taskStatusProto = new TaskStatusProto()
-            {
-                context_id = _contextId,
-                task_id = _taskId,
-                state = GetProtoState(),
-            };
-            if (_result.IsPresent())
-            {
-                taskStatusProto.result = ByteUtilities.CopyBytesFrom(_result.Value);
-            }
-            else if (_lastException.IsPresent())
-            {
-                //final Encoder<Throwable> codec = new ObjectSerializableCodec<>();
-                //final byte[] error = codec.encode(_lastException.get());
-                byte[] error = ByteUtilities.StringToByteArrays(_lastException.Value.ToString());
-                taskStatusProto.result = ByteUtilities.CopyBytesFrom(error);
-            }
-            else if (_state == TaskState.Running)
-            {
-                foreach (TaskMessage message in GetMessages())
-                {
-                    TaskStatusProto.TaskMessageProto taskMessageProto = new TaskStatusProto.TaskMessageProto()
-                    {
-                        source_id = message.MessageSourceId,
-                        message = ByteUtilities.CopyBytesFrom(message.Message),
-                    };
-                    taskStatusProto.task_message.Add(taskMessageProto);
-                }
-            }
-            return taskStatusProto;
-        }
-
-        internal void RecordExecptionWithoutHeartbeat(Exception e)
-        {
-            if (!_lastException.IsPresent())
-            {
-                _lastException = Optional<Exception>.Of(e);
-            }
-            State = TaskState.Failed;
-            _taskLifeCycle.Stop();
-        }
-
-        private static bool IsLegalStateTransition(TaskState? from, TaskState to)
-        {
-            if (from == null)
-            {
-                return to == TaskState.Init;
-            }
-            switch (from)
-            {
-                case TaskState.Init:
-                    switch (to)
-                    {
-                        case TaskState.Init:
-                        case TaskState.Running:
-                        case TaskState.Failed:
-                        case TaskState.Killed:
-                        case TaskState.Done:
-                            return true;
-                        default:
-                            return false;
-                    }
-                case TaskState.Running:
-                    switch (to)
-                    {
-                        case TaskState.CloseRequested:
-                        case TaskState.SuspendRequested:
-                        case TaskState.Failed:
-                        case TaskState.Killed:
-                        case TaskState.Done:
-                            return true;
-                        default:
-                            return false;
-                    }
-                case TaskState.CloseRequested:
-                    switch (to)
-                    {
-                        case TaskState.Failed:
-                        case TaskState.Killed:
-                        case TaskState.Done:
-                            return true;
-                        default:
-                            return false;
-                    }
-                case TaskState.SuspendRequested:
-                    switch (to)
-                    {
-                        case TaskState.Failed:
-                        case TaskState.Killed:
-                        case TaskState.Suspended:
-                            return true;
-                        default:
-                            return false;
-                    }
-
-                case TaskState.Failed:
-                case TaskState.Done:
-                case TaskState.Killed:           
-                default:
-                    return true;
-            }
-        }
-
-        private void Check()
-        {
-            if (_result.IsPresent() && _lastException.IsPresent())
-            {
-                LOGGER.Log(Level.Warning, "Both task result and exception are present, the expcetion will take over. Thrown away result:" + ByteUtilities.ByteArrarysToString(_result.Value));
-                State = TaskState.Failed;
-                _result = Optional<byte[]>.Empty();
-            }
-        }
-
-        private void Heartbeat()
-        {
-            _heartBeatManager.OnNext(ToProto());
-        }
-
-        private State GetProtoState()
-        {
-            switch (_state)
-            {
-                case TaskState.Init:
-                    return ProtoBuf.ReefServiceProto.State.INIT;
-                case TaskState.CloseRequested:
-                case TaskState.SuspendRequested:
-                case TaskState.Running:
-                    return ProtoBuf.ReefServiceProto.State.RUNNING;
-                case TaskState.Done:
-                    return ProtoBuf.ReefServiceProto.State.DONE;
-                case TaskState.Suspended:
-                    return ProtoBuf.ReefServiceProto.State.SUSPEND;
-                case TaskState.Failed:
-                    return ProtoBuf.ReefServiceProto.State.FAILED;
-                case TaskState.Killed:
-                    return ProtoBuf.ReefServiceProto.State.KILLED;
-                default:
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException("Unknown state: " + _state), LOGGER);
-                    break;
-            }
-            return ProtoBuf.ReefServiceProto.State.FAILED; //this line should not be reached as default case will throw exception
-        }
-
-        private ICollection<TaskMessage> GetMessages()
-        {
-            List<TaskMessage> result = new List<TaskMessage>();
-            if (_evaluatorMessageSources.IsPresent())
-            {
-                foreach (ITaskMessageSource source in _evaluatorMessageSources.Value)
-                {
-                    Optional<TaskMessage> taskMessageOptional = source.Message;
-                    if (taskMessageOptional.IsPresent())
-                    {
-                        result.Add(taskMessageOptional.Value);
-                    }
-                }
-            }
-            return result;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStopImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStopImpl.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStopImpl.cs
deleted file mode 100644
index 397411b..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/task/TaskStopImpl.cs
+++ /dev/null
@@ -1,35 +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 Org.Apache.REEF.Common.Task;
-using Org.Apache.REEF.Tasks.Events;
-
-namespace Org.Apache.REEF.Common
-{
-    public class TaskStopImpl : ITaskStop
-    {
-        //INJECT
-        public TaskStopImpl(string id)
-        {
-            Id = id;
-        }
-
-        public string Id { get; set; }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 0125128..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/utils/EvaluatorConfigurations.cs
+++ /dev/null
@@ -1,121 +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 Org.Apache.REEF.Utilities.Logging;
-using Org.Apache.REEF.Tang.Formats;
-using System;
-using System.IO;
-using System.Linq;
-
-namespace Org.Apache.REEF.Common
-{
-    public class EvaluatorConfigurations
-    {
-        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorConfigurations));
-
-        private AvroConfiguration _avroConfiguration;
-
-        private string _configFile;
-
-        private string _applicationId;
-
-        private string _evaluatorId;
-
-        private string _taskConfiguration;
-
-        private string _rootContextConfiguration;
-
-        private string _rootServiceConfiguration;
-
-        public EvaluatorConfigurations(string configFile)
-        {
-            using (LOGGER.LogFunction("EvaluatorConfigurations::EvaluatorConfigurations"))
-            {
-                if (string.IsNullOrWhiteSpace(configFile))
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("configFile"), LOGGER);
-                }
-                if (!File.Exists(configFile))
-                {
-                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new FileNotFoundException("cannot find file " + configFile), LOGGER);
-                }
-                _configFile = configFile;
-                AvroConfigurationSerializer serializer = new AvroConfigurationSerializer();
-                _avroConfiguration = serializer.AvroDeseriaizeFromFile(_configFile);
-            }
-        }
-
-        public string TaskConfiguration
-        {
-            get
-            {
-                _taskConfiguration = _taskConfiguration ?? GetSettingValue(REEF.Evaluator.Constants.TaskConfiguration);
-                return _taskConfiguration;
-            }
-        }
-
-        public string EvaluatorId
-        {
-            get
-            {
-                _evaluatorId = _evaluatorId ?? GetSettingValue(REEF.Evaluator.Constants.EvaluatorIdentifier);
-                return _evaluatorId;
-            }
-        }
-
-        public string ApplicationId
-        {
-            get
-            {
-                _applicationId = _applicationId ?? GetSettingValue(REEF.Evaluator.Constants.ApplicationIdentifier);
-                return _applicationId;
-            }
-        }
-
-        public string RootContextConfiguration
-        {
-            get
-            {
-                _rootContextConfiguration = _rootContextConfiguration ?? GetSettingValue(REEF.Evaluator.Constants.RootContextConfiguration);
-                return _rootContextConfiguration;
-            }
-        }
-
-        public string RootServiceConfiguration
-        {
-            get
-            {
-                _rootServiceConfiguration = _rootServiceConfiguration ?? GetSettingValue(REEF.Evaluator.Constants.RootServiceConfiguration);
-                return _rootServiceConfiguration;
-            }
-        }
-
-        private string GetSettingValue(string settingKey)
-        {
-            ConfigurationEntry configurationEntry =
-                _avroConfiguration.Bindings.SingleOrDefault(b => b.key.EndsWith(settingKey, StringComparison.OrdinalIgnoreCase));
-            if (configurationEntry == null)
-            {
-                return string.Empty;
-            }
-
-            return configurationEntry.value;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/utils/RemoteManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/utils/RemoteManager.cs b/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/utils/RemoteManager.cs
deleted file mode 100644
index c9bcb56..0000000
--- a/lang/cs/Org.Apache.REEF.Common/runtime/evaluator/utils/RemoteManager.cs
+++ /dev/null
@@ -1,25 +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.
- */
-
-namespace Org.Apache.REEF.Common
-{
-    public class RemoteManager
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/services/IService.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/services/IService.cs b/lang/cs/Org.Apache.REEF.Common/services/IService.cs
deleted file mode 100644
index 016291c..0000000
--- a/lang/cs/Org.Apache.REEF.Common/services/IService.cs
+++ /dev/null
@@ -1,25 +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.
- */
-
-namespace Org.Apache.REEF.Services
-{
-    public interface IService
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
deleted file mode 100644
index 5331709..0000000
--- a/lang/cs/Org.Apache.REEF.Common/services/ServiceConfiguration.cs
+++ /dev/null
@@ -1,83 +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 Org.Apache.REEF.Tang.Annotations;
-using Org.Apache.REEF.Tang.Formats;
-using Org.Apache.REEF.Tang.Interface;
-using Org.Apache.REEF.Tang.Util;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-
-[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]
-
-namespace Org.Apache.REEF.Services
-{
-    /// <summary>
-    /// Configuration module for services. The configuration created here can be passed alongside a ContextConfiguration
-    /// to form a context. Different from bindings made in the ContextConfiguration, those made here will be passed along
-    /// to child context.
-    /// </summary>
-    public class ServiceConfiguration : ConfigurationModuleBuilder
-    {
-        /// <summary>
-        /// A set of services to instantiate. All classes given here will be instantiated in the context, and their references
-        /// will be made available to child context and tasks.
-        /// </summary>
-        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
-        public static readonly OptionalParameter<IService> Services = new OptionalParameter<IService>();
-
-        public ServiceConfiguration()
-            : base()
-        {
-        }
-
-        public ServiceConfiguration(string config)
-        {
-            TangConfig = new AvroConfigurationSerializer().FromString(config);
-        }
-
-        public static ConfigurationModule ConfigurationModule
-        {
-            get
-            {
-                return new ServiceConfiguration()
-                    .BindSetEntry(GenericType<ServicesSet>.Class, Services)
-                    .Build();
-            }
-        }
-
-        public IConfiguration TangConfig { get; private set; }
-    }
-
-    public class InjectedServices
-    {
-        [Inject]
-        public InjectedServices([Parameter(typeof(ServicesSet))] ISet<IService> services)
-        {
-            Services = services;
-        }
-
-        public ISet<IService> Services { get; set; }
-    }
-
-    [NamedParameter("Set of services", "servicesSet", "")]
-    class ServicesSet : Name<ISet<IService>>
-    {      
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/services/ServicesConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/services/ServicesConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/services/ServicesConfigurationOptions.cs
deleted file mode 100644
index 31a206a..0000000
--- a/lang/cs/Org.Apache.REEF.Common/services/ServicesConfigurationOptions.cs
+++ /dev/null
@@ -1,31 +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 Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Services
-{
-    public class ServicesConfigurationOptions
-    {
-        [NamedParameter("Services", "services", "services")]
-        public class Services : Name<string>
-        {
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/tasks/IDriverMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/tasks/IDriverMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/tasks/IDriverMessageHandler.cs
deleted file mode 100644
index 4c5d42f..0000000
--- a/lang/cs/Org.Apache.REEF.Common/tasks/IDriverMessageHandler.cs
+++ /dev/null
@@ -1,31 +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 Org.Apache.REEF.Tasks.Defaults;
-using Org.Apache.REEF.Tasks.Events;
-using Org.Apache.REEF.Tang.Annotations;
-
-namespace Org.Apache.REEF.Tasks
-{
-    //[DefaultImplementation(typeof(DefaultTaskMessageSource))]
-    public interface IDriverMessageHandler
-    {
-        void Handle(IDriverMessage message);
-    }
-}


[14/19] incubator-reef git commit: [REEF-136] Harmonize namespaces and folder names in Org.Apache.REEF projects

Posted by tm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/ReefMessageProtoObserver.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/ReefMessageProtoObserver.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/ReefMessageProtoObserver.cs
new file mode 100644
index 0000000..d1a9f8d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/ReefMessageProtoObserver.cs
@@ -0,0 +1,140 @@
+/**
+ * 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 System.Threading;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+using Org.Apache.REEF.Wake.Remote;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator
+{
+    public class ReefMessageProtoObserver :
+        IObserver<IRemoteMessage<REEFMessage>>,
+        IObservable<IRemoteMessage<REEFMessage>>,
+        IDisposable
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ReefMessageProtoObserver));
+        private volatile IObserver<IRemoteMessage<REEFMessage>> _observer = null;
+        private long _count = 0;
+        private DateTime _begin;
+        private DateTime _origBegin;
+
+        public void OnCompleted()
+        {
+        }
+
+        public void OnError(Exception error)
+        {
+        }
+
+        public void OnNext(IRemoteMessage<REEFMessage> value)
+        {
+            REEFMessage remoteEvent = value.Message;
+            IRemoteIdentifier id = value.Identifier;
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "receive a ReefMessage from {0} Driver at {1}.", remoteEvent, id));
+
+            if (remoteEvent.evaluatorControl != null)
+            {
+                if (remoteEvent.evaluatorControl.context_control != null)
+                {
+                    string context_message = null;
+                    string task_message = null;
+
+                    if (remoteEvent.evaluatorControl.context_control.context_message != null)
+                    {
+                        context_message = remoteEvent.evaluatorControl.context_control.context_message.ToString();
+                    }
+                    if (remoteEvent.evaluatorControl.context_control.task_message != null)
+                    {
+                        task_message = ByteUtilities.ByteArrarysToString(remoteEvent.evaluatorControl.context_control.task_message);
+                    }
+
+                    if (!(string.IsNullOrEmpty(context_message) && string.IsNullOrEmpty(task_message)))
+                    {
+                        LOGGER.Log(Level.Info, 
+                            string.Format(CultureInfo.InvariantCulture, "Control protobuf with context message [{0}] and task message [{1}]", context_message, task_message));
+                    }                   
+                    else if (remoteEvent.evaluatorControl.context_control.remove_context != null)
+                    {
+                         LOGGER.Log(Level.Info, 
+                            string.Format(CultureInfo.InvariantCulture, "Control protobuf to remove context {0}", remoteEvent.evaluatorControl.context_control.remove_context.context_id));
+                    }
+                    else if (remoteEvent.evaluatorControl.context_control.add_context != null)
+                    {
+                        LOGGER.Log(Level.Info, 
+                            string.Format(CultureInfo.InvariantCulture, "Control protobuf to add a context on top of {0}", remoteEvent.evaluatorControl.context_control.add_context.parent_context_id));
+                    }
+                    else if (remoteEvent.evaluatorControl.context_control.start_task != null)
+                    {
+                        LOGGER.Log(Level.Info, 
+                            string.Format(CultureInfo.InvariantCulture, "Control protobuf to start an task in {0}", remoteEvent.evaluatorControl.context_control.start_task.context_id));
+                    }
+                    else if (remoteEvent.evaluatorControl.context_control.stop_task != null)
+                    {
+                        LOGGER.Log(Level.Info, "Control protobuf to stop task");
+                    }
+                    else if (remoteEvent.evaluatorControl.context_control.suspend_task != null)
+                    {
+                        LOGGER.Log(Level.Info, "Control protobuf to suspend task"); 
+                    }
+                }
+            } 
+            if (_count == 0)
+            {
+                _begin = DateTime.Now;
+                _origBegin = _begin;
+            }
+            var count = Interlocked.Increment(ref _count);
+
+            int printBatchSize = 100000;
+            if (count % printBatchSize == 0)
+            {
+                DateTime end = DateTime.Now;
+                var diff = (end - _begin).TotalMilliseconds;
+                double seconds = diff / 1000.0;
+                long eventsPerSecond = (long)(printBatchSize / seconds);
+                _begin = DateTime.Now;
+            }
+
+            var observer = _observer;
+            if (observer != null)
+            {
+                observer.OnNext(value);
+            }
+        }
+
+        public IDisposable Subscribe(IObserver<IRemoteMessage<REEFMessage>> observer)
+        {
+            if (_observer != null)
+            {
+                return null;
+            }
+            _observer = observer;
+            return this;
+        }
+
+        public void Dispose()
+        {
+            _observer = null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/CloseEventImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/CloseEventImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/CloseEventImpl.cs
new file mode 100644
index 0000000..39bda77
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/CloseEventImpl.cs
@@ -0,0 +1,48 @@
+/**
+ * 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.Common.Tasks.Events;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class CloseEventImpl : ICloseEvent
+    {
+        public CloseEventImpl()
+        {
+            Value = Optional<byte[]>.Empty();
+        }
+
+        public CloseEventImpl(byte[] bytes)
+        {
+            Value = Optional<byte[]>.OfNullable(bytes);
+        }
+
+        public Optional<byte[]> Value
+        {
+            get { return Value; }
+            set { value = Value; } 
+        }
+
+        public override string ToString()
+        {
+            return "CloseEvent{value=" + Value.ToString() + "}";
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/DriverMessageImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/DriverMessageImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/DriverMessageImpl.cs
new file mode 100644
index 0000000..548e13a
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/DriverMessageImpl.cs
@@ -0,0 +1,52 @@
+/**
+ * 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.Common.Tasks.Events;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class DriverMessageImpl : IDriverMessage
+    {
+        private Optional<byte[]> _value;
+ 
+        public DriverMessageImpl()
+        {
+            _value = Optional<byte[]>.Empty();
+        }
+
+        public DriverMessageImpl(byte[] bytes)
+        {
+            _value = Optional<byte[]>.OfNullable(bytes);
+        }
+
+        public Optional<byte[]> Message
+        {
+            get
+            {
+                return _value;
+            }
+        }
+
+        public override string ToString()
+        {
+            return "DriverMessage [value=" + ByteUtilities.ByteArrarysToString(_value.Value) + "]";
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/SuspendEventImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/SuspendEventImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/SuspendEventImpl.cs
new file mode 100644
index 0000000..0a19106
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/SuspendEventImpl.cs
@@ -0,0 +1,48 @@
+/**
+ * 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.Common.Tasks.Events;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class SuspendEventImpl : ICloseEvent
+    {
+        public SuspendEventImpl()
+        {
+            Value = Optional<byte[]>.Empty();
+        }
+
+        public SuspendEventImpl(byte[] bytes)
+        {
+            Value = Optional<byte[]>.OfNullable(bytes);
+        }
+
+        public Optional<byte[]> Value
+        {
+            get { return Value; }
+            set { value = Value; }
+        }
+
+        public override string ToString()
+        {
+            return "SuspendEvent{value=" + Value.ToString() + "}";
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskClientCodeException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskClientCodeException.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskClientCodeException.cs
new file mode 100644
index 0000000..da83300
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskClientCodeException.cs
@@ -0,0 +1,65 @@
+/**
+ * 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.Interface;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class TaskClientCodeException : Exception
+    {
+        private readonly string _taskId;
+
+        private readonly string _contextId;
+
+        /// <summary>
+        /// construct the exception that caused the Task to fail
+        /// </summary>
+        /// <param name="taskId"> the id of the failed task.</param>
+        /// <param name="contextId"> the id of the context the failed Task was executing in.</param>
+        /// <param name="message"> the error message </param>
+        /// <param name="cause"> the exception that caused the Task to fail.</param>
+        public TaskClientCodeException(
+                string taskId,
+                string contextId,
+                string message,
+                Exception cause)
+            : base(message, cause)
+        {
+            _taskId = taskId;
+            _contextId = contextId;
+        }
+
+        public string TaskId 
+        {
+            get { return _taskId; }
+        }
+
+        public string ContextId
+        {
+            get { return _contextId; }
+        }
+
+        public static string GetTaskIdentifier(IConfiguration c)
+        {
+            // TODO: update after TANG is available
+            return string.Empty;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskLifeCycle.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskLifeCycle.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskLifeCycle.cs
new file mode 100644
index 0000000..74fc320
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskLifeCycle.cs
@@ -0,0 +1,68 @@
+/**
+ * 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.Common.Tasks.Events;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class TaskLifeCycle
+    {
+        private readonly HashSet<IObserver<ITaskStop>> _taskStopHandlers;
+        private readonly HashSet<IObserver<ITaskStart>> _taskStartHandlers;
+        private readonly ITaskStart _taskStart;
+        private readonly ITaskStop _taskStop;
+
+        // INJECT
+        public TaskLifeCycle(
+            HashSet<IObserver<ITaskStop>> taskStopHandlers,
+            HashSet<IObserver<ITaskStart>> taskStartHandlers,
+            TaskStartImpl taskStart,
+            TaskStopImpl taskStop)
+        {
+            _taskStartHandlers = taskStartHandlers;
+            _taskStopHandlers = taskStopHandlers;
+            _taskStart = taskStart;
+            _taskStop = taskStop;
+        }
+
+        public TaskLifeCycle()
+        {
+            _taskStartHandlers = new HashSet<IObserver<ITaskStart>>();
+            _taskStopHandlers = new HashSet<IObserver<ITaskStop>>();
+        }
+        
+        public void Start() 
+        {
+            foreach (IObserver<ITaskStart> startHandler in _taskStartHandlers) 
+            {
+                startHandler.OnNext(_taskStart);
+            }
+        }
+
+        public void Stop() 
+        {
+            foreach (IObserver<ITaskStop> stopHandler in _taskStopHandlers)
+            {
+                stopHandler.OnNext(_taskStop);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..721adf7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskRuntime.cs
@@ -0,0 +1,326 @@
+/**
+ * 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.Globalization;
+using Org.Apache.REEF.Common.Io;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Common.Tasks.Events;
+using Org.Apache.REEF.Tang.Exceptions;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class TaskRuntime : IObserver<ICloseEvent>, IObserver<ISuspendEvent>, IObserver<IDriverMessage>
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskRuntime));
+        
+        private readonly ITask _task;
+
+        private readonly IInjector _injector;
+
+        // The memento given by the task configuration
+        private readonly Optional<byte[]> _memento;
+
+        private readonly HeartBeatManager _heartBeatManager;
+
+        private readonly TaskStatus _currentStatus;
+
+        private readonly INameClient _nameClient;
+
+        public TaskRuntime(IInjector taskInjector, string contextId, string taskId, HeartBeatManager heartBeatManager, string memento = null)
+        {
+            _injector = taskInjector;
+            _heartBeatManager = heartBeatManager;
+
+            Optional<ISet<ITaskMessageSource>> messageSources = Optional<ISet<ITaskMessageSource>>.Empty();
+            try
+            {
+                _task = _injector.GetInstance<ITask>();
+            }
+            catch (Exception e)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(new InvalidOperationException("Unable to inject task.", e), Level.Error, "Unable to inject task.", LOGGER);
+            }
+            try
+            {
+                ITaskMessageSource taskMessageSource = _injector.GetInstance<ITaskMessageSource>();
+                messageSources = Optional<ISet<ITaskMessageSource>>.Of(new HashSet<ITaskMessageSource>() { taskMessageSource });
+            }
+            catch (Exception e)
+            {
+                Org.Apache.REEF.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
+            {
+                _nameClient = _injector.GetInstance<INameClient>();
+                _heartBeatManager.EvaluatorSettings.NameClient = _nameClient;
+            }
+            catch (InjectionException)
+            {
+                LOGGER.Log(Level.Warning, "Cannot inject name client from task configuration.");
+                // do not rethrow since user is not required to provide name client
+            }
+
+            LOGGER.Log(Level.Info, "task message source injected");
+            _currentStatus = new TaskStatus(_heartBeatManager, contextId, taskId, messageSources);
+            _memento = memento == null ?
+                Optional<byte[]>.Empty() : Optional<byte[]>.Of(ByteUtilities.StringToByteArrays(memento));
+        }
+
+        public string TaskId
+        {
+            get { return _currentStatus.TaskId; }
+        }
+
+        public string ContextId
+        {
+            get { return _currentStatus.ContextId; }
+        }
+
+        public void Initialize()
+        {
+            _currentStatus.SetRunning();
+        }
+
+        /// <summary>
+        /// Run the task
+        /// </summary>
+        public void Start()
+        {
+            try
+            {
+                LOGGER.Log(Level.Info, "Call Task");
+                if (_currentStatus.IsNotRunning())
+                {
+                    var e = new InvalidOperationException("TaskRuntime not in Running state, instead it is in state " + _currentStatus.State);
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER);
+                }
+                byte[] result;
+                byte[] taskMemento = _memento.IsPresent() ? _memento.Value : null;
+                System.Threading.Tasks.Task<byte[]> runTask = new System.Threading.Tasks.Task<byte[]>(() => RunTask(taskMemento));
+                try
+                {
+                    runTask.Start();
+                    runTask.Wait();
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, "Exception thrown during task running.", LOGGER);
+                }
+                result = runTask.Result;
+
+                LOGGER.Log(Level.Info, "Task Call Finished");
+                if (_task != null)
+                {
+                    _task.Dispose();
+                }
+                _currentStatus.SetResult(result);
+                if (result != null && result.Length > 0)
+                {
+                    LOGGER.Log(Level.Info, "Task running result:\r\n" + System.Text.Encoding.Default.GetString(result));
+                }
+            }
+            catch (Exception e)
+            {
+                if (_task != null)
+                {
+                    _task.Dispose();
+                }
+                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Task failed caused by exception [{0}]", e));
+                _currentStatus.SetException(e);
+            }
+        }
+
+        public TaskState GetTaskState()
+        {
+            return _currentStatus.State;
+        }
+
+        /// <summary>
+        /// Called by heartbeat manager
+        /// </summary>
+        /// <returns>  current TaskStatusProto </returns>
+        public TaskStatusProto GetStatusProto()
+        {
+            return _currentStatus.ToProto();
+        }
+
+        public bool HasEnded()
+        {
+            return _currentStatus.HasEnded();
+        }
+
+        /// <summary>
+        /// get ID of the task.
+        /// </summary>
+        /// <returns>ID of the task.</returns>
+        public string GetActicityId()
+        {
+            return _currentStatus.TaskId;
+        }
+
+        public void Close(byte[] message)
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Trying to close Task {0}", TaskId));
+            if (_currentStatus.IsNotRunning())
+            {
+                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Trying to close an task that is in {0} state. Ignored.", _currentStatus.State));
+            }
+            else
+            {
+                try
+                {
+                    OnNext(new CloseEventImpl(message));
+                    _currentStatus.SetCloseRequested();
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Error during Close.", LOGGER);
+
+                    _currentStatus.SetException(
+                        new TaskClientCodeException(TaskId, ContextId, "Error during Close().", e));
+                }
+            }
+        }
+
+        public void Suspend(byte[] message)
+        {
+            LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Trying to suspend Task {0}", TaskId));
+            
+            if (_currentStatus.IsNotRunning())
+            {
+                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Trying to supend an task that is in {0} state. Ignored.", _currentStatus.State));
+            }
+            else
+            {
+                try
+                {
+                    OnNext(new SuspendEventImpl(message));
+                    _currentStatus.SetSuspendRequested();
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Error during Suspend.", LOGGER);
+                    _currentStatus.SetException(
+                        new TaskClientCodeException(TaskId, ContextId, "Error during Suspend().", e));
+                }
+            }
+        }
+
+        public void Deliver(byte[] message)
+        {
+            if (_currentStatus.IsNotRunning())
+            {
+                LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "Trying to send a message to an task that is in {0} state. Ignored.", _currentStatus.State));
+            }
+            else
+            {
+                try
+                {
+                    OnNext(new DriverMessageImpl(message));
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Error during message delivery.", LOGGER);
+                    _currentStatus.SetException(
+                        new TaskClientCodeException(TaskId, ContextId, "Error during message delivery.", e));
+                }
+            }
+        }
+
+        public void OnNext(ICloseEvent value)
+        {
+            LOGGER.Log(Level.Info, "TaskRuntime::OnNext(ICloseEvent value)");
+            // TODO: send a heartbeat
+        }
+
+        void IObserver<ICloseEvent>.OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<IDriverMessage>.OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<IDriverMessage>.OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<ISuspendEvent>.OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<ISuspendEvent>.OnError(Exception error)
+        {
+            throw new NotImplementedException();
+        }
+
+        void IObserver<ICloseEvent>.OnCompleted()
+        {
+            throw new NotImplementedException();
+        }
+
+        public void OnNext(ISuspendEvent value)
+        {
+            LOGGER.Log(Level.Info, "TaskRuntime::OnNext(ISuspendEvent value)");
+            // TODO: send a heartbeat
+        }
+
+        public void OnNext(IDriverMessage value)
+        {
+            IDriverMessageHandler messageHandler = null;
+            LOGGER.Log(Level.Info, "TaskRuntime::OnNext(IDriverMessage value)");
+            try
+            {
+                messageHandler = _injector.GetInstance<IDriverMessageHandler>();
+            }
+            catch (Exception e)
+            {
+                Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, "Received Driver message, but unable to inject handler for driver message ", LOGGER);
+            }
+            if (messageHandler != null)
+            {
+                try
+                {
+                    messageHandler.Handle(value);
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, "Exception throw when handling driver message: " + e, LOGGER);
+                    _currentStatus.RecordExecptionWithoutHeartbeat(e);
+                }
+            }
+        }
+
+        private byte[] RunTask(byte[] memento)
+        {
+            return _task.Call(memento);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStartImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStartImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStartImpl.cs
new file mode 100644
index 0000000..1c3c734
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStartImpl.cs
@@ -0,0 +1,34 @@
+/**
+ * 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.Common.Tasks.Events;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class TaskStartImpl : ITaskStart
+    {        
+        //INJECT
+        public TaskStartImpl(string id)
+        {
+            Id = id;
+        }
+
+        public string Id { get; set; } 
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskState.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskState.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskState.cs
new file mode 100644
index 0000000..7829364
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskState.cs
@@ -0,0 +1,40 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public enum TaskState
+    {
+        Init = 0,
+        
+        Running = 1,
+
+        CloseRequested = 2,
+
+        SuspendRequested = 3,
+
+        Suspended = 4,
+
+        Failed = 5,
+
+        Done = 6,
+
+        Killed = 7
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..d62ef39
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStatus.cs
@@ -0,0 +1,330 @@
+/**
+ * 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.Globalization;
+using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
+using Org.Apache.REEF.Common.Tasks;
+using Org.Apache.REEF.Utilities;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class TaskStatus
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskStatus));
+        private readonly TaskLifeCycle _taskLifeCycle;
+        private readonly HeartBeatManager _heartBeatManager;
+        private readonly Optional<ISet<ITaskMessageSource>> _evaluatorMessageSources;
+
+        private string _taskId;
+        private string _contextId;
+        private Optional<Exception> _lastException = Optional<Exception>.Empty();
+        private Optional<byte[]> _result = Optional<byte[]>.Empty();
+        private TaskState _state;
+
+        public TaskStatus(HeartBeatManager heartBeatManager, string contextId, string taskId, Optional<ISet<ITaskMessageSource>> evaluatorMessageSources)
+        {
+            _contextId = contextId;
+            _taskId = taskId;
+            _heartBeatManager = heartBeatManager;
+            _taskLifeCycle = new TaskLifeCycle();
+            _evaluatorMessageSources = evaluatorMessageSources;
+            State = TaskState.Init;
+        }
+
+        public TaskState State
+        {
+            get
+            {
+                return _state;
+            }
+
+            set
+            {
+                if (IsLegalStateTransition(_state, value))
+                {
+                    _state = value;
+                }
+                else
+                {
+                    string message = string.Format(CultureInfo.InvariantCulture, "Illegal state transition from [{0}] to [{1}]", _state, value);
+                    LOGGER.Log(Level.Error, message);
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException(message), LOGGER);
+                }
+            }
+        }
+
+        public string TaskId
+        {
+            get { return _taskId; }
+        }
+
+        public string ContextId
+        {
+            get { return _contextId; }
+        }
+
+        public void SetException(Exception e)
+        {
+            RecordExecptionWithoutHeartbeat(e);
+            Heartbeat();
+            _lastException = Optional<Exception>.Empty();
+        }
+
+        public void SetResult(byte[] result)
+        {
+            _result = Optional<byte[]>.OfNullable(result);
+            if (State == TaskState.Running)
+            {
+                State = TaskState.Done;
+            }
+            else if (State == TaskState.SuspendRequested)
+            {
+                State = TaskState.Suspended;
+            }
+            else if (State == TaskState.CloseRequested)
+            {
+                State = TaskState.Done;
+            }
+            _taskLifeCycle.Stop();
+            Heartbeat();
+        }
+
+        public void SetRunning()
+        {
+            LOGGER.Log(Level.Verbose, "TaskStatus::SetRunning");
+            if (_state == TaskState.Init)
+            {
+                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();
+                    State = TaskState.Running;
+                }
+                catch (Exception e)
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Cannot set task status to running.", LOGGER);
+                    SetException(e);
+                }
+            }
+        }
+
+        public void SetCloseRequested()
+        {
+            State = TaskState.CloseRequested;
+        }
+
+        public void SetSuspendRequested()
+        {
+            State = TaskState.SuspendRequested;
+        }
+
+        public void SetKilled()
+        {
+            State = TaskState.Killed;
+            Heartbeat();
+        }
+
+        public bool IsNotRunning()
+        {
+            return _state != TaskState.Running;
+        }
+
+        public bool HasEnded()
+        {
+            switch (_state)
+            {
+                case TaskState.Done:
+                case TaskState.Suspended:
+                case TaskState.Failed:
+                case TaskState.Killed:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        public TaskStatusProto ToProto()
+        {
+            Check();
+            TaskStatusProto taskStatusProto = new TaskStatusProto()
+            {
+                context_id = _contextId,
+                task_id = _taskId,
+                state = GetProtoState(),
+            };
+            if (_result.IsPresent())
+            {
+                taskStatusProto.result = ByteUtilities.CopyBytesFrom(_result.Value);
+            }
+            else if (_lastException.IsPresent())
+            {
+                //final Encoder<Throwable> codec = new ObjectSerializableCodec<>();
+                //final byte[] error = codec.encode(_lastException.get());
+                byte[] error = ByteUtilities.StringToByteArrays(_lastException.Value.ToString());
+                taskStatusProto.result = ByteUtilities.CopyBytesFrom(error);
+            }
+            else if (_state == TaskState.Running)
+            {
+                foreach (TaskMessage message in GetMessages())
+                {
+                    TaskStatusProto.TaskMessageProto taskMessageProto = new TaskStatusProto.TaskMessageProto()
+                    {
+                        source_id = message.MessageSourceId,
+                        message = ByteUtilities.CopyBytesFrom(message.Message),
+                    };
+                    taskStatusProto.task_message.Add(taskMessageProto);
+                }
+            }
+            return taskStatusProto;
+        }
+
+        internal void RecordExecptionWithoutHeartbeat(Exception e)
+        {
+            if (!_lastException.IsPresent())
+            {
+                _lastException = Optional<Exception>.Of(e);
+            }
+            State = TaskState.Failed;
+            _taskLifeCycle.Stop();
+        }
+
+        private static bool IsLegalStateTransition(TaskState? from, TaskState to)
+        {
+            if (from == null)
+            {
+                return to == TaskState.Init;
+            }
+            switch (from)
+            {
+                case TaskState.Init:
+                    switch (to)
+                    {
+                        case TaskState.Init:
+                        case TaskState.Running:
+                        case TaskState.Failed:
+                        case TaskState.Killed:
+                        case TaskState.Done:
+                            return true;
+                        default:
+                            return false;
+                    }
+                case TaskState.Running:
+                    switch (to)
+                    {
+                        case TaskState.CloseRequested:
+                        case TaskState.SuspendRequested:
+                        case TaskState.Failed:
+                        case TaskState.Killed:
+                        case TaskState.Done:
+                            return true;
+                        default:
+                            return false;
+                    }
+                case TaskState.CloseRequested:
+                    switch (to)
+                    {
+                        case TaskState.Failed:
+                        case TaskState.Killed:
+                        case TaskState.Done:
+                            return true;
+                        default:
+                            return false;
+                    }
+                case TaskState.SuspendRequested:
+                    switch (to)
+                    {
+                        case TaskState.Failed:
+                        case TaskState.Killed:
+                        case TaskState.Suspended:
+                            return true;
+                        default:
+                            return false;
+                    }
+
+                case TaskState.Failed:
+                case TaskState.Done:
+                case TaskState.Killed:           
+                default:
+                    return true;
+            }
+        }
+
+        private void Check()
+        {
+            if (_result.IsPresent() && _lastException.IsPresent())
+            {
+                LOGGER.Log(Level.Warning, "Both task result and exception are present, the expcetion will take over. Thrown away result:" + ByteUtilities.ByteArrarysToString(_result.Value));
+                State = TaskState.Failed;
+                _result = Optional<byte[]>.Empty();
+            }
+        }
+
+        private void Heartbeat()
+        {
+            _heartBeatManager.OnNext(ToProto());
+        }
+
+        private State GetProtoState()
+        {
+            switch (_state)
+            {
+                case TaskState.Init:
+                    return Protobuf.ReefProtocol.State.INIT;
+                case TaskState.CloseRequested:
+                case TaskState.SuspendRequested:
+                case TaskState.Running:
+                    return Protobuf.ReefProtocol.State.RUNNING;
+                case TaskState.Done:
+                    return Protobuf.ReefProtocol.State.DONE;
+                case TaskState.Suspended:
+                    return Protobuf.ReefProtocol.State.SUSPEND;
+                case TaskState.Failed:
+                    return Protobuf.ReefProtocol.State.FAILED;
+                case TaskState.Killed:
+                    return Protobuf.ReefProtocol.State.KILLED;
+                default:
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException("Unknown state: " + _state), LOGGER);
+                    break;
+            }
+            return Protobuf.ReefProtocol.State.FAILED; //this line should not be reached as default case will throw exception
+        }
+
+        private ICollection<TaskMessage> GetMessages()
+        {
+            List<TaskMessage> result = new List<TaskMessage>();
+            if (_evaluatorMessageSources.IsPresent())
+            {
+                foreach (ITaskMessageSource source in _evaluatorMessageSources.Value)
+                {
+                    Optional<TaskMessage> taskMessageOptional = source.Message;
+                    if (taskMessageOptional.IsPresent())
+                    {
+                        result.Add(taskMessageOptional.Value);
+                    }
+                }
+            }
+            return result;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStopImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStopImpl.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStopImpl.cs
new file mode 100644
index 0000000..8ad8a5b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Task/TaskStopImpl.cs
@@ -0,0 +1,34 @@
+/**
+ * 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.Common.Tasks.Events;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Task
+{
+    public class TaskStopImpl : ITaskStop
+    {
+        //INJECT
+        public TaskStopImpl(string id)
+        {
+            Id = id;
+        }
+
+        public string Id { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..66f726d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/EvaluatorConfigurations.cs
@@ -0,0 +1,122 @@
+/**
+ * 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.IO;
+using System.Linq;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Utils
+{
+    public class EvaluatorConfigurations
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorConfigurations));
+
+        private AvroConfiguration _avroConfiguration;
+
+        private string _configFile;
+
+        private string _applicationId;
+
+        private string _evaluatorId;
+
+        private string _taskConfiguration;
+
+        private string _rootContextConfiguration;
+
+        private string _rootServiceConfiguration;
+
+        public EvaluatorConfigurations(string configFile)
+        {
+            using (LOGGER.LogFunction("EvaluatorConfigurations::EvaluatorConfigurations"))
+            {
+                if (string.IsNullOrWhiteSpace(configFile))
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("configFile"), LOGGER);
+                }
+                if (!File.Exists(configFile))
+                {
+                    Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new FileNotFoundException("cannot find file " + configFile), LOGGER);
+                }
+                _configFile = configFile;
+                AvroConfigurationSerializer serializer = new AvroConfigurationSerializer();
+                _avroConfiguration = serializer.AvroDeseriaizeFromFile(_configFile);
+            }
+        }
+
+        public string TaskConfiguration
+        {
+            get
+            {
+                _taskConfiguration = _taskConfiguration ?? GetSettingValue(Constants.TaskConfiguration);
+                return _taskConfiguration;
+            }
+        }
+
+        public string EvaluatorId
+        {
+            get
+            {
+                _evaluatorId = _evaluatorId ?? GetSettingValue(Constants.EvaluatorIdentifier);
+                return _evaluatorId;
+            }
+        }
+
+        public string ApplicationId
+        {
+            get
+            {
+                _applicationId = _applicationId ?? GetSettingValue(Constants.ApplicationIdentifier);
+                return _applicationId;
+            }
+        }
+
+        public string RootContextConfiguration
+        {
+            get
+            {
+                _rootContextConfiguration = _rootContextConfiguration ?? GetSettingValue(Constants.RootContextConfiguration);
+                return _rootContextConfiguration;
+            }
+        }
+
+        public string RootServiceConfiguration
+        {
+            get
+            {
+                _rootServiceConfiguration = _rootServiceConfiguration ?? GetSettingValue(Constants.RootServiceConfiguration);
+                return _rootServiceConfiguration;
+            }
+        }
+
+        private string GetSettingValue(string settingKey)
+        {
+            ConfigurationEntry configurationEntry =
+                _avroConfiguration.Bindings.SingleOrDefault(b => b.key.EndsWith(settingKey, StringComparison.OrdinalIgnoreCase));
+            if (configurationEntry == null)
+            {
+                return string.Empty;
+            }
+
+            return configurationEntry.value;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/RemoteManager.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/RemoteManager.cs b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/RemoteManager.cs
new file mode 100644
index 0000000..c129d04
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/Evaluator/Utils/RemoteManager.cs
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Runtime.Evaluator.Utils
+{
+    public class RemoteManager
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..54aca4c
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Runtime/MachineStatus.cs
@@ -0,0 +1,137 @@
+/**
+ * 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.Diagnostics;
+using System.Globalization;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Runtime
+{
+    public class MachineStatus
+    {
+        private static PerformanceCounter _cpuCounter;
+
+        private static PerformanceCounter _ramCounter;
+
+        private static PerformanceCounter _processCpuCounter;
+
+        private static Process _process;
+
+        private static bool _checkStatus;
+
+        static MachineStatus()
+        {
+            _checkStatus = true;
+            _process = Process.GetCurrentProcess();
+            string processName = _process.ProcessName;
+
+            _cpuCounter = _cpuCounter ?? new PerformanceCounter()
+            {
+                CategoryName = "Processor",
+                CounterName = "% Processor Time",
+                InstanceName = "_Total",
+            };
+
+            _ramCounter = _ramCounter ?? new PerformanceCounter()
+            {
+                CategoryName = "Memory",
+                CounterName = "Available MBytes"
+            };
+
+            _processCpuCounter = _processCpuCounter ?? new PerformanceCounter()
+            {
+                CategoryName = "Process",
+                CounterName = "% Processor Time",
+                InstanceName = processName
+            };
+        }
+
+        public static string CurrentNodeCpuUsage
+        {
+            get
+            {
+                return _cpuCounter.NextValue() + "%";
+            }
+        }
+
+        public static string AvailableMemory
+        {
+            get
+            {
+                return _ramCounter.NextValue() + "MB";
+            }
+        }
+
+        public static string CurrentProcessMemoryUsage
+        {
+            get
+            {
+                return ((float)_process.WorkingSet64 / 1000000.0).ToString(CultureInfo.InvariantCulture) + "MB";
+            }
+        }
+
+        public static string PeakProcessMemoryUsage
+        {
+            get
+            {
+                return ((float)_process.PeakWorkingSet64 / 1000000.0).ToString(CultureInfo.InvariantCulture) + "MB";
+            }
+        }
+
+        // this may not be accurate if there are multiple evaluator processes running on a single machine
+        public static string CurrentProcessCpuUsage
+        {
+            get
+            {
+                return ((float)_processCpuCounter.RawValue / 1000000.0) + "%";
+            }
+        }
+
+        public override string ToString()
+        {
+            string info = "No machine status information retrieved. Could be due to lack of admin right to get the info.";
+            if (_checkStatus)
+            {
+                try
+                {
+                    _process.Refresh();
+                    info = string.Format(
+                    CultureInfo.InvariantCulture,
+                    "current node is running at [{0}] CPU usage and with [{1}] memory available.{2}             current evaluator process is using [{3}] of CPU and [{4}] of memory, with a peak memory usage of [{5}]",
+                    CurrentNodeCpuUsage,
+                    AvailableMemory,
+                    Environment.NewLine,
+                    CurrentProcessCpuUsage,
+                    CurrentProcessMemoryUsage,
+                    PeakProcessMemoryUsage);
+                }
+                catch (Exception e)
+                {
+                    _checkStatus = false; // It only takes one exception to switch the cheking 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.
+                    info = "Cannot obtain machine status due to error " + e.Message;
+                }
+            }
+            
+            return info;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Services/IService.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Services/IService.cs b/lang/cs/Org.Apache.REEF.Common/Services/IService.cs
new file mode 100644
index 0000000..fa5b5d7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Services/IService.cs
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Services
+{
+    public interface IService
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/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
new file mode 100644
index 0000000..af5070b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Services/ServiceConfiguration.cs
@@ -0,0 +1,83 @@
+/**
+ * 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 System.Diagnostics.CodeAnalysis;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Tang.Util;
+
+[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]
+
+namespace Org.Apache.REEF.Common.Services
+{
+    /// <summary>
+    /// Configuration module for services. The configuration created here can be passed alongside a ContextConfiguration
+    /// to form a context. Different from bindings made in the ContextConfiguration, those made here will be passed along
+    /// to child context.
+    /// </summary>
+    public class ServiceConfiguration : ConfigurationModuleBuilder
+    {
+        /// <summary>
+        /// A set of services to instantiate. All classes given here will be instantiated in the context, and their references
+        /// will be made available to child context and tasks.
+        /// </summary>
+        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
+        public static readonly OptionalParameter<IService> Services = new OptionalParameter<IService>();
+
+        public ServiceConfiguration()
+            : base()
+        {
+        }
+
+        public ServiceConfiguration(string config)
+        {
+            TangConfig = new AvroConfigurationSerializer().FromString(config);
+        }
+
+        public static ConfigurationModule ConfigurationModule
+        {
+            get
+            {
+                return new ServiceConfiguration()
+                    .BindSetEntry(GenericType<ServicesSet>.Class, Services)
+                    .Build();
+            }
+        }
+
+        public IConfiguration TangConfig { get; private set; }
+    }
+
+    public class InjectedServices
+    {
+        [Inject]
+        public InjectedServices([Parameter(typeof(ServicesSet))] ISet<IService> services)
+        {
+            Services = services;
+        }
+
+        public ISet<IService> Services { get; set; }
+    }
+
+    [NamedParameter("Set of services", "servicesSet", "")]
+    class ServicesSet : Name<ISet<IService>>
+    {      
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Services/ServicesConfigurationOptions.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Services/ServicesConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/Services/ServicesConfigurationOptions.cs
new file mode 100644
index 0000000..f4afd7b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Services/ServicesConfigurationOptions.cs
@@ -0,0 +1,31 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Common.Services
+{
+    public class ServicesConfigurationOptions
+    {
+        [NamedParameter("Services", "services", "services")]
+        public class Services : Name<string>
+        {
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultDriverMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultDriverMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultDriverMessageHandler.cs
new file mode 100644
index 0000000..5e34136
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultDriverMessageHandler.cs
@@ -0,0 +1,41 @@
+/**
+ * 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.Common.Tasks.Events;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Utilities.Logging;
+
+namespace Org.Apache.REEF.Common.Tasks.Defaults
+{
+    public class DefaultDriverMessageHandler : IDriverMessageHandler
+    {
+        private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverMessageHandler));
+
+        [Inject]
+        public DefaultDriverMessageHandler()
+        {
+        }
+
+        public void Handle(IDriverMessage message)
+        {
+            Utilities.Diagnostics.Exceptions.Throw(new InvalidOperationException("No DriverMessage handler bound. Message received" + message), LOGGER);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultTaskMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultTaskMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultTaskMessageSource.cs
new file mode 100644
index 0000000..2929a59
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Defaults/DefaultTaskMessageSource.cs
@@ -0,0 +1,49 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Common.Tasks.Defaults
+{
+    public class DefaultTaskMessageSource : ITaskMessageSource
+    {
+        [Inject]
+        public DefaultTaskMessageSource()
+        {
+        }
+
+        public Optional<TaskMessage> Message
+        {
+            get
+            {
+                TaskMessage defaultTaskMessage = TaskMessage.From(
+                    "defaultSourceId", 
+                    ByteUtilities.StringToByteArrays("default message generated at " + DateTime.Now.ToString(CultureInfo.InvariantCulture)));
+                return Optional<TaskMessage>.Of(defaultTaskMessage);
+            }
+
+            set
+            {
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ICloseEvent.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ICloseEvent.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ICloseEvent.cs
new file mode 100644
index 0000000..b26f255
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ICloseEvent.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Common.Tasks.Events
+{
+    public interface ICloseEvent
+    {
+        Optional<byte[]> Value { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Events/IDriverMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Events/IDriverMessage.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/IDriverMessage.cs
new file mode 100644
index 0000000..15a706e
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/IDriverMessage.cs
@@ -0,0 +1,28 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Common.Tasks.Events
+{
+    public interface IDriverMessage
+    {
+        Optional<byte[]> Message { get; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ISuspendEvent.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ISuspendEvent.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ISuspendEvent.cs
new file mode 100644
index 0000000..36356b7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ISuspendEvent.cs
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Tasks.Events
+{
+    public interface ISuspendEvent
+    {
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStart.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStart.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStart.cs
new file mode 100644
index 0000000..aeb376d
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStart.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Tasks.Events
+{
+    public interface ITaskStart
+    {
+        string Id { get; set; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStop.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStop.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStop.cs
new file mode 100644
index 0000000..b80b38b
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/Events/ITaskStop.cs
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+namespace Org.Apache.REEF.Common.Tasks.Events
+{
+    public interface ITaskStop
+    {
+        string Id { get; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/IDriverMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/IDriverMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/IDriverMessageHandler.cs
new file mode 100644
index 0000000..0b8e7e7
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/IDriverMessageHandler.cs
@@ -0,0 +1,29 @@
+/**
+ * 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.Common.Tasks.Events;
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    //[DefaultImplementation(typeof(DefaultTaskMessageSource))]
+    public interface IDriverMessageHandler
+    {
+        void Handle(IDriverMessage message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/IRunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/IRunningTask.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/IRunningTask.cs
new file mode 100644
index 0000000..236da5a
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/IRunningTask.cs
@@ -0,0 +1,53 @@
+/**
+ * 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.Utilities;
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    /// <summary>
+    /// Represents a running Task
+    /// </summary>
+    public interface IRunningTask : IIdentifiable, IDisposable
+    {
+        /// <summary>
+        /// Sends the message to the running task.
+        /// </summary>
+        /// <param name="message"></param>
+        void OnNext(byte[] message);
+
+        /// <summary>
+        ///  Signal the task to suspend.
+        /// </summary>
+        /// <param name="message">a message that is sent to the Task.</param>
+        void Suspend(byte[] message);
+
+        /// <summary>
+        /// Sends the message to the running task.
+        /// </summary>
+        void Suspend();
+
+        /// <summary>
+        /// Signal the task to shut down.
+        /// </summary>
+        /// <param name="message">a message that is sent to the Task.</param>
+        void Dispose(byte[] message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/ITask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/ITask.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/ITask.cs
new file mode 100644
index 0000000..37a1d46
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/ITask.cs
@@ -0,0 +1,28 @@
+/**
+ * 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;
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    public interface ITask : IDisposable
+    {
+        byte[] Call(byte[] memento);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/ITaskMessageSource.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/ITaskMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/ITaskMessageSource.cs
new file mode 100644
index 0000000..d9830c4
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Tasks/ITaskMessageSource.cs
@@ -0,0 +1,31 @@
+/**
+ * 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.Common.Tasks.Defaults;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Utilities;
+
+namespace Org.Apache.REEF.Common.Tasks
+{
+    [DefaultImplementation(typeof(DefaultTaskMessageSource))]
+    public interface ITaskMessageSource
+    {
+        Optional<TaskMessage> Message { get; set; }
+    }
+}
\ No newline at end of file