Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

GSP-111: Add System Metadata In Storage Metadata #111

Merged
merged 7 commits into from
Jun 21, 2021
Merged

Conversation

JinnyYi
Copy link
Contributor

@JinnyYi JinnyYi commented Jun 17, 2021

fix: #84

@JinnyYi JinnyYi changed the title Proposal: Add Service Metadata In Storage Metadata GSP-111: Add Service Metadata In Storage Metadata Jun 17, 2021
Comment on lines 49 to 56
For service metadata, we will introduce `Strong Typed Service Metadata` like `ObjectMetadata`. We will generate following struct for specific service according to service pairs:

```go
type ServiceMetadata struct {
<service meta> <type>
...
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly?

  • In go-storage/types, there are type Object (has field serviceMetadata interface{}), and StorageMeta
  • In go-service-* type ObjectMetadata is used to set serviceMetadata, and has getter GetObjectMetadata

Now, this proposal intends to also add the field serviceMetadata interface{} to StorageMeta. Should the go-service-* type be called StorageMetadata?

And I'm wondering why type Object and StorageMeta are at the same level 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to rename go-service-*.ObjectMetadata into something like go-service-*.ServiceObjectMetadata to avoid confusion? (and correspondingly, ServiceStorageMeta in this proposal.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root cause is Object is a struct but Storager is an interface.

If Storage is a struct that exposed to the user, we can set serviceMetadata in Storage struct just like we do on Object.

Well, StorageMeta and StorageMetadata do look wired to me too. Do you have a better idea/name for that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the most wired one is that both go-storage.Object and go-storage.StorageMeta will have field serviceMetadata,

but go-service-*.ServiceMetadata will be the one that belongs to StorageMeta. This seems to be rather confusing

Copy link
Contributor

@Xuanwo Xuanwo Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it.

The problem is introduced by simplify

  • Service Level/Specified Object Metadata to serviceMetadata in Object
  • Service Level/Specified Storage Metadata to serviceMetadata in StorageMeta

But I don't have better ideas about the name.

Copy link
Contributor

@xxchan xxchan Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ServiceObjectMetadata and ServiceStorageMetadata?

Naming is so difficult!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can find the opposite word of global to represent all those situations? So we can:

  • Distinguish Service Pair and Service's Pair
  • Distinguish Service Metadata and Service's Metadata
  • ...

And our API will turn into:

func GetObjectXxxxMetadata(o* Object) ObjectXxxxMetadata
func GetStorageXxxxMetadata(s *StorageMeta) StorageXxxxMetadata

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Distinguish Service Pair and Service's Pair
  • Distinguish Service Metadata and Service's Metadata

Do I understand correctly?

  • Service Pair could be all the pairs in the current service. Service's Pair just means pairs related to the service implementations.
  • Service Metadata includes object service metadata and storage service metadata. Service's Metadata could corresponds to StorageMeta here.

@Xuanwo
Copy link
Contributor

Xuanwo commented Jun 21, 2021

ping @JinnyYi , Let's use system to replace service here, as we discussed in https://matrix.to/#/!l8rnxDAEOzBxO84I:aos.dev/$tVsHCWfTTcIJTL_Zxu0WvtVaeyJt3iJHplJGfHhqAAk

@Xuanwo
Copy link
Contributor

Xuanwo commented Jun 21, 2021

ping @xxchan @Prnyself for final review.

@Xuanwo Xuanwo merged commit a3de4b0 into master Jun 21, 2021
@Xuanwo Xuanwo deleted the service-metadata branch June 21, 2021 07:54
@JinnyYi JinnyYi changed the title GSP-111: Add Service Metadata In Storage Metadata GSP-111: Add System Metadata In Storage Metadata Jun 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add service related metadata in StorageMeta
3 participants