Add guc variable for shard count

pull/867/head
Metin Doslu 2016-10-05 17:11:55 +03:00
parent 98e0648d40
commit d04f4f5935
3 changed files with 13 additions and 0 deletions

View File

@ -55,6 +55,7 @@
/* Shard related configuration */
int ShardCount = 32;
int ShardReplicationFactor = 2; /* desired replication factor for shards */
int ShardMaxSize = 1048576; /* maximum size in KB one shard can grow to */
int ShardPlacementPolicy = SHARD_PLACEMENT_ROUND_ROBIN;

View File

@ -332,6 +332,17 @@ RegisterCitusConfigVariables(void)
0,
NULL, NULL, NULL);
DefineCustomIntVariable(
"citus.shard_count",
gettext_noop("Sets the number of shards for a new hash-partitioned table"
"created with create_distributed_table()."),
NULL,
&ShardCount,
32, 1, 64000,
PGC_USERSET,
0,
NULL, NULL, NULL);
DefineCustomIntVariable(
"citus.shard_replication_factor",
gettext_noop("Sets the replication factor for shards."),

View File

@ -82,6 +82,7 @@ typedef enum
/* Config variables managed via guc.c */
extern int ShardCount;
extern int ShardReplicationFactor;
extern int ShardMaxSize;
extern int ShardPlacementPolicy;