コード例 #1
0
        /// <exception cref="System.Exception"/>
        public virtual void TestResourceTrackerOnHA()
        {
            NodeId   nodeId   = NodeId.NewInstance("localhost", 0);
            Resource resource = Resource.NewInstance(2048, 4);
            // make sure registerNodeManager works when failover happens
            RegisterNodeManagerRequest request = RegisterNodeManagerRequest.NewInstance(nodeId
                                                                                        , 0, resource, YarnVersionInfo.GetVersion(), null, null);

            resourceTracker.RegisterNodeManager(request);
            NUnit.Framework.Assert.IsTrue(WaitForNodeManagerToConnect(10000, nodeId));
            // restart the failover thread, and make sure nodeHeartbeat works
            failoverThread = CreateAndStartFailoverThread();
            NodeStatus status = NodeStatus.NewInstance(NodeId.NewInstance("localhost", 0), 0,
                                                       null, null, null);
            NodeHeartbeatRequest request2 = NodeHeartbeatRequest.NewInstance(status, null, null
                                                                             );

            resourceTracker.NodeHeartbeat(request2);
        }
コード例 #2
0
        /// <exception cref="Com.Google.Protobuf.ServiceException"/>
        public virtual YarnServerCommonServiceProtos.NodeHeartbeatResponseProto NodeHeartbeat
            (RpcController controller, YarnServerCommonServiceProtos.NodeHeartbeatRequestProto
            proto)
        {
            NodeHeartbeatRequestPBImpl request = new NodeHeartbeatRequestPBImpl(proto);

            try
            {
                NodeHeartbeatResponse response = real.NodeHeartbeat(request);
                return(((NodeHeartbeatResponsePBImpl)response).GetProto());
            }
            catch (YarnException e)
            {
                throw new ServiceException(e);
            }
            catch (IOException e)
            {
                throw new ServiceException(e);
            }
        }