LoadingCache yog dab tsi?
LoadingCache yog dab tsi?

Video: LoadingCache yog dab tsi?

Video: LoadingCache yog dab tsi?
Video: कांच बीड़ा दू ऐ गजबन | Kanch Bida Dyu Ya Gajban | MR RADHEY ft Sonam Choudhary | 2024, Hlis ntuj nqeg
Anonim

A LoadingCache yog ib lub Cache tsim nrog ib qho txuas CacheLoader. Tsim ib lub CacheLoader feem ntau yog ib qho yooj yim raws li kev siv txoj kev V load (K qhov tseem ceeb) cuam tshuam kev zam.

Tsis tas li ntawd, Guava Cache ua haujlwm li cas?

Cov Guava Cache yog ib qho ntxiv cache , nyob rau hauv lub siab hais tias thaum koj thov ib yam khoom los ntawm lub cache , nws kuaj xyuas seb nws twb muaj tus nqi sib thooj rau tus yuam sij muab. Yog tias nws tsis tau muaj tus nqi, nws siv CacheLoader los nqa tus nqi thiab tom qab ntawd nws khaws cov nqi hauv cache thiab rov qab los.

Ib yam li ntawd, Guava Cache xov puas nyab xeeb? Guava Cache muaj kev yoog raws thiab lub zog ntau dua li HashMap lossis ConcurrentHashMap, tab sis tsis hnyav npaum li siv EHCache lossis Memcached (lossis muaj zog rau qhov teeb meem, xws li Guava Cache ua haujlwm nkaus xwb hauv nco). Muaj lwm txoj hauv kev 'asMap' uas nthuav tawm cov ntawv nkag hauv cache as a xov nyab xeeb daim ntawv qhia.

Ib yam li ib tug yuav nug, guava cache yog dab tsi?

Guava cache yog ib lub tsev qiv ntawv yooj yim uas muab hloov tau thiab muaj zog caching nta. Guava cache yog ib lub tsev qiv ntawv yooj yim uas muab hloov tau thiab muaj zog caching nta. Raws li guava developers piav qhia, ua cache tuaj yeem siv tau thaum xav tau ceev ceev thiab thaum cov nqi rov qab tau ntau zaus.

Cache hnyav yog dab tsi?

MaximumWeight(ntev hnyav ) Qhia qhov siab tshaj plaws hnyav ntawm entries cache tej zaum muaj. static CacheBuilder newBuilder() Tsim ib qho piv txwv CacheBuilder tshiab nrog rau qhov chaw pib, suav nrog cov yuam sij muaj zog, muaj txiaj ntsig zoo, thiab tsis muaj kev tshem tawm tsis siv neeg txhua yam.

Pom zoo: