1.”isReplace”: “false”,不更新,直接插入,速度最快,原因显而易见。40000 records/s
"writer": {
"name": "mongodbwriter",
"parameter": {
"address": [
"10.0.0.1:27017"
],
"userName": "",
"userPassword": "",
"dbName": "testdb",
"collectionName": "test_table",
"column": [
{
"name":"user_id",
"type":"long"
},
{
"name": "province_code",
"type": "string"
},
{
"name": "scores",
"type": "json"
}
],
"writeMode": {
"isReplace": "false",
"replaceKey": "_id"
}
}
}
2.”isReplace”: “true”,更新,并指定_id,通过_id更新,速度 17000 records/s
"writer": {
"name": "mongodbwriter",
"parameter": {
"address": [
"10.0.0.1:27017"
],
"userName": "",
"userPassword": "",
"dbName": "testdb",
"collectionName": "test_table",
"column": [
{
"name":"_id",
"type":"long"
},
{
"name": "province_code",
"type": "string"
},
{
"name": "scores",
"type": "json"
}
],
"writeMode": {
"isReplace": "true",
"replaceKey": "_id"
}
}
}
3.”isReplace”: “true”,更新,不指定_id,通过u_id更新,速度最慢 1000 records/s
"writer": {
"name": "mongodbwriter",
"parameter": {
"address": [
"10.0.0.1:27017"
],
"userName": "",
"userPassword": "",
"dbName": "testdb",
"collectionName": "test_table",
"column": [
{
"name":"u_id",
"type":"long"
},
{
"name": "province_code",
"type": "string"
},
{
"name": "scores",
"type": "json"
}
],
"writeMode": {
"isReplace": "true",
"replaceKey": "u_id"
}
}
}