简体   繁体   English

如何从Azure Data Lake中读取文件并在Angular-2中显示这些文件?

[英]How to read files from Azure Data Lake and display those files in Angular-2?

I need to read files from Azure Data Lake and I have to display those files in Angular-2 Component. 我需要从Azure Data Lake中读取文件,并且必须在Angular-2 Component中显示这些文件。 but i am getting only file properties from Azure Data Lake while using List File Status() method. 但是我在使用列表文件Status()方法时仅从Azure Data Lake获取文件属性。 but i need the file with content. 但是我需要包含内容的文件。 how to read all the files with contents from azure Data Lake. 如何从天蓝色的Data Lake中读取包含内容的所有文件。 I am listing all the file status using like below code. 我使用下面的代码列出所有文件状态。

                listOfFiles =  ListItems(pathOfFolder);
                var stTime = new DateTime();

                foreach (var file1 in listOfFiles) {

                    var srcPath = pathOfFolder + "/" + file1.PathSuffix;
                    using (var stream = adlsFileSystemClient.FileSystem.Open(_adlsAccountName, srcPath)) {
                        using (var fileStream = new FileStream(destPath, FileMode.Create))
                        {
                            stream.CopyTo(fileStream);
                            listOfStreams.Add(fileStream);

                        }
                    }

                }

But it will give list of file streams and it will take much time. 但是它将提供文件流的列表,并且将花费很多时间。 is there any way to get all the files with content.? 有没有办法获取所有包含内容的文件?

There is no API that will get all the files and their content in one shot. 没有API可以一次性获得所有文件及其内容。 As one can imagine, a folder could have millions of files each potentially of terabytes of data. 可以想象,一个文件夹可能包含数百万个文件,每个文件可能包含数TB的数据。 A single REST call cannot robustly return the enumeration as well as contents of such a large data set. 单个REST调用无法可靠地返回枚举以及如此大数据集的内容。

The way you are doing it is the correct way. 您这样做的方式是正确的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM