http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs new file mode 100644 index 0000000..27b965c --- /dev/null +++ b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfiguration.cs @@ -0,0 +1,149 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using Org.Apache.REEF.Common.Tasks.Events; +using Org.Apache.REEF.Tang.Formats; +using Org.Apache.REEF.Tang.Formats.AvroConfigurationDataContract; +using Org.Apache.REEF.Tang.Interface; +using Org.Apache.REEF.Tang.Util; +using Org.Apache.REEF.Utilities.Logging; + +[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static readonly field, typical usage in configurations")] + +namespace Org.Apache.REEF.Common.Tasks +{ + public class TaskConfiguration : ConfigurationModuleBuilder + { + // this is a hack for getting the task identifier for now + public const string TaskIdentifier = "TaskConfigurationOptions+Identifier"; + + /// <summary> + /// The identifier of the task. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly RequiredParameter<string> Identifier = new RequiredParameter<string>(); + + /// <summary> + /// The task to instantiate. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly RequiredImpl<ITask> Task = new RequiredImpl<ITask>(); + + /// <summary> + /// for task suspension. Defaults to task failure if not bound. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalImpl<IObserver<ISuspendEvent>> OnSuspend = new OptionalImpl<IObserver<ISuspendEvent>>(); + + /// <summary> + /// for messages from the driver. Defaults to task failure if not bound. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalImpl<IDriverMessageHandler> OnMessage = new OptionalImpl<IDriverMessageHandler>(); + + /// <summary> + /// for closure requests from the driver. Defaults to task failure if not bound. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalImpl<IObserver<ICloseEvent>> OnClose = new OptionalImpl<IObserver<ICloseEvent>>(); + + /// <summary> + /// Message source invoked upon each evaluator heartbeat. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalImpl<ITaskMessageSource> OnSendMessage = new OptionalImpl<ITaskMessageSource>(); + + /// <summary> + /// to receive TaskStart after the Task.call() method was called. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalImpl<IObserver<ITaskStart>> OnTaskStart = new OptionalImpl<IObserver<ITaskStart>>(); + + /// <summary> + /// to receive TaskStop after the Task.call() method returned. + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalImpl<IObserver<ITaskStop>> OnTaskStop = new OptionalImpl<IObserver<ITaskStop>>(); + + /// <summary> + /// The memento to be passed to Task.call(). + /// </summary> + [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")] + public static readonly OptionalParameter<string> Memento = new OptionalParameter<string>(); + + private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskConfiguration)); + + public TaskConfiguration() + : base() + { + } + + public TaskConfiguration(string configString) + { + TangConfig = new AvroConfigurationSerializer().FromString(configString); + AvroConfiguration avroConfiguration = AvroConfiguration.GetAvroConfigurationFromEmbeddedString(configString); + foreach (ConfigurationEntry config in avroConfiguration.Bindings) + { + if (config.key.Contains(TaskIdentifier)) + { + TaskId = config.value; + } + } + if (string.IsNullOrWhiteSpace(TaskId)) + { + string msg = "Required parameter TaskId not provided."; + LOGGER.Log(Level.Error, msg); + Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException(msg), LOGGER); + } + } + + public static ConfigurationModule ConfigurationModule + { + get + { + return new TaskConfiguration() + .BindImplementation(GenericType<ITask>.Class, Task) + .BindImplementation(GenericType<ITaskMessageSource>.Class, OnSendMessage) + .BindImplementation(GenericType<IDriverMessageHandler>.Class, OnMessage) + .BindNamedParameter(GenericType<TaskConfigurationOptions.Identifier>.Class, Identifier) + .BindNamedParameter(GenericType<TaskConfigurationOptions.Memento>.Class, Memento) + .BindNamedParameter(GenericType<TaskConfigurationOptions.CloseHandler>.Class, OnClose) + .BindNamedParameter(GenericType<TaskConfigurationOptions.SuspendHandler>.Class, OnSuspend) + .BindSetEntry(GenericType<TaskConfigurationOptions.StartHandlers>.Class, OnTaskStart) + .BindSetEntry(GenericType<TaskConfigurationOptions.StopHandlers>.Class, OnTaskStop) + .Build(); + } + } + + public string TaskId { get; private set; } + + public IList<KeyValuePair<string, string>> Configurations { get; private set; } + + public IConfiguration TangConfig { get; private set; } + + public override string ToString() + { + return string.Format(CultureInfo.InvariantCulture, "TaskConfiguration - configurations: {0}", TangConfig.ToString()); + } + } +}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs new file mode 100644 index 0000000..9d2f2e2 --- /dev/null +++ b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskConfigurationOptions.cs @@ -0,0 +1,69 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using Org.Apache.REEF.Common.Tasks.Events; +using Org.Apache.REEF.Tang.Annotations; + +namespace Org.Apache.REEF.Common.Tasks +{ + public class TaskConfigurationOptions + { + [NamedParameter("The Identifier of the Task", "taskid", "Task")] + public class Identifier : Name<string> + { + } + + [NamedParameter(documentation: "The memento to be used for the Task")] + public class Memento : Name<string> + { + } + + [NamedParameter("TaskMessageSource", "messagesource", null)] + public class TaskMessageSources : Name<ISet<ITaskMessageSource>> + { + } + + [NamedParameter(documentation: "The set of event handlers for the TaskStart event.")] + public class StartHandlers : Name<ISet<IObserver<ITaskStart>>> + { + } + + [NamedParameter(documentation: "The set of event handlers for the TaskStop event.")] + public class StopHandlers : Name<ISet<IObserver<ITaskStop>>> + { + } + + [NamedParameter(documentation: "The event handler that receives the close event.")] + public class CloseHandler : Name<IObserver<ICloseEvent>> + { + } + + [NamedParameter(documentation: "The event handler that receives the suspend event.")] + public class SuspendHandler : Name<IObserver<ISuspendEvent>> + { + } + + [NamedParameter(documentation: "The event handler that receives messages from the driver.")] + public class MessageHandler : Name<IObserver<IDriverMessage>> + { + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs new file mode 100644 index 0000000..494f59f --- /dev/null +++ b/lang/cs/Org.Apache.REEF.Common/Tasks/TaskMessage.cs @@ -0,0 +1,68 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using Org.Apache.REEF.Utilities; +using Org.Apache.REEF.Utilities.Logging; + +namespace Org.Apache.REEF.Common.Tasks +{ + public class TaskMessage : IMessage + { + private static readonly Logger LOGGER = Logger.GetLogger(typeof(TaskMessage)); + private readonly string _messageSourcId; + private readonly byte[] _bytes; + + private TaskMessage(string messageSourceId, byte[] bytes) + { + _messageSourcId = messageSourceId; + _bytes = bytes; + } + + public string MessageSourceId + { + get { return _messageSourcId; } + } + + public byte[] Message + { + get { return _bytes; } + set { } + } + + /// <summary> + /// From byte[] message to a TaskMessage + /// </summary> + /// <param name="messageSourceId">messageSourceId The message's sourceID. This will be accessible in the Driver for routing</param> + /// <param name="message">The actual content of the message, serialized into a byte[]</param> + /// <returns>a new TaskMessage with the given content</returns> + public static TaskMessage From(string messageSourceId, byte[] message) + { + if (string.IsNullOrEmpty(messageSourceId)) + { + Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("messageSourceId"), LOGGER); + } + if (message == null) + { + Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("bytes"), LOGGER); + } + return new TaskMessage(messageSourceId, message); + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs b/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs deleted file mode 100644 index 50fd6b7..0000000 --- a/lang/cs/Org.Apache.REEF.Common/api/AbstractFailure.cs +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Utilities; -using System; -using System.Globalization; -using Org.Apache.REEF.Utilities.Logging; - -namespace Org.Apache.REEF.Common.Api -{ - public abstract class AbstractFailure : IFailure - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(AbstractFailure)); - - public AbstractFailure() - { - } - - /// <summary> - /// Most detailed error message constructor that takes all parameters possible. - /// </summary> - /// <param name="id">Identifier of the entity that produced the error. Cannot be null.</param> - /// <param name="message">One-line error message. Cannot be null.</param> - /// <param name="description">Long error description. Can be null.</param> - /// <param name="cause">Exception that caused the error. Can be null.</param> - /// <param name="data">byte array that contains serialized version of the error. Can be null.</param> - public AbstractFailure(string id, string message, string description, Exception cause, byte[] data) - { - if (string.IsNullOrEmpty(id)) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("id"), LOGGER); - } - if (string.IsNullOrEmpty(message)) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("message"), LOGGER); - } - Id = id; - Message = message; - Description = Optional<string>.OfNullable(string.IsNullOrEmpty(description) ? GetStackTrace(cause) : description); - Cause = Optional<Exception>.OfNullable(cause); - Data = Optional<byte[]>.OfNullable(data); - } - - /// <summary> - /// Build error message given the entity ID and the short error message. - /// </summary> - /// <param name="id"></param> - /// <param name="message"></param> - public AbstractFailure(string id, string message) - : this(id, message, null, null, null) - { - } - - /// <summary> - /// Build error message given the failed entity ID and Exception. - /// Populates the message with the Exception.getMessage() result, and stores - /// the exception stack trace in the description. - /// </summary> - /// <param name="id"></param> - /// <param name="cause"></param> - public AbstractFailure(string id, Exception cause) - { - if (string.IsNullOrEmpty(id)) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("id"), LOGGER); - } - Id = id; - Message = cause.Message; - Description = Optional<string>.Of(GetStackTrace(cause)); - Cause = Optional<Exception>.Of(cause); - Data = Optional<byte[]>.Empty(); - } - - /// <summary> - /// Build error message given the entity ID plus short and long error message. - /// </summary> - /// <param name="id"></param> - /// <param name="message"></param> - /// <param name="description"></param> - public AbstractFailure(string id, string message, string description) - : this(id, message, description, null, null) - { - } - - /// <summary> - /// Identifier of the entity that produced the error. Cannot be null. - /// </summary> - public string Id { get; set; } - - public string Message { get; set; } - - public Optional<string> Description { get; set; } - - public Optional<string> Reason { get; set; } - - public Optional<Exception> Cause { get; set; } - - public Optional<byte[]> Data { get; set; } - - public Exception AsError() - { - return Cause.IsPresent() ? Cause.Value : new InvalidOperationException(ToString()); - } - - /// <summary> - /// Helper function: produce the string that contains the given exception's stack trace. Returns null if the argument is null. - /// </summary> - /// <param name="ex"></param> - public string GetStackTrace(Exception ex) - { - if (ex == null) - { - return null; - } - else - { - return ex.StackTrace; - } - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "{0} with id={1} failed: {2}", GetType(), Id, Message); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs b/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs deleted file mode 100644 index fd94b62..0000000 --- a/lang/cs/Org.Apache.REEF.Common/api/IAbstractFailure.cs +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Api -{ - public interface IAbstractFailure : IFailure - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs b/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs deleted file mode 100644 index 454bdf4..0000000 --- a/lang/cs/Org.Apache.REEF.Common/api/IFailure.cs +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Utilities; -using System; - -namespace Org.Apache.REEF.Common.Api -{ - /// <summary> - /// Common interface for all error messages in REEF. - /// Most of its functionality is generic and implemented in the AbstractFailure class. - /// </summary> - public interface IFailure : IIdentifiable - { - /// <summary> - /// One-line error message. Should never be null. - /// </summary> - string Message { get; set; } - - /// <summary> - /// Optional long error description. - /// </summary> - Optional<string> Description { get; set; } - - /// <summary> - /// Exception that caused the error, or null. - /// </summary> - Optional<string> Reason { get; set; } - - /// <summary> - /// Optional serialized version of the error message. - /// </summary> - Optional<byte[]> Data { get; set; } - - /// <summary> - /// Return the original Java Exception, or generate a new one if it does not exists. - /// ALWAYS returns an exception, never null - /// </summary> - Exception AsError(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IResourceLaunchHandler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/api/IResourceLaunchHandler.cs b/lang/cs/Org.Apache.REEF.Common/api/IResourceLaunchHandler.cs deleted file mode 100644 index 3287407..0000000 --- a/lang/cs/Org.Apache.REEF.Common/api/IResourceLaunchHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto; -using System; - -namespace Org.Apache.REEF.Common.Api -{ - public interface IResourceLaunchHandler : IObserver<ResourceLaunchProto> - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IResourceReleaseHandler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/api/IResourceReleaseHandler.cs b/lang/cs/Org.Apache.REEF.Common/api/IResourceReleaseHandler.cs deleted file mode 100644 index 5d807ad..0000000 --- a/lang/cs/Org.Apache.REEF.Common/api/IResourceReleaseHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto; -using System; - -namespace Org.Apache.REEF.Common.Api -{ - public interface IResourceReleaseHandler : IObserver<ResourceReleaseProto> - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/api/IResourceRequestHandler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/api/IResourceRequestHandler.cs b/lang/cs/Org.Apache.REEF.Common/api/IResourceRequestHandler.cs deleted file mode 100644 index 4932e5e..0000000 --- a/lang/cs/Org.Apache.REEF.Common/api/IResourceRequestHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto; -using System; - -namespace Org.Apache.REEF.Common.Api -{ - public interface IResourceRequestHandler : IObserver<ResourceRequestProto> - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs deleted file mode 100644 index 2f0ae95..0000000 --- a/lang/cs/Org.Apache.REEF.Common/avro/AvroDriverInfo.cs +++ /dev/null @@ -1,65 +0,0 @@ -//<auto-generated /> -namespace Org.Apache.REEF.Common.Avro -{ - using System.Collections.Generic; - using System.Runtime.Serialization; - - /// <summary> - /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroDriverInfo. - /// </summary> - [DataContract(Namespace = "org.apache.reef.webserver")] - [KnownType(typeof(List<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo>))] - public partial class AvroDriverInfo - { - private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroDriverInfo"",""fields"":[{""name"":""remoteId"",""type"":""string""},{""name"":""startTime"",""type"":""string""},{""name"":""services"",""type"":{""type"":""array"",""items"":{""type"":""record"",""name"":""org.apache.reef.webserver.AvroReefServiceInfo"",""fields"":[{""name"":""serviceName"",""type"":""string""},{""name"":""serviceInfo"",""type"":""string""}]}}}]}"; - - /// <summary> - /// Gets the schema. - /// </summary> - public static string Schema - { - get - { - return JsonSchema; - } - } - - /// <summary> - /// Gets or sets the remoteId field. - /// </summary> - [DataMember] - public string remoteId { get; set; } - - /// <summary> - /// Gets or sets the startTime field. - /// </summary> - [DataMember] - public string startTime { get; set; } - - /// <summary> - /// Gets or sets the services field. - /// </summary> - [DataMember] - public IList<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo> services { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="AvroDriverInfo"/> class. - /// </summary> - public AvroDriverInfo() - { - } - - /// <summary> - /// Initializes a new instance of the <see cref="AvroDriverInfo"/> class. - /// </summary> - /// <param name="remoteId">The remoteId.</param> - /// <param name="startTime">The startTime.</param> - /// <param name="services">The services.</param> - public AvroDriverInfo(string remoteId, string startTime, IList<Org.Apache.REEF.Common.Avro.AvroReefServiceInfo> services) - { - this.remoteId = remoteId; - this.startTime = startTime; - this.services = services; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs deleted file mode 100644 index 3767c2b..0000000 --- a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpRequest.cs +++ /dev/null @@ -1,79 +0,0 @@ -//<auto-generated /> -namespace Org.Apache.REEF.Common.Avro -{ - using System.Runtime.Serialization; - - /// <summary> - /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroHttpRequest. - /// </summary> - [DataContract(Namespace = "org.apache.reef.webserver")] - public partial class AvroHttpRequest - { - private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroHttpRequest"",""fields"":[{""name"":""requestUrl"",""type"":""string""},{""name"":""pathInfo"",""type"":""string""},{""name"":""queryString"",""type"":""string""},{""name"":""httpMethod"",""type"":""string""},{""name"":""inputStream"",""type"":""bytes""}]}"; - - /// <summary> - /// Gets the schema. - /// </summary> - public static string Schema - { - get - { - return JsonSchema; - } - } - - /// <summary> - /// Gets or sets the requestUrl field. - /// </summary> - [DataMember] - public string RequestUrl { get; set; } - - /// <summary> - /// Gets or sets the pathInfo field. - /// </summary> - [DataMember] - public string PathInfo { get; set; } - - /// <summary> - /// Gets or sets the queryString field. - /// </summary> - [DataMember] - public string QueryString { get; set; } - - /// <summary> - /// Gets or sets the httpMethod field. - /// </summary> - [DataMember] - public string HttpMethod { get; set; } - - /// <summary> - /// Gets or sets the inputStream field. - /// </summary> - [DataMember] - public byte[] InputStream { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="AvroHttpRequest"/> class. - /// </summary> - public AvroHttpRequest() - { - } - - /// <summary> - /// Initializes a new instance of the <see cref="AvroHttpRequest"/> class. - /// </summary> - /// <param name="requestUrl">The requestUrl.</param> - /// <param name="pathInfo">The pathInfo.</param> - /// <param name="queryString">The queryString.</param> - /// <param name="httpMethod">The httpMethod.</param> - /// <param name="inputStream">The inputStream.</param> - public AvroHttpRequest(string requestUrl, string pathInfo, string queryString, string httpMethod, byte[] inputStream) - { - RequestUrl = requestUrl; - PathInfo = pathInfo; - QueryString = queryString; - HttpMethod = httpMethod; - InputStream = inputStream; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpSerializer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpSerializer.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpSerializer.cs deleted file mode 100644 index 2d1fb53..0000000 --- a/lang/cs/Org.Apache.REEF.Common/avro/AvroHttpSerializer.cs +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Microsoft.Hadoop.Avro; -using System.IO; - -namespace Org.Apache.REEF.Common.Avro -{ - public class AvroHttpSerializer - { - public static AvroHttpRequest FromBytes(byte[] serializedBytes) - { - var serializer = AvroSerializer.Create<AvroHttpRequest>(); - using (var stream = new MemoryStream(serializedBytes)) - { - return serializer.Deserialize(stream); - } - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs deleted file mode 100644 index a3c0007..0000000 --- a/lang/cs/Org.Apache.REEF.Common/avro/AvroJsonSerializer.cs +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Utilities; - -using Newtonsoft.Json; - -namespace Org.Apache.REEF.Common.Avro -{ - /// <summary> - /// Wrapper class for serialize/deserialize Avro json. This avoids having to reference Avro dll in every project - /// </summary> - /// <typeparam name="T"> the deserialized type</typeparam> - public class AvroJsonSerializer<T> - { - public static T FromString(string str) - { - return JsonConvert.DeserializeObject<T>(str); - } - - public static string ToString(T obj) - { - return JsonConvert.SerializeObject(obj); - } - - public static T FromBytes(byte[] bytes) - { - return FromString(ByteUtilities.ByteArrarysToString(bytes)); - } - - public static byte[] ToBytes(T obj) - { - return ByteUtilities.StringToByteArrays(JsonConvert.SerializeObject(obj)); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs b/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs deleted file mode 100644 index 9b65c62..0000000 --- a/lang/cs/Org.Apache.REEF.Common/avro/AvroReefServiceInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -//<auto-generated /> -namespace Org.Apache.REEF.Common.Avro -{ - using System.Runtime.Serialization; - - /// <summary> - /// Used to serialize and deserialize Avro record org.apache.reef.webserver.AvroReefServiceInfo. - /// </summary> - [DataContract(Namespace = "org.apache.reef.webserver")] - public partial class AvroReefServiceInfo - { - private const string JsonSchema = @"{""type"":""record"",""name"":""org.apache.reef.webserver.AvroReefServiceInfo"",""fields"":[{""name"":""serviceName"",""type"":""string""},{""name"":""serviceInfo"",""type"":""string""}]}"; - - /// <summary> - /// Gets the schema. - /// </summary> - public static string Schema - { - get - { - return JsonSchema; - } - } - - /// <summary> - /// Gets or sets the serviceName field. - /// </summary> - [DataMember] - public string serviceName { get; set; } - - /// <summary> - /// Gets or sets the serviceInfo field. - /// </summary> - [DataMember] - public string serviceInfo { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="AvroReefServiceInfo"/> class. - /// </summary> - public AvroReefServiceInfo() - { - } - - /// <summary> - /// Initializes a new instance of the <see cref="AvroReefServiceInfo"/> class. - /// </summary> - /// <param name="serviceName">The serviceName.</param> - /// <param name="serviceInfo">The serviceInfo.</param> - public AvroReefServiceInfo(string serviceName, string serviceInfo) - { - this.serviceName = serviceName; - this.serviceInfo = serviceInfo; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs b/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs deleted file mode 100644 index 967995a..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/INodeDescriptor.cs +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System.Net; - -using Org.Apache.REEF.Common.Capabilities; - -namespace Org.Apache.REEF.Common.Catalog -{ - public interface INodeDescriptor - { - IPEndPoint InetSocketAddress { get; set; } - - string HostName { get; set; } - - CPU Cpu { get; set; } - - RAM Ram { get; set; } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs b/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs deleted file mode 100644 index 5e6bb32..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/IRackDescriptor.cs +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Catalog -{ - public interface IRackDescriptor : IResourceCatalog - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs b/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs deleted file mode 100644 index c972f73..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/IResourceCatalog.cs +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.Capabilities; -using System.Collections.Generic; - -namespace Org.Apache.REEF.Common.Catalog -{ - public interface IResourceCatalog - { - string Name { get; set; } - - ICollection<ICapability> Capabilities { get; set; } - - ICollection<INodeDescriptor> Nodes { get; set; } - - ICollection<IRackDescriptor> Racks { get; set; } - - INodeDescriptor GetNode(string nodeId); - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs deleted file mode 100644 index 696248b..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/NodeDescriptorImpl.cs +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.Capabilities; -using System.Collections.Generic; -using System.Net; - -namespace Org.Apache.REEF.Common.Catalog -{ - public class NodeDescriptorImpl : INodeDescriptor - { - private RackDescriptorImpl _rack; - - private string _id; - - private IPEndPoint _address; - - private RAM _ram; - - private IList<ICapability> _capabilities; - - public NodeDescriptorImpl() - { - } - - public NodeDescriptorImpl(string id, IPEndPoint addresss, RackDescriptorImpl rack, RAM ram) - { - _id = id; - _address = addresss; - _rack = rack; - _ram = ram; - _capabilities = new List<ICapability>(); - _rack.AddNodeDescriptor(this); - } - - public RackDescriptorImpl Rack - { - get - { - return _rack; - } - } - - public string Id - { - get - { - return _id; - } - } - - public string HostName { get; set; } - - public CPU Cpu - { - get - { - return new CPU(1); - } - - set - { - } - } - - public RAM Ram - { - get - { - return _ram; - } - - set - { - _ram = value; - } - } - - public IList<ICapability> Capabilities - { - get - { - return _capabilities; - } - } - - public IPEndPoint InetSocketAddress - { - get - { - return _address; - } - - set - { - _address = value; - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs b/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs deleted file mode 100644 index b6d89d8..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/RackDescriptorImpl.cs +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.Capabilities; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Org.Apache.REEF.Common.Catalog -{ - public class RackDescriptorImpl : IRackDescriptor - { - public RackDescriptorImpl(string name) - { - Name = name; - Capabilities = new List<ICapability>(); - Nodes = new List<INodeDescriptor>(); - } - - public string Name { get; set; } - - public ICollection<ICapability> Capabilities { get; set; } - - public ICollection<INodeDescriptor> Nodes { get; set; } - - public ICollection<IRackDescriptor> Racks { get; set; } - - public INodeDescriptor GetNode(string nodeId) - { - throw new NotImplementedException(); - } - - public void AddNodeDescriptor(NodeDescriptorImpl node) - { - Nodes.Add(node); - } - - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append("Rack " + Name); - foreach (INodeDescriptor nodeDescriptor in Nodes) - { - stringBuilder.Append(Environment.NewLine + nodeDescriptor); - } - return stringBuilder.ToString(); - } - - public override int GetHashCode() - { - return Name.GetHashCode(); - } - - public override bool Equals(object obj) - { - return base.Equals(obj); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs b/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs deleted file mode 100644 index 7d9e7ca..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/ResourceCatalogImpl.cs +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.Capabilities; -using Org.Apache.REEF.Common.ProtoBuf.DriverRuntimeProto; -using Org.Apache.REEF.Utilities.Logging; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Net; -using System.Text; - -namespace Org.Apache.REEF.Common.Catalog -{ - public class ResourceCatalogImpl : IResourceCatalog - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(ResourceCatalogImpl)); - - private static string defaultRackName = "default-rack"; - - private Dictionary<string, RackDescriptorImpl> _racks = new Dictionary<string, RackDescriptorImpl>(); - - private Dictionary<string, NodeDescriptorImpl> _nodes = new Dictionary<string, NodeDescriptorImpl>(); - - public string Name { get; set; } - - public ICollection<ICapability> Capabilities { get; set; } - - public ICollection<INodeDescriptor> Nodes { get; set; } - - public ICollection<IRackDescriptor> Racks { get; set; } - - public INodeDescriptor GetNode(string nodeId) - { - return _nodes[nodeId]; - } - - public void Handle(NodeDescriptorProto node) - { - string rackName = node.rack_name == null ? node.rack_name : defaultRackName; - string message = string.Format( - CultureInfo.InvariantCulture, - "Catalog new node: id[{0}], rack[{1}], host[{2}], port[{3}], memory[{4}]", - node.identifier, - rackName, - node.host_name, - node.port, - node.memory_size); - LOGGER.Log(Level.Info, message); - if (!string.IsNullOrWhiteSpace(rackName) && !_racks.ContainsKey(rackName)) - { - RackDescriptorImpl newRack = new RackDescriptorImpl(rackName); - _racks.Add(rackName, newRack); - } - RackDescriptorImpl rack = _racks[rackName]; - IPAddress ipAddress = null; - IPAddress.TryParse(node.host_name, out ipAddress); - if (ipAddress == null) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("cannot parse host ipaddress: " + node.host_name), LOGGER); - } - IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, node.port); - RAM ram = new RAM(node.memory_size); - NodeDescriptorImpl nodeDescriptor = new NodeDescriptorImpl(node.identifier, ipEndPoint, rack, ram); - _nodes.Add(nodeDescriptor.Id, nodeDescriptor); - } - - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append("=== Resource Catalog ==="); - foreach (IRackDescriptor rackDescriptor in Racks) - { - stringBuilder.Append(Environment.NewLine + rackDescriptor); - } - return stringBuilder.ToString(); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs b/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs deleted file mode 100644 index 599db2e..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/CPU.cs +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System; -using System.Globalization; -using Org.Apache.REEF.Common.Api; -using Org.Apache.REEF.Utilities.Logging; - -namespace Org.Apache.REEF.Common.Capabilities -{ - public class CPU : ICapability - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(CPU)); - - private int _cores; - - public CPU(int cores) - { - if (cores <= 0) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("cores cannot be non-positive"), LOGGER); - } - _cores = cores; - } - - public int Cores - { - get - { - return _cores; - } - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "CPU Cores = [{0}]", Cores); - } - - public override int GetHashCode() - { - return Cores.GetHashCode(); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs b/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs deleted file mode 100644 index 4c838f7..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/ICapability.cs +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Capabilities -{ - public interface ICapability - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs b/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs deleted file mode 100644 index 68f5a08..0000000 --- a/lang/cs/Org.Apache.REEF.Common/catalog/capabilities/RAM.cs +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System.Globalization; - -namespace Org.Apache.REEF.Common.Capabilities -{ - public class RAM : ICapability - { - private int _megaBytes; - - public RAM(int megaBytes) - { - _megaBytes = megaBytes; - } - - public int MegaBytes - { - get - { - return _megaBytes; - } - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "RAM(in mega bytes) = [{0}]", MegaBytes); - } - - public override int GetHashCode() - { - return MegaBytes.GetHashCode(); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs b/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs deleted file mode 100644 index 7f9b226..0000000 --- a/lang/cs/Org.Apache.REEF.Common/context/ContextMessage.cs +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System; -using Org.Apache.REEF.Utilities.Logging; - -namespace Org.Apache.REEF.Common.Context -{ - public class ContextMessage - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(ContextMessage)); - private readonly string _messageSourcId; - private readonly byte[] _bytes; - - private ContextMessage(string messageSourceId, byte[] bytes) - { - _messageSourcId = messageSourceId; - _bytes = bytes; - } - - public string MessageSourceId - { - get { return _messageSourcId; } - } - - public byte[] Bytes - { - get { return _bytes; } - } - - /// <summary> - /// construt a new new ContextMessage with the given content. - /// </summary> - /// <param name="messageSourceId">The message's sourceID. This will be accessible in the Driver for routing.</param> - /// <param name="bytes">The actual content of the message, serialized into a byte[]</param> - /// <returns>new ContextMessage with the given content.</returns> - public static ContextMessage From(string messageSourceId, byte[] bytes) - { - if (string.IsNullOrEmpty(messageSourceId)) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("messageSourceId"), LOGGER); - } - if (bytes == null) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentNullException("bytes"), LOGGER); - } - return new ContextMessage(messageSourceId, bytes); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs b/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs deleted file mode 100644 index 7d7a298..0000000 --- a/lang/cs/Org.Apache.REEF.Common/context/IContextMessage.cs +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Utilities; - -namespace Org.Apache.REEF.Common.Context -{ - public interface IContextMessage : IMessage, IIdentifiable - { - string MessageSourceId { get; } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs b/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs deleted file mode 100644 index 044d0af..0000000 --- a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System; - -namespace Org.Apache.REEF.Common.Context -{ - public interface IContextMessageHandler : IObserver<byte[]> - { - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs b/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs deleted file mode 100644 index d1eb08c..0000000 --- a/lang/cs/Org.Apache.REEF.Common/context/IContextMessageSource.cs +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Utilities; - -namespace Org.Apache.REEF.Common.Context -{ - public interface IContextMessageSource - { - Optional<ContextMessage> Message { get; set; } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs deleted file mode 100644 index 26049e6..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultLocalHttpDriverConnection.cs +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Tang.Annotations; -using System; - -namespace Org.Apache.REEF.Common.Evaluator -{ - public class DefaultLocalHttpDriverConnection : IDriverConnection - { - private readonly Uri _queryUri; - - [Inject] - public DefaultLocalHttpDriverConnection() - { - _queryUri = new Uri( - string.Concat( - Constants.LocalHttpEndpointBaseUri, - Constants.HttpReefUriSpecification, - Constants.HttpDriverUriTarget)); - } - - public DriverInformation GetDriverInformation(string applicationId) - { - // application id not needed for local runtime - return DriverInformation.GetDriverInformationFromHttp(_queryUri); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnClusterHttpDriverConnection.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnClusterHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnClusterHttpDriverConnection.cs deleted file mode 100644 index e0076e7..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnClusterHttpDriverConnection.cs +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Tang.Annotations; -using System; - -namespace Org.Apache.REEF.Common.Evaluator -{ - public class DefaultYarnClusterHttpDriverConnection : IDriverConnection - { - [Inject] - public DefaultYarnClusterHttpDriverConnection() - { - } - - public DriverInformation GetDriverInformation(string applicationId) - { - // e.g., http://headnodehost:9014/proxy/application_1407519727821_0012/reef/v1/driver - Uri queryUri = new Uri( - string.Concat( - Constants.HDInsightClusterHttpEndpointBaseUri, - applicationId, - Constants.HttpReefUriSpecification, - Constants.HttpDriverUriTarget)); - return DriverInformation.GetDriverInformationFromHttp(queryUri); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs deleted file mode 100644 index 9a4974c..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/DefaultYarnOneBoxHttpDriverConnection.cs +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Tang.Annotations; -using System; -using System.Globalization; - -namespace Org.Apache.REEF.Common.Evaluator -{ - public class DefaultYarnOneBoxHttpDriverConnection : IDriverConnection - { - [Inject] - public DefaultYarnOneBoxHttpDriverConnection() - { - } - - public DriverInformation GetDriverInformation(string applicationId) - { - // e.g., http://yingdac1:8088/proxy/application_1407519727821_0012/reef/v1/driver - string oneBoxHost = string.Format(CultureInfo.InvariantCulture, "http://{0}:8088/proxy/", Environment.MachineName); - Uri queryUri = new Uri( - string.Concat( - oneBoxHost, - applicationId, - Constants.HttpReefUriSpecification, - Constants.HttpDriverUriTarget)); - return DriverInformation.GetDriverInformationFromHttp(queryUri); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs deleted file mode 100644 index 055784e..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/DriverInformation.cs +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using Org.Apache.REEF.Common.Avro; -using Org.Apache.REEF.Utilities.Logging; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; - -namespace Org.Apache.REEF.Common.Evaluator -{ - public class DriverInformation - { - private static readonly Logger LOGGER = Logger.GetLogger(typeof(DriverInformation)); - - private string _rid; - - private string _startTime; - - private string _nameServerId; - - private IList<AvroReefServiceInfo> _services; - - public DriverInformation(string rid, string startTime, IList<AvroReefServiceInfo> services) - { - _rid = rid; - _startTime = startTime; - _services = services; - - if (_services == null) - { - LOGGER.Log(Level.Warning, "no services information from driver."); - } - else - { - AvroReefServiceInfo nameServerInfo = - _services.FirstOrDefault( - s => s.serviceName.Equals(Constants.NameServerServiceName, StringComparison.OrdinalIgnoreCase)); - if (nameServerInfo != null) - { - _nameServerId = nameServerInfo.serviceInfo; - } - } - } - - public string DriverRemoteIdentifier - { - get - { - return _rid; - } - } - - public string DriverStartTime - { - get - { - return _startTime; - } - } - - public string NameServerId - { - get - { - return _nameServerId; - } - } - - public static DriverInformation GetDriverInformationFromHttp(Uri queryUri) - { - HttpWebRequest request = (HttpWebRequest)WebRequest.Create(queryUri); - request.AllowAutoRedirect = false; - request.KeepAlive = false; - request.ContentType = "text/html"; - - string driverInfomation; - AvroDriverInfo info = null; - try - { - using (HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse()) - { - Stream stream = webResponse.GetResponseStream(); - if (stream == null) - { - return null; - } - using (StreamReader streamReader = new StreamReader(stream, Encoding.UTF8)) - { - driverInfomation = streamReader.ReadToEnd(); - LOGGER.Log(Level.Verbose, "Http response line: " + driverInfomation); - info = AvroJsonSerializer<AvroDriverInfo>.FromString(driverInfomation); - } - } - } - catch (WebException) - { - LOGGER.Log(Level.Warning, string.Format(CultureInfo.InvariantCulture, "In RECOVERY mode, cannot connect to [{0}] for driver information, will try again later.", queryUri)); - return null; - } - catch (Exception e) - { - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(e, Level.Error, string.Format(CultureInfo.InvariantCulture, "Cannot read content from {0}.", queryUri), LOGGER); - } - - if (info != null) - { - LOGGER.Log( - Level.Verbose, - string.Format(CultureInfo.InvariantCulture, "Driver information extracted with remote identier [{0}], start time [{1}], and servics [{2}]", info.remoteId, info.startTime, info.services)); - return new DriverInformation(info.remoteId, info.startTime, info.services); - } - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs deleted file mode 100644 index 22ffa67..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorOperationState.cs +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Evaluator -{ - public enum EvaluatorOperationState - { - /// <summary> - /// default state - /// </summary> - UNINITIATED = 0, - - /// <summary> - /// normal operational state - /// </summary> - OPERATIONAL = 1, - - /// <summary> - /// in the process of recovering - /// </summary> - RECOVERY = 2 - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs deleted file mode 100644 index 2db37a8..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorRuntimeState.cs +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.evaluator -{ - public enum EvaluatorRuntimeState - { - /// <summary> - /// default state - /// </summary> - UNINITIATED = 0, - - /// <summary> - /// normal operational state - /// </summary> - RUNNING = 1, - - /// <summary> - /// in the process of recovering - /// </summary> - RECOVERY = 2 - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs deleted file mode 100644 index 4269dd2..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/EvaluatorType.cs +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Evaluator -{ - public enum EvaluatorType - { - /// <summary> - /// default type - /// </summary> - UNDECIDED = 0, - - /// <summary> - /// Indicates an Evaluator that runs on the JVM - /// </summary> - JVM = 1, - - /// <summary> - /// Indicates an Evaluator that runs on the CLR - /// </summary> - CLR = 2 - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs b/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs deleted file mode 100644 index 10c6d6e..0000000 --- a/lang/cs/Org.Apache.REEF.Common/evaluator/IDriverConnection.cs +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Evaluator -{ - public interface IDriverConnection - { - DriverInformation GetDriverInformation(string applicationId); - } -} http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/7edb8570/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs b/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs deleted file mode 100644 index 924f2c4..0000000 --- a/lang/cs/Org.Apache.REEF.Common/events/IContextStart.cs +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -namespace Org.Apache.REEF.Common.Events -{ - public interface IContextStart - { - string Id { get; set; } - } -} \ No newline at end of file
