0

I am trying to do the below use case and I am unable to find any explanation about how to do it with Apache Geode.

For example:

I have an Apache Geode Region called A (1000 records) that has the SD Repository "crudRepoA".

During run-time I want to snapshot this Region to another Region called A1 (1000 records) and use a similar CRUD Repository that I have defined on Region A.

Is live Snapshot possible with an out-of-the-box feature of Apache Geode?

Is it possible to use the "crudRepoA" on this newly created Region?

Is there a way to create a new "crudRepoA1" (identical to "crudRepoA") on the fly and run my queries on this newly created Region?

John Blum
  • 7,381
  • 1
  • 20
  • 30

1 Answers1

0

Is live Snapshot possible with an out of the box feature of Apache Geode?

Yes. You can use Apache Geode's Cache/Region Snapshot Service (possibly, worth a look anyway). This is also well supported by Spring Data Geode.

Is it possible to use the crudRepoA on this newly created region ?

Well, not exactly, so...

Is there a way to create a new crudRepoA1 (identical to crudRepoA) on the fly and run my queries on this newly created Region?

Yes.

You can do the following...

@Region("A")
class DomainTypeForRegionA { 
  @Id Long id;
  ...
}

interface RegionARepository extends GemfireRepository<DomainTypeForRegionA, Long> { ... }

@Region("A1")
interface RegionA1Repository extends RegionARepository { ... } 

Sometime ago (1.4.0.M1) I added support for annotating the application (GemFire) Repository interface (with @Region) instead/also, which overrides the Region in which the data for the application domain object type (defined by the @Region annotation on the domain object type itself, e.g. as shown above with DomainTypeForRegionA) is persisted or accessed.

Read the entire section Entity Mapping in the SDG Reference Guide.

Hope this helps!

-John

John Blum
  • 7,381
  • 1
  • 20
  • 30