-
Notifications
You must be signed in to change notification settings - Fork 344
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
Add TableView support #743
Conversation
A few things worth noting:
|
Schema Schema | ||
|
||
// SchemaValueType represents the type of values for the given schema. | ||
SchemaValueType reflect.Type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious how does is the Schema related to the SchemaValueType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long! Basically the types have to match, but since Golang has no generics yet, there's no good way of getting the types out of the Schema, and while for things like strings and ints the type can be inferred, in cases like protos there's no way to do that. I guess we can add the field in the Schema itself but that feels like a larger change and isn't useful for most users of schemas?
Sorry for the slow turnaround - I somehow messed up my local dev environment. I've discussed with @nlu90 and filed apache/pulsar#14821, so I'll change the corresponding methods to returning copies of the underlying data. |
@Shoothzj I'm sure I follow your suggestion. Can you make a concrete example? Also, this is just porting the TableView feature already present in Java client to Go, with the same exact semantics. I think we should have a new PIP to add more features TableView |
// sync make sure the tableView's consume progress beyond this time
func (tv *TableViewImpl) sync(time time.Time) {
}
// syncLatest make sure the tableView's consume progress beyond the latestMsgId when this function are called
func (tv *TableViewImpl) syncLatest() {
} @merlimat Thanks, I know the background. I was wondering if we can have methods like the below. If that make sense, I can write a PIP. |
@Shoothzj The question I have on these methods is what would be their usage. Eg: even if you do In the meantime, I'm going ahead to merge this as it includes the features described in PIP-104. |
@merlimat let's continue our discussion in slack. |
Fixes apache/pulsar#13929
Motivation
This adds TableView support to the Golang client so it can have feature parity with the Java client.
See apache/pulsar#12356 and apache/pulsar#12838 for context.
Modifications
Add
TableView
andClient.CreateTableView
and so users can track a keyed topic as a map.Verifying this change
This change added tests and can be verified as follows:
go test -timeout 5s -run ^TestTableView$ github.com/apache/pulsar-client-go/pulsar
Does this pull request potentially affect one of the following parts:
Documentation