ConcurrentSizedTimeoutCache

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 int capacity
final int concurrencyLevel
final long timeout
@Nonnull final TimeUnit timeoutUnit
@Nonnull final Function computeKey
@Nonnull final Function computeValue
@Nullable final BiConsumer destroyer

CleanupFutureAction

public new CleanupFutureAction (this.future)

Method CleanupFutureAction.

Parameters:
this.future this.future

shutdown

public void shutdown ()

Method shutdown.

cleanup

public void cleanup ()

Method cleanup.

get

public V get (final K key)

Method get.

Parameters:
final K key

noopDestroy

static void noopDestroy (final K key, final V value)

Method noopDestroy.

Parameters:
final K key
final V value

Bucket

public public Bucket (final int capacity, final long timeout_ns)

Method Bucket.

Parameters:
final int capacity
final long timeout_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 K key
@Nonnull final Function computeKey
@Nonnull final Function computeValue
@Nonnull final BiConsumer destroyer

clear

public void clear (@Nonnull final BiConsumer destroyer)

Method clear.

Parameters:
@Nonnull final BiConsumer destroyer

CacheEntry

public private CacheEntry ()

Method CacheEntry.

markAndGet

protected V markAndGet (final long timestamp)

Method markAndGet.

Parameters:
final long timestamp