Package xyz.cofe.cbuffer.page
Interface CachePagedState<M extends UsedPagesInfo,D extends DirtyPagedDataBase<M,? extends DirtyPagedState>>
-
- All Known Implementing Classes:
CachePagedState.NonThreadSafe,CCachePagedData.State
public interface CachePagedState<M extends UsedPagesInfo,D extends DirtyPagedDataBase<M,? extends DirtyPagedState>>Состояние объектаCachePagedDataBaseПредполагается наличие 2ух реализаций, для Non Thread safe и Thread safe
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCachePagedState.NonThreadSafe
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <R> Rcache2prst_read(Function<IntArrayReadOnly,R> code)Отображение кеша страниц на основную память.voidcache2prst_replace(Function<IntArrayReadOnly,int[]> code)voidcache2prst_write(Consumer<IntArrayMutable> code)DcachePages()Кеш страниц (быстрая)voidcachePages(D pages)voidclose()booleanisClosed()static CachePagedState.NonThreadSafenonSafe()Создание состояния - Non Thread safeResizablePages<M>persistentPages()Основная|Постоянная память (медленная)voidpersistentPages(ResizablePages<M> pages)Map<Integer,Integer>prst2cache()отображение страниц основной памяти на кешvoidprst2cache(Map<Integer,Integer> map)default <R> Rprst2cache_read(Function<MapReadonly<Integer,Integer>,R> code)default <R> Rprst2cache_write(Function<MapMutable<Integer,Integer>,R> code)xyz.cofe.fn.Tuple2<Long,Long>statCacheHitMiss()voidstatCacheHitMiss(boolean hit)
-
-
-
Method Detail
-
cachePages
D cachePages()
Кеш страниц (быстрая)
-
cachePages
void cachePages(D pages)
-
persistentPages
ResizablePages<M> persistentPages()
Основная|Постоянная память (медленная)
-
persistentPages
void persistentPages(ResizablePages<M> pages)
-
cache2prst_read
<R> R cache2prst_read(Function<IntArrayReadOnly,R> code)
Отображение кеша страниц на основную память.Семантика:
cache2prst[ cache_page_index ] = hard_pages_indexЗначение (hard_pages_index):
- -1 или меньше - нет отображения
-
0 или больше - отображение есть
страница может быть чистой или грязной:
DirtyPagedDataBase.dirty(int)- где аргумент hard_pages_index
-
cache2prst_write
void cache2prst_write(Consumer<IntArrayMutable> code)
-
cache2prst_replace
void cache2prst_replace(Function<IntArrayReadOnly,int[]> code)
-
prst2cache_read
default <R> R prst2cache_read(Function<MapReadonly<Integer,Integer>,R> code)
-
prst2cache_write
default <R> R prst2cache_write(Function<MapMutable<Integer,Integer>,R> code)
-
isClosed
boolean isClosed()
-
close
void close()
-
statCacheHitMiss
void statCacheHitMiss(boolean hit)
-
nonSafe
static CachePagedState.NonThreadSafe nonSafe()
Создание состояния - Non Thread safe- Returns:
- состояние
-
-