Skip to content

Commit

Permalink
rename vtts
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanck committed Oct 27, 2023
1 parent 2b376f2 commit 8b5d469
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class CommitCompletePayload implements Payload {

private UUID commitId;
private Long vtts;
private Long validThroughTs;
private final Schema avroSchema;

private static final Schema AVRO_SCHEMA =
Expand All @@ -42,7 +42,7 @@ public class CommitCompletePayload implements Payload {
.prop(AvroSchemaUtil.FIELD_ID_PROP, 1000)
.type(UUID_SCHEMA)
.noDefault()
.name("vtts")
.name("validThroughTs")
.prop(AvroSchemaUtil.FIELD_ID_PROP, 1001)
.type()
.nullable()
Expand All @@ -55,9 +55,9 @@ public CommitCompletePayload(Schema avroSchema) {
this.avroSchema = avroSchema;
}

public CommitCompletePayload(UUID commitId, Long vtts) {
public CommitCompletePayload(UUID commitId, Long validThroughTs) {
this.commitId = commitId;
this.vtts = vtts;
this.validThroughTs = validThroughTs;
this.avroSchema = AVRO_SCHEMA;
}

Expand All @@ -69,8 +69,8 @@ public UUID commitId() {
* Valid-through timestamp, which is the min-of-max record timestamps across all workers for the
* commit.
*/
public Long vtts() {
return vtts;
public Long validThroughTs() {
return validThroughTs;
}

@Override
Expand All @@ -86,7 +86,7 @@ public void put(int i, Object v) {
this.commitId = (UUID) v;
return;
case 1:
this.vtts = (Long) v;
this.validThroughTs = (Long) v;
return;
default:
// ignore the object, it must be from a newer version of the format
Expand All @@ -99,7 +99,7 @@ public Object get(int i) {
case 0:
return commitId;
case 1:
return vtts;
return validThroughTs;
default:
throw new UnsupportedOperationException("Unknown field ordinal: " + i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CommitTablePayload implements Payload {
private UUID commitId;
private TableName tableName;
private Long snapshotId;
private Long vtts;
private Long validThroughTs;
private final Schema avroSchema;

private static final Schema AVRO_SCHEMA =
Expand All @@ -54,7 +54,7 @@ public class CommitTablePayload implements Payload {
.nullable()
.longType()
.noDefault()
.name("vtts")
.name("validThroughTs")
.prop(AvroSchemaUtil.FIELD_ID_PROP, 1403)
.type()
.nullable()
Expand All @@ -67,11 +67,12 @@ public CommitTablePayload(Schema avroSchema) {
this.avroSchema = avroSchema;
}

public CommitTablePayload(UUID commitId, TableName tableName, Long snapshotId, Long vtts) {
public CommitTablePayload(
UUID commitId, TableName tableName, Long snapshotId, Long validThroughTs) {
this.commitId = commitId;
this.tableName = tableName;
this.snapshotId = snapshotId;
this.vtts = vtts;
this.validThroughTs = validThroughTs;
this.avroSchema = AVRO_SCHEMA;
}

Expand All @@ -87,8 +88,8 @@ public Long snapshotId() {
return snapshotId;
}

public Long vtts() {
return vtts;
public Long validThroughTs() {
return validThroughTs;
}

@Override
Expand All @@ -110,7 +111,7 @@ public void put(int i, Object v) {
this.snapshotId = (Long) v;
return;
case 3:
this.vtts = (Long) v;
this.validThroughTs = (Long) v;
return;
default:
// ignore the object, it must be from a newer version of the format
Expand All @@ -127,7 +128,7 @@ public Object get(int i) {
case 2:
return snapshotId;
case 3:
return vtts;
return validThroughTs;
default:
throw new UnsupportedOperationException("Unknown field ordinal: " + i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void testCommitTableSerialization() {
assertThat(payload.commitId()).isEqualTo(commitId);
assertThat(payload.tableName().toIdentifier()).isEqualTo(TableIdentifier.parse("db.tbl"));
assertThat(payload.snapshotId()).isEqualTo(1L);
assertThat(payload.vtts()).isEqualTo(2L);
assertThat(payload.validThroughTs()).isEqualTo(2L);
}

@Test
Expand All @@ -127,6 +127,6 @@ public void testCommitCompleteSerialization() {
assertThat(result.type()).isEqualTo(event.type());
CommitCompletePayload payload = (CommitCompletePayload) result.payload();
assertThat(payload.commitId()).isEqualTo(commitId);
assertThat(payload.vtts()).isEqualTo(2L);
assertThat(payload.validThroughTs()).isEqualTo(2L);
}
}

0 comments on commit 8b5d469

Please sign in to comment.