@@ -71,26 +71,6 @@ def __init__(self, args):
7171 self .decay = response ['decay' ]
7272
7373
74- class TDigestInfo (object ):
75- compression = None
76- capacity = None
77- mergedNodes = None
78- unmergedNodes = None
79- mergedWeight = None
80- unmergedWeight = None
81- totalCompressions = None
82-
83- def __init__ (self , args ):
84- response = dict (zip (map (nativestr , args [::2 ]), args [1 ::2 ]))
85- self .compression = response ['Compression' ]
86- self .capacity = response ['Capacity' ]
87- self .mergedNodes = response ['Merged nodes' ]
88- self .unmergedNodes = response ['Unmerged nodes' ]
89- self .mergedWeight = response ['Merged weight' ]
90- self .unmergedWeight = response ['Unmerged weight' ]
91- self .totalCompressions = response ['Total compressions' ]
92-
93-
9474def spaceHolder (response ):
9575 return response
9676
@@ -118,7 +98,6 @@ class Client(Redis): # changed from StrictRedis
11898 - CF for Cuckoo Filter
11999 - CMS for Count-Min Sketch
120100 - TOPK for TopK Data Structure
121- - TDIGEST for estimate rank statistics
122101 """
123102
124103 BF_RESERVE = 'BF.RESERVE'
@@ -157,16 +136,6 @@ class Client(Redis): # changed from StrictRedis
157136 TOPK_LIST = 'TOPK.LIST'
158137 TOPK_INFO = 'TOPK.INFO'
159138
160- TDIGEST_CREATE = 'TDIGEST.CREATE'
161- TDIGEST_RESET = 'TDIGEST.RESET'
162- TDIGEST_ADD = 'TDIGEST.ADD'
163- TDIGEST_MERGE = 'TDIGEST.MERGE'
164- TDIGEST_CDF = 'TDIGEST.CDF'
165- TDIGEST_QUANTILE = 'TDIGEST.QUANTILE'
166- TDIGEST_MIN = 'TDIGEST.MIN'
167- TDIGEST_MAX = 'TDIGEST.MAX'
168- TDIGEST_INFO = 'TDIGEST.INFO'
169-
170139 def __init__ (self , * args , ** kwargs ):
171140 """
172141 Creates a new RedisBloom client.
@@ -212,15 +181,6 @@ def __init__(self, *args, **kwargs):
212181 self .TOPK_LIST : parseToList ,
213182 self .TOPK_INFO : TopKInfo ,
214183
215- self .TDIGEST_CREATE : bool_ok ,
216- # self.TDIGEST_RESET: bool_ok,
217- # self.TDIGEST_ADD: spaceHolder,
218- # self.TDIGEST_MERGE: spaceHolder,
219- # self.TDIGEST_CDF: spaceHolder,
220- # self.TDIGEST_QUANTILE: spaceHolder,
221- # self.TDIGEST_MIN: spaceHolder,
222- # self.TDIGEST_MAX: spaceHolder,
223- self .TDIGEST_INFO : TDigestInfo ,
224184 }
225185 for k , v in six .iteritems (MODULE_CALLBACKS ):
226186 self .set_response_callback (k , v )
@@ -613,83 +573,6 @@ def topkInfo(self, key):
613573
614574 return self .execute_command (self .TOPK_INFO , key )
615575
616- ################## T-Digest Functions ######################
617-
618- def tdigestCreate (self , key , compression ):
619- """"
620- Allocate the memory and initialize the t-digest.
621- """
622- params = [key , compression ]
623-
624- return self .execute_command (self .TDIGEST_CREATE , * params )
625-
626- def tdigestReset (self , key ):
627- """
628- Reset the sketch ``key`` to zero - empty out the sketch and re-initialize it.
629- """
630-
631- return self .execute_command (self .TDIGEST_RESET , key )
632-
633- def tdigestAdd (self , key , values , weights ):
634- """
635- Adds one or more samples (value with weight) to a sketch ``key``.
636- Both ``values`` and ``weights`` are lists.
637- Example - tdigestAdd('A', [1500.0], [1.0])
638- """
639- params = [key ]
640- self .appendValuesAndWeights (params , values , weights )
641-
642- return self .execute_command (self .TDIGEST_ADD , * params )
643-
644- def tdigestMerge (self , toKey , fromKey ):
645- """
646- Merges all of the values from 'fromKey' to 'toKey' sketch.
647- """
648- params = [toKey , fromKey ]
649-
650- return self .execute_command (self .TDIGEST_MERGE , * params )
651-
652- def tdigestMin (self , key ):
653- """
654- Returns minimum value from the sketch ``key``.
655- Will return DBL_MAX if the sketch is empty.
656- """
657-
658- return self .execute_command (self .TDIGEST_MIN , key )
659-
660- def tdigestMax (self , key ):
661- """
662- Returns maximum value from the sketch ``key``.
663- Will return DBL_MIN if the sketch is empty.
664- """
665-
666- return self .execute_command (self .TDIGEST_MAX , key )
667-
668- def tdigestQuantile (self , key , quantile ):
669- """
670- Returns double value estimate of the cutoff such that a specified fraction of the data added
671- to this TDigest would be less than or equal to the cutoff.
672- """
673- params = [key , quantile ]
674-
675- return self .execute_command (self .TDIGEST_QUANTILE , * params )
676-
677- def tdigestCdf (self , key , value ):
678- """
679- Returns double fraction of all points added which are <= value.
680- """
681- params = [key , value ]
682-
683- return self .execute_command (self .TDIGEST_CDF , * params )
684-
685- def tdigestInfo (self , key ):
686- """
687- Returns Compression, Capacity, Merged Nodes, Unmerged Nodes, Merged Weight, Unmerged Weight
688- and Total Compressions.
689- """
690-
691- return self .execute_command (self .TDIGEST_INFO , key )
692-
693576 def pipeline (self , transaction = True , shard_hint = None ):
694577 """
695578 Return a new pipeline object that can queue multiple commands for
0 commit comments