为什么“没有为此流类型实现GetURI()”发生? [英] why "GetURI() is not implemented for this stream type" occurs?

查看:70
本文介绍了为什么“没有为此流类型实现GetURI()”发生?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个程序,用于获取文件名。该程序的主体是:


HpcLinqConfiguration config = new HpcLinqConfiguration(SampleConfiguration.HeadNode);

config.JobFriendlyName =" sample"; $
HpcLinqContext context = new HpcLinqContext(config);


Utilities.LoadData(context," files" ;,@" data \\\1.txt");
$
Utilities.LoadData(context," files",@" data\2.txt");

IQueryable< FileRecord> file = context.FromDsc< FileRecord>(" files");
$
Console.WriteLine(" wait ...");

foreach(FileRecord c in文件)
$
      Console.WriteLine(c.FilePath);
$
Console.WriteLine("按Enter继续...");
$
Console.ReadLine();


程序无法正常运行,所以我调试它。后行:IQueryable< FileRecord> file = context.FromDsc< FileRecord>(" files");   已被执行,变量文件的信息为:


结果视图:


    base:{" GetURI()未针对此流类型实施。"}


   错误代码:251658240


我该怎么做才能让这个程序正常工作?


期待你的帮助!


xfengm

解决方案

您加载的数据是文本类型,但您尝试将其读作
类型 FileRecord


FileRecord是HpcLinqExtras项目中示例的一部分。看看DupPic2的一个例子吧。它旨在允许您在将文件数据添加到DSC之前存储文件数据和文件的原始路径。


以下将打印文件集的内容:


IQueryable< LineRecord> file = context.FromDsc< FileRecord>(" files");
$
Console.WriteLine(" wait ...");

foreach(LineRecord c in文件)
$
     Console.WriteLine(c.Line);


I written a program,for getting the file name.The body of the program is:

HpcLinqConfiguration config = new HpcLinqConfiguration(SampleConfiguration.HeadNode);
config.JobFriendlyName = "sample";
HpcLinqContext context = new HpcLinqContext(config);

Utilities.LoadData(context, "files", @"data\1.txt");
Utilities.LoadData(context, "files", @"data\2.txt");
IQueryable<FileRecord> file = context.FromDsc<FileRecord>("files");
Console.WriteLine("wait...");
foreach (FileRecord c in file)
      Console.WriteLine(c.FilePath);
Console.WriteLine("Press enter to continue ...");
Console.ReadLine();

The program does not work correctly,so i debugging it.After line:IQueryable<FileRecord> file = context.FromDsc<FileRecord>("files");   was exected,the info of variable file is:

Results View:

    base:{"GetURI() is not implemented for this stream type."}

    errorcode:251658240

What can i do for this program to work correctly?

Looking forward for your help!

xfengm

解决方案

The data you are loading is of type text but you are trying to read it as type FileRecord.

FileRecord is part of the samples, in HpcLinqExtras project. Look at DupPic2 for an example of it's usage. It's designed to allow you to store file data and the original path of the file before it was added to DSC.

The following will print the contents of the fileset:

IQueryable<LineRecord> file = context.FromDsc<FileRecord>("files");
Console.WriteLine("wait...");
foreach (LineRecord c in file)
     Console.WriteLine(c.Line);


这篇关于为什么“没有为此流类型实现GetURI()”发生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆