@@ -160,11 +160,13 @@ pub enum DropCommand {
160160pub enum MetaStoreCommand {
161161 SetCurrent { id : u128 } ,
162162 Compaction ,
163+ Healthcheck ,
163164}
164165
165166#[ derive( Debug , Clone , PartialEq ) ]
166167pub enum CacheStoreCommand {
167168 Compaction ,
169+ Healthcheck ,
168170}
169171
170172pub struct CubeStoreParser < ' a > {
@@ -346,33 +348,35 @@ impl<'a> CubeStoreParser<'a> {
346348 }
347349
348350 pub fn parse_cachestore ( & mut self ) -> Result < Statement , ParserError > {
349- if self . parse_custom_token ( "compaction" ) {
350- Ok ( Statement :: System ( SystemCommand :: CacheStore (
351- CacheStoreCommand :: Compaction ,
352- ) ) )
351+ let command = if self . parse_custom_token ( "compaction" ) {
352+ CacheStoreCommand :: Compaction
353+ } else if self . parse_custom_token ( "healthcheck" ) {
354+ CacheStoreCommand :: Healthcheck
353355 } else {
354- Err ( ParserError :: ParserError (
356+ return Err ( ParserError :: ParserError (
355357 "Unknown cachestore command" . to_string ( ) ,
356- ) )
357- }
358+ ) ) ;
359+ } ;
360+
361+ Ok ( Statement :: System ( SystemCommand :: CacheStore ( command) ) )
358362 }
359363
360364 pub fn parse_metastore ( & mut self ) -> Result < Statement , ParserError > {
361- if self . parse_custom_token ( "set_current" ) {
362- Ok ( Statement :: System ( SystemCommand :: MetaStore (
363- MetaStoreCommand :: SetCurrent {
364- id : self . parse_integer ( "metastore snapshot id" , false ) ?,
365- } ,
366- ) ) )
365+ let command = if self . parse_custom_token ( "set_current" ) {
366+ MetaStoreCommand :: SetCurrent {
367+ id : self . parse_integer ( "metastore snapshot id" , false ) ?,
368+ }
367369 } else if self . parse_custom_token ( "compaction" ) {
368- Ok ( Statement :: System ( SystemCommand :: MetaStore (
369- MetaStoreCommand :: Compaction ,
370- ) ) )
370+ MetaStoreCommand :: Compaction
371+ } else if self . parse_custom_token ( "healthcheck" ) {
372+ MetaStoreCommand :: Healthcheck
371373 } else {
372- Err ( ParserError :: ParserError (
374+ return Err ( ParserError :: ParserError (
373375 "Unknown metastore command" . to_string ( ) ,
374- ) )
375- }
376+ ) ) ;
377+ } ;
378+
379+ Ok ( Statement :: System ( SystemCommand :: MetaStore ( command) ) )
376380 }
377381
378382 fn parse_queue ( & mut self ) -> Result < Statement , ParserError > {
0 commit comments