PartitionOwnership Class

  • java.lang.Object
    • com.azure.messaging.eventhubs.models.PartitionOwnership

public class PartitionOwnership

A model class to hold partition ownership information.

Constructor Summary

Constructor Description
PartitionOwnership()

Creates a new instance.

Method Summary

Modifier and Type Method and Description
String getConsumerGroup()

Gets the consumer group name associated with this ownership record.

String getETag()

Gets the ETag that was generated by the last known successful update to the partition ownership record.

String getEventHubName()

Gets the Event Hub name associated with this ownership record.

String getFullyQualifiedNamespace()

Returns the fully qualified namespace of the Event Hub.

Long getLastModifiedTime()

Gets the last modified time of this ownership record as epoch millis.

String getOwnerId()

Sets the unique event processor identifier as the owner of the partition id in this ownership record.

String getPartitionId()

Gets the partition id associated with this ownership record.

PartitionOwnership setConsumerGroup(String consumerGroup)

Sets the consumer group name associated with this ownership record.

PartitionOwnership setETag(String eTag)

Sets the ETag with the last known successful update to partition ownership record.

PartitionOwnership setEventHubName(String eventHubName)

Sets the Event Hub name associated with this ownership record.

PartitionOwnership setFullyQualifiedNamespace(String fullyQualifiedNamespace)

Sets the fully qualified namespace of the Event Hub.

PartitionOwnership setLastModifiedTime(Long lastModifiedTime)

Sets the last modified time of this ownership record as epoch millis.

PartitionOwnership setOwnerId(String ownerId)

Returns the unique event processor identifier that owns the partition id in this ownership record.

PartitionOwnership setPartitionId(String partitionId)

Sets the partition id associated with this ownership record.

Methods inherited from java.lang.Object

Constructor Details

PartitionOwnership

public PartitionOwnership()

Creates a new instance.

Method Details

getConsumerGroup

public String getConsumerGroup()

Gets the consumer group name associated with this ownership record.

Returns:

The consumer group name associated with this ownership record.

getETag

public String getETag()

Gets the ETag that was generated by the last known successful update to the partition ownership record. An ETag is a unique identifier * that is generated when a data record is successfully created/updated. The ETag is used to achieve optimistic concurrency in a distributed event processor setup. When multiple instances of event processor try to update the same partition ownership record, ETag is used to verify that the last values read by the instance requesting the update is still the latest ETag for this record. If the ETag in the store does not match the ETag in the update request, then the update is expected to fail as there was an update since the last time an event processor read this record.

Returns:

The eTag for this ownership record.

getEventHubName

public String getEventHubName()

Gets the Event Hub name associated with this ownership record.

Returns:

The Event Hub name associated with this ownership record.

getFullyQualifiedNamespace

public String getFullyQualifiedNamespace()

Returns the fully qualified namespace of the Event Hub.

Returns:

the fully qualified namespace of the Event Hub.

getLastModifiedTime

public Long getLastModifiedTime()

Gets the last modified time of this ownership record as epoch millis.

Returns:

The last modified time of this ownership record as epoch millis.

getOwnerId

public String getOwnerId()

Sets the unique event processor identifier as the owner of the partition id in this ownership record.

Returns:

The unique event processor identifier as the owner of the partition id in this ownership record.

getPartitionId

public String getPartitionId()

Gets the partition id associated with this ownership record.

Returns:

The partition id associated with this ownership record.

setConsumerGroup

public PartitionOwnership setConsumerGroup(String consumerGroup)

Sets the consumer group name associated with this ownership record.

Parameters:

consumerGroup - The consumer group name associated with this ownership record.

Returns:

The updated PartitionOwnership instance.

setETag

public PartitionOwnership setETag(String eTag)

Sets the ETag with the last known successful update to partition ownership record. An ETag is a unique identifier that is generated when a data record is successfully created/updated. This ETag is used to achieve optimistic concurrency in a distributed event processor setup. When multiple instances of event processor try to update the same partition ownership record, ETag is used to verify that the last values read by the instance requesting the update is still the latest ETag for this record. If the ETag in the store does not match the ETag in the update request, then the update is expected to fail as there was an update since the last time an event processor read this record.

Parameters:

eTag - The eTag for this ownership record.

Returns:

The updated PartitionOwnership instance.

setEventHubName

public PartitionOwnership setEventHubName(String eventHubName)

Sets the Event Hub name associated with this ownership record.

Parameters:

eventHubName - The Event Hub name associated with this ownership record.

Returns:

The updated PartitionOwnership instance.

setFullyQualifiedNamespace

public PartitionOwnership setFullyQualifiedNamespace(String fullyQualifiedNamespace)

Sets the fully qualified namespace of the Event Hub.

Parameters:

fullyQualifiedNamespace - the fully qualified namespace of the Event Hub.

Returns:

The updated PartitionOwnership instance.

setLastModifiedTime

public PartitionOwnership setLastModifiedTime(Long lastModifiedTime)

Sets the last modified time of this ownership record as epoch millis.

Parameters:

lastModifiedTime - The last modified time of this ownership record as epoch millis.

Returns:

The updated PartitionOwnership instance.

setOwnerId

public PartitionOwnership setOwnerId(String ownerId)

Returns the unique event processor identifier that owns the partition id in this ownership record.

Parameters:

ownerId - The unique event processor identifier that owns the partition id in this ownership record.

Returns:

The updated PartitionOwnership instance.

setPartitionId

public PartitionOwnership setPartitionId(String partitionId)

Sets the partition id associated with this ownership record.

Parameters:

partitionId - The partition id associated with this ownership record.

Returns:

The updated PartitionOwnership instance.

Applies to