-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: Add the pubsub lite source and settings #17
Conversation
src/main/java/com/google/cloud/pubsublite/flink/PubsubLiteSource.java
Outdated
Show resolved
Hide resolved
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.
This is a bit of a higher level comment. Can we separate out the user interface from the implementation? I.E. create an "internal" folder and put anything users shouldn't touch in it
SourceReaderContext readerContext) throws Exception { | ||
PubsubLiteDeserializationSchema<OUT> schema = settings.deserializationSchema(); | ||
schema.open( | ||
new DeserializationSchema.InitializationContext() { |
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.
does this not exist as a utility?
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.
I don't think so. At least I didn't find other sources using a utility to do this
new PubsubLiteRecordEmitter<>(), | ||
settings.getCursorCommitter(), | ||
settings.getSplitReaderSupplier(), | ||
new Configuration(), |
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.
Hmm is this correct? Is this supposed to be retrieved from somewhere?
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.
This is at least intentional
The only place the the configuration object is used is by the source reader base class here:
I don't really want to expose these settings to users, so I'm just passing in an empty config so we'll use the default value
src/main/java/com/google/cloud/pubsublite/flink/PubsubLiteSourceSettings.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/cloud/pubsublite/flink/PubsubLiteSourceSettings.java
Outdated
Show resolved
Hide resolved
Yeah, that makes sense. I'll move everything in a separate pr |
@AutoValue | ||
public abstract class PubsubLiteSourceSettings<OutputT> implements Serializable { | ||
private static final Logger LOG = LoggerFactory.getLogger(PubsubLiteSourceSettings.class); | ||
private static final long serialVersionUID = 0; |
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.
pick a "random" value. I.E. pound the number keys
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.
Done
|
||
public abstract Boundedness boundedness(); | ||
|
||
public abstract MessageTimestampExtractor timestampSelector(); |
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.
please add an // Optional comment on these that have defaults and add comments on each setting's getter and setter.
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.
Done
|
||
public abstract FlowControlSettings flowControlSettings(); | ||
|
||
public abstract Boundedness boundedness(); |
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.
please make this optional and unbounded by default?
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.
Done
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️