Ydb.Table.PartitioningPolicy
*/
class PartitioningPolicy extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field string preset_name = 1;
*/
protected $preset_name = '';
/**
* Generated from protobuf field .Ydb.Table.PartitioningPolicy.AutoPartitioningPolicy auto_partitioning = 2;
*/
protected $auto_partitioning = 0;
protected $partitions;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $preset_name
* @type int $auto_partitioning
* @type int|string $uniform_partitions
* Allows to enable uniform sharding using given shards number.
* The first components of primary key must have Uint32/Uint64 type.
* @type \Ydb\Table\ExplicitPartitions $explicit_partitions
* Explicitly specify key values which are used as borders for
* created partitions.
* }
*/
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;
}
/**
* Generated from protobuf field .Ydb.Table.PartitioningPolicy.AutoPartitioningPolicy auto_partitioning = 2;
* @return int
*/
public function getAutoPartitioning()
{
return $this->auto_partitioning;
}
/**
* Generated from protobuf field .Ydb.Table.PartitioningPolicy.AutoPartitioningPolicy auto_partitioning = 2;
* @param int $var
* @return $this
*/
public function setAutoPartitioning($var)
{
GPBUtil::checkEnum($var, \Ydb\Table\PartitioningPolicy\AutoPartitioningPolicy::class);
$this->auto_partitioning = $var;
return $this;
}
/**
* Allows to enable uniform sharding using given shards number.
* The first components of primary key must have Uint32/Uint64 type.
*
* Generated from protobuf field uint64 uniform_partitions = 3;
* @return int|string
*/
public function getUniformPartitions()
{
return $this->readOneof(3);
}
public function hasUniformPartitions()
{
return $this->hasOneof(3);
}
/**
* Allows to enable uniform sharding using given shards number.
* The first components of primary key must have Uint32/Uint64 type.
*
* Generated from protobuf field uint64 uniform_partitions = 3;
* @param int|string $var
* @return $this
*/
public function setUniformPartitions($var)
{
GPBUtil::checkUint64($var);
$this->writeOneof(3, $var);
return $this;
}
/**
* Explicitly specify key values which are used as borders for
* created partitions.
*
* Generated from protobuf field .Ydb.Table.ExplicitPartitions explicit_partitions = 4;
* @return \Ydb\Table\ExplicitPartitions|null
*/
public function getExplicitPartitions()
{
return $this->readOneof(4);
}
public function hasExplicitPartitions()
{
return $this->hasOneof(4);
}
/**
* Explicitly specify key values which are used as borders for
* created partitions.
*
* Generated from protobuf field .Ydb.Table.ExplicitPartitions explicit_partitions = 4;
* @param \Ydb\Table\ExplicitPartitions $var
* @return $this
*/
public function setExplicitPartitions($var)
{
GPBUtil::checkMessage($var, \Ydb\Table\ExplicitPartitions::class);
$this->writeOneof(4, $var);
return $this;
}
/**
* @return string
*/
public function getPartitions()
{
return $this->whichOneof("partitions");
}
}