Module org.elasticsearch.compute
Package org.elasticsearch.compute.lucene
Record Class ShardRefCounted.Single
java.lang.Object
java.lang.Record
org.elasticsearch.compute.lucene.ShardRefCounted.Single
- All Implemented Interfaces:
ShardRefCounted
- Enclosing interface:
ShardRefCounted
public static record ShardRefCounted.Single(int index, org.elasticsearch.core.RefCounted refCounted)
extends Record
implements ShardRefCounted
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.lucene.ShardRefCounted
ShardRefCounted.Single -
Field Summary
Fields inherited from interface org.elasticsearch.compute.lucene.ShardRefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionSingle(int index, org.elasticsearch.core.RefCounted refCounted) Creates an instance of aSinglerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.elasticsearch.core.RefCountedget(int shardId) final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.org.elasticsearch.core.RefCountedReturns the value of therefCountedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Single
public Single(int index, org.elasticsearch.core.RefCounted refCounted) Creates an instance of aSinglerecord class.- Parameters:
index- the value for theindexrecord componentrefCounted- the value for therefCountedrecord component
-
-
Method Details
-
get
public org.elasticsearch.core.RefCounted get(int shardId) - Specified by:
getin interfaceShardRefCounted- Parameters:
shardId- The shard index used byDocVector.- Returns:
- the
RefCountedfor the given shard. In production, this will almost always be aShardContext.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
refCounted
public org.elasticsearch.core.RefCounted refCounted()Returns the value of therefCountedrecord component.- Returns:
- the value of the
refCountedrecord component
-