public virtual Stream <RetrieveResult> Retrieve(string section, IDictionary <string, object> config) { string upperSection = section.ToUpper(); switch (upperSection) { case Sections.GRAPH_COUNTS: return(GraphCountsSection.Retrieve(DataCollector.kernel, Anonymizer.PLAIN_TEXT)); case Sections.TOKENS: return(TokensSection.Retrieve(DataCollector.kernel)); case Sections.META: return(MetaSection.Retrieve(null, DataCollector.kernel, DataCollector.queryCollector.numSilentQueryDrops())); case Sections.QUERIES: return(QueriesSection.retrieve(DataCollector.queryCollector.Data, new PlainText(DataCollector.valueMapper), RetrieveConfig.Of(config).MaxInvocations)); default: throw Sections.UnknownSectionException(section); } }
public virtual Stream <RetrieveResult> RetrieveAllAnonymized(string graphToken, IDictionary <string, object> config) { if (string.ReferenceEquals(graphToken, null) || graphToken.Equals("")) { throw new InvalidArgumentsException("Graph token must be a non-empty string"); } return(Stream.of(MetaSection.Retrieve(graphToken, DataCollector.kernel, DataCollector.queryCollector.numSilentQueryDrops()), GraphCountsSection.Retrieve(DataCollector.kernel, Anonymizer.IDS), QueriesSection.retrieve(DataCollector.queryCollector.Data, new IdAnonymizer(Transaction.tokenRead()), RetrieveConfig.Of(config).MaxInvocations)).flatMap(x => x)); }