Skip to content

add zero padding, insert order, and time stamp in text#50546

Merged
craig[bot] merged 1 commit intomasterfrom
workload/ycsb-add-insertorder-and-zeropadding
Jul 1, 2020
Merged

add zero padding, insert order, and time stamp in text#50546
craig[bot] merged 1 commit intomasterfrom
workload/ycsb-add-insertorder-and-zeropadding

Conversation

@robert-s-lee
Copy link
Copy Markdown
Contributor

@robert-s-lee robert-s-lee commented Jun 23, 2020

--insert-hash=true creates user1, user2 for ycsb_key
--zero-padding=2 creates user01, user02 for ycsb_key
--time-string=true creates field[0-9] with

2020-06-23 13:23:58.529711+00:00DwYFKxzTOKqgYwdHZNmbzdkRfINphVojmwiDbhaFsEnFHRpxSJQdSRnXOrQbjJhjYzko

instead of

rmArXhKIjbpTAPwyjDNsmkGTLXWNQHQCLAyKwWFOrlopXliOKqQANpakAxsmqfPzYSvAhgYYVQQDhUEuXCVuvsEdJrrguNSaXDbx

Closes #50545 and #50544

@robert-s-lee robert-s-lee requested a review from nvb June 23, 2020 13:46
@cockroach-teamcity
Copy link
Copy Markdown
Member

cockroach-teamcity commented Jun 23, 2020

CLA assistant check
All committers have signed the CLA.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@nvb
Copy link
Copy Markdown
Contributor

nvb commented Jun 23, 2020

@robert-s-lee could you describe the motivation here? It looks like some, but not all, of these flags are coming from the official YCSB. Is the idea to make this version more feature-complete?

@robert-s-lee
Copy link
Copy Markdown
Contributor Author

robert-s-lee commented Jun 23, 2020

The idea is not to make it more feature-complete. We use YCSB for demos of the locality and these fill the gap.

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

:lgtm: but you'll need to rebase first. Thanks for doing this.

Reviewed 1 of 1 files at r1, 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @robert-s-lee)


pkg/workload/ycsb/ycsb.go, line 616 at r1 (raw file):

	strStart := 0
	if yw.config.timeString {
		loc, _ := time.LoadLocation(timeZoneDefault)

You can replace these two lines with curTime := time.Now().UTC()


pkg/workload/ycsb/ycsb.go, line 618 at r1 (raw file):

		loc, _ := time.LoadLocation(timeZoneDefault)
		currentTime := time.Now().In(loc)
		copy(str, currentTime.Format(timeFormatTemplate))

We can avoid the intermediate allocation and the timeFormatLen const with:

str = curTime.AppendFormat(str[:0], timeFormatTemplate)
strStart = len(str)
str = str[:length]

@robert-s-lee robert-s-lee requested review from a team June 25, 2020 16:28
@robert-s-lee robert-s-lee requested review from a team as code owners June 25, 2020 16:28
@robert-s-lee robert-s-lee requested review from miretskiy and removed request for a team June 25, 2020 16:28
@knz
Copy link
Copy Markdown
Contributor

knz commented Jun 25, 2020

Something went amiss with the rebase.

@robert-s-lee robert-s-lee force-pushed the workload/ycsb-add-insertorder-and-zeropadding branch from 4ce31f0 to 0b5a75e Compare June 25, 2020 17:52
--insert-hash=true creates user1, user2 for ycsb_key
--zero-padding=2 creates user01, user02 for ycsb_key
--time-string=true creates field[0-9] with example
`2020-06-23 13:23:58.529711+00:00DwYFKxzTOKqgYwdHZNmbzdkRfINphVojmwiDbhaFsEnFHRpxSJQdSRnXOrQbjJhjYzko`
instead of
`rmArXhKIjbpTAPwyjDNsmkGTLXWNQHQCLAyKwWFOrlopXliOKqQANpakAxsmqfPzYSvAhgYYVQQDhUEuXCVuvsEdJrrguNSaXDbx`

Closes #50545 and #50544

Release note (general change): added new options to YCSB that mirrors OpenSource YCSB options

merge PR 50475

Merge changes from PR #50475 which  populates the fields[0-9] during the init
@robert-s-lee robert-s-lee force-pushed the workload/ycsb-add-insertorder-and-zeropadding branch from 5be15ae to ca700c9 Compare July 1, 2020 18:17
@robert-s-lee
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 1, 2020

Build succeeded

@craig craig bot merged commit c016727 into master Jul 1, 2020
@jordanlewis jordanlewis deleted the workload/ycsb-add-insertorder-and-zeropadding branch December 23, 2020 05:32
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.

workload/ycsb: add timestamp in the field[0-9] as well as random string

4 participants