public virtual void Setup() { mockProtocol = MockitoUtil.MockProtocol <HAServiceProtocol>(); mockZkfcProtocol = MockitoUtil.MockProtocol <ZKFCProtocol>(); tool = new _DFSHAAdmin_118(this); // OVerride the target to return our mock protocol // mock setup doesn't really throw tool.SetConf(GetHAConf()); tool.SetErrOut(new TextWriter(errOutBytes)); tool.SetOut(new TextWriter(outBytes)); }
// Couldn't find an Active RM /// <exception cref="System.Exception"/> private static HAServiceProtocol.HAServiceState GetHAState(YarnConfiguration yarnConf ) { HAServiceTarget haServiceTarget; int rpcTimeoutForChecks = yarnConf.GetInt(CommonConfigurationKeys.HaFcCliCheckTimeoutKey , CommonConfigurationKeys.HaFcCliCheckTimeoutDefault); yarnConf.Set(CommonConfigurationKeys.HadoopSecurityServiceUserNameKey, yarnConf.Get (YarnConfiguration.RmPrincipal, string.Empty)); haServiceTarget = new RMHAServiceTarget(yarnConf); HAServiceProtocol proto = haServiceTarget.GetProxy(yarnConf, rpcTimeoutForChecks); HAServiceProtocol.HAServiceState haState = proto.GetServiceStatus().GetState(); return(haState); }
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); }
public HAServiceProtocolServerSideTranslatorPB(HAServiceProtocol server) { this.server = server; }