Alexey Serbin has posted comments on this change.

Change subject: env: add RWFile::GetExtentMap for analyzing file extents
......................................................................


Patch Set 1:

(5 comments)

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

PS1, Line 875:   char buf[1024];
             :   memset(buf, 0, sizeof(buf));
I think it's possible to write 

char buf[1024] = { 0 };

instead


http://gerrit.cloudera.org:8080/#/c/6583/1/src/kudu/util/env_posix.cc
File src/kudu/util/env_posix.cc:

PS1, Line 728: OVERRIDE
nit: consider replacing with C++11-ish

Status GetExtentMap(ExtentMap* out) const override


PS1, Line 737: unique_ptr<char[]> buf(new char[kBufSize]);
Is it crucial to allocate this on the heap?  Would stack allocated array 
suffice?  It could allow to get rid of memset() call as well:

char buf[kBufSize] = { 0 };

Or even

uint8_t buf[kBufSize] = { 0 };


PS1, Line 747: ~(0ULL)
Would using FIEMAP_MAX_OFFSET macro be more idiomatic?


PS1, Line 749:       int ret = ioctl(fd_, FS_IOC_FIEMAP, fm);
             :       if (ret == -1) {
nit: since the 'ret' variable is not referenced anywhere else, consider

if (ioctl(...) == -1) {
  ...;
}


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I35bd1bdb9e1a839af2ab95ea73b79217c1f4a2b3
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to