Ydb.Table.ReplicationPolicy
*/
class ReplicationPolicy extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field string preset_name = 1;
*/
protected $preset_name = '';
/**
* If value is non-zero then it specifies a number of read-only
* replicas to create for a table. Zero value means preset
* setting usage.
*
* Generated from protobuf field uint32 replicas_count = 2;
*/
protected $replicas_count = 0;
/**
* If this feature in enabled then requested number of replicas
* will be created in each availability zone.
*
* Generated from protobuf field .Ydb.FeatureFlag.Status create_per_availability_zone = 3;
*/
protected $create_per_availability_zone = 0;
/**
* If this feature in enabled then read-only replicas can be promoted
* to leader.
*
* Generated from protobuf field .Ydb.FeatureFlag.Status allow_promotion = 4;
*/
protected $allow_promotion = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $preset_name
* @type int $replicas_count
* If value is non-zero then it specifies a number of read-only
* replicas to create for a table. Zero value means preset
* setting usage.
* @type int $create_per_availability_zone
* If this feature in enabled then requested number of replicas
* will be created in each availability zone.
* @type int $allow_promotion
* If this feature in enabled then read-only replicas can be promoted
* to leader.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Protos\YdbTable::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field string preset_name = 1;
* @return string
*/
public function getPresetName()
{
return $this->preset_name;
}
/**
* Generated from protobuf field string preset_name = 1;
* @param string $var
* @return $this
*/
public function setPresetName($var)
{
GPBUtil::checkString($var, True);
$this->preset_name = $var;
return $this;
}
/**
* If value is non-zero then it specifies a number of read-only
* replicas to create for a table. Zero value means preset
* setting usage.
*
* Generated from protobuf field uint32 replicas_count = 2;
* @return int
*/
public function getReplicasCount()
{
return $this->replicas_count;
}
/**
* If value is non-zero then it specifies a number of read-only
* replicas to create for a table. Zero value means preset
* setting usage.
*
* Generated from protobuf field uint32 replicas_count = 2;
* @param int $var
* @return $this
*/
public function setReplicasCount($var)
{
GPBUtil::checkUint32($var);
$this->replicas_count = $var;
return $this;
}
/**
* If this feature in enabled then requested number of replicas
* will be created in each availability zone.
*
* Generated from protobuf field .Ydb.FeatureFlag.Status create_per_availability_zone = 3;
* @return int
*/
public function getCreatePerAvailabilityZone()
{
return $this->create_per_availability_zone;
}
/**
* If this feature in enabled then requested number of replicas
* will be created in each availability zone.
*
* Generated from protobuf field .Ydb.FeatureFlag.Status create_per_availability_zone = 3;
* @param int $var
* @return $this
*/
public function setCreatePerAvailabilityZone($var)
{
GPBUtil::checkEnum($var, \Ydb\FeatureFlag\Status::class);
$this->create_per_availability_zone = $var;
return $this;
}
/**
* If this feature in enabled then read-only replicas can be promoted
* to leader.
*
* Generated from protobuf field .Ydb.FeatureFlag.Status allow_promotion = 4;
* @return int
*/
public function getAllowPromotion()
{
return $this->allow_promotion;
}
/**
* If this feature in enabled then read-only replicas can be promoted
* to leader.
*
* Generated from protobuf field .Ydb.FeatureFlag.Status allow_promotion = 4;
* @param int $var
* @return $this
*/
public function setAllowPromotion($var)
{
GPBUtil::checkEnum($var, \Ydb\FeatureFlag\Status::class);
$this->allow_promotion = $var;
return $this;
}
}