Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp @ 5757:5463c3ae3235 large-queries
refactored extended /changes
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Thu, 05 Sep 2024 18:21:56 +0200 |
parents | 3765085693e5 |
children | ca06dde85358 |
comparison
equal
deleted
inserted
replaced
5663:3765085693e5 | 5757:5463c3ae3235 |
---|---|
493 { | 493 { |
494 target.push_back(Convert(response.get_changes().changes(i))); | 494 target.push_back(Convert(response.get_changes().changes(i))); |
495 } | 495 } |
496 } | 496 } |
497 | 497 |
498 virtual void GetChanges2(std::list<ServerIndexChange>& target /*out*/, | 498 virtual void GetChangesExtended(std::list<ServerIndexChange>& target /*out*/, |
499 bool& done /*out*/, | 499 bool& done /*out*/, |
500 int64_t since, | 500 int64_t since, |
501 int64_t to, | 501 int64_t to, |
502 uint32_t limit, | 502 uint32_t limit, |
503 ChangeType changeType) ORTHANC_OVERRIDE | 503 ChangeType changeType) ORTHANC_OVERRIDE |
504 { | 504 { |
505 assert(database_.GetDatabaseCapabilities().HasExtendedApiV1()); | 505 assert(database_.GetDatabaseCapabilities().HasExtendedChanges()); |
506 | 506 |
507 DatabasePluginMessages::TransactionRequest request; | 507 DatabasePluginMessages::TransactionRequest request; |
508 DatabasePluginMessages::TransactionResponse response; | 508 DatabasePluginMessages::TransactionResponse response; |
509 | 509 |
510 request.mutable_get_changes2()->set_since(since); | 510 request.mutable_get_changes_extended()->set_since(since); |
511 request.mutable_get_changes2()->set_limit(limit); | 511 request.mutable_get_changes_extended()->set_limit(limit); |
512 request.mutable_get_changes2()->set_to(to); | 512 request.mutable_get_changes_extended()->set_to(to); |
513 request.mutable_get_changes2()->set_change_type(changeType); | 513 request.mutable_get_changes_extended()->set_change_type(changeType); |
514 ExecuteTransaction(response, DatabasePluginMessages::OPERATION_GET_CHANGES_2, request); | 514 ExecuteTransaction(response, DatabasePluginMessages::OPERATION_GET_CHANGES_2, request); |
515 | 515 |
516 done = response.get_changes().done(); | 516 done = response.get_changes().done(); |
517 | 517 |
518 target.clear(); | 518 target.clear(); |
1389 dbCapabilities_.SetRevisionsSupport(systemInfo.supports_revisions()); | 1389 dbCapabilities_.SetRevisionsSupport(systemInfo.supports_revisions()); |
1390 dbCapabilities_.SetLabelsSupport(systemInfo.supports_labels()); | 1390 dbCapabilities_.SetLabelsSupport(systemInfo.supports_labels()); |
1391 dbCapabilities_.SetAtomicIncrementGlobalProperty(systemInfo.supports_increment_global_property()); | 1391 dbCapabilities_.SetAtomicIncrementGlobalProperty(systemInfo.supports_increment_global_property()); |
1392 dbCapabilities_.SetUpdateAndGetStatistics(systemInfo.has_update_and_get_statistics()); | 1392 dbCapabilities_.SetUpdateAndGetStatistics(systemInfo.has_update_and_get_statistics()); |
1393 dbCapabilities_.SetMeasureLatency(systemInfo.has_measure_latency()); | 1393 dbCapabilities_.SetMeasureLatency(systemInfo.has_measure_latency()); |
1394 dbCapabilities_.SetHasExtendedApiV1(systemInfo.has_extended_api_v1()); | 1394 dbCapabilities_.SetHasExtendedChanges(systemInfo.has_extended_changes()); |
1395 } | 1395 } |
1396 | 1396 |
1397 open_ = true; | 1397 open_ = true; |
1398 } | 1398 } |
1399 | 1399 |