private AclProcessorStats ProcessAcl()

in AdlsDotNetSDK/AclTools/AclProcessor.cs [224:304]


        private AclProcessorStats ProcessAcl()
        {
            if (_cancelToken.IsCancellationRequested)
            {
                return _isVerify
                ? new AclProcessorStats(_filesEnumerated, _directoryEnumerated, _incorrectFileCount, _incorrectDirectoryCount, _linkPaths)
                : new AclProcessorStats(_filesEnumerated, _directoryEnumerated, 0, 0, _linkPaths);
            }

            //Create the threads
            for (int i = 0; i < NumThreads; i++)
            {
                _threadWorker[i] = new Thread(Run)
                {
                    Name = "Thread: " + i
                };
            }

            if (_aclStatusTracker != null)
            {
                _threadStats = new Thread(StatsRun)
                {
                    Name = "StatsThread"
                };
            }
            if (!string.IsNullOrEmpty(_incorrectVerifyFile))
            {
                _threadDumpIncorrectFiles = new Thread(VerifyFileDumpRun)
                {
                    Name = "Verify Dump Thread"
                };
            }

            // Put the first entry to queue
            DirectoryEntry dir = Client.GetDirectoryEntry(_inputPath);
            ProcessDirectoryEntry(dir);

            // Start the threads
            for (int i = 0; i < NumThreads; i++)
            {
                _threadWorker[i].Start();
            }

            if (_aclStatusTracker != null)
            {
                _threadStats.Start();
            }

            if (!string.IsNullOrEmpty(_incorrectVerifyFile))
            {
                _threadDumpIncorrectFiles.Start();
            }

            //Join the threads
            for (int i = 0; i < NumThreads; i++)
            {
                _threadWorker[i].Join();
            }

            if (_aclStatusTracker != null)
            {
                Interlocked.Increment(ref _consumerDone);
                _threadStats.Join();
            }

            if (!string.IsNullOrEmpty(_incorrectVerifyFile))
            {
                // Signify the end of the queue
                _incorrectFileList.Add(null);
                _threadDumpIncorrectFiles.Join();
            }

            if (GetException() != null)
            {
                throw GetException();
            }

            return _isVerify
                ? new AclProcessorStats(_filesEnumerated, _directoryEnumerated, _incorrectFileCount, _incorrectDirectoryCount, _linkPaths)
                : new AclProcessorStats(_filesEnumerated, _directoryEnumerated, 0, 0, _linkPaths);
        }