public IHadoopJobSubmissionPocoClient Create(IJobSubmissionClientCredential credentials, IAbstractionContext context, bool ignoreSslErrors, string userAgentString)
 {
     var remoteCredentials = credentials as BasicAuthCredential;
     if (remoteCredentials == null)
     {
         throw new NotSupportedException();
     }
     string clusterKey = remoteCredentials.Server.AbsoluteUri.ToUpperInvariant();
     if (pocoSimulators.ContainsKey(clusterKey))
     {
         var simulator = pocoSimulators[clusterKey];
         simulator.credentials = remoteCredentials;
         simulator.context = context;
         return simulator;
     }
     else
     {
         var simulator = new HadoopJobSubmissionPocoSimulatorClient(remoteCredentials, context, userAgentString);
         pocoSimulators.Add(clusterKey, simulator);
         return simulator;
     }
 }
예제 #2
0
        public IHadoopJobSubmissionPocoClient Create(IJobSubmissionClientCredential credentials, IAbstractionContext context, bool ignoreSslErrors, string userAgentString)
        {
            var remoteCredentials = credentials as BasicAuthCredential;

            if (remoteCredentials == null)
            {
                throw new NotSupportedException();
            }
            string clusterKey = remoteCredentials.Server.AbsoluteUri.ToUpperInvariant();

            if (pocoSimulators.ContainsKey(clusterKey))
            {
                var simulator = pocoSimulators[clusterKey];
                simulator.credentials = remoteCredentials;
                simulator.context     = context;
                return(simulator);
            }
            else
            {
                var simulator = new HadoopJobSubmissionPocoSimulatorClient(remoteCredentials, context, userAgentString);
                pocoSimulators.Add(clusterKey, simulator);
                return(simulator);
            }
        }