Skip to content

Commit

Permalink
Merge branch 'main' into pool-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat committed Sep 21, 2024
2 parents 34b9f01 + 5b8d658 commit 6421bc8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/client/common/io_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ func TestWriteOutput(t *testing.T) {
CreatedTimestamp: time.UnixMilli(2),
ModifiedTimestamp: time.UnixMilli(3),
ModificationsCount: 1,
SessionId: 5,
}, "{\"key\":\"my-key\",\"version_id\":1,\"created_timestamp\":\"" + time.UnixMilli(2).Format(time.RFC3339Nano) +
"\",\"modified_timestamp\":\"" + time.UnixMilli(3).Format(time.RFC3339Nano) +
"\",\"modifications_count\":1,\"ephemeral\":false,\"client_identity\":\"\"}\n"},
"\",\"modifications_count\":1,\"ephemeral\":false,\"session_id\":5,\"client_identity\":\"\"}\n"},
} {
t.Run(test.name, func(t *testing.T) {
b := bytes.NewBufferString("")
Expand Down
1 change: 1 addition & 0 deletions cmd/client/common/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type OutputVersion struct {
ModifiedTimestamp time.Time `json:"modified_timestamp"`
ModificationsCount int64 `json:"modifications_count"`
Ephemeral bool `json:"ephemeral"`
SessionId int64 `json:"session_id"`
ClientIdentity string `json:"client_identity"`
}

Expand Down
1 change: 1 addition & 0 deletions cmd/client/get/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func exec(cmd *cobra.Command, args []string) error {
ModifiedTimestamp: time.UnixMilli(int64(version.ModifiedTimestamp)),
ModificationsCount: version.ModificationsCount,
Ephemeral: version.Ephemeral,
SessionId: version.SessionId,
ClientIdentity: version.ClientIdentity,
})
}
Expand Down
4 changes: 4 additions & 0 deletions oxia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ type Version struct {
// Whether the record is ephemeral. See [Ephemeral]
Ephemeral bool

// For ephemeral records, the identifier of the session to which this record lifecycle
// is attached to. Non-ephemeral records will always report 0.
SessionId int64

// For ephemeral records, the unique identity of the Oxia client that did last modify it.
// It will be empty for all non-ephemeral records.
ClientIdentity string
Expand Down

0 comments on commit 6421bc8

Please sign in to comment.