Пример #1
0
        /// <exception cref="System.IO.IOException"/>
        internal static CacheDirectiveInfo AddCacheDirective(FSNamesystem fsn, CacheManager
                                                             cacheManager, CacheDirectiveInfo directive, EnumSet <CacheFlag> flags, bool logRetryCache
                                                             )
        {
            FSPermissionChecker pc = GetFsPermissionChecker(fsn);

            if (directive.GetId() != null)
            {
                throw new IOException("addDirective: you cannot specify an ID " + "for this operation."
                                      );
            }
            CacheDirectiveInfo effectiveDirective = cacheManager.AddDirective(directive, pc,
                                                                              flags);

            fsn.GetEditLog().LogAddCacheDirectiveInfo(effectiveDirective, logRetryCache);
            return(effectiveDirective);
        }