1
0
Fork 0

renamed --max-upload-size to --batch-size

This commit is contained in:
Jan Steemann 2013-09-13 20:23:28 +02:00
parent 3e1436b6d1
commit ec3ffa9bca
4 changed files with 22 additions and 9 deletions

View File

@ -165,7 +165,7 @@ static void ParseProgramOptions (int argc, char* argv[]) {
description
("collection", &Collections, "restrict to collection name (can be specified multiple times)")
("batch-size", &ChunkSize, "size for individual data batches (in bytes)")
("batch-size", &ChunkSize, "maximum size for individual data batches (in bytes)")
("dump-structure", &DumpStructure, "dump collection structure")
("dump-data", &DumpData, "dump collection data")
("include-system-collections", &IncludeSystemCollections, "include system collections")

View File

@ -82,7 +82,7 @@ V8ClientConnection* ClientConnection = 0;
/// @brief max size body size (used for imports)
////////////////////////////////////////////////////////////////////////////////
static uint64_t MaxUploadSize = 1024 * 1024;
static uint64_t ChunkSize = 1024 * 1024 * 4;
////////////////////////////////////////////////////////////////////////////////
/// @brief quote character(s)
@ -144,17 +144,24 @@ static bool Progress = false;
////////////////////////////////////////////////////////////////////////////////
static void ParseProgramOptions (int argc, char* argv[]) {
ProgramOptionsDescription deprecatedOptions("DEPRECATED options");
deprecatedOptions
("max-upload-size", &ChunkSize, "size for individual data batches (in bytes)")
;
ProgramOptionsDescription description("STANDARD options");
description
("file", &FileName, "file name (\"-\" for STDIN)")
("batch-size", &ChunkSize, "size for individual data batches (in bytes)")
("collection", &CollectionName, "collection name")
("create-collection", &CreateCollection, "create collection if it does not yet exist")
("max-upload-size", &MaxUploadSize, "maximum size of import chunks (in bytes)")
("type", &TypeImport, "type of file (\"csv\", \"tsv\", or \"json\")")
("quote", &Quote, "quote character(s)")
("separator", &Separator, "separator")
("progress", &Progress, "show progress")
(deprecatedOptions, true)
;
BaseClient.setupGeneral(description);
@ -324,7 +331,7 @@ int main (int argc, char* argv[]) {
cout << "request timeout: " << BaseClient.requestTimeout() << endl;
cout << "----------------------------------------" << endl;
ImportHelper ih(ClientConnection->getHttpClient(), MaxUploadSize);
ImportHelper ih(ClientConnection->getHttpClient(), ChunkSize);
// create colletion
if (CreateCollection) {

View File

@ -153,7 +153,7 @@ static void ParseProgramOptions (int argc, char* argv[]) {
description
("collection", &Collections, "restrict to collection name (can be specified multiple times)")
("batch-size", &ChunkSize, "size for individual data batches (in bytes)")
("batch-size", &ChunkSize, "maximum size for individual data batches (in bytes)")
("import-data", &ImportData, "import data into collection")
("create-collection", &ImportStructure, "create collection structure")
("include-system-collections", &IncludeSystemCollections, "include system collections")

View File

@ -94,7 +94,7 @@ v8::Persistent<v8::ObjectTemplate> ConnectionTempl;
/// @brief max size body size (used for imports)
////////////////////////////////////////////////////////////////////////////////
static uint64_t MaxUploadSize = 500000;
static uint64_t ChunkSize = 1024 * 1024 * 4;
////////////////////////////////////////////////////////////////////////////////
/// @brief startup JavaScript files
@ -278,7 +278,7 @@ static v8::Handle<v8::Value> JS_ImportCsvFile (v8::Arguments const& argv) {
}
}
ImportHelper ih(ClientConnection->getHttpClient(), MaxUploadSize);
ImportHelper ih(ClientConnection->getHttpClient(), ChunkSize);
ih.setQuote(quote);
ih.setSeparator(separator.c_str());
@ -327,7 +327,7 @@ static v8::Handle<v8::Value> JS_ImportJsonFile (v8::Arguments const& argv) {
}
ImportHelper ih(ClientConnection->getHttpClient(), MaxUploadSize);
ImportHelper ih(ClientConnection->getHttpClient(), ChunkSize);
string fileName = TRI_ObjectToString(argv[0]);
string collectionName = TRI_ObjectToString(argv[1]);
@ -413,9 +413,15 @@ static vector<string> ParseProgramOptions (int argc, char* argv[]) {
("javascript.unit-tests", &UnitTests, "do not start as shell, run unit tests instead")
("jslint", &JsLint, "do not start as shell, run jslint instead")
;
ProgramOptionsDescription deprecatedOptions("DEPRECATED options");
deprecatedOptions
("max-upload-size", &ChunkSize, "maximum size for individual data batches (in bytes)")
;
description
("max-upload-size", &MaxUploadSize, "maximum size of import chunks (in bytes)")
("chunk-size", &ChunkSize, "maximum size for individual data batches (in bytes)")
(deprecatedOptions, true)
(javascript, false)
;