Package org.apache.lucene.replicator.nrt

# Record Class CopyState

java.lang.Object
java.lang.Record
org.apache.lucene.replicator.nrt.CopyState

Record Components:
  `infos` - only non-null on the primary node

public record CopyState(Map<String,FileMetaData> files, long version, long gen, byte[] infosBytes, Set<String> completedMergeFiles, long primaryGen, SegmentInfos infos) extends Record
Holds incRef'd file level details for one point-in-time segment infos on the primary node.

WARNING: This API is experimental and might change in incompatible ways in the next release.

## Constructor Summary

Constructors
Constructor
Description
`CopyState(Map<String,FileMetaData> files, long version, long gen, byte[] infosBytes, Set<String> completedMergeFiles, long primaryGen, SegmentInfos infos)`
Creates an instance of a `CopyState` record class.

## Method Summary

Modifier and Type
Method
Description
`Set<String>`
`completedMergeFiles()`
Returns the value of the `completedMergeFiles` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`Map<String,FileMetaData>`
`files()`
Returns the value of the `files` record component.
`long`
`gen()`
Returns the value of the `gen` record component.
`final int`
`hashCode()`
Returns a hash code value for this object.
`SegmentInfos`
`infos()`
Returns the value of the `infos` record component.
`byte[]`
`infosBytes()`
Returns the value of the `infosBytes` record component.
`long`
`primaryGen()`
Returns the value of the `primaryGen` record component.
`String`
`toString()`
Returns a string representation of this record class.
`long`
`version()`
Returns the value of the `version` record component.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### CopyState

public CopyState(Map<String,FileMetaData> files, long version, long gen, byte[] infosBytes, Set<String> completedMergeFiles, long primaryGen, SegmentInfos infos)
Creates an instance of a `CopyState` record class.

Parameters:
  `files` - the value for the `files` record component
  `version` - the value for the `version` record component
  `gen` - the value for the `gen` record component
  `infosBytes` - the value for the `infosBytes` record component
  `completedMergeFiles` - the value for the `completedMergeFiles` record component
  `primaryGen` - the value for the `primaryGen` record component
  `infos` - the value for the `infos` record component

## Method Details

### toString

public String 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.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### 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.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
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 with `Objects::equals(Object,Object)`; primitive components are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### files

public Map<String,FileMetaData> files()
Returns the value of the `files` record component.

Returns:
  the value of the `files` record component

### version

public long version()
Returns the value of the `version` record component.

Returns:
  the value of the `version` record component

### gen

public long gen()
Returns the value of the `gen` record component.

Returns:
  the value of the `gen` record component

### infosBytes

public byte[] infosBytes()
Returns the value of the `infosBytes` record component.

Returns:
  the value of the `infosBytes` record component

### completedMergeFiles

public Set<String> completedMergeFiles()
Returns the value of the `completedMergeFiles` record component.

Returns:
  the value of the `completedMergeFiles` record component

### primaryGen

public long primaryGen()
Returns the value of the `primaryGen` record component.

Returns:
  the value of the `primaryGen` record component

### infos

public SegmentInfos infos()
Returns the value of the `infos` record component.

Returns:
  the value of the `infos` record component