You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by we...@apache.org on 2015/02/05 22:05:37 UTC
[16/51] [partial] incubator-reef git commit: [REEF-131] Towards the
new .Net project structure This is to change .Net project structure for Tang,
Wake, REEF utilities, Common and Driver:
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextFailureHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextFailureHandler.cs
deleted file mode 100644
index cb1621b..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextFailureHandler.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler used for FailedContext: It crashes the driver.
- /// </summary>
- public class DefaultContextFailureHandler : IObserver<IFailedContext>
- {
- [Inject]
- public DefaultContextFailureHandler()
- {
- }
-
- public void OnNext(IFailedContext value)
- {
- throw new InvalidOperationException("No handler bound for FailedContext: " + value.Id);
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextMessageHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextMessageHandler.cs
deleted file mode 100644
index f5b7ad2..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultContextMessageHandler.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Context;
-using Org.Apache.Reef.Utilities;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// efault event handler for ContextMessage: Logging it.
- /// </summary>
- public class DefaultContextMessageHandler : IObserver<IContextMessage>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultContextMessageHandler));
-
- [Inject]
- public DefaultContextMessageHandler()
- {
- }
-
- public void OnNext(IContextMessage value)
- {
- LOGGER.Log(Level.Info, "Received ContextMessage: " + ByteUtilities.ByteArrarysToString(value.Message));
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultCustomTraceListener.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultCustomTraceListener.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultCustomTraceListener.cs
deleted file mode 100644
index f197298..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultCustomTraceListener.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Tang.Annotations;
-using System.Diagnostics;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- public class DefaultCustomTraceListener : TraceListener
- {
- private readonly TraceListener _listener;
-
- [Inject]
- public DefaultCustomTraceListener()
- {
- _listener = new ConsoleTraceListener();
- }
-
- public override void Write(string message)
- {
- _listener.Write(message);
- }
-
- public override void WriteLine(string message)
- {
- _listener.WriteLine(message);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartContextActiveHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartContextActiveHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartContextActiveHandler.cs
deleted file mode 100644
index 314a132..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartContextActiveHandler.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default handler for ActiveContext received during driver restart: Close it.
- /// </summary>
- public class DefaultDriverRestartContextActiveHandler : IObserver<IActiveContext>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartContextActiveHandler));
-
- [Inject]
- public DefaultDriverRestartContextActiveHandler()
- {
- }
-
- public void OnNext(IActiveContext value)
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received ActiveContext during driver restart:[{0}], closing it", value.Id));
- value.Dispose();
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartHandler.cs
deleted file mode 100644
index 3603f61..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartHandler.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using Org.Apache.Reef.Wake.Time;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler for driver restart: Logging it.
- /// </summary>
- public class DefaultDriverRestartHandler : IObserver<StartTime>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartHandler));
-
- [Inject]
- public DefaultDriverRestartHandler()
- {
- }
-
- public void OnNext(StartTime startTime)
- {
- LOGGER.Log(Level.Info, "Driver restarted at" + new DateTime(startTime.TimeStamp));
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartTaskRunningHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartTaskRunningHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartTaskRunningHandler.cs
deleted file mode 100644
index 461b3bb..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultDriverRestartTaskRunningHandler.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Task;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler for TaskRuntime received during driver restart: Logging it.
- /// </summary>
- public class DefaultDriverRestartTaskRunningHandler : IObserver<IRunningTask>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultDriverRestartTaskRunningHandler));
-
- [Inject]
- public DefaultDriverRestartTaskRunningHandler()
- {
- }
-
- public void OnNext(IRunningTask runningTask)
- {
- LOGGER.Log(Level.Info, "Received TaskRuntime during driver restart: " + runningTask.Id);
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorAllocationHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorAllocationHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorAllocationHandler.cs
deleted file mode 100644
index 07a5828..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorAllocationHandler.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Evaluator;
-using Org.Apache.Reef.Driver.Evaluator;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default handler for AllocatedEvaluator: close it.
- /// </summary>
- public class DefaultEvaluatorAllocationHandler : IObserver<IAllocatedEvaluator>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultEvaluatorAllocationHandler));
-
- [Inject]
- public DefaultEvaluatorAllocationHandler()
- {
- }
-
- public void OnNext(IAllocatedEvaluator value)
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received AllocatedEvaluator : {0}, closing", value.Id));
- value.Dispose();
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorCompletionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorCompletionHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorCompletionHandler.cs
deleted file mode 100644
index 6297f64..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorCompletionHandler.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Evaluator;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler for CompletedEvaluator: Logging it.
- /// </summary>
- public class DefaultEvaluatorCompletionHandler : IObserver<ICompletedEvaluator>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultEvaluatorCompletionHandler));
-
- [Inject]
- public DefaultEvaluatorCompletionHandler()
- {
- }
-
- public void OnNext(ICompletedEvaluator value)
- {
- LOGGER.Log(Level.Info, "Received CompletedEvaluator: " + value.Id);
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorFailureHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorFailureHandler.cs
deleted file mode 100644
index ccd8d4c..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorFailureHandler.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Evaluator;
-using Org.Apache.Reef.Utilities.Diagnostics;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler used for FailedEvaluator: It crashes the driver.
- /// </summary>
- public class DefaultEvaluatorFailureHandler : IObserver<IFailedEvaluator>
- {
- [Inject]
- public DefaultEvaluatorFailureHandler()
- {
- }
-
- public void OnNext(IFailedEvaluator value)
- {
- var e = new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Evaluator {0} failed, and no handler is bound for FailedEvaluator.", value.Id));
- Exceptions.Throw(e, Logger.GetLogger(typeof(DefaultEvaluatorFailureHandler)));
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorRequestorHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorRequestorHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorRequestorHandler.cs
deleted file mode 100644
index 2b70281..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultEvaluatorRequestorHandler.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Bridge;
-using Org.Apache.Reef.Driver.Evaluator;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default handler for close messages from the client: logging it
- /// </summary>
- public class DefaultEvaluatorRequestorHandler : IObserver<IEvaluatorRequestor>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultClientCloseHandler));
-
- [Inject]
- public DefaultEvaluatorRequestorHandler()
- {
- }
-
- public void OnNext(IEvaluatorRequestor value)
- {
- LOGGER.Log(Level.Info, "Default evaluator requstor: requesting 1 evaluator with 512 MB");
- int evaluatorsNumber = 1;
- int memory = 512;
- string rack = "WonderlandRack";
- EvaluatorRequest request = new EvaluatorRequest(evaluatorsNumber, memory, rack);
-
- value.Submit(request);
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultHttpHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultHttpHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultHttpHandler.cs
deleted file mode 100644
index 2dc874b..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultHttpHandler.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using System.Net;
-using Org.Apache.Reef.Driver.Bridge;
-using Org.Apache.Reef.Utilities;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- public class DefaultHttpHandler : IHttpHandler
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultHttpHandler));
-
- [Inject]
- public DefaultHttpHandler()
- {
- }
-
- public string GetSpecification()
- {
- return "Ping";
- }
-
- public void OnHttpRequest(ReefHttpRequest requet, ReefHttpResponse response)
- {
- LOGGER.Log(Level.Info, "OnHttpRequest in DefaultHttpHandler is called.");
- response.Status = HttpStatusCode.OK;
- response.OutputStream = ByteUtilities.StringToByteArrays("Byte array returned from DefaultHttpHandler in CLR!!!");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskCompletionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskCompletionHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskCompletionHandler.cs
deleted file mode 100644
index 5093c85..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskCompletionHandler.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Context;
-using Org.Apache.Reef.Common.Task;
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Driver.Task;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// efault event handler for CompletedTask: Log it and close the context.
- /// </summary>
- public class DefaultTaskCompletionHandler : IObserver<ICompletedTask>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskCompletionHandler));
-
- [Inject]
- public DefaultTaskCompletionHandler()
- {
- }
-
- public void OnNext(ICompletedTask value)
- {
- IActiveContext activeContext = value.ActiveContext;
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Received CompletedTask: {0} :: CLOSING context: {1}", value.Id, activeContext.Id));
- activeContext.Dispose();
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskFailureHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskFailureHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskFailureHandler.cs
deleted file mode 100644
index 99c7f8d..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskFailureHandler.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Task;
-using Org.Apache.Reef.Driver.Task;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-using System.Globalization;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler used for FailedTask: It crashes the driver.
- /// </summary>
- public class DefaultTaskFailureHandler : IObserver<IFailedTask>
- {
- [Inject]
- public DefaultTaskFailureHandler()
- {
- }
-
- public void OnNext(IFailedTask value)
- {
- throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Task {0} has failed, and no handler was bound for IFailedTask", value.Id) );
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskMessageHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskMessageHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskMessageHandler.cs
deleted file mode 100644
index 855085b..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskMessageHandler.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Task;
-using Org.Apache.Reef.Driver.Task;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler for TaskMessage: Logging it.
- /// </summary>
- public class DefaultTaskMessageHandler : IObserver<ITaskMessage>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskMessageHandler));
-
- [Inject]
- public DefaultTaskMessageHandler()
- {
- }
-
- public void OnNext(ITaskMessage value)
- {
- LOGGER.Log(Level.Info, "Default TaskMessage handler received message: " + value.Message);
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskRunningHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskRunningHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskRunningHandler.cs
deleted file mode 100644
index 0811967..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskRunningHandler.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Task;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler for TaskRuntime: Logging it.
- /// </summary>
- public class DefaultTaskRunningHandler : IObserver<IRunningTask>
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(DefaultTaskRunningHandler));
-
- [Inject]
- public DefaultTaskRunningHandler()
- {
- }
-
- public void OnNext(IRunningTask runningTask)
- {
- LOGGER.Log(Level.Info, "Received TaskRuntime: " + runningTask.Id);
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskSuspensionHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskSuspensionHandler.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskSuspensionHandler.cs
deleted file mode 100644
index 328b745..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/defaults/DefaultTaskSuspensionHandler.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common;
-using Org.Apache.Reef.Utilities.Diagnostics;
-using Org.Apache.Reef.Utilities.Logging;
-using Org.Apache.Reef.Tang.Annotations;
-using System;
-
-namespace Org.Apache.Reef.Driver.Defaults
-{
- /// <summary>
- /// Default event handler used for SuspendedTask: It crashes the driver.
- /// </summary>
- public class DefaultTaskSuspensionHandler : IObserver<ISuspendedTask>
- {
- [Inject]
- public DefaultTaskSuspensionHandler()
- {
- }
-
- public void OnNext(ISuspendedTask value)
- {
- Exceptions.Throw(new InvalidOperationException("No handler bound for SuspendedTask: " + value.Id), Logger.GetLogger(typeof(DefaultTaskSuspensionHandler)));
- }
-
- public void OnError(Exception error)
- {
- throw new NotImplementedException();
- }
-
- public void OnCompleted()
- {
- throw new NotImplementedException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorDescriptorImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorDescriptorImpl.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorDescriptorImpl.cs
deleted file mode 100644
index a43337e..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorDescriptorImpl.cs
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Catalog;
-using Org.Apache.Reef.Common.Evaluator;
-using Org.Apache.Reef.Driver.Bridge;
-using Org.Apache.Reef.Utilities.Diagnostics;
-using Org.Apache.Reef.Utilities.Logging;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- public class EvaluatorDescriptorImpl : IEvaluatorDescriptor
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(EvaluatorDescriptorImpl));
-
- private INodeDescriptor _nodeDescriptor;
-
- private EvaluatorType _type;
-
- private int _megaBytes;
-
- private int _virtualCore;
-
- private string _rack = "default_rack";
-
- public EvaluatorDescriptorImpl(string serializedString)
- {
- FromString(serializedString);
- }
-
- public EvaluatorDescriptorImpl(INodeDescriptor nodeDescriptor, EvaluatorType type, int megaBytes, int core)
- {
- _nodeDescriptor = nodeDescriptor;
- _type = type;
- _megaBytes = megaBytes;
- _virtualCore = core;
- }
-
- public INodeDescriptor NodeDescriptor
- {
- get
- {
- return _nodeDescriptor;
- }
-
- set
- {
- }
- }
-
- public EvaluatorType EvaluatorType
- {
- get
- {
- return _type;
- }
-
- set
- {
- }
- }
-
- public int Memory
- {
- get
- {
- return _megaBytes;
- }
-
- set
- {
- }
- }
-
- public int VirtualCore
- {
- get
- {
- return _virtualCore;
- }
-
- set
- {
- }
- }
-
- public string Rack
- {
- get
- {
- return _rack;
- }
-
- set
- {
- }
- }
-
- public void FromString(string str)
- {
- Dictionary<string, string> settings = new Dictionary<string, string>();
- string[] components = str.Split(',');
- foreach (string component in components)
- {
- string[] pair = component.Trim().Split('=');
- if (pair == null || pair.Length != 2)
- {
- var e = new ArgumentException("invalid component to be used as key-value pair:", component);
- Exceptions.Throw(e, LOGGER);
- }
- settings.Add(pair[0], pair[1]);
- }
- string ipAddress;
- if (!settings.TryGetValue("IP", out ipAddress))
- {
- Exceptions.Throw(new ArgumentException("cannot find IP entry"), LOGGER);
- }
- ipAddress = ipAddress.Split('/').Last();
- string port;
- if (!settings.TryGetValue("Port", out port))
- {
- Exceptions.Throw(new ArgumentException("cannot find Port entry"), LOGGER);
- }
- int portNumber = 0;
- int.TryParse(port, out portNumber);
- string hostName;
- if (!settings.TryGetValue("HostName", out hostName))
- {
- Exceptions.Throw(new ArgumentException("cannot find HostName entry"), LOGGER);
- }
- string memory;
- if (!settings.TryGetValue("Memory", out memory))
- {
- Exceptions.Throw(new ArgumentException("cannot find Memory entry"), LOGGER);
- }
- int memoryInMegaBytes = 0;
- int.TryParse(memory, out memoryInMegaBytes);
-
- string core;
- if (!settings.TryGetValue("Core", out core))
- {
- Exceptions.Throw(new ArgumentException("cannot find Core entry"), LOGGER);
- }
- int vCore = 0;
- int.TryParse(core, out vCore);
-
- IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(ipAddress), portNumber);
-
- _nodeDescriptor = new NodeDescriptorImpl();
- _nodeDescriptor.InetSocketAddress = ipEndPoint;
- _nodeDescriptor.HostName = hostName;
- _type = EvaluatorType.CLR;
- _megaBytes = memoryInMegaBytes;
- _virtualCore = vCore;
- }
-
- public void SetType(EvaluatorType type)
- {
- lock (this)
- {
- if (_type != EvaluatorType.UNDECIDED)
- {
- var e = new InvalidOperationException("Cannot change a set evaluator type: " + _type);
- Exceptions.Throw(e, LOGGER);
- }
- _type = type;
- }
- }
-
- public override bool Equals(object obj)
- {
- EvaluatorDescriptorImpl other = obj as EvaluatorDescriptorImpl;
- if (other == null)
- {
- return false;
- }
-
- return EquivalentMemory(other);
- // we don't care about rack now;
- // && string.Equals(_rack, other.Rack, StringComparison.OrdinalIgnoreCase);
- }
-
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
-
- private bool EquivalentMemory(EvaluatorDescriptorImpl other)
- {
- int granularity = ClrHandlerHelper.MemoryGranularity == 0
- ? Constants.DefaultMemoryGranularity
- : ClrHandlerHelper.MemoryGranularity;
- int m1 = (Memory - 1) / granularity;
- int m2 = (other.Memory - 1 ) / granularity;
- return (m1 == m2);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequest.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequest.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequest.cs
deleted file mode 100644
index fda7d5b..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequest.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Capabilities;
-using Org.Apache.Reef.Common.Catalog;
-using Org.Apache.Reef.Driver.Evaluator;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace Org.Apache.Reef.Driver.Bridge
-{
- [DataContract]
- public class EvaluatorRequest : IEvaluatorRequest
- {
- public EvaluatorRequest()
- : this(0, 0, 1, string.Empty, Guid.NewGuid().ToString("N"))
- {
- }
-
- public EvaluatorRequest(int number, int megaBytes)
- : this(number, megaBytes, 1, string.Empty, Guid.NewGuid().ToString("N"))
- {
- }
-
- public EvaluatorRequest(int number, int megaBytes, int core)
- : this(number, megaBytes, core, string.Empty, Guid.NewGuid().ToString("N"))
- {
- }
-
- public EvaluatorRequest(int number, int megaBytes, string rack)
- : this(number, megaBytes, 1, rack, Guid.NewGuid().ToString("N"))
- {
- }
-
- public EvaluatorRequest(int number, int megaBytes, int core, string rack)
- : this(number, megaBytes, core, rack, Guid.NewGuid().ToString("N"))
- {
- }
-
- public EvaluatorRequest(int number, int megaBytes, int core, string rack, string evaluatorBatchId)
- {
- Number = number;
- MemoryMegaBytes = megaBytes;
- VirtualCore = core;
- Rack = rack;
- EvaluatorBatchId = evaluatorBatchId;
- }
-
- public EvaluatorRequest(int number, int megaBytes, int core, List<ICapability> capabilitieses, IResourceCatalog catalog)
- {
- Number = number;
- MemoryMegaBytes = megaBytes;
- Capabilities = capabilitieses;
- VirtualCore = core;
- Catalog = catalog;
- EvaluatorBatchId = Guid.NewGuid().ToString("N");
- }
-
- [DataMember]
- public string InstanceId { get; set; }
-
- [DataMember]
- public int MemoryMegaBytes { get; set; }
-
- [DataMember]
- public int Number { get; set; }
-
- [DataMember]
- public int VirtualCore { get; set; }
-
- [DataMember]
- public string Rack { get; set; }
-
- [DataMember]
- public string EvaluatorBatchId { get; set; }
-
- public List<ICapability> Capabilities { get; set; }
-
- public IResourceCatalog Catalog { get; set; }
-
- public static EvaluatorRequestBuilder NewBuilder()
- {
- return new EvaluatorRequestBuilder();
- }
-
- public static EvaluatorRequestBuilder NewBuilder(EvaluatorRequest request)
- {
- return new EvaluatorRequestBuilder(request);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequestBuilder.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequestBuilder.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequestBuilder.cs
deleted file mode 100644
index 475d9af..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/EvaluatorRequestBuilder.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Capabilities;
-using Org.Apache.Reef.Common.Catalog;
-using Org.Apache.Reef.Driver.Bridge;
-using System.Collections.Generic;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- public class EvaluatorRequestBuilder
- {
- public EvaluatorRequestBuilder(EvaluatorRequest request)
- {
- foreach (ICapability capability in request.Capabilities)
- {
- Capabilities.Add(capability);
- }
- Number = request.Number;
- Catalog = request.Catalog;
- MegaBytes = request.MemoryMegaBytes;
- VirtualCore = request.VirtualCore;
- }
-
- internal EvaluatorRequestBuilder()
- {
- }
-
- public int Number { get; set; }
-
- public List<ICapability> Capabilities { get; set; }
-
- public IResourceCatalog Catalog { get; set; }
-
- public int MegaBytes { get; set; }
-
- public int VirtualCore { get; set; }
-
- public EvaluatorRequest Build()
- {
- return new EvaluatorRequest(Number, MegaBytes, VirtualCore, Capabilities, Catalog);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IAllocatedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IAllocatedEvaluator.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IAllocatedEvaluator.cs
deleted file mode 100644
index ce2bf08..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IAllocatedEvaluator.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common;
-using Org.Apache.Reef.Common.Evaluator;
-using Org.Apache.Reef.Utilities;
-using System;
-using System.Net;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- /// <summary>
- /// Represents an Evaluator that is allocated, but is not running yet.
- /// </summary>
- public interface IAllocatedEvaluator : IDisposable, IIdentifiable, IContextSubmittable, IContextAndTaskSubmittable
- {
- EvaluatorType Type { get; set; }
-
- string NameServerInfo { get; set; }
-
- string EvaluatorBatchId { get; set; }
-
- IEvaluatorDescriptor GetEvaluatorDescriptor();
-
- /// <summary>
- /// Puts the given file into the working directory of the Evaluator.
- /// </summary>
- /// <param name="file">the file to be copied</param>
- void AddFile(string file);
-
- /// <summary>
- /// Puts the given file into the working directory of the Evaluator and adds it to its classpath.
- /// </summary>
- /// <param name="file">the file to be copied</param>
- void AddLibrary(string file);
-
- void AddFileResource(string file);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/ICompletedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/ICompletedEvaluator.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/ICompletedEvaluator.cs
deleted file mode 100644
index 5c5fb62..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/ICompletedEvaluator.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Utilities;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- /// <summary>
- /// Represents an Evaluator that has completed
- /// </summary>
- public interface ICompletedEvaluator : IIdentifiable
- {
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorDescriptor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorDescriptor.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorDescriptor.cs
deleted file mode 100644
index 29e822f..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorDescriptor.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Catalog;
-using Org.Apache.Reef.Common.Evaluator;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- /// <summary>
- /// Metadata about an Evaluator.
- /// </summary>
- public interface IEvaluatorDescriptor
- {
- /// <summary>
- /// NodeDescriptor of the node where this Evaluator is running.
- /// </summary>
- INodeDescriptor NodeDescriptor { get; set; }
-
- /// <summary>
- /// type of Evaluator.
- /// </summary>
- EvaluatorType EvaluatorType { get; set; }
-
- /// <summary>
- /// the amount of memory allocated to this Evaluator.
- /// </summary>
- int Memory { get; set; }
-
- /// <summary>
- /// the virtual core allocated to this Evaluator.
- /// </summary>
- int VirtualCore { get; set; }
-
- /// <summary>
- /// rack on which the evaluator was allocated
- /// </summary>
- string Rack { get; set; }
-
- void FromString(string str);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequest .cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequest .cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequest .cs
deleted file mode 100644
index 4a9633a..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequest .cs
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Capabilities;
-using Org.Apache.Reef.Common.Catalog;
-using System.Collections.Generic;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- public interface IEvaluatorRequest
- {
- int MemoryMegaBytes { get; set; }
-
- int Number { get; set; }
-
- int VirtualCore { get; set; }
-
- string Rack { get; set; }
-
- string EvaluatorBatchId { get; set; }
-
- List<ICapability> Capabilities { get; set; }
-
- IResourceCatalog Catalog { get; set; }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequestor.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequestor.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequestor.cs
deleted file mode 100644
index e562f96..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IEvaluatorRequestor.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using System.Collections.Generic;
-
-using Org.Apache.Reef.Common.Catalog;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- /// <summary>
- /// Interface through which Evaluators can be requested.
- /// </summary>
- public interface IEvaluatorRequestor
- {
- /// <summary>
- /// Access to the {@link ResourceCatalog} for the cluster this Factory has access to
- /// </summary>
- IResourceCatalog ResourceCatalog { get; set; }
-
- /// <summary>
- /// Map between user evaluator id and evaluator information
- /// </summary>
- //IDictionary<string, IEvaluatorDescriptor> Evaluators { get; }
-
- /// <summary>
- /// Submit the request for new evaluator. The response will surface in the AllocatedEvaluator message handler.
- /// </summary>
- /// <param name="request"></param>
- void Submit(IEvaluatorRequest request);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IFailedEvaluator.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IFailedEvaluator.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IFailedEvaluator.cs
deleted file mode 100644
index 328d3ca..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/evaluator/IFailedEvaluator.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Exceptions;
-using Org.Apache.Reef.Driver.Bridge;
-using Org.Apache.Reef.Driver.Task;
-using Org.Apache.Reef.Utilities;
-using System.Collections.Generic;
-
-namespace Org.Apache.Reef.Driver.Evaluator
-{
- /// <summary>
- /// Represents an Evaluator that became unavailable.
- /// </summary>
- public interface IFailedEvaluator : IIdentifiable
- {
- EvaluatorException EvaluatorException { get; set; }
-
- List<FailedContext> FailedContexts { get; set; }
-
- Optional<IFailedTask> FailedTask { get; set; }
-
- IEvaluatorRequestor GetEvaluatorRequetor();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/packages.config
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/packages.config b/lang/cs/Source/REEF/reef-common/ReefDriver/packages.config
deleted file mode 100644
index 933b7e1..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/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="Microsoft.Hadoop.Avro" version="1.4.0.0" targetFramework="net45" />
- <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
- <package id="protobuf-net" version="2.0.0.668" targetFramework="net45" />
-</packages>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/task/ICompletedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/task/ICompletedTask.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/task/ICompletedTask.cs
deleted file mode 100644
index 336fd5c..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/task/ICompletedTask.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Utilities;
-
-namespace Org.Apache.Reef.Driver.Task
-{
- public interface ICompletedTask : IMessage, IIdentifiable
- {
- IActiveContext ActiveContext { get; set; }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/task/IFailedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/task/IFailedTask.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/task/IFailedTask.cs
deleted file mode 100644
index f85f28d..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/task/IFailedTask.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common.Api;
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Utilities;
-
-namespace Org.Apache.Reef.Driver.Task
-{
- public interface IFailedTask : IAbstractFailure
- {
- Optional<IActiveContext> GetActiveContext();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/task/IRunningTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/task/IRunningTask.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/task/IRunningTask.cs
deleted file mode 100644
index 7870777..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/task/IRunningTask.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Utilities;
-using System;
-
-namespace Org.Apache.Reef.Driver.Task
-{
- /// <summary>
- /// Represents a running Task
- /// </summary>
- public interface IRunningTask : IIdentifiable, IDisposable
- {
- /// <summary>
- /// the context the task is running on.
- /// </summary>
- IActiveContext ActiveContext { get; set; }
-
- /// <summary>
- /// Sends the message to the running task.
- /// </summary>
- /// <param name="message"></param>
- void OnNext(byte[] message);
-
- /// <summary>
- /// Sends the message
- /// </summary>
- /// <param name="message"></param>
- void Send(byte[] message);
-
- /// <summary>
- /// Signal the task to suspend.
- /// </summary>
- /// <param name="message">a message that is sent to the Task.</param>
- void Suspend(byte[] message);
-
- /// <summary>
- /// Sends the message to the running task.
- /// </summary>
- void Suspend();
-
- /// <summary>
- /// Signal the task to shut down.
- /// </summary>
- /// <param name="message">a message that is sent to the Task.</param>
- void Dispose(byte[] message);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/task/ISuspendedTask.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/task/ISuspendedTask.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/task/ISuspendedTask.cs
deleted file mode 100644
index c6b769a..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/task/ISuspendedTask.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Utilities;
-
-namespace Org.Apache.Reef.Driver
-{
- public interface ISuspendedTask : IMessage, IIdentifiable
- {
- IActiveContext ActiveContext { get; set; }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/task/ITaskMessage.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/task/ITaskMessage.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/task/ITaskMessage.cs
deleted file mode 100644
index e6fb7a1..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/task/ITaskMessage.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-namespace Org.Apache.Reef.Driver.Task
-{
- public interface ITaskMessage
- {
- byte[] Message { get; set; }
-
- string TaskId { get; set; }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-common/ReefDriver/task/RunningTaskImpl.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-common/ReefDriver/task/RunningTaskImpl.cs b/lang/cs/Source/REEF/reef-common/ReefDriver/task/RunningTaskImpl.cs
deleted file mode 100644
index 277e742..0000000
--- a/lang/cs/Source/REEF/reef-common/ReefDriver/task/RunningTaskImpl.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Org.Apache.Reef.Common;
-using Org.Apache.Reef.Common.ProtoBuf.EvaluatorRunTimeProto;
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Utilities.Logging;
-using System.Globalization;
-
-namespace Org.Apache.Reef.Driver.Task
-{
- public class RunningTaskImpl : IRunningTask
- {
- private static readonly Logger LOGGER = Logger.GetLogger(typeof(RunningTaskImpl));
-
- private string _id;
-
- private EvaluatorManager _evaluatorManager;
-
- private EvaluatorContext _evaluatorContext;
-
- public RunningTaskImpl(EvaluatorManager evaluatorManager, string taskId, EvaluatorContext evaluatorContext)
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "INIT: TaskRuntime id [{0}] on evaluator id [{1}]", taskId, evaluatorManager.Id));
- _id = taskId;
- _evaluatorManager = evaluatorManager;
- _evaluatorContext = evaluatorContext;
- }
-
- public string Id
- {
- get
- {
- return _id;
- }
-
- set
- {
- }
- }
-
- public IActiveContext ActiveContext
- {
- get
- {
- return _evaluatorContext;
- }
-
- set
- {
- }
- }
-
- public void Dispose()
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "DISPOSE: TaskRuntime id [{0}] on evaluator id [{1}]", _id, _evaluatorManager.Id));
- ContextControlProto contextControlProto = new ContextControlProto();
- contextControlProto.stop_task = new StopTaskProto();
- _evaluatorManager.Handle(contextControlProto);
- }
-
- public void Dispose(byte[] message)
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "DISPOSE: TaskRuntime id [{0}] on evaluator id [{1}] with message", _id, _evaluatorManager.Id));
- ContextControlProto contextControlProto = new ContextControlProto();
- contextControlProto.stop_task = new StopTaskProto();
- contextControlProto.task_message = message;
- _evaluatorManager.Handle(contextControlProto);
- }
-
- public void OnNext(byte[] message)
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "MESSAGE: TaskRuntime id [{0}] on evaluator id [{1}]", _id, _evaluatorManager.Id));
- ContextControlProto contextControlProto = new ContextControlProto();
- contextControlProto.task_message = message;
- _evaluatorManager.Handle(contextControlProto);
- }
-
- public void Suspend(byte[] message)
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "SUSPEND: TaskRuntime id [{0}] on evaluator id [{1}] with message", _id, _evaluatorManager.Id));
- ContextControlProto contextControlProto = new ContextControlProto();
- contextControlProto.suspend_task = new SuspendTaskProto();
- contextControlProto.task_message = message;
- _evaluatorManager.Handle(contextControlProto);
- }
-
- public void Suspend()
- {
- LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "SUSPEND: TaskRuntime id [{0}] on evaluator id [{1}]", _id, _evaluatorManager.Id));
- ContextControlProto contextControlProto = new ContextControlProto();
- contextControlProto.suspend_task = new SuspendTaskProto();
- _evaluatorManager.Handle(contextControlProto);
- }
-
- public override string ToString()
- {
- return "TaskRuntime with taskId = " + _id;
- }
-
- public override int GetHashCode()
- {
- return _id.GetHashCode();
- }
-
- public void Send(byte[] message)
- {
- LOGGER.Log(Level.Info, "RunningTaskImpl.Send() is called");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloCLRBridge.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloCLRBridge.csproj b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloCLRBridge.csproj
index 6248c08..604943e 100644
--- a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloCLRBridge.csproj
+++ b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloCLRBridge.csproj
@@ -98,33 +98,33 @@ under the License.
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(SourceDir)\Tang\Tang\Tang.csproj">
+ <ProjectReference Include="$(SourceDir)\Reef\reef-io\NetWork\NetWork.csproj">
+ <Project>{883ce800-6a6a-4e0a-b7fe-c054f4f2c1dc}</Project>
+ <Name>NetWork</Name>
+ </ProjectReference>
+ <ProjectReference Include="$(SourceDir)\Reef\reef-tasks\Tasks\Tasks.csproj">
+ <Project>{75503f90-7b82-4762-9997-94b5c68f15db}</Project>
+ <Name>Tasks</Name>
+ </ProjectReference>
+ <ProjectReference Include="$(SolutionDir)\Org.Apache.Reef.Tang\Org.Apache.Reef.Tang.csproj">
<Project>{97dbb573-3994-417a-9f69-ffa25f00d2a6}</Project>
- <Name>Tang</Name>
+ <Name>Org.Apache.Reef.Tang</Name>
</ProjectReference>
- <ProjectReference Include="$(SourceDir)\Utilities\Utilities.csproj">
+ <ProjectReference Include="$(SolutionDir)\Org.Apache.Reef.Utilities\Org.Apache.Reef.Utilities.csproj">
<Project>{79e7f89a-1dfb-45e1-8d43-d71a954aeb98}</Project>
- <Name>Utilities</Name>
- </ProjectReference>
- <ProjectReference Include="$(SourceDir)\WAKE\Wake\Wake.csproj">
- <Project>{cdfb3464-4041-42b1-9271-83af24cd5008}</Project>
- <Name>Wake</Name>
+ <Name>Org.Apache.Reef.Utilities</Name>
</ProjectReference>
- <ProjectReference Include="$(SourceDir)\Reef\reef-common\ReefCommon\ReefCommon.csproj">
+ <ProjectReference Include="..\..\..\..\Org.Apache.Reef.Common\Org.Apache.Reef.Common.csproj">
<Project>{545a0582-4105-44ce-b99c-b1379514a630}</Project>
- <Name>ReefCommon</Name>
+ <Name>Org.Apache.Reef.Common</Name>
</ProjectReference>
- <ProjectReference Include="$(SourceDir)\Reef\reef-common\ReefDriver\ReefDriver.csproj">
+ <ProjectReference Include="..\..\..\..\Org.Apache.Reef.Driver\Org.Apache.Reef.Driver.csproj">
<Project>{a6baa2a7-f52f-4329-884e-1bcf711d6805}</Project>
- <Name>ReefDriver</Name>
- </ProjectReference>
- <ProjectReference Include="$(SourceDir)\Reef\reef-io\NetWork\NetWork.csproj">
- <Project>{883ce800-6a6a-4e0a-b7fe-c054f4f2c1dc}</Project>
- <Name>NetWork</Name>
+ <Name>Org.Apache.Reef.Driver</Name>
</ProjectReference>
- <ProjectReference Include="$(SourceDir)\Reef\reef-tasks\Tasks\Tasks.csproj">
- <Project>{75503f90-7b82-4762-9997-94b5c68f15db}</Project>
- <Name>Tasks</Name>
+ <ProjectReference Include="..\..\..\..\Org.Apache.Reef.Wake\Org.Apache.Reef.Wake.csproj">
+ <Project>{cdfb3464-4041-42b1-9271-83af24cd5008}</Project>
+ <Name>Org.Apache.Reef.Wake</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -135,4 +135,4 @@ under the License.
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloTraceListener.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloTraceListener.cs b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloTraceListener.cs
index 18bcd7b..88dbe3b 100644
--- a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloTraceListener.cs
+++ b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/HelloTraceListener.cs
@@ -17,10 +17,10 @@
* under the License.
*/
-using Org.Apache.Reef.Tang.Annotations;
+using Org.Apache.REEF.Tang.Annotations;
using System.Diagnostics;
-namespace Org.Apache.Reef.Examples.HelloCLRBridge
+namespace Org.Apache.REEF.Examples.HelloCLRBridge
{
/// <summary>
/// This is a sample implemenation on how custom trace listner can be implemented
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/AnotherHelloAllocatedEvaluatorHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/AnotherHelloAllocatedEvaluatorHandler.cs b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/AnotherHelloAllocatedEvaluatorHandler.cs
index 5fff7b0..f71f8be 100644
--- a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/AnotherHelloAllocatedEvaluatorHandler.cs
+++ b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/AnotherHelloAllocatedEvaluatorHandler.cs
@@ -17,11 +17,11 @@
* under the License.
*/
-using Org.Apache.Reef.Driver.Evaluator;
-using Org.Apache.Reef.Tang.Annotations;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Tang.Annotations;
using System;
-namespace Org.Apache.Reef.Examples.HelloCLRBridge
+namespace Org.Apache.REEF.Examples.HelloCLRBridge
{
public class AnotherHelloAllocatedEvaluatorHandler : IObserver<IAllocatedEvaluator>
{
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c1b5200f/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/HelloActiveContextHandler.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/HelloActiveContextHandler.cs b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/HelloActiveContextHandler.cs
index 98cf687..3280bda 100644
--- a/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/HelloActiveContextHandler.cs
+++ b/lang/cs/Source/REEF/reef-examples/HelloCLRBridge/handlers/HelloActiveContextHandler.cs
@@ -17,17 +17,17 @@
* under the License.
*/
-using Org.Apache.Reef.Driver.Context;
-using Org.Apache.Reef.Driver.Evaluator;
-using Org.Apache.Reef.Tasks;
-using Org.Apache.Reef.Tang.Annotations;
-using Org.Apache.Reef.Tang.Formats;
-using Org.Apache.Reef.Tang.Interface;
-using Org.Apache.Reef.Tang.Util;
+using Org.Apache.REEF.Driver.Context;
+using Org.Apache.REEF.Driver.Evaluator;
+using Org.Apache.REEF.Tasks;
+using Org.Apache.REEF.Tang.Annotations;
+using Org.Apache.REEF.Tang.Formats;
+using Org.Apache.REEF.Tang.Interface;
+using Org.Apache.REEF.Tang.Util;
using System;
using System.Globalization;
-namespace Org.Apache.Reef.Examples.HelloCLRBridge
+namespace Org.Apache.REEF.Examples.HelloCLRBridge
{
public class HelloActiveContextHandler : IObserver<IActiveContext>
{