Add options to change the tilestats limits

This commit is contained in:
Eric Fischer
2018-08-31 15:12:00 -07:00
parent 5483720ee1
commit bc84b41246
8 changed files with 730 additions and 9 deletions
+21 -1
View File
@@ -2606,6 +2606,9 @@ int main(int argc, char **argv) {
{"no-tile-size-limit", no_argument, &prevent[P_KILOBYTE_LIMIT], 1},
{"no-tile-compression", no_argument, &prevent[P_TILE_COMPRESSION], 1},
{"no-tile-stats", no_argument, &prevent[P_TILE_STATS], 1},
{"tile-stats-attribute-limit", required_argument, 0, '~'},
{"tile-stats-sample-values-limit", required_argument, 0, '~'},
{"tile-stats-values-limit", required_argument, 0, '~'},
{"Temporary storage", 0, 0, 0},
{"temporary-directory", required_argument, 0, 't'},
@@ -2665,11 +2668,24 @@ int main(int argc, char **argv) {
}
}
while ((i = getopt_long(argc, argv, getopt_str, long_options, NULL)) != -1) {
int option_index = 0;
while ((i = getopt_long(argc, argv, getopt_str, long_options, &option_index)) != -1) {
switch (i) {
case 0:
break;
case '~': {
const char *opt = long_options[option_index].name;
if (strcmp(opt, "tile-stats-attribute-limit") == 0) {
max_tilestats_attributes = atoi(optarg);
} else if (strcmp(opt, "tile-stats-sample-values-limit") == 0) {
max_tilestats_sample_values = atoi(optarg);
} else if (strcmp(opt, "tile-stats-values-limit") == 0) {
max_tilestats_values = atoi(optarg);
}
break;
}
case 'n':
name = optarg;
break;
@@ -2987,6 +3003,10 @@ int main(int argc, char **argv) {
}
}
if (max_tilestats_sample_values < max_tilestats_values) {
max_tilestats_sample_values = max_tilestats_values;
}
signal(SIGPIPE, SIG_IGN);
files_open_at_start = open("/dev/null", O_RDONLY | O_CLOEXEC);