Adar Dembo has posted comments on this change. Change subject: block_manager: consolidate data directory management ......................................................................
Patch Set 2: (9 comments) http://gerrit.cloudera.org:8080/#/c/4793/2/src/kudu/fs/data_dirs.cc File src/kudu/fs/data_dirs.cc: PS2, Line 310: do { : cur_idx = data_dirs_next_.Load(); : next_idx = (cur_idx + 1) % data_dirs_.size(); : } while (!data_dirs_next_.CompareAndSet(cur_idx, next_idx)); : : > since there's no longer a check against "full paths" here, I think you coul Done Line 318: DataDir* DataDirManager::FindDataDirByUuidIndex(uint16_t uuid_idx) const { > any kind of CHECK you can do to make sure it's already opened? DataDirs only exist after Open() is called. Create() only creates data directories on disk. Line 323: return FindCopy(uuid_idx_by_data_dir_, dir, uuid_idx); > here too See above. http://gerrit.cloudera.org:8080/#/c/4793/2/src/kudu/fs/data_dirs.h File src/kudu/fs/data_dirs.h: Line 93: // Initializes the data directories on disk. > can you specify what happens if they already exist? Sure (it'll fail). Line 94: Status Create(bool test_hole_punch, bool fsync); > would a flags set be a more readable choice here? Sure. Line 97: Status Open(int max_data_dirs, LockMode mode); > doc 'max_data_dirs' Done PS2, Line 103: uuid index, > maybe a call-out here to where the idea of 'uuid index' is defined? I don't Sure (fs.proto). http://gerrit.cloudera.org:8080/#/c/4793/2/src/kudu/fs/log_block_manager.h File src/kudu/fs/log_block_manager.h: PS2, Line 241: full_root_paths > rename this and update docs The existing name/docs aren't wrong; it's OK (if perhaps imprecise) to think of data directories as "root paths". I left it as-is largely because I blew all of this away in the next patch anyway. Line 285: // Success or failure is set in 'result_status'. > why not return Status? Because OpenDataDir() is run on a thread pool as a closure of fixed type. It's not a lambda so capturing isn't an option, so instead we pass the status as an OUT parameter. -- To view, visit http://gerrit.cloudera.org:8080/4793 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc9d8999117a6383e7487b6c5bf065f10247b1d7 Gerrit-PatchSet: 2 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-HasComments: Yes
