[#28] storagegroup: Measure lifetime in NeoFS epochs

In previous version of the format storage group lifetime was measured in two
epoch times: NeoFS and Unix. Since unix is not processed in the system,
this commit narrows the time point of storage group expiration to the
system epoch number. The storagegroup.StorageGroup.Lifetime message has
therefore been deleted as no longer used.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-05 11:41:51 +03:00 committed by Stanislav Bogatyrev
parent 248a91b329
commit 487b84e614
2 changed files with 3 additions and 45 deletions

View file

@ -7,7 +7,6 @@
- Messages
- [StorageGroup](#storagegroup.StorageGroup)
- [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime)
- [Scalar Value Types](#scalar-value-types)
@ -33,36 +32,11 @@
| ----- | ---- | ----- | ----------- |
| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group |
| ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group |
| lifetime | [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) | | Lifetime is time until storage group is valid |
| ExpirationEpoch | [uint64](#uint64) | | ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. |
| Members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. |
<a name="storagegroup.StorageGroup.Lifetime"></a>
### Message StorageGroup.Lifetime
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| unit | [StorageGroup.Lifetime.Unit](#storagegroup.StorageGroup.Lifetime.Unit) | | Unit is lifetime type |
| Value | [int64](#int64) | | Value for lifetime |
<!-- end messages -->
<a name="storagegroup.StorageGroup.Lifetime.Unit"></a>
### StorageGroup.Lifetime.Unit
| Name | Number | Description |
| ---- | ------ | ----------- |
| Unlimited | 0 | Unlimited set if storage group always valid |
| NeoFSEpoch | 1 | NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch |
| UnixTime | 2 | UnixTime set if storage group is valid until lifetime unix timestamp |
<!-- end enums -->

View file

@ -11,24 +11,8 @@ message StorageGroup {
// ValidationHash is homomorphic hash of all object's payloads included into storage group
bytes ValidationHash = 2;
message Lifetime {
enum Unit {
// Unlimited set if storage group always valid
Unlimited = 0;
// NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch
NeoFSEpoch = 1;
// UnixTime set if storage group is valid until lifetime unix timestamp
UnixTime = 2;
}
// Unit is lifetime type
Unit unit = 1;
// Value for lifetime
int64 Value = 2;
}
// Lifetime is time until storage group is valid
Lifetime lifetime = 3;
// ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime.
uint64 ExpirationEpoch = 3;
// Members carries the list of identifiers of the object storage group members.
// The list is strictly ordered.