Skip to content
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

IGNITE-15356 .NET: Add basic thin client #306

Merged
merged 175 commits into from
Sep 7, 2021
Merged

Conversation

ptupitsyn
Copy link
Contributor

@ptupitsyn ptupitsyn commented Sep 1, 2021

  • Set up the project structure
  • Establish code style and enable code analysis
  • Implement serialization based on MessagePack-CSharp and ArrayPool.Shared
  • Implement async socket IO
  • Implement basic thin client (tuple, get table, upsert, get)

https://cwiki.apache.org/confluence/display/IGNITE/IEP-78+.NET+Thin+Client

Copy link
Contributor

@isapego isapego left a comment

Choose a reason for hiding this comment

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

Overall looks good.

prefixWriter.Write(7);
prefixWriter.Write(8);
prefixWriter.Write(9);
writer.Flush();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why writer and not prefixWriter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed. Flush is not always necessary, we got lucky here, but it should always be called.

private int _index;

/** Index within the array. */
private int _index2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably needs a better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, fixed.

Comment on lines 101 to 114
byte d = jBytes[15];
byte e = jBytes[14];
byte f = jBytes[13];
byte g = jBytes[12];
byte h = jBytes[11];
byte i = jBytes[10];
byte j = jBytes[9];
byte k = jBytes[8];

int a = BinaryPrimitives.ReadInt32BigEndian(jBytes[4..]);
short b = BinaryPrimitives.ReadInt16BigEndian(jBytes[2..]);
short c = BinaryPrimitives.ReadInt16BigEndian(jBytes);

return new Guid(a, b, c, d, e, f, g, h, i, j, k);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why GUID serialization format is that weird?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Guid and UUID use different encoding, see https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding.
XMLDoc comments updated.

@ptupitsyn ptupitsyn marked this pull request as ready for review September 7, 2021 07:39
@ptupitsyn ptupitsyn merged commit 2149ef0 into apache:main Sep 7, 2021
@ptupitsyn ptupitsyn deleted the ignite-15356 branch September 7, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants