Top Description Inners Fields Constructors Methods
io.netty.resolver.dns

pack-priv final Class DnsQueryIdSpace

extends Object
Class Inheritance
Imports
io.netty.util.internal.MathUtil, .PlatformDependent, .ThreadLocalRandom, java.util.Random

Special data-structure that will allow to retrieve the next query id to use, while still guarantee some sort of randomness. The query id will be between 0 (inclusive) and 65535 (inclusive) as defined by the RFC.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
DnsQueryIdSpace.DnsQueryIdRange

Provides a query if from a range of possible ids.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private final DnsQueryIdSpace.DnsQueryIdRange[]
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the maximum number of ids.
maxUsableIds
()

Return the maximum number of ids that are supported.

private static DnsQueryIdSpace.DnsQueryIdRange
newBucket(int idBucketsIdx)

pack-priv int

Returns:

next id to use.
nextId
()

Returns the next ID to use for a query or -1 if there is none left to use.

pack-priv void
pushId(int
the id.
id
)

Push back the id, so it can be used again for the next query.

pack-priv int

Returns:

the number of ids that are left for usage.
usableIds
()

Return how much more usable ids are left.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUCKET_DROP_THRESHOLDback to summary
private static final int BUCKET_DROP_THRESHOLD
BUCKET_SIZEback to summary
private static final int BUCKET_SIZE
BUCKETSback to summary
private static final int BUCKETS
idBucketsback to summary
private final DnsQueryIdSpace.DnsQueryIdRange[] idBuckets
MAX_IDback to summary
private static final int MAX_ID

Constructor Detail

DnsQueryIdSpaceback to summary
pack-priv DnsQueryIdSpace()

Method Detail

maxUsableIdsback to summary
pack-priv int maxUsableIds()

Return the maximum number of ids that are supported.

Returns:int

the maximum number of ids.

newBucketback to summary
private static DnsQueryIdSpace.DnsQueryIdRange newBucket(int idBucketsIdx)
nextIdback to summary
pack-priv int nextId()

Returns the next ID to use for a query or -1 if there is none left to use.

Returns:int

next id to use.

pushIdback to summary
pack-priv void pushId(int id)

Push back the id, so it can be used again for the next query.

Parameters
id:int

the id.

usableIdsback to summary
pack-priv int usableIds()

Return how much more usable ids are left.

Returns:int

the number of ids that are left for usage.

io.netty.resolver.dns back to summary

private final Class DnsQueryIdSpace.DnsQueryIdRange

extends Object
Class Inheritance

Provides a query if from a range of possible ids.

Field Summary

Modifier and TypeField and Description
private int
private final short[]
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
DnsQueryIdRange(int bucketSize, int startId)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the maximum number of ids.
maxUsableIds
()

Return the maximum number of ids that are supported.

pack-priv int

Returns:

next id to use.
nextId
()

Returns the next ID to use for a query or -1 if there is none left to use.

pack-priv void
pushId(int
the id.
id
)

Push back the id, so it can be used again for the next query.

pack-priv int

Returns:

the number of ids that are left for usage.
usableIds
()

Return how much more usable ids are left.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private int count
idsback to summary
private final short[] ids
startIdback to summary
private final int startId

Constructor Detail

DnsQueryIdRangeback to summary
pack-priv DnsQueryIdRange(int bucketSize, int startId)

Method Detail

maxUsableIdsback to summary
pack-priv int maxUsableIds()

Return the maximum number of ids that are supported.

Returns:int

the maximum number of ids.

nextIdback to summary
pack-priv int nextId()

Returns the next ID to use for a query or -1 if there is none left to use.

Returns:int

next id to use.

pushIdback to summary
pack-priv void pushId(int id)

Push back the id, so it can be used again for the next query.

Parameters
id:int

the id.

usableIdsback to summary
pack-priv int usableIds()

Return how much more usable ids are left.

Returns:int

the number of ids that are left for usage.