Esempio n. 1
0
 public _RMAdminCLI_96(TestRMAdminCLI _enclosing, HAServiceTarget haServiceTarget,
                       Configuration baseArg1)
     : base(baseArg1)
 {
     this._enclosing      = _enclosing;
     this.haServiceTarget = haServiceTarget;
 }
        protected override byte[] TargetToData(HAServiceTarget target)
        {
            IPEndPoint addr = target.GetAddress();

            return(((HAZKInfoProtos.ActiveNodeInfo)HAZKInfoProtos.ActiveNodeInfo.NewBuilder()
                    .SetHostname(addr.GetHostName()).SetPort(addr.Port).SetZkfcPort(target.GetZKFCAddress
                                                                                        ().Port).SetNameserviceId(localNNTarget.GetNameServiceId()).SetNamenodeId(localNNTarget
                                                                                                                                                                  .GetNameNodeId()).Build()).ToByteArray());
        }
Esempio n. 3
0
            protected override HAServiceTarget ResolveTarget(string nnId)
            {
                HAServiceTarget target = base.ResolveTarget(nnId);
                HAServiceTarget spy    = Org.Mockito.Mockito.Spy(target);

                try
                {
                    Org.Mockito.Mockito.DoReturn(this._enclosing.mockProtocol).When(spy).GetProxy(Org.Mockito.Mockito
                                                                                                  .Any <Configuration>(), Org.Mockito.Mockito.AnyInt());
                    Org.Mockito.Mockito.DoReturn(this._enclosing.mockZkfcProtocol).When(spy).GetZKFCProxy
                        (Org.Mockito.Mockito.Any <Configuration>(), Org.Mockito.Mockito.AnyInt());
                }
                catch (IOException e)
                {
                    throw new Exception(e);
                }
                return(spy);
            }
Esempio n. 4
0
        public virtual void Configure()
        {
            remoteAdminServiceAccessed = false;
            admin = Org.Mockito.Mockito.Mock <ResourceManagerAdministrationProtocol>();
            Org.Mockito.Mockito.When(admin.AddToClusterNodeLabels(Matchers.Any <AddToClusterNodeLabelsRequest
                                                                                >())).ThenAnswer(new _Answer_79(this));
            haadmin = Org.Mockito.Mockito.Mock <HAServiceProtocol>();
            Org.Mockito.Mockito.When(haadmin.GetServiceStatus()).ThenReturn(new HAServiceStatus
                                                                                (HAServiceProtocol.HAServiceState.Initializing));
            HAServiceTarget haServiceTarget = Org.Mockito.Mockito.Mock <HAServiceTarget>();

            Org.Mockito.Mockito.When(haServiceTarget.GetProxy(Matchers.Any <Configuration>(),
                                                              Matchers.AnyInt())).ThenReturn(haadmin);
            rmAdminCLI = new _RMAdminCLI_96(this, haServiceTarget, new Configuration());
            InitDummyNodeLabelsManager();
            rmAdminCLI.localNodeLabelsManager = dummyNodeLabelsManager;
            YarnConfiguration conf = new YarnConfiguration();

            conf.SetBoolean(YarnConfiguration.RmHaEnabled, true);
            rmAdminCLIWithHAEnabled = new _RMAdminCLI_113(this, haServiceTarget, conf);
        }