From 1510fdff5794b91ef24c0cbc7bfae23381eb7bba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sun, 1 Dec 2013 20:06:37 +0100 Subject: [PATCH] Show also replica attributes. --- run.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/run.cpp b/run.cpp index cc3752e..89129c6 100644 --- a/run.cpp +++ b/run.cpp @@ -264,6 +264,7 @@ int main(int argc, char *argv[]) { dmlite::ExtendedStat xstat; dmlite::Replica replica; std::vector replicas; + std::vector keys; char *cmd, *path, *rfn; size_t i; int64_t replicaid; @@ -274,6 +275,7 @@ int main(int argc, char *argv[]) { return 1; } cmd = argv[3]; + replica = dmlite::Replica(); if (strcasecmp(cmd, "add") == 0 && argc >= 6) { operation = "add replica"; path = argv[4]; @@ -291,6 +293,15 @@ int main(int argc, char *argv[]) { printf("Replicas of '%s':\n", path); for (i = 0; i < replicas.size(); i++) { printf(" %lu: inode %lu, server '%s', rfn '%s'\n", replicas[i].replicaid, replicas[i].fileid, replicas[i].server.c_str(), replicas[i].rfn.c_str()); + if (replicas[i].size()) { + keys = replicas[i].getKeys(); + printf("\t"); + for (size_t j = 0; j < keys.size(); j++) { + if (j) printf(", "); + printf("%s = '%s'", keys[j].c_str(), replicas[i].getString(keys[j]).c_str()); + } + printf("\n"); + } } } else if (strcasecmp(cmd, "delete") == 0 && argc >= 6) { operation = "delete replica"; -- 1.8.2.3