Documentation
¶
Index ¶
- Constants
- func BigTableReadRowsParallel(ctx context.Context, btClient *bigtable.Client, rowSet bigtable.RowSet, ...) error
- func CamelToSnake(str string) string
- func GetContainedIn(typeRelationJSONFilePath string) (map[TypePair][]string, error)
- func GetProjectID(db string) (string, error)
- func IterateSortPVs(pvs []*pb.PropertyValue, action func(i int, p, v string))
- func SnakeToCamel(s string) string
- func StringContainedIn(target string, strs []string) bool
- func StringList(strs []string) string
- func UnzipAndDecode(contents string) ([]byte, error)
- func ZipAndEncode(contents string) (string, error)
- type TypePair
Constants ¶
const ( // BqPrefix for internal dataset. BqPrefix = "google.com:" // BtProject is the GCP project containing the BigTable instance BtProject = "google.com:datcom-store-dev" // BtInstance for internal cache instance. BtInstance = "prophet-cache" // BtTable for internal table. BtTable = "dc9" // BtPropValInPrefix for internal GetPropertyValues in arc cache. BtPropValInPrefix = "d/0/" // BtPropValOutPrefix for internal GetPropertyValues out arc cache. BtPropValOutPrefix = "d/1/" // BtPopObsPrefix for internal pop obs cache. BtPopObsPrefix = "d/2/" // BtPlaceObsPrefix for internal place obs cache. BtPlaceObsPrefix = "d/3/" // BtPlaceKMLPrefix for internal place KML coordinates cache. BtPlaceKMLPrefix = "d/6/" // BtTriplesPrefix for internal GetTriples cache. BtTriplesPrefix = "d/7/" // BtArcsPrefix for internal arcs cache. BtArcsPrefix = "d/9/" // BtPopPrefix for population cache. BtPopPrefix = "d/a/" // BtObsPrefix for observation cache. BtObsPrefix = "d/b/" // BtFamily is the key for the row. BtFamily = "csv" // BtCacheLimit is the cache limit. The limit is per predicate and neighbor type. BtCacheLimit = 200 // BtBatchQuerySize is the size of BigTable batch query. BtBatchQuerySize = 1000 // LimitFactor is the amount to multiply the limit by to make sure certain // triples are returned by the BQ query. LimitFactor = 1 // TextType represents text type. TextType = "Text" )
Variables ¶
This section is empty.
Functions ¶
func BigTableReadRowsParallel ¶
func BigTableReadRowsParallel(ctx context.Context, btClient *bigtable.Client, rowSet bigtable.RowSet, action func(row bigtable.Row) error) error
BigTableReadRowsParallel reads BigTable rows in parallel, considering the size limit for RowSet is 500KB.
func CamelToSnake ¶
CamelToSnake converts a camel case string to snake case string.
func GetContainedIn ¶
GetContainedIn returns the contained in relation change given two types.
func GetProjectID ¶
GetProjectID gets the bigquery project id based on dataset name.
func IterateSortPVs ¶
func IterateSortPVs(pvs []*pb.PropertyValue, action func(i int, p, v string))
IterateSortPVs iterates a list of PVs and performs actions on them.
func SnakeToCamel ¶
SnakeToCamel converts a snake case string to camel case string.
func StringContainedIn ¶
StringContainedIn returns true if TARGET is contained in STRS
func StringList ¶
StringList formats a list of strings into a comma-separated list with each surrounded with quotes.
func UnzipAndDecode ¶
UnzipAndDecode decompresses the given contents using gzip and decodes it from base64
func ZipAndEncode ¶
ZipAndEncode Compresses the given contents using gzip and encodes it in base64