1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +03:00

change adddbroot for amazon

This commit is contained in:
david hill
2016-04-13 15:27:10 -05:00
parent aa86382a3c
commit fdcd05f8e4
4 changed files with 86 additions and 53 deletions

View File

@@ -14,7 +14,7 @@ fi
if [ "$1" = "create" ]; then if [ "$1" = "create" ]; then
if [ "$2" = "" ]; then if [ "$2" = "" ]; then
echo "Enter of the volume, in GiB (1-1024)" echo "Enter size of the volume, in GiB (1-1024)"
exit 1 exit 1
fi fi
volumeSize="$2" volumeSize="$2"

View File

@@ -5930,7 +5930,7 @@ namespace oam
* *
****************************************************************************/ ****************************************************************************/
void Oam::addDbroot(const int dbrootNumber, DBRootConfigList& dbrootlist) void Oam::addDbroot(const int dbrootNumber, DBRootConfigList& dbrootlist, string EBSsize)
{ {
int SystemDBRootCount = 0; int SystemDBRootCount = 0;
string cloud; string cloud;
@@ -5957,6 +5957,20 @@ namespace oam
if ( (cloud == "amazon-ec2" || cloud == "amazon-vpc") && if ( (cloud == "amazon-ec2" || cloud == "amazon-vpc") &&
DBRootStorageType == "external" ) DBRootStorageType == "external" )
{ {
if ( volumeSize == oam::UnassignedName )
{
if ( EBSsize != oam::UnassignedName ) {
volumeSize = EBSsize;
setSystemConfig("PMVolumeSize", volumeSize);
}
}
else
{
if ( EBSsize != oam::UnassignedName ) {
volumeSize = EBSsize;
}
}
if ( newSystemDBRootCount > MAX_DBROOT_AMAZON ) if ( newSystemDBRootCount > MAX_DBROOT_AMAZON )
{ {
cout << "ERROR: Failed add, total Number of DBRoots would be over maximum of " << MAX_DBROOT_AMAZON << endl; cout << "ERROR: Failed add, total Number of DBRoots would be over maximum of " << MAX_DBROOT_AMAZON << endl;

View File

@@ -2244,7 +2244,7 @@ namespace oam
/** /**
*@brief add DBRoot *@brief add DBRoot
*/ */
EXPORT void addDbroot(const int dbrootNumber, DBRootConfigList& dbrootlist); EXPORT void addDbroot(const int dbrootNumber, DBRootConfigList& dbrootlist, std::string EBSsize = oam::UnassignedName);
/** /**
*@brief distribute Fstab Updates *@brief distribute Fstab Updates

View File

@@ -1684,6 +1684,17 @@ int processCommand(string* arguments)
break; break;
} }
string cloud;
bool amazon = false;
try {
oam.getSystemConfig("Cloud", cloud);
}
catch(...) {}
string::size_type pos = cloud.find("amazon",0);
if (pos != string::npos)
amazon = true;
if (arguments[1] == "") if (arguments[1] == "")
{ {
// need atleast 1 arguments // need atleast 1 arguments
@@ -1691,20 +1702,28 @@ int processCommand(string* arguments)
break; break;
} }
if (arguments[2] != "")
{
// error out if extra arguments exist to catch if they meant to use assigndbrootpmconfig
cout << endl << "**** addDbroot Failed : Extra Parameter passed, enter 'help' for additional information" << endl;
break;
}
int dbrootNumber = atoi(arguments[1].c_str()); int dbrootNumber = atoi(arguments[1].c_str());
string EBSsize = oam::UnassignedName;
if (amazon)
{
if ( arguments[2] != "")
EBSsize = arguments[2];
else
{
cout << endl;
oam.getSystemConfig("PMVolumeSize", EBSsize);
string prompt = "Enter EBS storage size in GB: (" + EBSsize + "): ";
EBSsize = dataPrompt(prompt);
}
}
//get dbroots ids for reside PM //get dbroots ids for reside PM
try try
{ {
DBRootConfigList dbrootlist; DBRootConfigList dbrootlist;
oam.addDbroot(dbrootNumber, dbrootlist); oam.addDbroot(dbrootNumber, dbrootlist, EBSsize);
cout << endl << " New DBRoot IDs added = "; cout << endl << " New DBRoot IDs added = ";