Puas yog Guava LoadingCache xov zoo?
Puas yog Guava LoadingCache xov zoo?

Video: Puas yog Guava LoadingCache xov zoo?

Video: Puas yog Guava LoadingCache xov zoo?
Video: Ua Dab Tsi Txhaum Koj - David Yang (New Song 2021) 2024, Kaum ib hlis
Anonim

Interface LoadingCache Ib daim ntawv qhia tsis tu ncua los ntawm cov yuam sij mus rau qhov muaj nuj nqis. Tus nqi yog cia li loaded los ntawm cov cache , thiab khaws cia rau hauv lub cache kom txog thaum raug tshem tawm los yog manually invalidated. Kev siv ntawm no interface yuav tsum tau xov - nyab xeeb , thiab tuaj yeem yog yam xyuam xim accessed los ntawm ntau concurrent xov.

Ib yam li ntawd, koj tuaj yeem nug, 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.

Kuj Paub, 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 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.

LoadingCache yog dab tsi?

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.

Pom zoo: