- Notifications
You must be signed in to change notification settings - Fork 310
DATACASS-656 - Migrate to Cassandra Driver 4.x #167
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
Closed
Closed
Conversation
This file contains hidden or 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
…oryBean to CassandraCqlSessionFactoryBean.
…oryBean to CassandraCqlSessionFactoryBean.
Use consistently -ref.
We now provide SessionFactoryFactoryBean as factory bean and initializer for a SessionFactory. <cassandra:session-factory> <cassandra:script location="my/scripts/schema.cql"/> </cassandra:session-factory>
We now provide a utility class to build CQL statements using a fluent functional declaration.
AsyncResultStream can forward-stream over a AsyncResultStream by fetching subsequent pages and applying either a Consumer or Collector for non-blocking processing of asynchronously fetched results.
…Size and timeout. Use renamed Statement options by introducing new pageSize(…) and timeout(…) methods. Deprecated existing methods. Also, deprecate retryPolicy method in preparation for execution profiles.
Cassandra Driver 4 uses LocalDateTime as type for TIMESTAMP. We want to allow also usage of plain old Date to ease migration.
Forced quoting is now deprecated as we're using CqlIdentifier which is able to determine whether an identifier requires quoting.
Move to Driver's CqlIdentifier in Javadoc.
Collection-type terms cannot properly render tuple values or UDT values so we're translating these to proper CQL using nested term collections.
Fix references to CqlSession.
Typos.
mp911de added a commit that referenced this pull request Jan 8, 2020
…oryBean to CassandraCqlSessionFactoryBean. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Use consistently -ref. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
We now provide SessionFactoryFactoryBean as factory bean and initializer for a SessionFactory. <cassandra:session-factory> <cassandra:script location="my/scripts/schema.cql"/> </cassandra:session-factory> Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
…tuples, UDT). Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
We now provide a utility class to build CQL statements using a fluent functional declaration. AsyncResultStream can forward-stream over a AsyncResultStream by fetching subsequent pages and applying either a Consumer or Collector for non-blocking processing of asynchronously fetched results. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
…Size and timeout. Use renamed Statement options by introducing new pageSize(…) and timeout(…) methods. Deprecated existing methods. Also, deprecate retryPolicy method in preparation for execution profiles. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Cassandra Driver 4 uses LocalDateTime as type for TIMESTAMP. We want to allow also usage of plain old Date to ease migration. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Forced quoting is now deprecated as we're using CqlIdentifier which is able to determine whether an identifier requires quoting. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Move to Driver's CqlIdentifier in Javadoc. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Collection-type terms cannot properly render tuple values or UDT values so we're translating these to proper CQL using nested term collections. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Update license header years to 2020. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
CassandraType is a better place for the name enumeration as it provides the necessary context how Cassandra primitives are used than CassandraSimpleTypeHolder. Original pull request: #167.
mp911de added a commit that referenced this pull request Jan 8, 2020
Fix references to CqlSession. Typos. Original pull request: #167.
| That's merged now. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
This PR migrates Spring Data Cassandra to the Datastax 4.x driver.
Breaking changes:
Removal of types (without replacement):
PoolingOptionsFactoryBeanSocketOptionsFactoryBeanCassandraClusterFactoryBeanCassandraClusterParserCassandraCqlClusterFactoryBeanCassandraCqlClusterParserCassandraCqlSessionParserAbstractClusterConfigurationGuavaListenableFutureAdapterClusterBuilderConfigurer(useSessionBuilderConfigurerinsteadhttp://www.springframework.org/schema/cql, usehttp://www.springframework.org/schema/data/cassandrainstead)cassandra:cluster(endpoint properties merged tocassandra:session)cql:template, usecassandra:cql-templateinsteadDeprecation:
CassandraCqlSessionFactoryBean, useCqlSessionFactoryBeaninstead.CassandraSessionFactoryBean, useCqlSessionFactoryBeaninstead.AbstractCqlTemplateConfiguration, useAbstractSessionConfigurationinstead.CodecRegistryTupleTypeFactory, useSimpleTupleTypeFactoryinstead.CqlIdentifier, use the driverCqlIdentifierinstead.forceQuoteattributes as quoting is no longer required.CqlIdentifierproperly escapes reserved keywords and takes care of case-sensitivity.fetchSizeonQueryOptionsand…CqlTemplatetypes was deprecated, usepageSizeinsteadCqlSessionFactoryBean(cassandra:session) is deprecated. Keyspace creation viaCqlSessionFactoryBean(cassandra:session) is not affected.New Configuration API:
CqlSessionFactoryBeanInitializeKeyspaceBeanDefinitionParserSessionFactoryFactoryBeanincluding schema creation viaKeyspacePopulatorcassandra:cluster(endpoint properties merged tocassandra:session)cassandra:initialize-keyspacenamespace supportcassandra:session-factorywithcassandra:scriptsupportKeyspacePopulatorandSessionFactoryInitializerto initialize a keyspaceOther types of changes:
Nameconstant class was removed.@CassandraTypeswitched toCassandraSimpleTypeHolder.Name.ConsistentyLevelconstant class was removed and reintroduced asDefaultConsistencyLevel.@Consistencywas adapted toDefaultConsistencyLevel.RetryPolicyonQueryOptionsand…CqlTemplatetypes was removed without replacement.PagingStatetype was removed. Paging state now usesByteBuffer.SimpleUserTypeResolveracceptsCqlSessioninstead ofCluster.SimpleTupleTypeFactorywas migrated toenum.SimpleTupleTypeFactory.INSTANCEno longer requires aCluster/CqlSessioncontext.StatementBuilderto functionallyConfiguration summary
Driver 4 merges
ClusterandSessionobjects into a singleCqlSessionobject, therefore allCluster-related API was removed. The Configuration was revised in large parts by removing most configuration items that were moved intoDriverConfigLoaderthat is mostly file-based. This means thatSocketOptions,AddressTranslatorand many more options are configured now through other means.XML and Java-based config are adapted.
Keyspace creation is now tied to the
CqlSessionFactoryBeanand schema creation (types, tables, indexes) are controlled bySessionFactoryFactoryBean.Changes to Session
The driver now uses
CqlSessioninstead ofSession.SessionFactory,…CqlTemplate, and…CassandraTemplateand all related types are migrated accordingly.Further information:
TODO: