Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void Host::LatencyTracker::update(uint64_t latency_ns) {
}

bool VersionNumber::parse(const std::string& version) {
return sscanf(version.c_str(), "%d.%d.%d", &major_, &minor_, &patch_) >= 2;
return sscanf(version.c_str(), "%d.%d.%d", &major_version_, &minor_version_, &patch_version_) >= 2;
}

} // namespace cass
38 changes: 19 additions & 19 deletions src/host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,42 @@ struct TimestampedAverage {
class VersionNumber {
public:
VersionNumber()
: major_(0)
, minor_(0)
, patch_(0) { }
: major_version_(0)
, minor_version_(0)
, patch_version_(0) { }

VersionNumber(int major, int minor, int patch)
: major_(major)
, minor_(minor)
, patch_(patch) { }
VersionNumber(int major_version, int minor_version, int patch_version)
: major_version_(major_version)
, minor_version_(minor_version)
, patch_version_(patch_version) { }

bool operator >=(const VersionNumber& other) const {
return compare(other) >= 0;
}

int compare(const VersionNumber& other) const {
if (major_ < other.major_) return -1;
if (major_ > other.major_) return 1;
if (major_version_ < other.major_version_) return -1;
if (major_version_ > other.major_version_) return 1;

if (minor_ < other.minor_) return -1;
if (minor_ > other.minor_) return 1;
if (minor_version_ < other.minor_version_) return -1;
if (minor_version_ > other.minor_version_) return 1;

if (patch_ < other.patch_) return -1;
if (patch_ > other.patch_) return 1;
if (patch_version_ < other.patch_version_) return -1;
if (patch_version_ > other.patch_version_) return 1;

return 0;
}

bool parse(const std::string& version);

int major() const { return major_; }
int minor() const { return minor_; }
int patch() const { return patch_; }
int major_version() const { return major_version_; }
int minor_version() const { return minor_version_; }
int patch_version() const { return patch_version_; }

private:
int major_;
int minor_;
int patch_;
int major_version_;
int minor_version_;
int patch_version_;
};

class Host : public RefCounted<Host> {
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ void TableMetadata::build_keys_and_sort(const MetadataConfig& config) {
// 2) Clustering keys
// 3) Other columns

if (config.cassandra_version.major() >= 2) {
if (config.cassandra_version.major_version() >= 2) {
partition_key_.resize(get_column_count(columns_, CASS_COLUMN_TYPE_PARTITION_KEY));
clustering_key_.resize(get_column_count(columns_, CASS_COLUMN_TYPE_CLUSTERING_KEY));
for (ColumnMetadata::Vec::const_iterator i = columns_.begin(),
Expand Down