Second Part of Internal API Refactor (#1326)

This commit is contained in:
Philipp Moritz
2017-12-26 16:22:04 -08:00
committed by Robert Nishihara
parent 4bb5b6bd5b
commit 3d224c4edf
58 changed files with 537 additions and 677 deletions
+3 -9
View File
@@ -5,12 +5,6 @@ project(plasma)
# Recursively include common
include(${CMAKE_CURRENT_LIST_DIR}/../common/cmake/Common.cmake)
# Include plasma
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../thirdparty/arrow/python/cmake_modules)
find_package(Plasma)
include_directories(SYSTEM ${PLASMA_INCLUDE_DIR})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99 -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -O3 -Werror -Wall")
@@ -28,7 +22,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
add_executable(plasma_manager
plasma_manager.cc)
target_link_libraries(plasma_manager common ${PLASMA_STATIC_LIB} ${ARROW_DIR}/cpp/build/release/libarrow.a -lpthread)
target_link_libraries(plasma_manager common ${PLASMA_STATIC_LIB} ray_static ${ARROW_STATIC_LIB} -lpthread)
define_test(client_tests ${PLASMA_STATIC_LIB})
define_test(manager_tests ${PLASMA_STATIC_LIB} plasma_manager.cc)
define_test(client_tests "")
define_test(manager_tests "" plasma_manager.cc)
+3 -2
View File
@@ -1256,14 +1256,15 @@ void log_object_hash_mismatch_error_task_callback(Task *task,
/* Push the error to the Python driver that caused the nondeterministic task
* to be submitted. */
push_error(state->db, TaskSpec_driver_id(spec),
OBJECT_HASH_MISMATCH_ERROR_INDEX, sizeof(function), function.id);
OBJECT_HASH_MISMATCH_ERROR_INDEX, sizeof(function),
function.data());
}
void log_object_hash_mismatch_error_result_callback(ObjectID object_id,
TaskID task_id,
bool is_put,
void *user_context) {
CHECK(!IS_NIL_ID(task_id));
CHECK(!task_id.is_nil());
PlasmaManagerState *state = (PlasmaManagerState *) user_context;
/* Get the specification for the nondeterministic task. */
task_table_get_task(state->db, task_id, NULL,
+5 -5
View File
@@ -59,7 +59,7 @@ void PlasmaManagerState_free(PlasmaManagerState *state);
* manager.
*/
void process_transfer(event_loop *loop,
ObjectID object_id,
ray::ObjectID object_id,
uint8_t addr[4],
int port,
ClientConnection *conn);
@@ -81,7 +81,7 @@ void process_transfer(event_loop *loop,
*/
void process_data(event_loop *loop,
int client_sock,
ObjectID object_id,
ray::ObjectID object_id,
int64_t data_size,
int64_t metadata_size,
ClientConnection *conn);
@@ -157,7 +157,7 @@ ClientConnection *ClientConnection_listen(event_loop *loop,
/* Buffer for requests between plasma managers. */
typedef struct PlasmaRequestBuffer {
int type;
ObjectID object_id;
ray::ObjectID object_id;
uint8_t *data;
int64_t data_size;
uint8_t *metadata;
@@ -175,7 +175,7 @@ typedef struct PlasmaRequestBuffer {
* @param context The plasma manager state.
* @return Void.
*/
void call_request_transfer(ObjectID object_id,
void call_request_transfer(ray::ObjectID object_id,
const std::vector<std::string> &manager_vector,
void *context);
@@ -272,6 +272,6 @@ int get_client_sock(ClientConnection *conn);
* @return A bool that is true if the requested object is local and false
* otherwise.
*/
bool is_object_local(PlasmaManagerState *state, ObjectID object_id);
bool is_object_local(PlasmaManagerState *state, ray::ObjectID object_id);
#endif /* PLASMA_MANAGER_H */
+4 -4
View File
@@ -135,7 +135,7 @@ TEST request_transfer_test(void) {
int port;
ARROW_CHECK_OK(plasma::ReadDataRequest(
request_data.data(), request_data.size(), &object_id2, &address, &port));
ASSERT(ObjectID_equal(object_id, object_id2));
ASSERT(object_id == object_id2);
free(address);
/* Clean up. */
destroy_plasma_mock(remote_mock);
@@ -188,7 +188,7 @@ TEST request_transfer_retry_test(void) {
ARROW_CHECK_OK(plasma::ReadDataRequest(
request_data.data(), request_data.size(), &object_id2, &address, &port));
free(address);
ASSERT(ObjectID_equal(object_id, object_id2));
ASSERT(object_id == object_id2);
/* Clean up. */
destroy_plasma_mock(remote_mock2);
destroy_plasma_mock(remote_mock1);
@@ -254,9 +254,9 @@ TEST object_notifications_test(void) {
int flags = fcntl(fd[1], F_GETFL, 0);
CHECK(fcntl(fd[1], F_SETFL, flags | O_NONBLOCK) == 0);
ObjectID object_id = globally_unique_id();
ObjectID object_id = ObjectID::from_random();
ObjectInfoT info;
info.object_id = std::string((char *) &object_id.id[0], sizeof(object_id));
info.object_id = object_id.binary();
info.data_size = 10;
info.metadata_size = 1;
info.create_time = 0;
+1 -1
View File
@@ -7,5 +7,5 @@ set -e
./src/plasma/plasma_store -s /tmp/plasma_store_socket_1 -m 0 &
sleep 1
valgrind --leak-check=full --error-exitcode=1 ./src/plasma/manager_tests
valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all --leak-check-heuristics=stdstring --error-exitcode=1 ./src/plasma/manager_tests
killall plasma_store