spring-boot-data-geode
spring-boot-data-geode copied to clipboard
Tie-up tasks for Cache Data Import/Export using JSON
The following things need to be investigated further:
- DONE - Test with a
ClientCacheand client LOCALRegion(s)with no connections (i.e. noPooldefined) to a cluster/server using PDX
Currently Throws:
...
Caused by: org.apache.geode.pdx.JSONFormatterException: Could not parse JSON document: [Source: (String)"{"@type":"example.app.model.Customer","id":1,"name":"Jon Doe"}"; line: 1, column: 63]
...
Caused by: org.apache.geode.cache.CacheClosedException: Client pools have been closed so the PDX type registry is not available.
:(
-
DONE - Test using
@EnableClusterAwareannotation (this is currently not working because the "Cluster Configuration Push" happens in theSmartLifecyclephase of container startup and the "Import" happens in theBeanPostProcessor.postProcessAfterInitialization()callback on theRegion, which occurs before the push... #sigh) -
DONE - Test using
@EnableCachingDefinedRegionsannotation (i.e.Regionscreated from Spring's Cache Abstraction annotations or JSR-107, JCache API annotations) -
Test using
@EnableClusterDefinedRegionsannotation (i.e.Regionscreated on the client from the serverRegiondefinitions) -
Test export/import with entity having natural id (e.g.
Book.isbn) that would need to include a@identifierJSON object metadata field. Possible for POJO stored in theRegionsince we can inspect the object class type, not possible when theRegionvalue is aPdxInstancethat did not originate from JSON. In that case, the user must manually make sure the non-JSON generatedPdxInstanceincludes a@identifierPDX field before it is exported to JSON. -
Add more documentation around features & limitations (gotchas): ** Java 8 Types, JSR-310 (Time) Types and Jackson 2 vs. 3, etc. ** Use of multiple Cache Data Importers and ordering using the
@Orderannotation or theOrderedinterface on Cache Data Importer/Exporter bean definitions. ** Explain the (hidden) use ofPredicate'sto filterRegionson import and export. ** Explain the API/SPI for writing extensions, such as Cache Data Importers/Exporters for XML, XLS, SQL DML or other data formats. ** Explain the types of numeric values: e.g. application domain model class (e.g.Customer) might define anidfield of typeLongbut the value for the corresponding JSON field (i.e. "id") will be abyteas processed byJSONFormatter, thereforeRegion.get(key)lookups must becustomersRegion.get((byte) 1)even if the "Customers"Regionis defined asRegion<Long, Customer>. Also theRegionentry value will be aPdxInstanceand notCustomer. ** ??? -
???
Completed handling for client LOCAL Regions. See Issue #91, commit and test class.
Completed handling for Cache Data Imports/Exports in conjunction with the @EnableClusterAware annotation. See Issue #90, commit and test class, and specifically the configuration.
Filed the following Apache Geode JIRA tickets related to these problems:
-
GEODE-8235 - "Server should not be required to have an available PDX type registry for ClientCache applications."
-
GEODE-8254 - "JSONFormatter cannot parse JSON Arrays."
-
GEODE-8255 - "JSONFormatter does not properly generate the @type metadata field."
-
GEODE-8256 - "The Jackson ObjectMapper used by a PdxInstance does not properly handle Java 8 Types."
-
GEODE-8257 - "_ The Jackson ObjectMapper used by a PdxInstance cannot handle typed JSON Objects._"
-
GEODE-8258 - "_ Cannot implement PdxInstance and store in a Region._"