@@ -57,6 +57,11 @@ impl HLLSketch {
5757 self . inner . get_target_type ( )
5858 }
5959
60+ /// Returns sketch's configured lg_k value
61+ pub fn get_lg_config_k ( & self ) -> u8 {
62+ self . inner . get_lg_config_k ( )
63+ }
64+
6065 pub fn serialize ( & self ) -> impl AsRef < [ u8 ] > {
6166 struct UPtrVec ( cxx:: UniquePtr < cxx:: CxxVector < u8 > > ) ;
6267 impl AsRef < [ u8 ] > for UPtrVec {
@@ -99,6 +104,11 @@ impl HLLUnion {
99104 self . inner . get_target_type ( )
100105 }
101106
107+ /// Returns union's configured lg_k value
108+ pub fn get_lg_config_k ( & self ) -> u8 {
109+ self . inner . get_lg_config_k ( )
110+ }
111+
102112 /// Retrieve the current unioned sketch as a copy.
103113 pub fn sketch ( & self , tgt_type : HLLType ) -> HLLSketch {
104114 HLLSketch {
@@ -153,6 +163,7 @@ mod tests {
153163 #[ test]
154164 fn hll_simple_test_hll4 ( ) {
155165 let mut hh = HLLSketch :: new ( 12 , HLLType :: HLL_4 ) ;
166+ assert_eq ! ( hh. get_lg_config_k( ) , 12 ) ;
156167 assert_eq ! ( hh. get_target_type( ) , HLLType :: HLL_4 ) ;
157168
158169 assert_eq ! ( hh. estimate( ) , 0.0 ) ;
@@ -171,6 +182,7 @@ mod tests {
171182 #[ test]
172183 fn hll_simple_test_hll6 ( ) {
173184 let mut hh = HLLSketch :: new ( 12 , HLLType :: HLL_6 ) ;
185+ assert_eq ! ( hh. get_lg_config_k( ) , 12 ) ;
174186 assert_eq ! ( hh. get_target_type( ) , HLLType :: HLL_6 ) ;
175187
176188 assert_eq ! ( hh. estimate( ) , 0.0 ) ;
@@ -189,6 +201,7 @@ mod tests {
189201 #[ test]
190202 fn hll_simple_test_hll8 ( ) {
191203 let mut hh = HLLSketch :: new ( 12 , HLLType :: HLL_8 ) ;
204+ assert_eq ! ( hh. get_lg_config_k( ) , 12 ) ;
192205 assert_eq ! ( hh. get_target_type( ) , HLLType :: HLL_8 ) ;
193206
194207 assert_eq ! ( hh. estimate( ) , 0.0 ) ;
@@ -211,6 +224,7 @@ mod tests {
211224
212225 let mut union = HLLUnion :: new ( 12 ) ;
213226 assert_eq ! ( union . get_target_type( ) , HLLType :: HLL_8 ) ;
227+ assert_eq ! ( union . get_lg_config_k( ) , 12 ) ;
214228
215229 union. merge ( hll) ;
216230 union. merge ( HLLSketch :: new ( 12 , HLLType :: HLL_4 ) ) ;
0 commit comments