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

Fixed previous offset #7

Open
wants to merge 3 commits into
base: final-connector-ybdb
Choose a base branch
from

Conversation

isha-yb
Copy link

@isha-yb isha-yb commented Feb 28, 2022

No description provided.

@@ -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));
Copy link
Collaborator

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,
Copy link
Collaborator

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))){
Copy link
Collaborator

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)).

Copy link
Collaborator

@suranjan suranjan left a 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());
Copy link
Collaborator

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));
Copy link
Collaborator

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();

Copy link
Collaborator

Choose a reason for hiding this comment

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

why extra space?

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