public IEnumerable<PublishedResult> Crawl() { // todo how the crawler could know where is the file service hosted. // this property should be retrieved from the config file. var localFileServiceLocation = new FileLocation("find this one..."); return from file in FileRecord.Queryable from reference in file.References group new {reference, file.Hash} by reference.Word into references let files = from rr in references select new FileId(rr.Hash, rr.reference.Part) select new PublishedResult(references.Key, files, localFileServiceLocation); }
public override bool RemoveInto(FileId key, FileLocation value, NodeIdentifier<FileId> callerIdentifier = null) { Console.WriteLine("File2Machine -> RemoveInto(key: {0}, value: {1}, callerIdentifier: {2})", key, value, callerIdentifier); return base.RemoveInto(key, value, callerIdentifier); }
public override void StoreInto(FileId key, FileLocation value, NodeIdentifier<FileId> callerIdentifier = null) { Console.WriteLine("File2Machine -> StoreInto(key: {0}, value: {1}, callerIdentifier: {2})", key, value, callerIdentifier); base.StoreInto(key, value, callerIdentifier); }
public PublishedResult(string word, IEnumerable<FileId> files, FileLocation fileLocation) { Word = word; Files = files; FileLocation = fileLocation; }