- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::acs::PartitionedCache
::acs::PartitionedCache create ... \Partitioned cache infrastructure. Partition numbers are computed via a modulo function from the numeric keys.
[ -default_size (default "100KB") ] \
[ -maxentry:integer maxentry:integer ] \
[ -name name ] \
[ -package_key:required package_key:required ] \
[ -parameter:required parameter:required ] \
[ -partitions:integer (default "1") ] \
[ -timeout (default "5m") ]
Defined in packages/acs-tcl/tcl/acs-cache-procs.tcl
Class Relations
::nx::Class create ::acs::PartitionedCache \ -superclass ::acs::CacheMethods (to be applied on instances)
flush_all (scripted, public)
<instance of acs::PartitionedCache> flush_all \ [ -partition_key partition_key ]Flush all entries in all partitions of a cache.
- Switches:
- -partition_key (optional)
- Testcases:
- No testcase defined.
for {set i 0} {$i < ${:partitions}} {incr i} { ::acs::clusterwide ns_cache_flush ${:name}-$i #ns_log notice "flush_all: ns_cache_flush ${:name}-$i" #ns_log notice "... content of ${:name}-$i: [ns_cache_keys ${:name}-$i]" }init (scripted, public)
<instance of acs::PartitionedCache> initIf the name was not provided, use the object name as default for the cache name.
- Testcases:
- No testcase defined.
if {![info exists :name]} { set :name [namespace tail [current]] } set :partitions [::parameter::get_from_package_key -package_key ${:package_key} -parameter "${:parameter}Partitions" -default ${:partitions}] # # Create multiple separate caches depending on the # partitions. A PartitionedCache requires to have a # partitioning function that determines the nth partition # number from some partition_key. # set size [expr {[:get_size] / ${:partitions}}] set :partition_names {} for {set i 0} {$i < ${:partitions}} {incr i} { lappend :partition_names ${:name}-$i :cache_create ${:name}-$i $size }show_all (scripted, public)
<instance of acs::PartitionedCache> show_allLog all cache keys of all partitions to the system log. The primary usage is for debugging.
- Testcases:
- No testcase defined.
for {set i 0} {$i < ${:partitions}} {incr i} { ns_log notice "content of ${:name}-$i: [ns_cache_keys ${:name}-$i]" }
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables