-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bigtable: Read modify write row model #1334
Bigtable: Read modify write row model #1334
Conversation
Bigtable/src/DataClient.php
Outdated
*/ | ||
public function readModifyWriteRow($rowKey, $rules, array $options = []) | ||
{ | ||
if (!$rules instanceof ReadModifyWriteRowRules) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataUtil.php
Outdated
*/ | ||
public static function intToByteString($intValue) | ||
{ | ||
if (!is_numeric($intValue)) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataUtil.php
Outdated
* Utility method to convert integer value in to 64 bit signed BigEndian | ||
* representation. | ||
* | ||
* @param string|int $intValue Integer value to convert to. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataUtil.php
Outdated
* | ||
* @param string|int $intValue Integer value to convert to. | ||
* @return string Returns string of bytes representing 64 bit big signed BigEndian. | ||
* @throws \InvalidArgumentException If value is not numberic. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataUtil.php
Outdated
} | ||
|
||
/** | ||
* Convertes string bytes of 64 bit signed BigEndian to int. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* @param string $qualifier Column qualifier of the row. | ||
* @param string $value Value of the Column qualifier. | ||
* | ||
* @return ReadModifyWriteRowRules returns current ReadModifyWriteRowRules object. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
/** | ||
* Returns proto representation of ReadModifyWriteRule. | ||
* | ||
* @return array ReadModifyWriteRule Returns array of ReadModifyWriteRule rules. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* | ||
* @return array ReadModifyWriteRule Returns array of ReadModifyWriteRule rules. | ||
*/ | ||
public function toProto() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
->setRow( | ||
(new Row) | ||
->setFamilies( | ||
[ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataClient.php
Outdated
* ``` | ||
* use Google\Cloud\Bigtable\ReadModifyWriteRowRules; | ||
* | ||
* $rules = (new ReadModifyWriteRowRules)->append('cf1', 'cq1', 'value12'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataClient.php
Outdated
* print_r($row); | ||
* ``` | ||
* | ||
* //Increments value |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more minor notes, looking good!
Bigtable/src/DataUtil.php
Outdated
public static function intToByteString($intValue) | ||
{ | ||
if (!self::isSupported()) { | ||
throw new \ErrorException('This utility is only supported on 64 bit machine with PHP version > 5.5.'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/src/DataUtil.php
Outdated
public static function isSupported() | ||
{ | ||
if (self::$isSupported === null) { | ||
self::$isSupported = PHP_VERSION_ID > 50500; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* | ||
* @param string $familyName Family name of the row. | ||
* @param string $qualifier Column qualifier of the row. | ||
* @param int $amount Amount to add to value of Column qualifier. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
$snippet = $this->snippetFromMethod(DataClient::class, 'readModifyWriteRow', 1); | ||
|
||
if (phpversion() < '5.6.0') { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Bigtable/tests/Unit/DataUtilTest.php
Outdated
* @expectedException \InvalidArgumentException | ||
* @expectedExceptionMessage Expected argument to be of type int, instead got | ||
*/ | ||
public function testIntToByteStringWithString() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* Bigtable data operation mutate rows (#1230) * mutate rows * Fixed type in comment * Bigtable Mutate rows optional parameter (#1233) * add mutate rows optional configuration parameter * update order of append operation * Bigtable data read rows (#1234) * read rows * read rows acceptance test * fix type in parameter * fix param type in comment * Fix the state value * fix error in php5.5 * fix for protobuf extension * fix doc issue * review updates * fix rows->readAll * fix cs * Bigtable: Read rows filter (#1253) * read rows filter * fix test case * Filter * add comments * add espace for literal regex * Fix failing test * add snippet test * Fix doc * code review updates * moved builder in to its own namespace * add snippet test * arrange use statement * fix failing test case * Fix documentation * Readrows Filter and system test (#1322) * System test for filter * update doc * throw exception if rowKeys is not array in readRows * Simplified some fitler test * use dataprovider for filter system test * formatting * address feedback * Provide test name in message for conformance test (#1332) * provide message for failed test * update message * Bigtable: Read modify write row model (#1334) * readModifyWriteRowRule model * read modify write row * read modify write row api * update comments * fix static initializer * fix exception check for php < 7 * fix test case * update pack and unpack for php5.5 * address feedback * fix php 5.5 snippet test case * update doc and check * address feedback * Bigtable: Sample row keys api (#1338) * sample row keys * sample row keys * fix system test case * address feedback * fix snippet test * Bigtable: checkAndMutateRow api implementation (#1333) * checkAndMutateRow api * fix doc * fix snippet test * change snippet test * address feedback * update note * update comment * apply note to truemutations * fix comment * fix snippet test * Bigtable: refactor mutation model (#1367) * refactor mutation model * fix doc comment * address feedback * use ternary operator * fix comment * mutateRow api (#1382) * Rename DataClient -> Table and add BigtableClient (#1387) * rename DataClient to Table and add generic constructor options * update documentation * update snippets * update and rename system tests * update unit tests * add projectId/credentials to client * update mutateRow * update mutateRow system test * add imports for documentation * fix tests * potential fix for hhvm * fix projectId * Prep Bigtable handwritten client for release (#1388) * prepare bigtable handwritten layer for release * fix trailing comma * Update readme/projectID detection (#1391) * add note about differences in handwritten client * update projectID detection (we cannot reliably use the ClientTrait with the new client configuration options) * remove ClientTrait * add note on providing a keyfile * add note about authentication * Add 64 or 32 bit test (#1393) * Add 64 or 32 bit test * remove test annotation
Read modify write row model