mirror of https://gitee.com/bigwinds/arangodb
fix various small annoyances (#9079)
This commit is contained in:
parent
f5a14414e1
commit
59b67cad40
|
@ -120,10 +120,10 @@ struct log_t {
|
||||||
std::string const& clientId = std::string())
|
std::string const& clientId = std::string())
|
||||||
: index(idx),
|
: index(idx),
|
||||||
term(t),
|
term(t),
|
||||||
|
entry(std::make_shared<arangodb::velocypack::Buffer<uint8_t>>(*e.get())),
|
||||||
clientId(clientId),
|
clientId(clientId),
|
||||||
timestamp(std::chrono::duration_cast<std::chrono::milliseconds>(
|
timestamp(std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||||
std::chrono::system_clock::now().time_since_epoch())) {
|
std::chrono::system_clock::now().time_since_epoch())) {
|
||||||
entry = std::make_shared<arangodb::velocypack::Buffer<uint8_t>>(*e.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::ostream& operator<<(std::ostream& o, log_t const& l) {
|
friend std::ostream& operator<<(std::ostream& o, log_t const& l) {
|
||||||
|
|
|
@ -135,13 +135,13 @@ class KShortestPathsFinder : public ShortestPathFinder {
|
||||||
bool _done;
|
bool _done;
|
||||||
|
|
||||||
// Interface needed for ShortestPathPriorityQueue
|
// Interface needed for ShortestPathPriorityQueue
|
||||||
double weight() { return _weight; };
|
double weight() const { return _weight; }
|
||||||
VertexRef getKey() { return _vertex; };
|
VertexRef getKey() const { return _vertex; }
|
||||||
void setWeight(double weight) { _weight = weight; };
|
void setWeight(double weight) { _weight = weight; }
|
||||||
|
|
||||||
DijkstraInfo(VertexRef const& vertex, Edge const&& edge, VertexRef const& pred, double weight)
|
DijkstraInfo(VertexRef const& vertex, Edge const&& edge, VertexRef const& pred, double weight)
|
||||||
: _vertex(vertex), _edge(std::move(edge)), _pred(pred), _weight(weight), _done(false) {}
|
: _vertex(vertex), _edge(std::move(edge)), _pred(pred), _weight(weight), _done(false) {}
|
||||||
DijkstraInfo(VertexRef const& vertex)
|
explicit DijkstraInfo(VertexRef const& vertex)
|
||||||
: _vertex(vertex), _weight(0), _done(true) {}
|
: _vertex(vertex), _weight(0), _done(true) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ class KShortestPathsFinder : public ShortestPathFinder {
|
||||||
Direction _direction;
|
Direction _direction;
|
||||||
Frontier _frontier;
|
Frontier _frontier;
|
||||||
|
|
||||||
Ball(void) {}
|
Ball() {}
|
||||||
Ball(VertexRef const& centre, Direction direction)
|
Ball(VertexRef const& centre, Direction direction)
|
||||||
: _centre(centre), _direction(direction) {
|
: _centre(centre), _direction(direction) {
|
||||||
_frontier.insert(centre, std::make_unique<DijkstraInfo>(centre));
|
_frontier.insert(centre, std::make_unique<DijkstraInfo>(centre));
|
||||||
|
@ -175,7 +175,7 @@ class KShortestPathsFinder : public ShortestPathFinder {
|
||||||
double _weight;
|
double _weight;
|
||||||
|
|
||||||
Step(Edge&& edge, VertexRef const& vertex, double weight)
|
Step(Edge&& edge, VertexRef const& vertex, double weight)
|
||||||
: _edge(edge), _vertex(vertex), _weight(weight) {}
|
: _edge(std::move(edge)), _vertex(vertex), _weight(weight) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// A vertex that was discovered while computing
|
// A vertex that was discovered while computing
|
||||||
|
@ -225,7 +225,7 @@ class KShortestPathsFinder : public ShortestPathFinder {
|
||||||
bool getNextPathShortestPathResult(ShortestPathResult& path);
|
bool getNextPathShortestPathResult(ShortestPathResult& path);
|
||||||
// get the next available path as a Path
|
// get the next available path as a Path
|
||||||
bool getNextPath(Path& path);
|
bool getNextPath(Path& path);
|
||||||
bool isPathAvailable(void) { return _pathAvailable; }
|
bool isPathAvailable() const { return _pathAvailable; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Compute the first shortest path
|
// Compute the first shortest path
|
||||||
|
|
|
@ -888,9 +888,7 @@ Result Syncer::createView(TRI_vocbase_t& vocbase, arangodb::velocypack::Slice co
|
||||||
auto view = vocbase.lookupView(guidSlice.copyString());
|
auto view = vocbase.lookupView(guidSlice.copyString());
|
||||||
|
|
||||||
if (view) { // identical view already exists
|
if (view) { // identical view already exists
|
||||||
VPackSlice nameSlice = slice.get(StaticStrings::DataSourceName);
|
if (!nameSlice.isEqualString(view->name())) {
|
||||||
|
|
||||||
if (nameSlice.isString() && !nameSlice.isEqualString(view->name())) {
|
|
||||||
auto res = view->rename(nameSlice.copyString());
|
auto res = view->rename(nameSlice.copyString());
|
||||||
|
|
||||||
if (!res.ok()) {
|
if (!res.ok()) {
|
||||||
|
|
|
@ -1649,11 +1649,13 @@ Result TailingSyncer::fetchOpenTransactions(TRI_voc_tick_t fromTick, TRI_voc_tic
|
||||||
"&from=" + StringUtils::itoa(fromTick) +
|
"&from=" + StringUtils::itoa(fromTick) +
|
||||||
"&to=" + StringUtils::itoa(toTick);
|
"&to=" + StringUtils::itoa(toTick);
|
||||||
|
|
||||||
std::string const progress = "fetching initial master state with from tick " +
|
{
|
||||||
StringUtils::itoa(fromTick) + ", to tick " +
|
std::string const progress = "fetching initial master state with from tick " +
|
||||||
StringUtils::itoa(toTick);
|
StringUtils::itoa(fromTick) + ", to tick " +
|
||||||
|
StringUtils::itoa(toTick);
|
||||||
|
|
||||||
setProgress(progress);
|
setProgress(progress);
|
||||||
|
}
|
||||||
|
|
||||||
// send request
|
// send request
|
||||||
std::unique_ptr<httpclient::SimpleHttpResult> response;
|
std::unique_ptr<httpclient::SimpleHttpResult> response;
|
||||||
|
|
|
@ -61,7 +61,7 @@ class DatabaseManagerThread final : public Thread {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// how long will the thread pause between iterations
|
// how long will the thread pause between iterations
|
||||||
static constexpr unsigned long waitTime() { return 500 * 1000; }
|
static constexpr unsigned long waitTime() { return 500U * 1000U; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class DatabaseFeature : public application_features::ApplicationFeature {
|
class DatabaseFeature : public application_features::ApplicationFeature {
|
||||||
|
|
|
@ -1051,7 +1051,7 @@ Result transaction::Methods::commit() {
|
||||||
|
|
||||||
if (_state->isRunningInCluster() && _state->isTopLevelTransaction()) {
|
if (_state->isRunningInCluster() && _state->isTopLevelTransaction()) {
|
||||||
// first commit transaction on subordinate servers
|
// first commit transaction on subordinate servers
|
||||||
Result res = ClusterTrxMethods::commitTransaction(*this);
|
res = ClusterTrxMethods::commitTransaction(*this);
|
||||||
if (res.fail()) { // do not commit locally
|
if (res.fail()) { // do not commit locally
|
||||||
LOG_TOPIC("5743a", WARN, Logger::TRANSACTIONS)
|
LOG_TOPIC("5743a", WARN, Logger::TRANSACTIONS)
|
||||||
<< "failed to commit on subordinates: '" << res.errorMessage() << "'";
|
<< "failed to commit on subordinates: '" << res.errorMessage() << "'";
|
||||||
|
|
|
@ -464,7 +464,7 @@ arangodb::Result processJob(arangodb::httpclient::SimpleHttpClient& client,
|
||||||
|
|
||||||
bool dumpStructure = true;
|
bool dumpStructure = true;
|
||||||
|
|
||||||
if (dumpStructure && jobData.maskings != nullptr) {
|
if (jobData.maskings != nullptr) {
|
||||||
dumpStructure = jobData.maskings->shouldDumpStructure(jobData.name);
|
dumpStructure = jobData.maskings->shouldDumpStructure(jobData.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue