From: František Dvořák Date: Sun, 1 Dec 2013 19:06:37 +0000 (+0100) Subject: Show also replica attributes. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=1510fdff5794b91ef24c0cbc7bfae23381eb7bba;p=dmlite-clients.git Show also replica attributes. --- 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";