Example #1
0
	_ "kythe.io/kythe/go/services/graphstore/grpc"
	_ "kythe.io/kythe/go/services/graphstore/proxy"
)

var (
	gs graphstore.Service

	tablePath = flag.String("out", "", "Directory path to output serving table")

	maxPageSize = flag.Int("max_page_size", 4000,
		"If positive, edge/cross-reference pages are restricted to under this number of edges/references")
	compressShards = flag.Bool("compress_shards", false,
		"Determines whether intermediate data written to disk should be compressed.")
	maxShardSize = flag.Int("max_shard_size", 32000,
		"Maximum number of elements (edges, decoration fragments, etc.) to keep in-memory before flushing an intermediary data shard to disk.")
	shardIOBufferSize = datasize.Flag("shard_io_buffer", "16KiB",
		"Size of the reading/writing buffers for the intermediary data shards.")
)

func init() {
	gsutil.Flag(&gs, "graphstore", "GraphStore to read")
	flag.Usage = flagutil.SimpleUsage("Creates a combined xrefs/filetree/search serving table based on a given GraphStore",
		"--graphstore spec --out path")
}
func main() {
	flag.Parse()
	if gs == nil {
		flagutil.UsageError("missing required --graphstore flag")
	} else if *tablePath == "" {
		flagutil.UsageError("missing required --out flag")
	}
Example #2
0
import (
	"flag"
	"log"
	"os"

	"kythe.io/kythe/go/platform/delimited"
	"kythe.io/kythe/go/util/datasize"
	"kythe.io/kythe/go/util/flagutil"
)

func init() {
	flag.Usage = flagutil.SimpleUsage("Remove duplicate records from a delimited stream")
}

var cacheSize = datasize.Flag("cache_size", "3GiB", `Maximum size of the cache of known record hashes (e.g. "10B", "12KB", "3GiB", etc.)`)

func main() {
	flag.Parse()
	if flag.NArg() != 0 {
		flagutil.UsageErrorf("unknown arguments: %v", flag.Args())
	}

	rd, err := delimited.NewUniqReader(delimited.NewReader(os.Stdin), int(cacheSize.Bytes()))
	if err != nil {
		log.Fatalf("Error creating UniqReader: %v", err)
	}
	wr := delimited.NewWriter(os.Stdout)
	if err := delimited.Copy(wr, rd); err != nil {
		log.Fatal(err)
	}