-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grain key type isn't saved with the key #1043
Conversation
But there are extension methods on Cannot you use them? |
@gabikliot, the |
Then maybe we should provide a way to query this info? |
I mean, there are already like 5 ways to turn GR into a string. I think we should try to reduce those by providing a better way to extra the encapsulated info, rather then adding yet another |
@gabikliot , I totally agree and I thought about that too. public enum Category : byte
{
None = 0,
SystemTarget = 1,
SystemGrain = 2,
Grain = 3,
Client = 4,
KeyExtGrain = 6,
} into this: public enum Category : byte
{
None = 0,
SystemTarget = 1,
SystemGrain = 2,
GuidKeyGrain = 3,
Client = 4,
KeyExtGrain = 6,
LongKeyGrain = 7
} , and then this: public interface IGrainIdentity
{
Guid PrimaryKey { get; }
long PrimaryKeyLong { get; }
string PrimaryKeyString { get; }
string IdentityString { get; }
long GetPrimaryKeyLong(out string keyExt);
Guid GetPrimaryKey(out string keyExt);
} into this: public interface IGrainIdentity
{
Guid GuidKey { get; }
Nullable<long> LongKey { get; }
string StringKey { get; }
string Identity { get; }
} and then pass Grain.Identity to every |
This is an interesting problem that we've been pushing out for a long time. From the beginning a |
@sergeybykov I agree, that was more of a sketch for the least changes needed. My only concern is current data saved with the "old" enum e.g. Reminders. But, correct me if I'm wrong, upon deserialization of |
I'm currently trying to implement an
IStorageProvider
.The problem I'm facing is the lack of a method to get the original key provided by the user.
AFAIK, Orleans flattens the key to
UniqueKey
which I don't see any way to convert back.I've implemented a method that attempts to do that, but it assumes too much.
the problem is that a
GUID
that its first half is zeros is saved the same as along
.the
UniqueKey.IsLongKey
always returns true if the first half is zeroes.this is a bug, but fixing it will mean you can't use a long key equals to zero or a guid with all zeroes.
I thought about adding another enum value to
UniqueKey.Category
but that will break any current reminders kept without it.