Skip to content

Commit 7bd59bc

Browse files
committed
Remove function getBucketName
The connection may call getBucket() and pick out the name directly Change-Id: I710fe06063eccc0a16dc72988be38e3a1585d732 Reviewed-on: http://review.couchbase.org/103570 Tested-by: Build Bot <[email protected]> Reviewed-by: Ben Huddleston <[email protected]>
1 parent 371fc35 commit 7bd59bc

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

daemon/buckets.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,6 @@ class Bucket {
184184
DcpIface* bucketDcp{nullptr};
185185
};
186186

187-
/**
188-
* Get the name of the associated bucket. Note that this function must
189-
* only be called while the current connection is being served (otherwise
190-
* a race may occur causing the data to be returned to be modified).
191-
*
192-
* The client should not try to modify (or release) the returned pointer
193-
* as it points into the static area of the bucket array. The entry
194-
* is valid as long as the current connection is being served (unless it
195-
* tries to switch bucket/delete bucket, then it is invalidated).
196-
*/
197-
extern const char* getBucketName(const Connection* c);
198-
199187
/**
200188
* All of the buckets are stored in the following array. Index 0 is reserved
201189
* for the "no bucket" where all connections start off (unless there is a

daemon/mcaudit.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void audit_dcp_open(const Connection* c) {
178178
LOG_INFO("Open DCP stream with admin credentials");
179179
} else {
180180
auto root = create_memcached_audit_object(c);
181-
cJSON_AddStringToObject(root.get(), "bucket", getBucketName(c));
181+
cJSON_AddStringToObject(root.get(), "bucket", c->getBucket().name);
182182

183183
do_audit(c, MEMCACHED_AUDIT_OPENED_DCP_CONNECTION, root,
184184
"Failed to send DCP open connection "

daemon/memcached.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@
108108
static std::mutex buckets_lock;
109109
std::array<Bucket, COUCHBASE_MAX_NUM_BUCKETS + 1> all_buckets;
110110

111-
const char* getBucketName(const Connection* c) {
112-
return all_buckets[c->getBucketIndex()].name;
113-
}
114-
115111
void bucketsForEach(std::function<bool(Bucket&, void*)> fn, void *arg) {
116112
std::lock_guard<std::mutex> all_bucket_lock(buckets_lock);
117113
for (Bucket& bucket : all_buckets) {

0 commit comments

Comments
 (0)