Interface CacheEvictor
-
- All Superinterfaces:
Cache.Listener
- All Known Implementing Classes:
LeastRecentlyUsedCacheEvictor,NoOpCacheEvictor
@Deprecated public interface CacheEvictor extends Cache.Listener
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Evicts data from aCache. Implementations should callCache.removeSpan(CacheSpan)to evict cache entries based on their eviction policies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidonCacheInitialized()Deprecated.Called when cache has been initialized.voidonStartFile(Cache cache, String key, long position, long length)Deprecated.Called when a writer starts writing to the cache.booleanrequiresCacheSpanTouches()Deprecated.Returns whether the evictor requires theCacheto touchCacheSpanswhen it accesses them.-
Methods inherited from interface com.google.android.exoplayer2.upstream.cache.Cache.Listener
onSpanAdded, onSpanRemoved, onSpanTouched
-
-
-
-
Method Detail
-
requiresCacheSpanTouches
boolean requiresCacheSpanTouches()
Deprecated.Returns whether the evictor requires theCacheto touchCacheSpanswhen it accesses them. Implementations that do not useCacheSpan.lastTouchTimestampshould returnfalse.
-
onCacheInitialized
void onCacheInitialized()
Deprecated.Called when cache has been initialized.
-
onStartFile
void onStartFile(Cache cache, String key, long position, long length)
Deprecated.Called when a writer starts writing to the cache.- Parameters:
cache- The source of the event.key- The key being written.position- The starting position of the data being written.length- The length of the data being written, orC.LENGTH_UNSETif unknown.
-
-