Skip to content

The new objectDescriptor object. #21

@SUMUKHA-PK

Description

@SUMUKHA-PK

This issue demands a new descriptor type ObjectDescriptor and LockDescriptor over the old SimpleDescriptor.

SimpleDescriptor has both the ID of the object to be acquired and the Owner that needs to acquire it. While this makes sense for having complete details about the lock being acquired and that needs to be maintained in the map, this doesn't make sense when the lock is being pounced on. The lock that has to be pounced on cannot be described by a SimpleDescriptor but needs just the description of the object.

Thus, on separating these concerns I propose the following:

  • SimpleDescriptor gets a more meaningful name - LockDescriptor and has all data fields the same.
  • A new descriptor ObjectDescriptor that has only the ID of the object in it.

This suffices the needs of the pouncing feature.

Edit: The main reason for the move is the pouncers map in the lock client that needs to map the ObjectDescriptors to the slice of the pouncers and not a SimpleDescriptor to the slice of owners. The move is proposed so that in the future we can easily add fields to the struct of ObjectDescriptor and have our code function.

Edit 2: This also means that now, Watch can also take in ObjectDescriptor as it's argument instead of the SimpleDescriptor.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions