@@ -59,13 +59,79 @@ impl From<RegisterWithDatasetRequest> for crate::cloud::v1alpha1::RegisterWithDa
59
59
}
60
60
}
61
61
62
+ // --- QueryDatasetRequest ---
63
+
64
+ #[ derive( Debug , Clone ) ]
65
+ pub struct QueryDatasetRequest {
66
+ pub partition_ids : Vec < crate :: common:: v1alpha1:: ext:: PartitionId > ,
67
+ pub chunk_ids : Vec < re_chunk:: ChunkId > ,
68
+ pub entity_paths : Vec < EntityPath > ,
69
+ pub select_all_entity_paths : bool ,
70
+ pub fuzzy_descriptors : Vec < String > ,
71
+ pub exclude_static_data : bool ,
72
+ pub exclude_temporal_data : bool ,
73
+ pub scan_parameters : Option < crate :: common:: v1alpha1:: ext:: ScanParameters > ,
74
+ pub query : Option < Query > ,
75
+ }
76
+
77
+ impl TryFrom < crate :: cloud:: v1alpha1:: QueryDatasetRequest > for QueryDatasetRequest {
78
+ type Error = tonic:: Status ;
79
+
80
+ fn try_from ( value : crate :: cloud:: v1alpha1:: QueryDatasetRequest ) -> Result < Self , Self :: Error > {
81
+ Ok ( Self {
82
+ partition_ids : value
83
+ . partition_ids
84
+ . into_iter ( )
85
+ . map ( TryInto :: try_into)
86
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?,
87
+
88
+ chunk_ids : value
89
+ . chunk_ids
90
+ . into_iter ( )
91
+ . map ( |tuid| {
92
+ let id: re_tuid:: Tuid = tuid. try_into ( ) ?;
93
+ Ok :: < _ , tonic:: Status > ( re_chunk:: ChunkId :: from_u128 ( id. as_u128 ( ) ) )
94
+ } )
95
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?,
96
+
97
+ entity_paths : value
98
+ . entity_paths
99
+ . into_iter ( )
100
+ . map ( |path| {
101
+ path. try_into ( ) . map_err ( |err| {
102
+ tonic:: Status :: invalid_argument ( format ! ( "invalid entity path: {err}" ) )
103
+ } )
104
+ } )
105
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?,
106
+
107
+ select_all_entity_paths : value. select_all_entity_paths ,
108
+
109
+ fuzzy_descriptors : value. fuzzy_descriptors ,
110
+
111
+ exclude_static_data : value. exclude_static_data ,
112
+ exclude_temporal_data : value. exclude_temporal_data ,
113
+
114
+ scan_parameters : value
115
+ . scan_parameters
116
+ . map ( |params| params. try_into ( ) )
117
+ . transpose ( ) ?,
118
+
119
+ query : value. query . map ( |q| q. try_into ( ) ) . transpose ( ) ?,
120
+ } )
121
+ }
122
+ }
123
+
62
124
// --- GetChunksRequest --
63
125
64
126
#[ derive( Debug , Clone ) ]
65
127
pub struct GetChunksRequest {
66
128
pub partition_ids : Vec < crate :: common:: v1alpha1:: ext:: PartitionId > ,
67
129
pub chunk_ids : Vec < re_chunk:: ChunkId > ,
68
130
pub entity_paths : Vec < EntityPath > ,
131
+ pub select_all_entity_paths : bool ,
132
+ pub fuzzy_descriptors : Vec < String > ,
133
+ pub exclude_static_data : bool ,
134
+ pub exclude_temporal_data : bool ,
69
135
pub query : Option < Query > ,
70
136
}
71
137
@@ -99,6 +165,13 @@ impl TryFrom<crate::cloud::v1alpha1::GetChunksRequest> for GetChunksRequest {
99
165
} )
100
166
. collect :: < Result < Vec < _ > , _ > > ( ) ?,
101
167
168
+ select_all_entity_paths : value. select_all_entity_paths ,
169
+
170
+ fuzzy_descriptors : value. fuzzy_descriptors ,
171
+
172
+ exclude_static_data : value. exclude_static_data ,
173
+ exclude_temporal_data : value. exclude_temporal_data ,
174
+
102
175
query : value. query . map ( |q| q. try_into ( ) ) . transpose ( ) ?,
103
176
} )
104
177
}
@@ -113,6 +186,25 @@ pub struct DoMaintenanceRequest {
113
186
pub unsafe_allow_recent_cleanup : bool ,
114
187
}
115
188
189
+ impl TryFrom < crate :: cloud:: v1alpha1:: DoMaintenanceRequest > for DoMaintenanceRequest {
190
+ type Error = TypeConversionError ;
191
+
192
+ fn try_from ( value : crate :: cloud:: v1alpha1:: DoMaintenanceRequest ) -> Result < Self , Self :: Error > {
193
+ let cleanup_before = value
194
+ . cleanup_before
195
+ . map ( |ts| jiff:: Timestamp :: new ( ts. seconds , ts. nanos ) )
196
+ . transpose ( ) ?;
197
+
198
+ Ok ( Self {
199
+ optimize_indexes : value. optimize_indexes ,
200
+ retrain_indexes : value. retrain_indexes ,
201
+ compact_fragments : value. compact_fragments ,
202
+ cleanup_before,
203
+ unsafe_allow_recent_cleanup : value. unsafe_allow_recent_cleanup ,
204
+ } )
205
+ }
206
+ }
207
+
116
208
impl From < DoMaintenanceRequest > for crate :: cloud:: v1alpha1:: DoMaintenanceRequest {
117
209
fn from ( value : DoMaintenanceRequest ) -> Self {
118
210
Self {
0 commit comments