コード例 #1
0
 public _PrivilegedExceptionAction_333(FileSystemAccessService _enclosing, Configuration
                                       conf, FileSystemAccess.FileSystemExecutor <T> executor)
 {
     this._enclosing = _enclosing;
     this.conf       = conf;
     this.executor   = executor;
 }
コード例 #2
0
 /// <exception cref="Org.Apache.Hadoop.Lib.Service.FileSystemAccessException"/>
 public override T Execute <T>(string user, Configuration conf, FileSystemAccess.FileSystemExecutor
                               <T> executor)
 {
     Check.NotEmpty(user, "user");
     Check.NotNull(conf, "conf");
     Check.NotNull(executor, "executor");
     if (!conf.GetBoolean(FileSystemServiceCreated, false))
     {
         throw new FileSystemAccessException(FileSystemAccessException.ERROR.H04);
     }
     if (conf.Get(CommonConfigurationKeysPublic.FsDefaultNameKey) == null || conf.GetTrimmed
             (CommonConfigurationKeysPublic.FsDefaultNameKey).Length == 0)
     {
         throw new FileSystemAccessException(FileSystemAccessException.ERROR.H06, CommonConfigurationKeysPublic
                                             .FsDefaultNameKey);
     }
     try
     {
         ValidateNamenode(new URI(conf.Get(CommonConfigurationKeysPublic.FsDefaultNameKey)
                                  ).GetAuthority());
         UserGroupInformation ugi = GetUGI(user);
         return(ugi.DoAs(new _PrivilegedExceptionAction_333(this, conf, executor)));
     }
     catch (FileSystemAccessException ex)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new FileSystemAccessException(FileSystemAccessException.ERROR.H03, ex);
     }
 }
コード例 #3
0
ファイル: HttpFSServer.cs プロジェクト: orf53975/hadoop.net
        /// <summary>
        /// Executes a
        /// <see cref="Org.Apache.Hadoop.Lib.Service.FileSystemAccess.FileSystemExecutor{T}"/
        ///     >
        /// using a filesystem for the effective
        /// user.
        /// </summary>
        /// <param name="ugi">user making the request.</param>
        /// <param name="executor">FileSystemExecutor to execute.</param>
        /// <returns>FileSystemExecutor response</returns>
        /// <exception cref="System.IO.IOException">thrown if an IO error occurrs.</exception>
        /// <exception cref="Org.Apache.Hadoop.Lib.Service.FileSystemAccessException">
        /// thrown if a FileSystemAccess releated error occurred. Thrown
        /// exceptions are handled by
        /// <see cref="HttpFSExceptionProvider"/>
        /// .
        /// </exception>
        private T FsExecute <T>(UserGroupInformation ugi, FileSystemAccess.FileSystemExecutor
                                <T> executor)
        {
            FileSystemAccess fsAccess = HttpFSServerWebApp.Get().Get <FileSystemAccess>();
            Configuration    conf     = HttpFSServerWebApp.Get().Get <FileSystemAccess>().GetFileSystemConfiguration
                                            ();

            return(fsAccess.Execute(ugi.GetShortUserName(), conf, executor));
        }
コード例 #4
0
 /// <exception cref="Org.Apache.Hadoop.Lib.Service.FileSystemAccessException"/>
 public abstract T Execute <T>(string user, Configuration conf, FileSystemAccess.FileSystemExecutor
                               <T> executor);