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 - { - } -}
