Skip to content

Commit 4c976bb

Browse files
committed
make format
1 parent fb8e1b4 commit 4c976bb

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

cpp/src/plasma/client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ uint8_t* PlasmaClient::lookup_or_mmap(int fd, int store_fd_val, int64_t map_size
9191
if (result == MAP_FAILED) {
9292
ARROW_LOG(FATAL) << "mmap failed";
9393
}
94-
close(fd); // Closing this fd has an effect on performance.
94+
close(fd); // Closing this fd has an effect on performance.
9595

9696
ClientMmapTableEntry& entry = mmap_table_[store_fd_val];
9797
entry.pointer = result;

cpp/src/plasma/malloc.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include <sys/mman.h>
2626
#include <unistd.h>
2727

28-
#include <unordered_map>
2928
#include <cerrno>
29+
#include <unordered_map>
3030

3131
#include "plasma/common.h"
3232
#include "plasma/plasma.h"
@@ -44,9 +44,9 @@ int fake_munmap(void*, int64_t);
4444
#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
4545

4646
#ifndef ARROW_PLASMA_HUGEPAGES
47-
#define DEFAULT_GRANULARITY ((size_t) 128U * 1024U) // 128KB
47+
#define DEFAULT_GRANULARITY ((size_t)128U * 1024U) // 128KB
4848
#else
49-
#define DEFAULT_GRANULARITY ((size_t) 1024U * 1024U * 1024U) // 1GB
49+
#define DEFAULT_GRANULARITY ((size_t)1024U * 1024U * 1024U) // 1GB
5050
#endif
5151

5252
#include "thirdparty/dlmalloc.c" // NOLINT
@@ -134,15 +134,16 @@ void* fake_mmap(size_t size) {
134134
int fd = create_buffer(size);
135135
ARROW_CHECK(fd >= 0) << "Failed to create buffer during mmap";
136136
#ifdef __linux__
137-
void *pointer = mmap(NULL, size, PROT_READ | PROT_WRITE,
138-
MAP_SHARED | MAP_POPULATE, fd, 0);
137+
void* pointer =
138+
mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, fd, 0);
139139
#else
140-
void *pointer = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
140+
void* pointer = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
141141
#endif
142142
if (pointer == MAP_FAILED) {
143143
ARROW_LOG(ERROR) << "mmap failed with error: " << std::strerror(errno);
144144
if (errno == ENOMEM && plasma::plasma_config->hugepages_enabled) {
145-
ARROW_LOG(ERROR) << " (this probably means you have to increase /proc/sys/vm/nr_hugepages)";
145+
ARROW_LOG(ERROR)
146+
<< " (this probably means you have to increase /proc/sys/vm/nr_hugepages)";
146147
}
147148
return pointer;
148149
}

cpp/src/plasma/plasma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#include <string.h>
2828
#include <unistd.h> // pid_t
2929

30+
#include <string>
3031
#include <unordered_map>
3132
#include <unordered_set>
32-
#include <string>
3333

3434
#include "arrow/status.h"
3535
#include "arrow/util/logging.h"

cpp/src/plasma/store.cc

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ GetRequest::GetRequest(Client* client, const std::vector<ObjectID>& object_ids)
9696

9797
Client::Client(int fd) : fd(fd) {}
9898

99-
PlasmaStore::PlasmaStore(EventLoop* loop, int64_t system_memory,
100-
std::string directory, bool hugepages_enabled)
99+
PlasmaStore::PlasmaStore(EventLoop* loop, int64_t system_memory, std::string directory,
100+
bool hugepages_enabled)
101101
: loop_(loop), eviction_policy_(&store_info_) {
102102
store_info_.memory_capacity = system_memory;
103103
store_info_.directory = directory;
@@ -117,9 +117,7 @@ PlasmaStore::~PlasmaStore() {
117117
}
118118
}
119119

120-
const PlasmaStoreInfo* PlasmaStore::get_plasma_store_info() {
121-
return &store_info_;
122-
}
120+
const PlasmaStoreInfo* PlasmaStore::get_plasma_store_info() { return &store_info_; }
123121

124122
// If this client is not already using the object, add the client to the
125123
// object's list of clients, otherwise do nothing.
@@ -644,8 +642,8 @@ class PlasmaStoreRunner {
644642
bool hugepages_enabled) {
645643
// Create the event loop.
646644
loop_.reset(new EventLoop);
647-
store_.reset(new PlasmaStore(loop_.get(), system_memory, directory,
648-
hugepages_enabled));
645+
store_.reset(
646+
new PlasmaStore(loop_.get(), system_memory, directory, hugepages_enabled));
649647
plasma_config = store_->get_plasma_store_info();
650648
int socket = bind_ipc_sock(socket_name, true);
651649
// TODO(pcm): Check return value.
@@ -680,8 +678,8 @@ void HandleSignal(int signal) {
680678
}
681679
}
682680

683-
void start_server(char* socket_name, int64_t system_memory,
684-
std::string plasma_directory, bool hugepages_enabled) {
681+
void start_server(char* socket_name, int64_t system_memory, std::string plasma_directory,
682+
bool hugepages_enabled) {
685683
// Ignore SIGPIPE signals. If we don't do this, then when we attempt to write
686684
// to a client that has already died, the store could die.
687685
signal(SIGPIPE, SIG_IGN);
@@ -733,7 +731,8 @@ int main(int argc, char* argv[]) {
733731
ARROW_LOG(FATAL) << "please specify the amount of system memory with -m switch";
734732
}
735733
if (hugepages_enabled && plasma_directory.empty()) {
736-
ARROW_LOG(FATAL) << "if you want to use hugepages, please specify path to huge pages filesystem with -d";
734+
ARROW_LOG(FATAL) << "if you want to use hugepages, please specify path to huge pages "
735+
"filesystem with -d";
737736
}
738737
if (plasma_directory.empty()) {
739738
#ifdef __linux__
@@ -743,7 +742,8 @@ int main(int argc, char* argv[]) {
743742
#endif
744743
}
745744
ARROW_LOG(INFO) << "Starting object store with directory " << plasma_directory
746-
<< " and huge page support " << (hugepages_enabled ? "enabled" : "disabled");
745+
<< " and huge page support "
746+
<< (hugepages_enabled ? "enabled" : "disabled");
747747
#ifdef __linux__
748748
if (!hugepages_enabled) {
749749
// On Linux, check that the amount of memory available in /dev/shm is large
@@ -756,21 +756,19 @@ int main(int argc, char* argv[]) {
756756
int64_t shm_mem_avail = shm_vfs_stats.f_bsize * shm_vfs_stats.f_bavail;
757757
close(shm_fd);
758758
if (system_memory > shm_mem_avail) {
759-
ARROW_LOG(FATAL) << "System memory request exceeds memory available in "
760-
<< plasma_directory << ". The request is for "
761-
<< system_memory << " bytes, and the amount available is "
762-
<< shm_mem_avail
763-
<< " bytes. You may be able to free up space by deleting files in "
764-
"/dev/shm. If you are inside a Docker container, you may need to "
765-
"pass "
766-
"an argument with the flag '--shm-size' to 'docker run'.";
759+
ARROW_LOG(FATAL)
760+
<< "System memory request exceeds memory available in " << plasma_directory
761+
<< ". The request is for " << system_memory
762+
<< " bytes, and the amount available is " << shm_mem_avail
763+
<< " bytes. You may be able to free up space by deleting files in "
764+
"/dev/shm. If you are inside a Docker container, you may need to "
765+
"pass an argument with the flag '--shm-size' to 'docker run'.";
767766
}
768767
}
769768
#endif
770769
// Make it so dlmalloc fails if we try to request more memory than is
771770
// available.
772771
plasma::dlmalloc_set_footprint_limit((size_t)system_memory);
773772
ARROW_LOG(DEBUG) << "starting server listening on " << socket_name;
774-
plasma::start_server(socket_name, system_memory, plasma_directory,
775-
hugepages_enabled);
773+
plasma::start_server(socket_name, system_memory, plasma_directory, hugepages_enabled);
776774
}

0 commit comments

Comments
 (0)