http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Remote/Proto/WakeRemoteProtos.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Remote/Proto/WakeRemoteProtos.cs b/lang/cs/Source/WAKE/Wake/Remote/Proto/WakeRemoteProtos.cs deleted file mode 100644 index 247fff9..0000000 --- a/lang/cs/Source/WAKE/Wake/Remote/Proto/WakeRemoteProtos.cs +++ /dev/null @@ -1,76 +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 ProtoBuf; -using System; -using System.IO; -using System.Runtime.Serialization; - -namespace Org.Apache.Reef.Wake.Remote.Proto.WakeRemoteProtos -{ - /// <summary> - /// Message p buff - /// </summary> - public partial class WakeMessagePBuf - { - public static WakeMessagePBuf Deserialize(byte[] bytes) - { - WakeMessagePBuf pbuf = null; - using (var s = new MemoryStream(bytes)) - { - pbuf = Serializer.Deserialize<WakeMessagePBuf>(s); - } - return pbuf; - } - - public byte[] Serialize() - { - using (var s = new MemoryStream()) - { - Serializer.Serialize(s, this); - return s.ToArray(); - } - } - } - - /// <summary> - /// Wake tuple buf - /// </summary> - public partial class WakeTuplePBuf - { - public static WakeTuplePBuf Deserialize(byte[] bytes) - { - WakeTuplePBuf pbuf = null; - using (var s = new MemoryStream(bytes)) - { - pbuf = Serializer.Deserialize<WakeTuplePBuf>(s); - } - return pbuf; - } - - public byte[] Serialize() - { - using (var s = new MemoryStream()) - { - Serializer.Serialize(s, this); - return s.ToArray(); - } - } - } -}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Remote/RemoteConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Remote/RemoteConfiguration.cs b/lang/cs/Source/WAKE/Wake/Remote/RemoteConfiguration.cs deleted file mode 100644 index 633cc79..0000000 --- a/lang/cs/Source/WAKE/Wake/Remote/RemoteConfiguration.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.Tang.Annotations; -using System; - -namespace Org.Apache.Reef.Wake.Remote -{ - public class RemoteConfiguration - { - [NamedParameter(shortName: "rm_name", documentation: "The name of the remote manager.")] - public class ManagerName : Name<string> - { - } - - [NamedParameter(shortName: "rm_host", documentation: "The host address to be used for messages.")] - public class HostAddress : Name<string> - { - } - - [NamedParameter(shortName: "rm_port", documentation: "The port to be used for messages.")] - public class Port : Name<int> - { - } - - [NamedParameter(documentation: "The codec to be used for messages.")] - public class MessageCodec : Name<ICodec<Type>> - { - } - - [NamedParameter(documentation: "The event handler to be used for exception")] - public class ErrorHandler : Name<IObserver<Exception>> - { - } - - [NamedParameter(shortName: "rm_order", documentation: "Whether or not to use the message ordering guarantee", defaultValue: "true")] - public class OrderingGuarantee : Name<bool> - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Remote/RemoteRuntimeException.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Remote/RemoteRuntimeException.cs b/lang/cs/Source/WAKE/Wake/Remote/RemoteRuntimeException.cs deleted file mode 100644 index 061e532..0000000 --- a/lang/cs/Source/WAKE/Wake/Remote/RemoteRuntimeException.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 System; - -namespace Org.Apache.Reef.Wake.Remote -{ - /// <summary>Wake remote runtime exception</summary> - [System.Serializable] - public class RemoteRuntimeException : Exception - { - private const long serialVersionUID = 1L; - - /// <summary>Constructs a new runtime remote exception with the specified detail message and cause - /// </summary> - /// <param name="s">the detailed message</param> - /// <param name="e">the cause</param> - public RemoteRuntimeException(string s, Exception e) - : base(s, e) - { - } - - /// <summary>Constructs a new runtime remote exception with the specified detail message - /// </summary> - /// <param name="s">the detailed message</param> - public RemoteRuntimeException(string s) - : base(s) - { - } - - /// <summary>Constructs a new runtime remote exception with the specified cause</summary> - /// <param name="e">the cause</param> - public RemoteRuntimeException(Exception e) - : base("Runtime Exception", e) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Event/Alarm.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Event/Alarm.cs b/lang/cs/Source/WAKE/Wake/Time/Event/Alarm.cs deleted file mode 100644 index 611b5a1..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Event/Alarm.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; - -namespace Org.Apache.Reef.Wake.Time -{ - /// <summary> - /// Represents a timer event. - /// </summary> - public abstract class Alarm : Time - { - private IObserver<Alarm> _handler; - - public Alarm(long timestamp, IObserver<Alarm> handler) : base(timestamp) - { - _handler = handler; - } - - public void Handle() - { - _handler.OnNext(this); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Event/StartTime.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Event/StartTime.cs b/lang/cs/Source/WAKE/Wake/Time/Event/StartTime.cs deleted file mode 100644 index 4cea1bc..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Event/StartTime.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. - */ - -namespace Org.Apache.Reef.Wake.Time -{ - /// <summary> - /// Represents the Time at which a component started. - /// </summary> - public class StartTime : Time - { - public StartTime(long timeStamp) : base(timeStamp) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Event/StopTime.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Event/StopTime.cs b/lang/cs/Source/WAKE/Wake/Time/Event/StopTime.cs deleted file mode 100644 index 8e3bf65..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Event/StopTime.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. - */ - -namespace Org.Apache.Reef.Wake.Time -{ - /// <summary> - /// Represents the Time at which a component stops. - /// </summary> - public class StopTime : Time - { - public StopTime(long timeStamp) : base(timeStamp) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/IClock.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/IClock.cs b/lang/cs/Source/WAKE/Wake/Time/IClock.cs deleted file mode 100644 index 6d906b8..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/IClock.cs +++ /dev/null @@ -1,89 +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 Org.Apache.Reef.Tang.Annotations; -using Org.Apache.Reef.Wake.Impl; -using Org.Apache.Reef.Wake.Time.Runtime.Event; - -namespace Org.Apache.Reef.Wake.Time -{ - public abstract class IClock : IDisposable - { - /// <summary> - /// Schedule a TimerEvent at the given future offset - /// </summary> - /// <param name="offset">The offset in the future to schedule the alarm</param> - /// <param name="handler">The IObserver to to be called</param> - public abstract void ScheduleAlarm(long offset, IObserver<Alarm> handler); - - /// <summary> - /// Clock is idle if it has no future alarms set - /// </summary> - /// <returns>True if no future alarms are set, otherwise false</returns> - public abstract bool IsIdle(); - - /// <summary> - /// Dispose of the clock and all scheduled alarms - /// </summary> - public abstract void Dispose(); - - /// <summary> - /// Bind this to an event handler to statically subscribe to the StartTime Event - /// </summary> - [NamedParameter(documentation: "Will be called upon the start even", defaultClass: typeof(MissingStartHandlerHandler))] - public class StartHandler : Name<ISet<IObserver<StartTime>>> - { - } - - /// <summary> - /// Bind this to an event handler to statically subscribe to the StopTime Event - /// </summary> - [NamedParameter(documentation: "Will be called upon the stop event", defaultClass: typeof(LoggingEventHandler<StopTime>))] - public class StopHandler : Name<ISet<IObserver<StopTime>>> - { - } - - /// <summary> - /// Bind this to an event handler to statically subscribe to the RuntimeStart Event - /// </summary> - [NamedParameter(documentation: "Will be called upon the runtime start event", defaultClass: typeof(LoggingEventHandler<RuntimeStart>))] - public class RuntimeStartHandler : Name<ISet<IObserver<RuntimeStart>>> - { - } - - /// <summary> - /// Bind this to an event handler to statically subscribe to the RuntimeStop Event - /// </summary> - [NamedParameter(documentation: "Will be called upon the runtime stop event", defaultClass: typeof(LoggingEventHandler<RuntimeStop>))] - public class RuntimeStopHandler : Name<ISet<IObserver<RuntimeStop>>> - { - } - - /// <summary> - /// Bind this to an event handler to statically subscribe to the IdleClock Event - /// </summary> - [NamedParameter(documentation: "Will be called upon the Idle event", defaultClass: typeof(LoggingEventHandler<IdleClock>))] - public class IdleHandler : Name<ISet<IObserver<IdleClock>>> - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/ClientAlarm.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/ClientAlarm.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/ClientAlarm.cs deleted file mode 100644 index ac95896..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/ClientAlarm.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 System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Org.Apache.Reef.Wake.Time.Runtime.Event -{ - public class ClientAlarm : Alarm - { - public ClientAlarm(long timestamp, IObserver<Alarm> handler) : base(timestamp, handler) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/IdleClock.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/IdleClock.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/IdleClock.cs deleted file mode 100644 index 3ca1fd8..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/IdleClock.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.Wake.Time.Runtime.Event -{ - public class IdleClock : Time - { - public IdleClock(long timestamp) : base(timestamp) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeAlarm.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeAlarm.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeAlarm.cs deleted file mode 100644 index 701bf88..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeAlarm.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 System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Org.Apache.Reef.Wake.Time.Runtime.Event -{ - public class RuntimeAlarm : Alarm - { - public RuntimeAlarm(long timestamp, IObserver<Alarm> handler) : base(timestamp, handler) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStart.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStart.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStart.cs deleted file mode 100644 index d08cccc..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStart.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.Wake.Time.Runtime.Event -{ - public class RuntimeStart : Time - { - public RuntimeStart(long timeStamp) : base(timeStamp) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStop.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStop.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStop.cs deleted file mode 100644 index 6324e20..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/Event/RuntimeStop.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 System; - -namespace Org.Apache.Reef.Wake.Time.Runtime.Event -{ - public class RuntimeStop : Time - { - public RuntimeStop(long timestamp) : this(timestamp, null) - { - } - - public RuntimeStop(long timestamp, Exception e) : base(timestamp) - { - Exception = e; - } - - public Exception Exception { get; private set; } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/ITimer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/ITimer.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/ITimer.cs deleted file mode 100644 index c932aa4..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/ITimer.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; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Org.Apache.Reef.Tang.Annotations; - -namespace Org.Apache.Reef.Wake.Time.Runtime -{ - [DefaultImplementation(typeof(RealTimer))] - public interface ITimer - { - /// <summary> - /// Gets the current time - /// </summary> - long CurrentTime { get; } - - /// <summary> - /// Gets the difference between the given time and the current time - /// </summary> - /// <param name="time">The time to compare against the current time</param> - long GetDuration(long time); - - /// <summary> - /// Checks if the given time has already passed. - /// </summary> - /// <param name="time">The time to check if it has passed or not</param> - bool IsReady(long time); - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/LogicalTimer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/LogicalTimer.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/LogicalTimer.cs deleted file mode 100644 index f4b6c75..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/LogicalTimer.cs +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Org.Apache.Reef.Tang.Annotations; -using Org.Apache.Reef.Wake.Time.Runtime.Event; - -namespace Org.Apache.Reef.Wake.Time.Runtime -{ - /// <summary> - /// LogicalTimer class used for testing purposes. - /// </summary> - public class LogicalTimer : ITimer - { - [Inject] - public LogicalTimer() - { - } - - public long CurrentTime - { - get { return 0; } - } - - public long GetDuration(long time) - { - return 0; - } - - public bool IsReady(long time) - { - return true; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/RealTimer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/RealTimer.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/RealTimer.cs deleted file mode 100644 index 2e99202..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/RealTimer.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 System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Org.Apache.Reef.Tang.Annotations; -using Org.Apache.Reef.Wake.Time.Runtime.Event; - -namespace Org.Apache.Reef.Wake.Time.Runtime -{ - public class RealTimer : ITimer - { - [Inject] - public RealTimer() - { - } - - /// <summary> - /// Gets the number of milliseconds since Epoch - /// </summary> - public long CurrentTime - { - get { return DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; } - } - - /// <summary> - /// Gets the difference between the given time and the current time - /// </summary> - /// <param name="time">The time to compare against the current time</param> - public long GetDuration(long time) - { - return time - CurrentTime; - } - - /// <summary> - /// Checks if the given time has already passed. - /// </summary> - /// <param name="time">The time to check if it has passed or not</param> - public bool IsReady(long time) - { - return GetDuration(time) <= 0; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Runtime/RuntimeClock.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Runtime/RuntimeClock.cs b/lang/cs/Source/WAKE/Wake/Time/Runtime/RuntimeClock.cs deleted file mode 100644 index a8c77af..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Runtime/RuntimeClock.cs +++ /dev/null @@ -1,257 +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.Reactive; -using System.Reactive.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -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; - -namespace Org.Apache.Reef.Wake.Time.Runtime.Event -{ - public class RuntimeClock : IClock - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(RuntimeClock)); - - private ITimer _timer; - private PubSubSubject<Time> _handlers; - private ISet<Time> _schedule; - - private IInjectionFuture<ISet<IObserver<StartTime>>> _startHandler; - private IInjectionFuture<ISet<IObserver<StopTime>>> _stopHandler; - private IInjectionFuture<ISet<IObserver<RuntimeStart>>> _runtimeStartHandler; - private IInjectionFuture<ISet<IObserver<RuntimeStop>>> _runtimeStopHandler; - private IInjectionFuture<ISet<IObserver<IdleClock>>> _idleHandler; - - private bool _disposed; - - /// <summary> - /// Create a new RuntimeClock with injectable IObservers - /// </summary> - /// <param name="timer">The runtime clock timer</param> - /// <param name="startHandler">The start handler</param> - /// <param name="stopHandler">The stop handler</param> - /// <param name="runtimeStartHandler">The runtime start handler</param> - /// <param name="runtimeStopHandler">The runtime stop handler</param> - /// <param name="idleHandler">The idle handler</param> - [Inject] - internal RuntimeClock( - ITimer timer, - [Parameter(typeof(StartHandler))] IInjectionFuture<ISet<IObserver<StartTime>>> startHandler, - [Parameter(typeof(StopHandler))] IInjectionFuture<ISet<IObserver<StopTime>>> stopHandler, - [Parameter(typeof(RuntimeStartHandler))] IInjectionFuture<ISet<IObserver<RuntimeStart>>> runtimeStartHandler, - [Parameter(typeof(RuntimeStopHandler))] IInjectionFuture<ISet<IObserver<RuntimeStop>>> runtimeStopHandler, - [Parameter(typeof(IdleHandler))] IInjectionFuture<ISet<IObserver<IdleClock>>> idleHandler) - { - _timer = timer; - _schedule = new SortedSet<Time>(); - _handlers = new PubSubSubject<Time>(); - - _startHandler = startHandler; - _stopHandler = stopHandler; - _runtimeStartHandler = runtimeStartHandler; - _runtimeStopHandler = runtimeStopHandler; - _idleHandler = idleHandler; - } - - public IInjectionFuture<ISet<IObserver<RuntimeStart>>> InjectedRuntimeStartHandler - { - get { return _runtimeStartHandler; } - set { _runtimeStartHandler = value; } - } - - public IInjectionFuture<ISet<IObserver<RuntimeStop>>> InjectedRuntimeStopHandler - { - get { return _runtimeStopHandler; } - set { _runtimeStopHandler = value; } - } - - /// <summary> - /// Schedule a TimerEvent at the given future offset - /// </summary> - /// <param name="offset">The offset in the future to schedule the alarm</param> - /// <param name="handler">The IObserver to to be called</param> - public override void ScheduleAlarm(long offset, IObserver<Alarm> handler) - { - if (_disposed) - { - return; - } - if (handler == null) - { - Exceptions.Throw(new ArgumentNullException("handler"), LOGGER); - } - - lock (_schedule) - { - _schedule.Add(new ClientAlarm(_timer.CurrentTime + offset, handler)); - Monitor.PulseAll(_schedule); - } - } - - /// <summary> - /// Clock is idle if it has no future alarms set - /// </summary> - /// <returns>True if no future alarms are set, otherwise false</returns> - public override bool IsIdle() - { - lock (_schedule) - { - return _schedule.Count == 0; - } - } - - /// <summary> - /// Dispose of the clock and all scheduled alarms - /// </summary> - public override void Dispose() - { - lock (_schedule) - { - _schedule.Clear(); - _schedule.Add(new StopTime(_timer.CurrentTime)); - Monitor.PulseAll(_schedule); - _disposed = true; - } - } - - /// <summary> - /// Register the IObserver for the particular Time event. - /// </summary> - /// <param name="observer">The handler to register</param> - public void RegisterObserver<U>(IObserver<U> observer) where U : Time - { - if (_disposed) - { - return; - } - - _handlers.Subscribe(observer); - } - - /// <summary> - /// Start the RuntimeClock. - /// Clock will continue to run and handle events until it has been disposed. - /// </summary> - public void Run() - { - SubscribeHandlers(); - _handlers.OnNext(new RuntimeStart(_timer.CurrentTime)); - _handlers.OnNext(new StartTime(_timer.CurrentTime)); - - while (true) - { - lock (_schedule) - { - if (IsIdle()) - { - _handlers.OnNext(new IdleClock(_timer.CurrentTime)); - } - - // Blocks and releases lock until it receives the next event - Time alarm = GetNextEvent(); - ProcessEvent(alarm); - - if (alarm is StopTime) - { - break; - } - } - } - _handlers.OnNext(new RuntimeStop(_timer.CurrentTime)); - } - - /// <summary> - /// Register the event handlers - /// </summary> - private void SubscribeHandlers() - { - Subscribe(_startHandler.Get()); - Subscribe(_stopHandler.Get()); - Subscribe(_runtimeStartHandler.Get()); - Subscribe(_runtimeStopHandler.Get()); - Subscribe(_idleHandler.Get()); - } - - /// <summary> - /// Subscribe a set of IObservers for a particular Time event - /// </summary> - /// <param name="observers">The set of observers to subscribe</param> - private void Subscribe<U>(ISet<IObserver<U>> observers) where U : Time - { - foreach (IObserver<U> observer in observers) - { - _handlers.Subscribe(observer); - } - } - - /// <summary> - /// Wait until the first scheduled alarm is ready to be handled - /// Assumes that we have a lock on the _schedule SortedSet - /// </summary> - private Time GetNextEvent() - { - // Wait for an alarm to be scheduled on the condition variable Count - while (_schedule.Count == 0) - { - Monitor.Wait(_schedule); - } - - // Once the alarm is scheduled, wait for the prescribed amount of time. - // If a new alarm is scheduled with a shorter duration, Wait will preempt - // and duration will update to reflect the new alarm's timestamp - for (long duration = _timer.GetDuration(_schedule.First().TimeStamp); - duration > 0; - duration = _timer.GetDuration(_schedule.First().TimeStamp)) - { - Monitor.Wait(_schedule, TimeSpan.FromMilliseconds(duration)); - } - - Time time = _schedule.First(); - _schedule.Remove(time); - return time; - } - - /// <summary> - /// Process the next Time event. - /// </summary> - /// <param name="time">The Time event to handle</param> - private void ProcessEvent(Time time) - { - if (time is Alarm) - { - Alarm alarm = (Alarm) time; - alarm.Handle(); - } - else - { - _handlers.OnNext(time); - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Time/Time.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Time/Time.cs b/lang/cs/Source/WAKE/Wake/Time/Time.cs deleted file mode 100644 index 0ebc1a7..0000000 --- a/lang/cs/Source/WAKE/Wake/Time/Time.cs +++ /dev/null @@ -1,82 +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; - -namespace Org.Apache.Reef.Wake.Time -{ - /// <summary> - /// Time object - /// </summary> - public abstract class Time : IComparable<Time> - { - public Time(long timeStamp) - { - TimeStamp = timeStamp; - } - - public long TimeStamp { get; private set; } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0}:[{1}]", GetType().Name, TimeStamp); - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (this == obj) - { - return true; - } - Time other = obj as Time; - if (other != null) - { - return CompareTo(other) == 0; - } - return false; - } - - public int CompareTo(Time other) - { - if (TimeStamp < other.TimeStamp) - { - return -1; - } - if (TimeStamp > other.TimeStamp) - { - return 1; - } - if (GetHashCode() < other.GetHashCode()) - { - return -1; - } - if (GetHashCode() > other.GetHashCode()) - { - return 1; - } - return 0; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/Actionable.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/Actionable.cs b/lang/cs/Source/WAKE/Wake/Util/Actionable.cs deleted file mode 100644 index 5e5364c..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/Actionable.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 System.Threading; - -namespace Org.Apache.Reef.Wake.Util -{ - public class Actionable - { - private readonly ThreadStart _threadStart; - - public Actionable() - { - } - - internal Actionable(ThreadStart threadStart) - { - _threadStart = threadStart; - } - - public void Call() - { - _threadStart(); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/Disposable.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/Disposable.cs b/lang/cs/Source/WAKE/Wake/Util/Disposable.cs deleted file mode 100644 index ebe30bc..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/Disposable.cs +++ /dev/null @@ -1,63 +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; - -namespace Org.Apache.Reef.Wake.Util -{ - /// <summary> - /// Generates IDisposables from a factory method - /// </summary> - internal class Disposable : IDisposable - { - private Action _disposeFunction; - private bool _disposed; - - private Disposable(Action disposeFunction) - { - _disposeFunction = disposeFunction; - _disposed = false; - } - - /// <summary> - /// Factory method to create an IDisposable from a function. - /// </summary> - /// <param name="disposeFunction">The function to call when disposing</param> - /// <returns>An IDisposable from the given dispose function</returns> - public static IDisposable Create(Action disposeFunction) - { - return new Disposable(disposeFunction); - } - - /// <summary> - /// Dispose of resources by calling the supplied dispose function - /// </summary> - public void Dispose() - { - if (!_disposed) - { - _disposeFunction(); - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/FixedThreadPoolTaskService.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/FixedThreadPoolTaskService.cs b/lang/cs/Source/WAKE/Wake/Util/FixedThreadPoolTaskService.cs deleted file mode 100644 index e86820d..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/FixedThreadPoolTaskService.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 System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Org.Apache.Reef.Utilities.Diagnostics; -using Org.Apache.Reef.Utilities.Logging; -using Org.Apache.Reef.Wake.Time.Runtime.Event; - -namespace Org.Apache.Reef.Wake.Util -{ - public class FixedThreadPoolTaskService : ITaskService - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(FixedThreadPoolTaskService)); - - TaskFactory factory; - - List<Task> tasks = new List<Task>(); - bool shuttingDown; - - internal FixedThreadPoolTaskService(int maxDegreeOfParallelism) - { - LimitedConcurrencyLevelTaskScheduler lcts = new LimitedConcurrencyLevelTaskScheduler(maxDegreeOfParallelism); - factory = new TaskFactory(lcts); - } - - public bool AwaitTermination(long n, TimeSpan unit) - { - Task[] allTasks; - lock (tasks) - { - if (tasks.Count == 0) - { - return true; - } - allTasks = tasks.ToArray(); - } - return Task.WaitAll(allTasks, unit); - } - - public void ShutdownNow() - { - Shutdown(); - } - - public void Shutdown() - { - lock (tasks) - { - shuttingDown = true; - } - } - - public Task<T> Submit<T>(Func<T> c) - { - Task<T> task = null; - lock (tasks) - { - if (shuttingDown) - { - Exceptions.Throw(new InvalidOperationException("Shutting down"), LOGGER); - } - - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); - CancellationToken cancellationToken = cancellationTokenSource.Token; - task = factory.StartNew(c, cancellationToken); - tasks.Add(task); - } - return task; - } - - public void Execute(ThreadStart threadStart) - { - new Actionable(threadStart).Call(); - } - - internal void RemoveTask(Task task) - { - lock (tasks) - { - tasks.Remove(task); - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/IStartable.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/IStartable.cs b/lang/cs/Source/WAKE/Wake/Util/IStartable.cs deleted file mode 100644 index 2327819..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/IStartable.cs +++ /dev/null @@ -1,32 +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; - -namespace Org.Apache.Reef.Wake.Util -{ - public interface IStartable - { - void Start(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/ITaskService.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/ITaskService.cs b/lang/cs/Source/WAKE/Wake/Util/ITaskService.cs deleted file mode 100644 index 2ad0e1e..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/ITaskService.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 System; -using System.Threading; -using System.Threading.Tasks; - -namespace Org.Apache.Reef.Wake.Util -{ - public interface ITaskService - { - void Shutdown(); - - void Execute(ThreadStart threadStart); - - Task<T> Submit<T>(Func<T> ob); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs b/lang/cs/Source/WAKE/Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs deleted file mode 100644 index 4bd3083..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs +++ /dev/null @@ -1,187 +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.Threading; -using System.Threading.Tasks; -using Org.Apache.Reef.Utilities.Diagnostics; -using Org.Apache.Reef.Utilities.Logging; - -namespace Org.Apache.Reef.Wake.Util -{ - internal class LimitedConcurrencyLevelTaskScheduler : TaskScheduler - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(LimitedConcurrencyLevelTaskScheduler)); - - /// <summary>Whether the current thread is processing work items.</summary> - [ThreadStatic] - private static bool _currentThreadIsProcessingItems; - - /// <summary>The list of tasks to be executed.</summary> - private readonly LinkedList<Task> _tasks = new LinkedList<Task>(); // protected by lock(_tasks) - - /// <summary>The maximum concurrency level allowed by this scheduler.</summary> - private readonly int _maxDegreeOfParallelism; - - /// <summary>Whether the scheduler is currently processing work items.</summary> - private int _delegatesQueuedOrRunning = 0; // protected by lock(_tasks) - - /// <summary> - /// Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the - /// specified degree of parallelism. - /// </summary> - /// <param name="maxDegreeOfParallelism">The maximum degree of parallelism provided by this scheduler.</param> - public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism) - { - if (maxDegreeOfParallelism < 1) - { - Exceptions.Throw(new ArgumentOutOfRangeException("maxDegreeOfParallelism"), LOGGER); - } - _maxDegreeOfParallelism = maxDegreeOfParallelism; - } - - /// <summary>Gets the maximum concurrency level supported by this scheduler.</summary> - public sealed override int MaximumConcurrencyLevel - { - get - { - return _maxDegreeOfParallelism; - } - } - - /// <summary>Queues a task to the scheduler.</summary> - /// <param name="task">The task to be queued.</param> - protected sealed override void QueueTask(Task task) - { - // Add the task to the list of tasks to be processed. If there aren't enough - // delegates currently queued or running to process tasks, schedule another. - lock (_tasks) - { - _tasks.AddLast(task); - if (_delegatesQueuedOrRunning < _maxDegreeOfParallelism) - { - ++_delegatesQueuedOrRunning; - NotifyThreadPoolOfPendingWork(); - } - } - } - - /// <summary>Attempts to execute the specified task on the current thread.</summary> - /// <param name="task">The task to be executed.</param> - /// <param name="taskWasPreviouslyQueued"></param> - /// <returns>Whether the task could be executed on the current thread.</returns> - protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) - { - // If this thread isn't already processing a task, we don't support inlining - if (!_currentThreadIsProcessingItems) - { - return false; - } - - // If the task was previously queued, remove it from the queue - if (taskWasPreviouslyQueued) - { - TryDequeue(task); - } - - // Try to run the task. - return TryExecuteTask(task); - } - - /// <summary>Attempts to remove a previously scheduled task from the scheduler.</summary> - /// <param name="task">The task to be removed.</param> - /// <returns>Whether the task could be found and removed.</returns> - protected sealed override bool TryDequeue(Task task) - { - lock (_tasks) - { - return _tasks.Remove(task); - } - } - - /// <summary>Gets an enumerable of the tasks currently scheduled on this scheduler.</summary> - /// <returns>An enumerable of the tasks currently scheduled.</returns> - protected sealed override IEnumerable<Task> GetScheduledTasks() - { - bool lockTaken = false; - try - { - Monitor.TryEnter(_tasks, ref lockTaken); - if (lockTaken) - { - return _tasks.ToArray(); - } - else - { - throw new NotSupportedException(); - } - } - finally - { - if (lockTaken) - { - Monitor.Exit(_tasks); - } - } - } - - /// <summary> - /// Informs the ThreadPool that there's work to be executed for this scheduler. - /// </summary> - private void NotifyThreadPoolOfPendingWork() - { - ThreadPool.UnsafeQueueUserWorkItem(_ => - { - // Note that the current thread is now processing work items. - // This is necessary to enable inlining of tasks into this thread. - _currentThreadIsProcessingItems = true; - try - { - // Process all available items in the queue. - while (true) - { - Task item; - lock (_tasks) - { - // When there are no more items to be processed, - // note that we're done processing, and get out. - if (_tasks.Count == 0) - { - --_delegatesQueuedOrRunning; - break; - } - // Get the next item from the queue - item = _tasks.First.Value; - _tasks.RemoveFirst(); - } - // Execute the task we pulled out of the queue - base.TryExecuteTask(item); - } - } - // We're done processing items on the current thread - finally - { - _currentThreadIsProcessingItems = false; - } - }, null); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/NetworkUtils.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/NetworkUtils.cs b/lang/cs/Source/WAKE/Wake/Util/NetworkUtils.cs deleted file mode 100644 index c598c49..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/NetworkUtils.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 System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; - -namespace Org.Apache.Reef.Wake.Util -{ - public class NetworkUtils - { - private static IPAddress _localAddress; - private static Random _random = new Random(); - - /// <summary> - /// Returns the first usable IP Address for the machine. - /// </summary> - /// <returns>The machine's local IP Address</returns> - public static IPAddress LocalIPAddress - { - get - { - if (_localAddress == null) - { - IPAddress[] localIps = Dns.GetHostAddresses(Dns.GetHostName()); - _localAddress = localIps.Where(i => i.AddressFamily.Equals(AddressFamily.InterNetwork)) - .OrderBy(ip => ip.ToString()) - .First(); - } - - return _localAddress; - } - } - - /// <summary> - /// Generate a random port between low (inclusive) and high (exclusive) - /// </summary> - /// <param name="low">The inclusive lower bound of the of the port range</param> - /// <param name="high">The exclusive upper bound of the port range</param> - /// <returns>The randomly generated port</returns> - public static int GenerateRandomPort(int low, int high) - { - return _random.Next(low, high); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/SerializationHelper.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/SerializationHelper.cs b/lang/cs/Source/WAKE/Wake/Util/SerializationHelper.cs deleted file mode 100644 index cd9e220..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/SerializationHelper.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 ProtoBuf; -using System; -using System.IO; -using System.Runtime.Serialization; - -namespace Org.Apache.Reef.Wake.Util -{ - public class SerializationHelper - { - public static byte[] Serialize<T>(T t) - { - using (var s = new MemoryStream()) - { - Serializer.Serialize(s, t); - return s.ToArray(); - } - } - - public static T Deserialize<T>(byte[] bytes) - { - using (var s = new MemoryStream(bytes)) - { - return Serializer.Deserialize<T>(s); - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/TaskExtensions.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/TaskExtensions.cs b/lang/cs/Source/WAKE/Wake/Util/TaskExtensions.cs deleted file mode 100644 index 0c1da40..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/TaskExtensions.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 System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Org.Apache.Reef.Wake.Util -{ - public static class TaskExtensions - { - public static void Forget(this Task task) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Util/TimeHelper.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Util/TimeHelper.cs b/lang/cs/Source/WAKE/Wake/Util/TimeHelper.cs deleted file mode 100644 index 2b437fa..0000000 --- a/lang/cs/Source/WAKE/Wake/Util/TimeHelper.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; -using System.Threading; - -namespace Org.Apache.Reef.Wake.Util -{ - public class TimeHelper - { - public const long TicksPerMilliSecond = 10000; - public const long TicksPerMicroSecond = 10; - public const double TicksPerNanoSecond = .01; - - public static long CurrentTimeToNanoSeconds - { - get - { - return DateTime.Now.Ticks / 100; - } - } - - public static long AsLongNanoSeconds(TimeSpan timeSpan) - { - return (long)(timeSpan.Ticks * TicksPerNanoSecond); - } - - public static double AsDoubleNanoSeconds(TimeSpan timeSpan) - { - return timeSpan.Ticks * TicksPerNanoSecond; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/Wake.csproj ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/Wake.csproj b/lang/cs/Source/WAKE/Wake/Wake.csproj deleted file mode 100644 index cd15289..0000000 --- a/lang/cs/Source/WAKE/Wake/Wake.csproj +++ /dev/null @@ -1,216 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{CDFB3464-4041-42B1-9271-83AF24CD5008}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Org.Apache.Reef.Wake</RootNamespace> - <AssemblyName>Org.Apache.Reef.Wake</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <FileAlignment>512</FileAlignment> - <RestorePackages>true</RestorePackages> - <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> - </PropertyGroup> - <Import Project="$(SolutionDir)\Source\build.props" /> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>$(BinDir)\$(Platform)\$(Configuration)\$(RootNamespace)</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>$(BinDir)\$(Platform)\$(Configuration)\$(RootNamespace)</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>$(BinDir)\$(Platform)\$(Configuration)\$(RootNamespace)</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>$(BinDir)\$(Platform)\$(Configuration)\$(RootNamespace)</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="protobuf-net"> - <HintPath>$(PackagesDir)\protobuf-net.$(ProtobufVersion)\lib\net40\protobuf-net.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Core" /> - <Reference Include="System.Reactive.Core"> - <HintPath>$(PackagesDir)\Rx-Core.$(RxVersion)\lib\net45\System.Reactive.Core.dll</HintPath> - </Reference> - <Reference Include="System.Reactive.Interfaces"> - <HintPath>$(PackagesDir)\Rx-Interfaces.$(RxVersion)\lib\net45\System.Reactive.Interfaces.dll</HintPath> - </Reference> - <Reference Include="System.Runtime.Serialization" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="AbstractEStage.cs" /> - <Compile Include="IEStage.cs" /> - <Compile Include="IEventHandler.cs" /> - <Compile Include="IIdentifier.cs" /> - <Compile Include="IIdentifierFactory.cs" /> - <Compile Include="Impl\LoggingEventHandler.cs" /> - <Compile Include="Impl\MissingStartHandlerHandler.cs" /> - <Compile Include="Impl\MultiEventHandler.cs" /> - <Compile Include="Impl\PeriodicEvent.cs" /> - <Compile Include="Impl\PubSubEventHandler.cs" /> - <Compile Include="Impl\SingleThreadStage.cs" /> - <Compile Include="Impl\SyncStage.cs" /> - <Compile Include="Impl\ThreadPoolStage.cs" /> - <Compile Include="Impl\TimerStage.cs" /> - <Compile Include="IObserverFactory.cs" /> - <Compile Include="IStage.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Remote\ICodec.cs" /> - <Compile Include="Remote\ICodecFactory.cs" /> - <Compile Include="Remote\IDecoder.cs" /> - <Compile Include="Remote\IEncoder.cs" /> - <Compile Include="Remote\ILink.cs" /> - <Compile Include="Remote\Impl\ByteCodec.cs" /> - <Compile Include="Remote\Impl\ByteCodecFactory.cs" /> - <Compile Include="Remote\Impl\Channel.cs" /> - <Compile Include="Remote\Impl\DefaultRemoteManager.cs" /> - <Compile Include="Remote\Impl\DefaultRemoteMessage.cs" /> - <Compile Include="Remote\Impl\IntCodec.cs" /> - <Compile Include="Remote\Impl\IPEndpointComparer.cs" /> - <Compile Include="Remote\Impl\Link.cs" /> - <Compile Include="Remote\Impl\MultiCodec.cs" /> - <Compile Include="Remote\Impl\MultiDecoder.cs" /> - <Compile Include="Remote\Impl\MultiEncoder.cs" /> - <Compile Include="Remote\Impl\ObserverContainer.cs" /> - <Compile Include="Remote\Impl\RemoteEvent.cs" /> - <Compile Include="Remote\Impl\RemoteEventCodec.cs" /> - <Compile Include="Remote\Impl\RemoteEventDecoder.cs" /> - <Compile Include="Remote\Impl\RemoteEventEncoder.cs" /> - <Compile Include="Remote\Impl\RemoteEventEndpoint.cs" /> - <Compile Include="Remote\Impl\SocketRemoteIdentifier.cs" /> - <Compile Include="Remote\Impl\StringCodec.cs" /> - <Compile Include="Remote\Impl\StringIdentifier.cs" /> - <Compile Include="Remote\Impl\StringIdentifierFactory.cs" /> - <Compile Include="Remote\Impl\TransportClient.cs" /> - <Compile Include="Remote\Impl\TransportEvent.cs" /> - <Compile Include="Remote\Impl\TransportServer.cs" /> - <Compile Include="Remote\IRemoteEvent.cs" /> - <Compile Include="Remote\IRemoteIdentifier.cs" /> - <Compile Include="Remote\IRemoteIdentifierFactory.cs" /> - <Compile Include="Remote\IRemoteManager.cs" /> - <Compile Include="Remote\IRemoteMessage.cs" /> - <Compile Include="Remote\ISubscriptionManager.cs" /> - <Compile Include="Remote\Proto\WakeRemoteProtos.cs" /> - <Compile Include="Remote\RemoteConfiguration.cs" /> - <Compile Include="Remote\RemoteRuntimeException.cs" /> - <Compile Include="RX\AbstractObserver.cs" /> - <Compile Include="RX\AbstractRxStage.cs" /> - <Compile Include="RX\Impl\PubSubSubject.cs" /> - <Compile Include="RX\Impl\RxSyncStage.cs" /> - <Compile Include="RX\Impl\RxThreadPoolStage.cs" /> - <Compile Include="RX\Impl\RxTimerStage.cs" /> - <Compile Include="RX\Impl\SimpleSubject.cs" /> - <Compile Include="RX\IRxStage.cs" /> - <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" /> - <Compile Include="Time\IClock.cs" /> - <Compile Include="Time\Runtime\Event\ClientAlarm.cs" /> - <Compile Include="Time\Runtime\Event\IdleClock.cs" /> - <Compile Include="Time\Runtime\Event\RuntimeAlarm.cs" /> - <Compile Include="Time\Runtime\Event\RuntimeStart.cs" /> - <Compile Include="Time\Runtime\Event\RuntimeStop.cs" /> - <Compile Include="Time\Runtime\ITimer.cs" /> - <Compile Include="Time\Runtime\LogicalTimer.cs" /> - <Compile Include="Time\Runtime\RealTimer.cs" /> - <Compile Include="Time\Runtime\RuntimeClock.cs" /> - <Compile Include="Time\Time.cs" /> - <Compile Include="Util\Actionable.cs" /> - <Compile Include="Util\Disposable.cs" /> - <Compile Include="Util\FixedThreadPoolTaskService.cs" /> - <Compile Include="Util\IStartable.cs" /> - <Compile Include="Util\ITaskService.cs" /> - <Compile Include="Util\LimitedConcurrencyLevelTaskScheduler.cs" /> - <Compile Include="Util\NetworkUtils.cs" /> - <Compile Include="Util\SerializationHelper.cs" /> - <Compile Include="Util\TaskExtensions.cs" /> - <Compile Include="Util\TimeHelper.cs" /> - <Compile Include="WakeRuntimeException.cs" /> - </ItemGroup> - <ItemGroup> - <None Include="packages.config" /> - <None Include="Protobuf\RemoteProtocol.proto" /> - </ItemGroup> - <ItemGroup> - <Folder Include="Time\Time\Event\" /> - <Folder Include="Time\Time\Runtime\Event\" /> - <Folder Include="Util\Util\" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="$(SourceDir)\Tang\Tang\Tang.csproj"> - <Project>{97dbb573-3994-417a-9f69-ffa25f00d2a6}</Project> - <Name>Tang</Name> - </ProjectReference> - <ProjectReference Include="$(SourceDir)\Utilities\Utilities.csproj"> - <Project>{79e7f89a-1dfb-45e1-8d43-d71a954aeb98}</Project> - <Name>Utilities</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/WakeRuntimeException.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/WakeRuntimeException.cs b/lang/cs/Source/WAKE/Wake/WakeRuntimeException.cs deleted file mode 100644 index 0ac2c13..0000000 --- a/lang/cs/Source/WAKE/Wake/WakeRuntimeException.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 System; - -namespace Org.Apache.Reef.Wake -{ - /// <summary>Wake runtime exception</summary> - [System.Serializable] - public class WakeRuntimeException : Exception - { - private const long serialVersionUID = 1L; - - /// <summary>Constructs a new runtime wake exception with the specified detail message and cause - /// </summary> - /// <param name="s">the detailed message</param> - /// <param name="e">the cause</param> - public WakeRuntimeException(string s, Exception e) - : base(s, e) - { - } - - /// <summary>Constructs a new runtime stage exception with the specified detail message - /// </summary> - /// <param name="s">the detailed message</param> - public WakeRuntimeException(string s) - : base(s) - { - } - - /// <summary>Constructs a new runtime stage exception with the specified cause</summary> - /// <param name="e">the cause</param> - public WakeRuntimeException(Exception e) - : base("Runtime Exception", e) - { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/packages.config ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/packages.config b/lang/cs/Source/WAKE/Wake/packages.config deleted file mode 100644 index fd78097..0000000 --- a/lang/cs/Source/WAKE/Wake/packages.config +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<packages> - <package id="protobuf-net" version="2.0.0.668" targetFramework="net45" /> - <package id="Rx-Core" version="2.2.5" targetFramework="net45" /> - <package id="Rx-Interfaces" version="2.2.5" targetFramework="net45" /> -</packages> http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/WAKE/Wake/src/main/cs/Examples/P2p/IEventSource.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Source/WAKE/Wake/src/main/cs/Examples/P2p/IEventSource.cs b/lang/cs/Source/WAKE/Wake/src/main/cs/Examples/P2p/IEventSource.cs deleted file mode 100644 index d761032..0000000 --- a/lang/cs/Source/WAKE/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(); - } -}
