Skip to content

First stab #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

First stab #1

wants to merge 1 commit into from

Conversation

immesys
Copy link
Member

@immesys immesys commented Nov 25, 2019

Still more documentation required, probably some helper classes for inserting, and definitely more testing.

Any feedback so far?

Copy link
Collaborator

@bbengfort bbengfort left a comment

Choose a reason for hiding this comment

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

Looks great so far - and you've done a fairly complete implementation. I think this counts towards our language bindings count! Nice work!

this.Min = count == 0 ? null : min;
this.Mean = count == 0 ? null : mean;
this.Max = count == 0 ? null : max;
this.Stddev = count == 0 ? null : stddev;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This at least is the one place where I prefer C# over Go … the ability to set primitive types to nil without a pointer!

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, you do need to declare them as nullable.

/// <summary>
/// The UUID of the stream
/// </summary>
private readonly Guid id;
Copy link
Collaborator

Choose a reason for hiding this comment

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

private readonly allows external callers to read the id but not write to it, or is it private and can only be set in the constructor? There are a few ingest related use cases, e.g. list_collections where access to the uuid is good to have. Would it be good to have an accessor, to allow public readers to access the property, e.g. UUID()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, definitely want to have the UUID available, good catch

/// <summary>
/// The tags for the stream, may be null
/// </summary>
private Dictionary<string, string> tags;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just for my own reference, does C# allow null strings so we don't have to deal with any of that pointer business?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep

throw new NotImplementedException("not implemented");
var p = new V5Api.StreamInfoParams
{
Uuid = ByteString.CopyFrom(id.ToByteArray()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a go programmer thing to caps the Uuid? Or is this also a C# thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is actually a property, so it should be capitalized as part of C# style. More specifically though, this property is autogenerated from protobuf

/// <param name="end">The (exclusive) ending timestamp in nanoseconds since the Unix Epoch (Jan 1st 1970)</param>
/// <param name="version">The version of the stream to query. If unspecified, the latest version will be used</param>
/// <returns>A Cursor of RawValues that can be enumerated. <see cref="ICursor"/></returns>
public ICursor<RawPoint> RawValues(long start, long end, ulong version = BTrDB.LatestVersion)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I very much like this ICursor interface … I know you did extra work to get the Wait() in there and I think it's going to pay off.

Copy link
Member Author

Choose a reason for hiding this comment

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

That ICursor was the result of many iterations...

lastmaj = res.VersionMajor;
lastmin = res.VersionMinor;
}
return (lastmaj, lastmin);
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 going to be nice to send any size iterable at this and have it batch for us. We may want to put suggested batch size as a constant outside the func in case we want to write concurrent inserts from PI

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, will move it

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