Exemplo n.º 1
0
        /// <summary>
        /// Checks file system limits (max component length and max directory items)
        /// during a rename operation.
        /// </summary>
        /// <exception cref="Org.Apache.Hadoop.Hdfs.Protocol.FSLimitException.PathComponentTooLongException
        ///     "/>
        /// <exception cref="Org.Apache.Hadoop.Hdfs.Protocol.FSLimitException.MaxDirectoryItemsExceededException
        ///     "/>
        internal static void VerifyFsLimitsForRename(FSDirectory fsd, INodesInPath srcIIP
                                                     , INodesInPath dstIIP)
        {
            byte[] dstChildName = dstIIP.GetLastLocalName();
            string parentPath   = dstIIP.GetParentPath();

            fsd.VerifyMaxComponentLength(dstChildName, parentPath);
            // Do not enforce max directory items if renaming within same directory.
            if (srcIIP.GetINode(-2) != dstIIP.GetINode(-2))
            {
                fsd.VerifyMaxDirItems(dstIIP.GetINode(-2).AsDirectory(), parentPath);
            }
        }