Skip to content

Commit

Permalink
Merge pull request Juniper#180 from Juniper/arvindv-development2
Browse files Browse the repository at this point in the history
changing the replication factor to 2 for ContrailAnalytics keyspace.
  • Loading branch information
Raj Reddy committed Jan 16, 2014
2 parents bc3f489 + c7e41de commit 0293e1b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/analytics/db_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ bool DbHandler::Initialize(int instance) {
return false;
}

if (!dbif_->Db_AddSetTablespace(g_viz_constants.COLLECTOR_KEYSPACE)) {
if (!dbif_->Db_AddSetTablespace(g_viz_constants.COLLECTOR_KEYSPACE,"2")) {
LOG(ERROR, __func__ << ": Create/Set KEYSPACE: " <<
g_viz_constants.COLLECTOR_KEYSPACE << " FAILED");
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/analytics/test/cdb_if_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class CdbIfMock : public CdbIf {

MOCK_METHOD0(Db_Init, bool());
MOCK_METHOD0(Db_Uninit, void());
MOCK_METHOD1(Db_AddTablespace, bool(const std::string&));
MOCK_METHOD1(Db_AddTablespace, bool(const std::string&,const std::string&));
MOCK_METHOD1(Db_SetTablespace, bool(const std::string&));
MOCK_METHOD1(Db_AddSetTablespace, bool(const std::string&));
MOCK_METHOD1(Db_AddSetTablespace, bool(const std::string&,const std::string& = "1"));
MOCK_METHOD1(Db_FindTablespace, bool(const std::string&));

MOCK_METHOD2(Db_GetColumnFamilies, void(const std::string, std::vector<std::string>&));
Expand Down
8 changes: 4 additions & 4 deletions src/gendb/cdb_if.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ void CdbIf::Db_Uninit(bool shutdown) {
}
}

bool CdbIf::Db_AddTablespace(const std::string& tablespace) {
bool CdbIf::Db_AddTablespace(const std::string& tablespace,const std::string& replication_factor) {
if (!Db_FindTablespace(tablespace)) {
KsDef ks_def;
ks_def.__set_name(tablespace);
ks_def.__set_strategy_class("SimpleStrategy");
std::map<std::string, std::string> strat_options;
strat_options.insert(std::pair<std::string, std::string>("replication_factor", "1"));
strat_options.insert(std::pair<std::string, std::string>("replication_factor", replication_factor));
ks_def.__set_strategy_options(strat_options);

try {
Expand Down Expand Up @@ -235,8 +235,8 @@ bool CdbIf::Db_SetTablespace(const std::string& tablespace) {
return true;
}

bool CdbIf::Db_AddSetTablespace(const std::string& tablespace) {
if (!Db_AddTablespace(tablespace)) {
bool CdbIf::Db_AddSetTablespace(const std::string& tablespace,const std::string& replication_factor) {
if (!Db_AddTablespace(tablespace,replication_factor)) {
return false;
}
if (!Db_SetTablespace(tablespace)) {
Expand Down
4 changes: 2 additions & 2 deletions src/gendb/cdb_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class CdbIf : public GenDbIf {
virtual bool Db_Init(std::string task_id, int task_instance);
virtual void Db_Uninit(bool shutdown);
virtual void Db_SetInitDone(bool);
virtual bool Db_AddTablespace(const std::string& tablespace);
virtual bool Db_AddTablespace(const std::string& tablespace,const std::string& replication_factor);
virtual bool Db_SetTablespace(const std::string& tablespace);
virtual bool Db_AddSetTablespace(const std::string& tablespace);
virtual bool Db_AddSetTablespace(const std::string& tablespace,const std::string& replication_factor = "1");
virtual bool Db_FindTablespace(const std::string& tablespace);
/* api to add a column family in the current table space */
virtual bool NewDb_AddColumnfamily(const GenDb::NewCf& cf);
Expand Down
4 changes: 2 additions & 2 deletions src/gendb/gendb_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ class GenDbIf {
virtual void Db_Uninit(bool shutdown) = 0;
virtual void Db_SetInitDone(bool init_done) = 0;
/* api to create a table space */
virtual bool Db_AddTablespace(const std::string& tablespace) = 0;
virtual bool Db_AddTablespace(const std::string& tablespace,const std::string& replication_factor) = 0;
/* api to set the current table space */
virtual bool Db_SetTablespace(const std::string& tablespace) = 0;
/* api to set the current table space */
virtual bool Db_AddSetTablespace(const std::string& tablespace) = 0;
virtual bool Db_AddSetTablespace(const std::string& tablespace,const std::string& replication_factor="1") = 0;
/* api to add a column family in the current table space */
virtual bool Db_FindTablespace(const std::string& tablespace) = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/query_engine/test/query_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void CdbIfMock::initialize_tables()

bool CdbIfMock::Db_Init() {return true;}

bool CdbIfMock::Db_AddSetTablespace(const std::string& tablespace)
bool CdbIfMock::Db_AddSetTablespace(const std::string& tablespace, const std::string& replication_factor)
{
QE_ASSERT(tablespace == g_viz_constants.COLLECTOR_KEYSPACE);
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/query_engine/test/query_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CdbIfMock : public CdbIf {
~CdbIfMock() { MessageTable.clear();}

bool Db_Init();
bool Db_AddSetTablespace(const std::string& tablespace);
bool Db_AddSetTablespace(const std::string& tablespace,const std::string& replication_factor = "1");
bool Db_GetRangeSlices(std::vector<GenDb::Column>&,const GenDb::Cf&, const GenDb::ColumnRange&, const GenDb::RowKeyRange&);
bool Db_GetMultiRow(std::map<std::string, std::vector<GenDb::ColElement> >& ret,
const std::string& cfname, const std::vector<std::string>& key);
Expand Down

0 comments on commit 0293e1b

Please sign in to comment.