-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use DISALLOW_COPY_AND_MOVE instead. #4411
Comments
may I have a try? |
You can try in one class at first. |
Hi, I add the DISALLOW_COPY_AND_MOVE(className) macro in CPUAffinityManager.h. I wonder where should I write this macro so that all other class neet it can use it. |
there are some classes I intend to refactor: dbms/src/Common/ActionBlocker.h: dbms/src/Common/CompactArray.h: dbms/src/Common/COWPtr.h: dbms/src/Common/CPUAffinityManager.h: dbms/src/Common/DNSCache.h: dbms/src/Common/ExecutableTask.h: dbms/src/Common/RWLock.cpp: dbms/src/Common/TiFlashMetrics.h: dbms/src/Common/HashTable/FixedHashTable.h: dbms/src/Common/HashTable/HashTable.h: dbms/src/Common/HashTable/SmallTable.h: dbms/src/Common/tests/gtest_mpmc_queue.cpp: dbms/src/DataStreams/SummingSortedBlockInputStream.h: dbms/src/Debug/MockSSTReader.h: dbms/src/Encryption/createWriteBufferFromFileBaseByFileProvider.h: dbms/src/Encryption/RateLimiter.h: dbms/src/Interpreters/LogicalExpressionsOptimizer.h: dbms/src/IO/DoubleConverter.h: dbms/src/IO/ReadBufferAIO.h: dbms/src/IO/WriteBufferAIO.h: dbms/src/Storages/DeltaMerge/Segment.h: dbms/src/Storages/DeltaMerge/ColumnFile/ColumnFile.h: dbms/src/Storages/DeltaMerge/tools/workload/TableGenerator.cpp: dbms/src/Storages/Page/stress/PSWorkload.h: dbms/src/Storages/Page/V1/PageEntries.h: dbms/src/Storages/Page/V1/mvcc/VersionSet.h: dbms/src/Storages/Page/V1/VersionSet/PageEntriesEdit.h: dbms/src/Storages/Page/V2/PageEntries.h: dbms/src/Storages/Page/V2/VersionSet/PageEntriesEdit.h: dbms/src/Storages/Page/V3/PageDirectory.h: dbms/src/Storages/Page/V3/PageEntriesEdit.h: dbms/src/Storages/Page/V3/LogFile/LogReader.h: dbms/src/Storages/Page/V3/LogFile/LogWriter.h: dbms/src/Storages/Page/V3/WAL/WALReader.h: dbms/src/Storages/Transaction/DecodingStorageSchemaSnapshot.h: dbms/src/Storages/Transaction/FileEncryption.h: dbms/src/Storages/Transaction/ProxyFFI.cpp: dbms/src/Storages/Transaction/ProxyFFI.h: dbms/src/Storages/Transaction/ProxyFFICommon.h: dbms/src/Storages/Transaction/ReadIndexWorker.h: dbms/src/Storages/Transaction/RegionTable.h: dbms/src/Storages/Transaction/SSTReader.h: dbms/src/Storages/Transaction/TableRowIDMinMax.h: dbms/src/Storages/Transaction/TiKVKeyValue.h: disallow move: dbms/src/Common/CPUAffinityManager.h: dbms/src/Common/ExecutableTask.h: dbms/src/Common/TiFlashMetrics.h: dbms/src/Encryption/RateLimiter.h: dbms/src/Storages/DeltaMerge/Segment.h: dbms/src/Storages/DeltaMerge/tools/workload/TableGenerator.cpp: dbms/src/Storages/Page/stress/PSWorkload.h: dbms/src/Storages/Page/V3/PageDirectory.h: dbms/src/Storages/Transaction/SSTReader.h: dbms/src/Storages/Transaction/TableRowIDMinMax.h: dbms/src/Flash/Coprocessor/DAGStorageInterpreter.h: dbms/src/IO/WriteBufferFromString.h: any suggestions? |
I see that there are also boost::noncopyable in the code base. Maybe we can unify them? |
Enhancement
reference:
https://github.com/oceanbase/oceanbase/blob/master/src/observer/ob_cache_size_calculator.h
In CPUAffinityManager.h and many other classes, they disabled copy and move constructor, maybe we can simpilfy the code like:
The text was updated successfully, but these errors were encountered: