Ejemplo n.º 1
0
func (c *ParHashCollector) makePartitions(sgs store.SubGraphs) (p_it partitionIterator) {
	keys := sgs.Keys()
	p_it = func() (part store.Iterator, next partitionIterator) {
		var key []byte
		key, keys = keys()
		if keys == nil {
			return nil, nil
		}
		return bufferedIterator(sgs.Find(key), 10), p_it
	}
	return p_it
}
Ejemplo n.º 2
0
func writeAllPatterns(all store.SubGraphs, nodeAttrs *bptree.BpTree, outputDir string) {
	alle, err := os.Create(path.Join(outputDir, "all-embeddings.dot"))
	if err != nil {
		log.Fatal(err)
	}
	defer alle.Close()
	allp, err := os.Create(path.Join(outputDir, "all-patterns.dot"))
	if err != nil {
		log.Fatal(err)
	}
	defer allp.Close()
	count := 0
	for key, next := all.Keys()(); next != nil; key, next = next() {
		writePattern(count, outputDir, alle, allp, nodeAttrs, all, key)
		count++
	}
}