Skip to content

Commit

Permalink
Remove enable_native_example_query_recording flag.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 668021819
  • Loading branch information
chunxiangzheng authored and copybara-github committed Aug 27, 2024
1 parent 22c2081 commit 4496152
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
34 changes: 12 additions & 22 deletions fcp/client/fl_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1961,13 +1961,9 @@ std::vector<std::string> HandleMultipleTaskAssignments(
SelectorContext selector_context_with_task_details =
FillSelectorContextWithTaskLevelDetails(
task_assignment, federated_selector_context, opstats_logger, flags);
std::unique_ptr<ExampleIteratorQueryRecorder>
example_iterator_query_recorder = nullptr;
if (flags->enable_native_example_query_recording()) {
example_iterator_query_recorder =
std::make_unique<ExampleIteratorQueryRecorderImpl>(
selector_context_with_task_details);
}
auto example_iterator_query_recorder =
std::make_unique<ExampleIteratorQueryRecorderImpl>(
selector_context_with_task_details);
RunPlanResults run_plan_results = RunComputation(
task_assignment, selector_context_with_task_details, env_deps,
phase_logger, files, log_manager, opstats_logger, flags,
Expand All @@ -1989,11 +1985,10 @@ std::vector<std::string> HandleMultipleTaskAssignments(
} else {
task_result_info.set_result(false);
}
if (flags->enable_native_example_query_recording() &&
example_iterator_query_recorder) {

*task_result_info.mutable_example_iterator_queries() =
example_iterator_query_recorder->StopRecordingAndGetQueries();
}

env_deps->OnTaskCompleted(std::move(task_result_info));
}
return successful_task_names;
Expand Down Expand Up @@ -2219,13 +2214,9 @@ absl::StatusOr<FLRunnerResult> RunFederatedComputation(
FillSelectorContextWithTaskLevelDetails(checkin_result,
federated_selector_context,
opstats_logger, flags);
std::unique_ptr<ExampleIteratorQueryRecorder>
example_iterator_query_recorder = nullptr;
if (flags->enable_native_example_query_recording()) {
example_iterator_query_recorder =
std::make_unique<ExampleIteratorQueryRecorderImpl>(
selector_context_with_task_details);
}
auto example_iterator_query_recorder =
std::make_unique<ExampleIteratorQueryRecorderImpl>(
selector_context_with_task_details);

auto run_plan_results = RunComputation(
checkin_result, selector_context_with_task_details, env_deps,
Expand All @@ -2249,11 +2240,10 @@ absl::StatusOr<FLRunnerResult> RunFederatedComputation(
} else {
task_result_info.set_result(false);
}
if (flags->enable_native_example_query_recording() &&
example_iterator_query_recorder) {
*task_result_info.mutable_example_iterator_queries() =
example_iterator_query_recorder->StopRecordingAndGetQueries();
}

*task_result_info.mutable_example_iterator_queries() =
example_iterator_query_recorder->StopRecordingAndGetQueries();

env_deps->OnTaskCompleted(std::move(task_result_info));
}
}
Expand Down
4 changes: 0 additions & 4 deletions fcp/client/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ class Flags {
// If true, OpStats logger enables PhaseStats logging.
virtual bool enable_phase_stats_logging() const { return false; }

// If true, example query recording will happen in the native code. But if
// enable_task_completion_callback is false, the recorded data won't be used.
virtual bool enable_native_example_query_recording() const { return false; }

// If true, confidential aggregation is advertised & can be used for uploads.
virtual bool enable_confidential_aggregation() const { return false; }

Expand Down
2 changes: 0 additions & 2 deletions fcp/client/test_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,6 @@ class MockFlags : public Flags {
MOCK_METHOD(bool, enable_phase_stats_logging, (), (const, override));
MOCK_METHOD(bool, enable_lightweight_client_report_wire_format, (),
(const, override));
MOCK_METHOD(bool, enable_native_example_query_recording, (),
(const, override));
MOCK_METHOD(bool, enable_confidential_aggregation, (), (const, override));
MOCK_METHOD(bool, check_trustworthiness_for_min_sep_policy, (),
(const, override));
Expand Down

0 comments on commit 4496152

Please sign in to comment.