Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions admin/admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ admin :: migrate_data(const char* space_from, const char* space_to,
size_t total_sz = sizeof(uint32_t) * 2 + space_from_sz + space_to_sz;
std::vector<char> buf(total_sz);
char* pos = &buf[0];
pos = e::pack64be(space_from_sz, pos);
pos = e::pack32be(space_from_sz, pos);
memcpy(pos, space_from, space_from_sz);
pos += space_from_sz;
pos = e::pack64be(space_to_sz, pos);
pos = e::pack32be(space_to_sz, pos);
memcpy(pos, space_to, space_to_sz);

int64_t cid = m_coord.rpc("migrate", &buf[0], total_sz,
Expand All @@ -233,6 +233,12 @@ admin :: migrate_data(const char* space_from, const char* space_to,
}
}

uint16_t
admin :: num_ongoing_migrations(const char* space_name)
{
return m_coord.config()->num_ongoing_migrations(space_name);
}

int
admin :: validate_space(const char* description,
hyperdex_admin_returncode* status)
Expand Down
3 changes: 3 additions & 0 deletions admin/admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class admin
const char** spaces);
int64_t migrate_data(const char* space_from, const char* space_to,
enum hyperdex_admin_returncode* status);
// Return the number of ongoing migrations from or to the given space
uint16_t num_ongoing_migrations(const char* space_name);

// manage servers
int64_t server_register(uint64_t token, const char* address,
enum hyperdex_admin_returncode* status);
Expand Down
8 changes: 8 additions & 0 deletions admin/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ hyperdex_admin_migrate_data(struct hyperdex_admin* _adm,
);
}

HYPERDEX_API uint16_t
hyperdex_admin_num_ongoing_migrations(struct hyperdex_admin* _adm,
const char* space_name)
{
hyperdex::admin* adm = reinterpret_cast<hyperdex::admin*>(_adm);
return adm->num_ongoing_migrations(space_name);
}

HYPERDEX_API int64_t
hyperdex_admin_server_register(struct hyperdex_admin* _adm,
uint64_t token,
Expand Down
1 change: 1 addition & 0 deletions bindings/python/_hyperdex_admin.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#error Do not use this file, it is the result of a failed Cython compilation.
Loading