8000 Remove unused variable check from arangodump. (#6529) · arangodb/arangodb@8b78465 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b78465

Browse files
Dan Larkin-Yorkjsteemann
authored andcommitted
Remove unused variable check from arangodump. (#6529)
1 parent a576409 commit 8b78465

File tree

1 file changed

+14
-21
lines changed
< 8000 /div>

1 file changed

+14
-21
lines changed

arangosh/Dump/DumpFeature.cpp

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ Result DumpFeature::runDump(httpclient::SimpleHttpClient& client,
636636
if (!collections.isArray()) {
637637
return ::ErrorMalformedJsonResponse;
638638
}
639-
639+
640640
// get the view list
641641
VPackSlice views = body.get("views");
642642
if (!views.isArray()) {
@@ -648,7 +648,7 @@ Result DumpFeature::runDump(httpclient::SimpleHttpClient& client,
648648
if (res.fail()) {
649649
return res;
650650
}
651-
651+
652652
// Step 2. Store view definition files
653653
res = storeViews(views);
654654
if (res.fail()) {
@@ -712,7 +712,7 @@ Result DumpFeature::runDump(httpclient::SimpleHttpClient& client,
712712
std::to_string(cid), name, collectionType);
713713
_clientTaskQueue.queueJob(std::move(jobData));
714714
}
715-
715+
716716
// wait for all jobs to finish, then check for errors
717717
_clientTaskQueue.waitForIdle();
718718
{
@@ -756,19 +756,19 @@ Result DumpFeature::runClusterDump(httpclient::SimpleHttpClient& client,
756756
if (!collections.isArray()) {
757757
return ::ErrorMalformedJsonResponse;
758758
}
759-
759+
760760
// get the view list
761761
VPackSlice views = body.get("views");
762762
if (!views.isArray()) {
763763
views = VPackSlice::emptyArraySlice();
764764
}
765-
765+
766766
// Step 1. Store view definition files
767767
Result res = storeDumpJson(body, dbname);
768768
if (res.fail()) {
769769
return res;
770770
}
771-
771+
772772
// Step 2. Store view definition files
773773
res = storeViews(views);
774774
if (res.fail()) {
@@ -863,10 +863,10 @@ Result DumpFeature::runClusterDump(httpclient::SimpleHttpClient& client,
863863

864864
return {TRI_ERROR_NO_ERROR};
865865
}
866-
866+
867867
Result DumpFeature::storeDumpJson(VPackSlice const& body,
868868
std::string const& dbName) const {
869-
869+
870870
// read the server's max tick value
871871
std::string const tickString =
872872
basics::VelocyPackHelper::getStringValue(body, "tick", "");
@@ -875,27 +875,20 @@ Result DumpFeature::storeDumpJson(VPackSlice const& body,
875875
}
876876
LOG_TOPIC(INFO, Logger::DUMP)
877877
<< "Last tick provided by server is: " << tickString;
878-
879-
// set the local max tick value
880-
uint64_t maxTick = basics::StringUtils::uint64(tickString);
881-
// check if the user specified a max tick value
882-
if (_options.tickEnd > 0 && maxTick > _options.tickEnd) {
883-
maxTick = _options.tickEnd;
884-
}
885-
878+
886879
try {
887880
VPackBuilder meta;
888881
meta.openObject();
889882
meta.add("database", VPackValue(dbName));
890883
meta.add("lastTickAtDumpStart", VPackValue(tickString));
891884
meta.close();
892-
885+
893886
// save last tick in file
894887
auto file = _directory->writableFile("dump.json", true);
895888
if (!::fileOk(file.get())) {
896889
return ::fileError(file.get(), true);
897890
}
898-
891+
899892
std::string const metaString = meta.slice().toJson();
900893
file->write(metaString.c_str(), metaString.size());
901894
if (file->status().fail()) {
@@ -910,14 +903,14 @@ Result DumpFeature::storeDumpJson(VPackSlice const& body,
910903
}
911904
return {};
912905
}
913-
906+
914907
Result DumpFeature::storeViews(VPackSlice const& views) const {
915908
for (VPackSlice view : VPackArrayIterator(views)) {
916909
auto nameSlice = view.get(StaticStrings::DataSourceName);
917910
if (!nameSlice.isString() || nameSlice.getStringLength() == 0) {
918911
continue; // ignore
919912
}
920-
913+
921914
try {
922915
std::string fname = nameSlice.copyString();
923916
fname.append(".view.json");
@@ -926,7 +919,7 @@ Result DumpFeature::storeViews(VPackSlice const& views) const {
926919
if (!::fileOk(file.get())) {
927920
return ::fileError(file.get(), true);
928921
}
929-
922+
930923
std::string const viewString = view.toJson();
931924
file->write(viewString.c_str(), viewString.size());
932925
if (file->status().fail()) {

0 commit comments

Comments
 (0)
0