Skip to content

Fixed previous offset#7

Open
isha-yb wants to merge 3 commits intofinal-connector-ybdbfrom
iamoncar-final-connector
Open

Fixed previous offset#7
isha-yb wants to merge 3 commits intofinal-connector-ybdbfrom
iamoncar-final-connector

Conversation

@isha-yb
Copy link

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

No description provided.


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?

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

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?

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