-
Notifications
You must be signed in to change notification settings - Fork 121
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
refactor: replace individual variables with ConnectionProperty #3322
Merged
rahul2393
merged 2 commits into
transactional-connection-state
from
refactor-connection-variables-to-connection-state
Sep 12, 2024
Merged
refactor: replace individual variables with ConnectionProperty #3322
rahul2393
merged 2 commits into
transactional-connection-state
from
refactor-connection-variables-to-connection-state
Sep 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product-auto-label
bot
added
size: xl
Pull request size is extra large.
api: spanner
Issues related to the googleapis/java-spanner API.
labels
Sep 6, 2024
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 7, 2024 09:13
c8e3f5a
to
95d3b5f
Compare
olavloite
force-pushed
the
transactional-connection-state
branch
from
September 7, 2024 09:19
1a223a0
to
1072b1a
Compare
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 7, 2024 09:28
95d3b5f
to
510bb3e
Compare
olavloite
force-pushed
the
transactional-connection-state
branch
from
September 7, 2024 09:47
1072b1a
to
5276c5e
Compare
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 7, 2024 09:50
510bb3e
to
51bb5c7
Compare
olavloite
force-pushed
the
transactional-connection-state
branch
from
September 7, 2024 10:05
5276c5e
to
929466b
Compare
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
2 times, most recently
from
September 7, 2024 13:39
f53ea91
to
82884b5
Compare
olavloite
force-pushed
the
transactional-connection-state
branch
from
September 7, 2024 13:39
929466b
to
b2022c0
Compare
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
2 times, most recently
from
September 7, 2024 15:15
1b54384
to
94c2d17
Compare
olavloite
changed the title
chore: replace individual variables with ConnectionProperty
refactor: replace individual variables with ConnectionProperty
Sep 7, 2024
olavloite
force-pushed
the
transactional-connection-state
branch
from
September 10, 2024 10:45
b2022c0
to
a7dd2e9
Compare
…tate This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure.
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 10, 2024 10:54
94c2d17
to
8d91e01
Compare
Replace individual variables in ConnectionOptions and ConnectionImpl with references to ConnectionProperties. This reduces the amount of code bloat, especially in ConnectionOptions, as all connection property parsing is now handled by the ConnectionState class in a generic way. This setup also reduces the amount of code that is needed to add a new connection property, as there is only one source of truth: the list of properties in the ConnectionProperties class. Following steps that will reduce the amount of code bloat further are: 1. Replace all the regular expressions for SET and SHOW statements with a simple token-based parser. 2. Cleaning up ConnectionOptions further by removing the duplicate list of ConnectionProperties there. These can be removed once the JDBC driver has been updated to use the new list of properties.
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 10, 2024 11:40
8d91e01
to
aec3020
Compare
rahul2393
approved these changes
Sep 12, 2024
rahul2393
deleted the
refactor-connection-variables-to-connection-state
branch
September 12, 2024 08:48
rahul2393
pushed a commit
that referenced
this pull request
Oct 11, 2024
…tate (#3321) * refactor: add internal data structures for transactional connection state This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure. * refactor: replace individual variables with ConnectionProperty (#3322) * refactor: add internal data structures for transactional connection state This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure. * refactor: replace individual variables with ConnectionProperty Replace individual variables in ConnectionOptions and ConnectionImpl with references to ConnectionProperties. This reduces the amount of code bloat, especially in ConnectionOptions, as all connection property parsing is now handled by the ConnectionState class in a generic way. This setup also reduces the amount of code that is needed to add a new connection property, as there is only one source of truth: the list of properties in the ConnectionProperties class. Following steps that will reduce the amount of code bloat further are: 1. Replace all the regular expressions for SET and SHOW statements with a simple token-based parser. 2. Cleaning up ConnectionOptions further by removing the duplicate list of ConnectionProperties there. These can be removed once the JDBC driver has been updated to use the new list of properties. * feat: enable transactional connection state as an opt-in (#3326) * refactor: add internal data structures for transactional connection state This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure. * refactor: replace individual variables with ConnectionProperty Replace individual variables in ConnectionOptions and ConnectionImpl with references to ConnectionProperties. This reduces the amount of code bloat, especially in ConnectionOptions, as all connection property parsing is now handled by the ConnectionState class in a generic way. This setup also reduces the amount of code that is needed to add a new connection property, as there is only one source of truth: the list of properties in the ConnectionProperties class. Following steps that will reduce the amount of code bloat further are: 1. Replace all the regular expressions for SET and SHOW statements with a simple token-based parser. 2. Cleaning up ConnectionOptions further by removing the duplicate list of ConnectionProperties there. These can be removed once the JDBC driver has been updated to use the new list of properties. * refactor: add internal data structures for transactional connection state This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure. * refactor: replace individual variables with ConnectionProperty Replace individual variables in ConnectionOptions and ConnectionImpl with references to ConnectionProperties. This reduces the amount of code bloat, especially in ConnectionOptions, as all connection property parsing is now handled by the ConnectionState class in a generic way. This setup also reduces the amount of code that is needed to add a new connection property, as there is only one source of truth: the list of properties in the ConnectionProperties class. Following steps that will reduce the amount of code bloat further are: 1. Replace all the regular expressions for SET and SHOW statements with a simple token-based parser. 2. Cleaning up ConnectionOptions further by removing the duplicate list of ConnectionProperties there. These can be removed once the JDBC driver has been updated to use the new list of properties. * feat: enable transactional connection state as an opt-in This change enables transactional connection state for the Connection API. It can be enabled by default for PostgreSQL-dialect databases using a system property, and is always an opt-in for GoogleSQL-dialect databases. Transactional connection state can be enabled for any database connection with the `connection_state_type` connection STARTUP property. * chore: remove misleading comment * chore: generate libraries at Tue Oct 8 12:50:40 UTC 2024 --------- Co-authored-by: cloud-java-bot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: spanner
Issues related to the googleapis/java-spanner API.
size: xl
Pull request size is extra large.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace individual variables in ConnectionOptions and ConnectionImpl with
references to ConnectionProperties. This reduces the amount of code bloat,
especially in ConnectionOptions, as all connection property parsing is
now handled by the ConnectionState class in a generic way.
This setup also reduces the amount of code that is needed to add a new
connection property, as there is only one source of truth: the list of
properties in the ConnectionProperties class.
Following steps that will reduce the amount of code bloat further are:
a simple token-based parser.
of ConnectionProperties there. These can be removed once the JDBC
driver has been updated to use the new list of properties.