public class ConcurrentSizedTimeoutCache
Class ConcurrentSizedTimeoutCache. Provides concurrentsizedtimeoutcache functionality for the Hytale server.
java.lang.Object > ConcurrentSizedTimeoutCache
Field Summary
timeout_ns
final
long
timeout_ns
Field timeout_ns.
bucketCount
final
int
bucketCount
Field bucketCount.
bucketCapacity
final
int
bucketCapacity
Field bucketCapacity.
hash
final
int
hash
Field hash.
timestamp
final
long
timestamp
Field timestamp.
readStamp
final
long
readStamp
Field readStamp.
newKey
final
K
newKey
Field newKey.
newValue
final
V
newValue
Field newValue.
writeStamp
final
long
writeStamp
Field writeStamp.
needsTrim
final
boolean
needsTrim
Field needsTrim.
expireTimestamp
final
long
expireTimestamp
Field expireTimestamp.
key
public
K
key
Field key.
value
public
V
value
Field value.
Method Detail
ConcurrentSizedTimeoutCache
public
public
ConcurrentSizedTimeoutCache
(final int capacity, final int concurrencyLevel, final long timeout, @Nonnull final TimeUnit timeoutUnit, @Nonnull final Function computeKey, @Nonnull final Function computeValue, @Nullable final BiConsumer destroyer)
Method ConcurrentSizedTimeoutCache.
- Parameters:
final intcapacityfinal intconcurrencyLevelfinal longtimeout@Nonnull final TimeUnittimeoutUnit@Nonnull final FunctioncomputeKey@Nonnull final FunctioncomputeValue@Nullable final BiConsumerdestroyer
CleanupFutureAction
public
new
CleanupFutureAction
(this.future)
Method CleanupFutureAction.
- Parameters:
this.futurethis.future
shutdown
public
void
shutdown
()
Method shutdown.
cleanup
public
void
cleanup
()
Method cleanup.
get
public
V
get
(final K key)
Method get.
- Parameters:
final Kkey
noopDestroy
static
void
noopDestroy
(final K key, final V value)
Method noopDestroy.
- Parameters:
final Kkeyfinal Vvalue
Bucket
public
public
Bucket
(final int capacity, final long timeout_ns)
Method Bucket.
- Parameters:
final intcapacityfinal longtimeout_ns
compute
public
V
compute
(@Nonnull final K key, @Nonnull final Function computeKey, @Nonnull final Function computeValue, @Nonnull final BiConsumer destroyer)
Method compute.
- Parameters:
@Nonnull final Kkey@Nonnull final FunctioncomputeKey@Nonnull final FunctioncomputeValue@Nonnull final BiConsumerdestroyer
clear
public
void
clear
(@Nonnull final BiConsumer destroyer)
Method clear.
- Parameters:
@Nonnull final BiConsumerdestroyer
CacheEntry
public
private
CacheEntry
()
Method CacheEntry.
markAndGet
protected
V
markAndGet
(final long timestamp)
Method markAndGet.
- Parameters:
final longtimestamp