-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fixed previous offset #7
base: final-connector-ybdb
Are you sure you want to change the base?
Conversation
@@ -333,7 +336,7 @@ private String readOptionalString(Map<String, ?> offset, String key) { | |||
public YugabyteDBOffsetContext load(Map<String, ?> offset) { | |||
|
|||
LOGGER.debug("The offset being loaded in YugabyteDBOffsetContext.. " + offset); | |||
|
|||
OpId opid1 = OpId.valueOf((String) offset.get(YugabyteDBOffsetContext.LAST_COMPLETELY_PROCESSED_LSN_KEY)); |
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.
Use a better variable name
new OpId(0, 0, null, 0, 0), | ||
new OpId(0, 0, null, 0, 0), | ||
new OpId(0, 0, null, 0, 0), | ||
opid1, |
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.
What happens when there is no offset loaded?
@@ -278,6 +278,9 @@ private void getChanges2(ChangeEventSourceContext context, | |||
for (Pair<String, String> entry : tabletPairList) { | |||
final String tabletId = entry.getValue(); | |||
offsetContext.initSourceInfo(tabletId, this.connectorConfig); | |||
if(offsetContext.lsn(tabletId).equals(new OpId(0,0,null,0,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.
Check formatting, if we init then lsn will always be new OpId(0,0,null,0,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.
Indentation
@@ -278,6 +278,7 @@ private void getChanges2(ChangeEventSourceContext context, | |||
for (Pair<String, String> entry : tabletPairList) { | |||
final String tabletId = entry.getValue(); | |||
offsetContext.initSourceInfo(tabletId, this.connectorConfig); | |||
offsetContext.getSourceInfo(tabletId).updateLastCommit(offsetContext.lastCompletelyProcessedLsn()); |
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 take care of indentation!
|
||
OpId lastCompletelyProcessedLsn; | ||
if(offset != null){ | ||
lastCompletelyProcessedLsn = OpId.valueOf((String) offset.get(YugabyteDBOffsetContext.LAST_COMPLETELY_PROCESSED_LSN_KEY)); |
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.
indentation?
@@ -60,7 +60,7 @@ private YugabyteDBOffsetContext(YugabyteDBConnectorConfig connectorConfig, | |||
// sourceInfo.update(lsn, time, txId, null, sourceInfo.xmin()); | |||
sourceInfo.updateLastCommit(lastCommitLsn); | |||
sourceInfoSchema = sourceInfo.schema(); | |||
|
|||
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.
why extra space?
No description provided.