You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2017/05/09 23:51:01 UTC

[kudu-CR] faststring: add shrink to fit()

Hello David Ribeiro Alves,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/6835

to review the following change.

Change subject: faststring: add shrink_to_fit()
......................................................................

faststring: add shrink_to_fit()

This adds a shrink_to_fit() method which reallocates the underlying buffer of a
faststring to match its current length. This is useful in the case where a
faststring acts as a long-lived buffer which occasionally gets large values,
but often contains small ones.

Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
---
M src/kudu/util/CMakeLists.txt
A src/kudu/util/faststring-test.cc
M src/kudu/util/faststring.cc
M src/kudu/util/faststring.h
4 files changed, 90 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/35/6835/1
-- 
To view, visit http://gerrit.cloudera.org:8080/6835
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>

[kudu-CR] faststring: add shrink to fit()

Posted by "David Ribeiro Alves (Code Review)" <ge...@cloudera.org>.
David Ribeiro Alves has posted comments on this change.

Change subject: faststring: add shrink_to_fit()
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/6835/1/src/kudu/util/faststring-test.cc
File src/kudu/util/faststring-test.cc:

PS1, Line 33: TestShrinkToFit_SmallerThanInitialCapacity
nit: TestShrinkToFit_DontShrinkIfSmallerThanInitialCapacity ? or just explain a bit what this is testing.


http://gerrit.cloudera.org:8080/#/c/6835/1/src/kudu/util/faststring.h
File src/kudu/util/faststring.h:

PS1, Line 208:   // Any pointers within this instance are invalidated.
mention that this doesn't shrink below the initial capacity


-- 
To view, visit http://gerrit.cloudera.org:8080/6835
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: Yes

[kudu-CR] faststring: add shrink to fit()

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged.

Change subject: faststring: add shrink_to_fit()
......................................................................


faststring: add shrink_to_fit()

This adds a shrink_to_fit() method which reallocates the underlying buffer of a
faststring to match its current length. This is useful in the case where a
faststring acts as a long-lived buffer which occasionally gets large values,
but often contains small ones.

Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Reviewed-on: http://gerrit.cloudera.org:8080/6835
Reviewed-by: David Ribeiro Alves <da...@gmail.com>
Tested-by: Kudu Jenkins
---
M src/kudu/util/CMakeLists.txt
A src/kudu/util/faststring-test.cc
M src/kudu/util/faststring.cc
M src/kudu/util/faststring.h
4 files changed, 96 insertions(+), 6 deletions(-)

Approvals:
  David Ribeiro Alves: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/6835
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] faststring: add shrink to fit()

Posted by "David Ribeiro Alves (Code Review)" <ge...@cloudera.org>.
David Ribeiro Alves has posted comments on this change.

Change subject: faststring: add shrink_to_fit()
......................................................................


Patch Set 2: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/6835
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] faststring: add shrink to fit()

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: faststring: add shrink_to_fit()
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/6835/1/src/kudu/util/faststring-test.cc
File src/kudu/util/faststring-test.cc:

PS1, Line 33: TestShrinkToFit_SmallerThanInitialCapacity
> nit: TestShrinkToFit_DontShrinkIfSmallerThanInitialCapacity ? or just expla
Done


http://gerrit.cloudera.org:8080/#/c/6835/1/src/kudu/util/faststring.h
File src/kudu/util/faststring.h:

PS1, Line 208:   // Any pointers within this instance are invalidated.
> mention that this doesn't shrink below the initial capacity
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/6835
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] faststring: add shrink to fit()

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Adar Dembo, Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/6835

to look at the new patch set (#2).

Change subject: faststring: add shrink_to_fit()
......................................................................

faststring: add shrink_to_fit()

This adds a shrink_to_fit() method which reallocates the underlying buffer of a
faststring to match its current length. This is useful in the case where a
faststring acts as a long-lived buffer which occasionally gets large values,
but often contains small ones.

Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
---
M src/kudu/util/CMakeLists.txt
A src/kudu/util/faststring-test.cc
M src/kudu/util/faststring.cc
M src/kudu/util/faststring.h
4 files changed, 96 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/35/6835/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6835
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0e437ff180fccd1957d252fb9a3551bb91ba7917
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>