Skip to content

Bigtable: Add createUnsafe factory method in Mutation model#3800

Merged
chingor13 merged 3 commits intogoogleapis:masterfrom
ajaaym:mutation_with_serverside_timestamp
Oct 10, 2018
Merged

Bigtable: Add createUnsafe factory method in Mutation model#3800
chingor13 merged 3 commits intogoogleapis:masterfrom
ajaaym:mutation_with_serverside_timestamp

Conversation

@ajaaym
Copy link
Contributor

@ajaaym ajaaym commented Oct 10, 2018

Add createUnsafe factory method in Mutation model.

@ajaaym ajaaym requested a review from a team October 10, 2018 20:04
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 10, 2018
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 10, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 10, 2018

private Mutation() {}
/**
* Creates Mutation object which allows setCell operation to set server side timestamp.

This comment was marked as spam.

This comment was marked as spam.

Preconditions.checkNotNull(value, "value can't be null.");
Preconditions.checkArgument(timestamp != -1, "Serverside timestamps are not supported");
if (!allowServersideTimestamp) {
Preconditions.checkArgument(timestamp != -1, "Serverside timestamps are not supported");

This comment was marked as spam.

.setCell(
"fake-family",
ByteString.copyFromUtf8("fake-qualifier"),
-1,

This comment was marked as spam.

Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming the doc change

/**
* Creates new instance of Mutation object.
*
* @return Mutation object.

This comment was marked as spam.

This comment was marked as spam.

@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 10, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 10, 2018
@chingor13 chingor13 merged commit 8548be5 into googleapis:master Oct 10, 2018
@chingor13 chingor13 mentioned this pull request Oct 10, 2018
chingor13 pushed a commit that referenced this pull request Mar 24, 2026
#3800)

So far these versions are managed both by renovate-bot and Hermetic
Build. Since each release of Hermetic Build keeps these template
versions up to date, it's better suited to manage these versions via
Hermetic Build.

The updates should be reflected by updating
`.github/workflows/hermetic_library_generation.yaml` referenced version
to the current released one.
chingor13 pushed a commit that referenced this pull request Mar 24, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>2.59.0</summary>

##
[2.59.0](googleapis/sdk-platform-java@v2.58.0...v2.59.0)
(2025-06-02)


### Features

* add logic to set universe domain to ServiceAccountJwtAccessCredentials
([#3806](googleapis/sdk-platform-java#3806))
([32dd11e](googleapis/sdk-platform-java@32dd11e))
* use debian base image for `java-library-generation`
([#3817](googleapis/sdk-platform-java#3817))
([3e3cf6d](googleapis/sdk-platform-java@3e3cf6d))


### Bug Fixes

* manage graalvm image versions via Hermetic Build templates _only_
([#3800](googleapis/sdk-platform-java#3800))
([45747cb](googleapis/sdk-platform-java@45747cb))


### Dependencies

* update dependency com.google.oauth-client:google-oauth-client-bom to
v1.39.0
([#3813](googleapis/sdk-platform-java#3813))
([c7a978e](googleapis/sdk-platform-java@c7a978e))
* update google api dependencies
([#3791](googleapis/sdk-platform-java#3791))
([4a4f77f](googleapis/sdk-platform-java@4a4f77f))
* update google auth library dependencies to v1.36.0
([#3814](googleapis/sdk-platform-java#3814))
([f54ac49](googleapis/sdk-platform-java@f54ac49))
* update grpc dependencies to 1.71.0
([#3807](googleapis/sdk-platform-java#3807))
([ce01aef](googleapis/sdk-platform-java@ce01aef))
* Upgrade Protobuf-Java to v3.25.8
([#3810](googleapis/sdk-platform-java#3810))
([2263d1d](googleapis/sdk-platform-java@2263d1d))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
chingor13 pushed a commit that referenced this pull request Mar 24, 2026
* Add a simple benchmark for statement parser

Also fixes the pom to run the annotation processor so that
mvn -Pbenchmark actually is able to run benchmarks.

* Optimize AbstractStatementParser.statementStartsWith

I found this was taking ~25% of the CPU of pgadapter when running
the TPCC benchmark loader, which seems to generate very large DMLs.

Previously, it would call split() over the whole string with
a limit. Now, it uses Guava's lazy splitter so that it doesn't
have to copy the remainder of the string following the second
match.

For whatever reason, it seems like the previous implementation
was doing something much more expensive than just copying the
tail. For 100kb long query text, this new implementation is
1600x faster. For short queries it's only a few times faster.

Before:
Benchmark                                Mode  Cnt        Score        Error  Units
StatementParserBenchmark.isQueryTest    thrpt    5  1461962.835 ± 340237.573  ops/s
StatementParserBenchmark.longQueryTest  thrpt    5     2873.150 ±    490.611  ops/s

After:

Benchmark                                Mode  Cnt        Score        Error  Units
StatementParserBenchmark.isQueryTest    thrpt    5  4765215.378 ± 132661.232  ops/s
StatementParserBenchmark.longQueryTest  thrpt    5  4671884.683 ± 486566.506  ops/s

* perf: further micro optimizations to parser

* fix: remove supportsExplain

The `supportsExplain()` method did not actually do anything useful and
returned the wrong result. The reason that it was not useful is that:
1. Parsers that do support the EXPLAIN keyword handle these as client-side statements.
   This means that they never go into the isQuery() method.
2. Parsers that do not support the EXPLAIN keyword cannot do anything with it anyways.

* build: register clirr difference

---------

Co-authored-by: Knut Olav Løite <koloite@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants