Skip to content

Commit

Permalink
Separate the reporting page tokens from the CMMS page tokens.
Browse files Browse the repository at this point in the history
  • Loading branch information
riemanli committed Apr 27, 2023
1 parent 4375ead commit 9ad7a71
Show file tree
Hide file tree
Showing 14 changed files with 174 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ kt_jvm_library(
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha:principal_server_interceptor",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha:reporting_principal",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha:resource_key",
"//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto",
"//src/main/proto/wfa/measurement/internal/reporting:reporting_sets_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v1alpha:page_token_kt_jvm_proto",
"//src/main/proto/wfa/measurement/reporting/v1alpha:reporting_sets_service_kt_jvm_grpc_proto",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common/grpc",
Expand Down Expand Up @@ -66,10 +66,10 @@ kt_jvm_library(
"//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:measurement_kt_jvm_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:measurements_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto",
"//src/main/proto/wfa/measurement/internal/reporting:measurements_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/internal/reporting:reporting_sets_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/internal/reporting:reports_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v1alpha:page_token_kt_jvm_proto",
"//src/main/proto/wfa/measurement/reporting/v1alpha:reports_service_kt_jvm_grpc_proto",
"@wfa_common_jvm//imports/java/com/google/protobuf/util",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ package org.wfanet.measurement.reporting.service.api.v1alpha
import io.grpc.Status
import kotlin.math.min
import kotlinx.coroutines.flow.toList
import org.wfanet.measurement.api.v2alpha.ListReportingSetsPageToken
import org.wfanet.measurement.api.v2alpha.ListReportingSetsPageTokenKt.previousPageEnd
import org.wfanet.measurement.api.v2alpha.MeasurementConsumerKey
import org.wfanet.measurement.api.v2alpha.copy
import org.wfanet.measurement.api.v2alpha.listReportingSetsPageToken
import org.wfanet.measurement.common.base64UrlDecode
import org.wfanet.measurement.common.base64UrlEncode
import org.wfanet.measurement.common.grpc.failGrpc
Expand All @@ -39,10 +35,14 @@ import org.wfanet.measurement.internal.reporting.StreamReportingSetsRequestKt.fi
import org.wfanet.measurement.internal.reporting.reportingSet as internalReportingSet
import org.wfanet.measurement.internal.reporting.streamReportingSetsRequest
import org.wfanet.measurement.reporting.v1alpha.CreateReportingSetRequest
import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsPageToken
import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsPageTokenKt.previousPageEnd
import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsRequest
import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsResponse
import org.wfanet.measurement.reporting.v1alpha.ReportingSet
import org.wfanet.measurement.reporting.v1alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineImplBase
import org.wfanet.measurement.reporting.v1alpha.copy
import org.wfanet.measurement.reporting.v1alpha.listReportingSetsPageToken
import org.wfanet.measurement.reporting.v1alpha.listReportingSetsResponse
import org.wfanet.measurement.reporting.v1alpha.reportingSet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ import org.wfanet.measurement.api.v2alpha.DataProvider
import org.wfanet.measurement.api.v2alpha.DataProviderKey
import org.wfanet.measurement.api.v2alpha.DataProvidersGrpcKt.DataProvidersCoroutineStub
import org.wfanet.measurement.api.v2alpha.EncryptionPublicKey
import org.wfanet.measurement.api.v2alpha.ListReportsPageToken
import org.wfanet.measurement.api.v2alpha.ListReportsPageTokenKt.previousPageEnd
import org.wfanet.measurement.api.v2alpha.Measurement
import org.wfanet.measurement.api.v2alpha.Measurement.DataProviderEntry
import org.wfanet.measurement.api.v2alpha.MeasurementConsumer
Expand All @@ -67,7 +65,6 @@ import org.wfanet.measurement.api.v2alpha.getCertificateRequest
import org.wfanet.measurement.api.v2alpha.getDataProviderRequest
import org.wfanet.measurement.api.v2alpha.getMeasurementConsumerRequest
import org.wfanet.measurement.api.v2alpha.getMeasurementRequest
import org.wfanet.measurement.api.v2alpha.listReportsPageToken
import org.wfanet.measurement.api.v2alpha.measurement
import org.wfanet.measurement.api.v2alpha.measurementSpec
import org.wfanet.measurement.api.v2alpha.requisitionSpec
Expand Down Expand Up @@ -141,6 +138,8 @@ import org.wfanet.measurement.internal.reporting.timeIntervals as internalTimeIn
import org.wfanet.measurement.reporting.service.api.EncryptionKeyPairStore
import org.wfanet.measurement.reporting.v1alpha.CreateReportRequest
import org.wfanet.measurement.reporting.v1alpha.GetReportRequest
import org.wfanet.measurement.reporting.v1alpha.ListReportsPageToken
import org.wfanet.measurement.reporting.v1alpha.ListReportsPageTokenKt.previousPageEnd
import org.wfanet.measurement.reporting.v1alpha.ListReportsRequest
import org.wfanet.measurement.reporting.v1alpha.ListReportsResponse
import org.wfanet.measurement.reporting.v1alpha.Metric
Expand Down Expand Up @@ -172,6 +171,7 @@ import org.wfanet.measurement.reporting.v1alpha.ReportsGrpcKt.ReportsCoroutineIm
import org.wfanet.measurement.reporting.v1alpha.TimeInterval
import org.wfanet.measurement.reporting.v1alpha.TimeIntervals
import org.wfanet.measurement.reporting.v1alpha.copy
import org.wfanet.measurement.reporting.v1alpha.listReportsPageToken
import org.wfanet.measurement.reporting.v1alpha.listReportsResponse
import org.wfanet.measurement.reporting.v1alpha.metric
import org.wfanet.measurement.reporting.v1alpha.periodicTimeInterval
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ kt_jvm_library(
"//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:measurement_kt_jvm_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:measurements_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto",
"//src/main/proto/wfa/measurement/config/reporting:metric_spec_config_kt_jvm_proto",
"//src/main/proto/wfa/measurement/internal/reporting/v2:measurements_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/internal/reporting/v2:metrics_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/internal/reporting/v2:reporting_sets_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:metrics_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:page_token_kt_jvm_proto",
"@wfa_common_jvm//imports/java/com/google/protobuf/util",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common/identity",
Expand All @@ -98,12 +98,12 @@ kt_jvm_library(
"//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:measurement_kt_jvm_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:measurements_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto",
"//src/main/proto/wfa/measurement/config/reporting:metric_spec_config_kt_jvm_proto",
"//src/main/proto/wfa/measurement/internal/reporting/v2:measurements_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/internal/reporting/v2:metrics_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/internal/reporting/v2:reporting_sets_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:metrics_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:page_token_kt_jvm_proto",
"@wfa_common_jvm//imports/java/com/google/protobuf/util",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common/crypto:security_provider",
Expand All @@ -120,4 +120,4 @@ kt_jvm_library(
deps = [
"@wfa_common_jvm//imports/kotlin/kotlinx/coroutines:core",
],
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ import org.wfanet.measurement.api.v2alpha.DataProvider
import org.wfanet.measurement.api.v2alpha.DataProviderKey
import org.wfanet.measurement.api.v2alpha.DataProvidersGrpcKt.DataProvidersCoroutineStub
import org.wfanet.measurement.api.v2alpha.EncryptionPublicKey
import org.wfanet.measurement.api.v2alpha.ListMetricsPageToken
import org.wfanet.measurement.api.v2alpha.ListMetricsPageTokenKt.previousPageEnd
import org.wfanet.measurement.api.v2alpha.Measurement
import org.wfanet.measurement.api.v2alpha.MeasurementConsumer
import org.wfanet.measurement.api.v2alpha.MeasurementConsumerKey
Expand All @@ -59,13 +57,11 @@ import org.wfanet.measurement.api.v2alpha.MeasurementSpec
import org.wfanet.measurement.api.v2alpha.MeasurementsGrpcKt.MeasurementsCoroutineStub
import org.wfanet.measurement.api.v2alpha.RequisitionSpec.EventGroupEntry
import org.wfanet.measurement.api.v2alpha.RequisitionSpecKt
import org.wfanet.measurement.api.v2alpha.copy
import org.wfanet.measurement.api.v2alpha.createMeasurementRequest
import org.wfanet.measurement.api.v2alpha.getCertificateRequest
import org.wfanet.measurement.api.v2alpha.getDataProviderRequest
import org.wfanet.measurement.api.v2alpha.getMeasurementConsumerRequest
import org.wfanet.measurement.api.v2alpha.getMeasurementRequest
import org.wfanet.measurement.api.v2alpha.listMetricsPageToken
import org.wfanet.measurement.api.v2alpha.measurement
import org.wfanet.measurement.api.v2alpha.measurementSpec
import org.wfanet.measurement.api.v2alpha.requisitionSpec
Expand Down Expand Up @@ -127,6 +123,8 @@ import org.wfanet.measurement.reporting.v2alpha.BatchGetMetricsRequest
import org.wfanet.measurement.reporting.v2alpha.BatchGetMetricsResponse
import org.wfanet.measurement.reporting.v2alpha.CreateMetricRequest
import org.wfanet.measurement.reporting.v2alpha.GetMetricRequest
import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageToken
import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageTokenKt.previousPageEnd
import org.wfanet.measurement.reporting.v2alpha.ListMetricsRequest
import org.wfanet.measurement.reporting.v2alpha.ListMetricsResponse
import org.wfanet.measurement.reporting.v2alpha.Metric
Expand All @@ -141,6 +139,8 @@ import org.wfanet.measurement.reporting.v2alpha.MetricSpec
import org.wfanet.measurement.reporting.v2alpha.MetricsGrpcKt.MetricsCoroutineImplBase
import org.wfanet.measurement.reporting.v2alpha.batchCreateMetricsResponse
import org.wfanet.measurement.reporting.v2alpha.batchGetMetricsResponse
import org.wfanet.measurement.reporting.v2alpha.copy
import org.wfanet.measurement.reporting.v2alpha.listMetricsPageToken
import org.wfanet.measurement.reporting.v2alpha.listMetricsResponse
import org.wfanet.measurement.reporting.v2alpha.metric
import org.wfanet.measurement.reporting.v2alpha.metricResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.wfanet.measurement.reporting.service.api.v2alpha

import org.wfanet.measurement.api.v2alpha.DifferentialPrivacyParams
import org.wfanet.measurement.api.v2alpha.ListMetricsPageToken
import org.wfanet.measurement.api.v2alpha.Measurement
import org.wfanet.measurement.api.v2alpha.MeasurementSpec
import org.wfanet.measurement.api.v2alpha.MeasurementSpec.VidSamplingInterval
Expand All @@ -35,6 +34,7 @@ import org.wfanet.measurement.internal.reporting.v2.StreamMetricsRequestKt
import org.wfanet.measurement.internal.reporting.v2.TimeInterval as InternalTimeInterval
import org.wfanet.measurement.internal.reporting.v2.streamMetricsRequest
import org.wfanet.measurement.internal.reporting.v2.timeInterval as internalTimeInterval
import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageToken
import org.wfanet.measurement.reporting.v2alpha.MetricSpec
import org.wfanet.measurement.reporting.v2alpha.MetricSpecKt
import org.wfanet.measurement.reporting.v2alpha.TimeInterval
Expand Down
58 changes: 15 additions & 43 deletions src/main/proto/wfa/measurement/api/v2alpha/page_token.proto
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2021 The Cross-Media Measurement Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* Copyright 2021 The Cross-Media Measurement Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

syntax = "proto3";

Expand Down Expand Up @@ -59,33 +61,3 @@ message ListRequisitionsPageToken {
PreviousPageEnd last_requisition = 6;
repeated Measurement.State measurement_states = 7;
}

message ListReportingSetsPageToken {
int32 page_size = 1;
string measurement_consumer_reference_id = 2;
message PreviousPageEnd {
string measurement_consumer_reference_id = 1;
fixed64 external_reporting_set_id = 2;
}
PreviousPageEnd last_reporting_set = 3;
}

message ListReportsPageToken {
int32 page_size = 1;
string measurement_consumer_reference_id = 2;
message PreviousPageEnd {
string measurement_consumer_reference_id = 1;
fixed64 external_report_id = 2;
}
PreviousPageEnd last_report = 3;
}

message ListMetricsPageToken {
int32 page_size = 1;
string cmms_measurement_consumer_id = 2;
message PreviousPageEnd {
string cmms_measurement_consumer_id = 1;
fixed64 external_metric_id = 2;
}
PreviousPageEnd last_metric = 3;
}
21 changes: 21 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v1alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,27 @@ proto_library(
],
)

proto_library(
name = "page_token_proto",
srcs = ["page_token.proto"],
deps = [],
)

java_proto_library(
name = "page_token_java_proto",
deps = [
":page_token_proto",
],
)

kt_jvm_proto_library(
name = "page_token_kt_jvm_proto",
srcs = [
":page_token_proto",
],
deps = [":page_token_java_proto"],
)

# Services.

proto_library(
Expand Down
42 changes: 42 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v1alpha/page_token.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2023 The Cross-Media Measurement Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

syntax = "proto3";

package wfa.measurement.reporting.v1alpha;

option java_package = "org.wfanet.measurement.reporting.v1alpha";
option java_multiple_files = true;

message ListReportingSetsPageToken {
int32 page_size = 1;
string measurement_consumer_reference_id = 2;
message PreviousPageEnd {
string measurement_consumer_reference_id = 1;
fixed64 external_reporting_set_id = 2;
}
PreviousPageEnd last_reporting_set = 3;
}

message ListReportsPageToken {
int32 page_size = 1;
string measurement_consumer_reference_id = 2;
message PreviousPageEnd {
string measurement_consumer_reference_id = 1;
fixed64 external_report_id = 2;
}
PreviousPageEnd last_report = 3;
}
21 changes: 21 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ proto_library(
],
)

proto_library(
name = "page_token_proto",
srcs = ["page_token.proto"],
deps = [],
)

java_proto_library(
name = "page_token_java_proto",
deps = [
":page_token_proto",
],
)

kt_jvm_proto_library(
name = "page_token_kt_jvm_proto",
srcs = [
":page_token_proto",
],
deps = [":page_token_java_proto"],
)

# Services.

proto_library(
Expand Down
52 changes: 52 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v2alpha/page_token.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2023 The Cross-Media Measurement Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

syntax = "proto3";

package wfa.measurement.reporting.v2alpha;

option java_package = "org.wfanet.measurement.reporting.v2alpha";
option java_multiple_files = true;

message ListReportingSetsPageToken {
int32 page_size = 1;
string cmms_measurement_consumer_id = 2;
message PreviousPageEnd {
string cmms_measurement_consumer_id = 1;
fixed64 external_reporting_set_id = 2;
}
PreviousPageEnd last_reporting_set = 3;
}

message ListReportsPageToken {
int32 page_size = 1;
string cmms_measurement_consumer_id = 2;
message PreviousPageEnd {
string cmms_measurement_consumer_id = 1;
fixed64 external_report_id = 2;
}
PreviousPageEnd last_report = 3;
}

message ListMetricsPageToken {
int32 page_size = 1;
string cmms_measurement_consumer_id = 2;
message PreviousPageEnd {
string cmms_measurement_consumer_id = 1;
fixed64 external_metric_id = 2;
}
PreviousPageEnd last_metric = 3;
}
Loading

0 comments on commit 9ad7a71

Please sign in to comment.