getting started with apache geode

32

Upload: john-blum

Post on 16-Apr-2017

388 views

Category:

Software


7 download

TRANSCRIPT

Page 1: Getting Started with Apache Geode
Page 2: Getting Started with Apache Geode

2© 2014 Pivotal Software, Inc. All rights reserved. 2© 2014 Pivotal Software, Inc. All rights reserved.

Getting Started withApache GeodeSpring Boot ^ Spring Data Geode

John Blum

Page 3: Getting Started with Apache Geode

3© 2014 Pivotal Software, Inc. All rights reserved.

Presenter

John Blum Spring Data TeamSpring Data Geode LeadApache Geode CommitterPivotal Software, Inc.

@john_blum jxblum

Page 4: Getting Started with Apache Geode

4© 2014 Pivotal Software, Inc. All rights reserved.

How do you build an application that uses Apache Geode?

Page 5: Getting Started with Apache Geode

5© 2014 Pivotal Software, Inc. All rights reserved.

How do you configure and bootstrap Apache Geode for your application to use?

Page 6: Getting Started with Apache Geode

6© 2014 Pivotal Software, Inc. All rights reserved.

1. Install Apache Geode

2. Use Gfsh to start a Locator

3. Start Pulse

4. Start a Server

5. Create a replicated, persistent Region

6. Manipulate data in a Region and

demonstrate persistence.

7. Examine the effects of replication.

8. Restart the cache servers in parallel.

9. Shutdown the system including your

Locators.

Gfsh>

Page 7: Getting Started with Apache Geode

7© 2014 Pivotal Software, Inc. All rights reserved.

API

Page 8: Getting Started with Apache Geode

8© 2014 Pivotal Software, Inc. All rights reserved.

Gfsh+

API

Page 9: Getting Started with Apache Geode

9© 2014 Pivotal Software, Inc. All rights reserved.

cache.xml

Page 10: Getting Started with Apache Geode

10© 2014 Pivotal Software, Inc. All rights reserved.

Cluster Configuration

gfsh>start locator ..

gfsh>start server ..

gfsh>create region ..gfsh>create index ..

gfsh>deploy ..

gfsh>create gateway-sender ..

gfsh>create gateway-receiver ..

gfsh>alter region ..gfsh>create disk-store ..

gfsh>destroy index ..

gfsh>create async-event-queue ..

gfsh>alter runtime ..

gfsh>configure pdx ..

gfsh>destroy function..

Page 11: Getting Started with Apache Geode

11© 2014 Pivotal Software, Inc. All rights reserved.

App

cache.xml • Geode API

Gfsh

Cluster ConfigBosh

CF-CLI

PivotalGemFire

Page 12: Getting Started with Apache Geode

12© 2014 Pivotal Software, Inc. All rights reserved.

Spring XML

Page 13: Getting Started with Apache Geode

13© 2014 Pivotal Software, Inc. All rights reserved.

Spring @Java Config

Page 14: Getting Started with Apache Geode

14© 2014 Pivotal Software, Inc. All rights reserved.

Argh!

Gfsh API <cache.xml/> Cluster Configuration Spring XML Spring Java-based Annotation Config @

Page 15: Getting Started with Apache Geode

15© 2014 Pivotal Software, Inc. All rights reserved.

Spring Data GemFire / Geode

15

Apply the Spring Framework’s powerful, non-invasive programming model & concepts to simplify the configuration and development of highly-scalable, distributed Spring applications based on Pivotal GemFire or Apache Geode.

Promise

Page 16: Getting Started with Apache Geode

16© 2014 Pivotal Software, Inc. All rights reserved.

Spring Data GemFire / Geode

16

Simplify the OOTB, getting started experience by reducing the friction to get up & running as quickly and easily as possible.

Promise of 2016…

Page 17: Getting Started with Apache Geode

17© 2014 Pivotal Software, Inc. All rights reserved.

Apps are the currency…

Page 18: Getting Started with Apache Geode

18© 2014 Pivotal Software, Inc. All rights reserved.

Page 19: Getting Started with Apache Geode

19© 2014 Pivotal Software, Inc. All rights reserved.

Maven ArtifactsSpring Data GemFire / Geode

Spring Data GemFire<dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-gemfire</artifactId> <version>1.8.2.RELEASE</version></dependency>

Spring Data Geode<dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-geode</artifactId> <version>1.0.0.APACHE-GEODE-INCUBATING-M2</version></dependency>

Pivotal GemFire

http://search.maven.org/#artifactdetails%7Corg.springframework.data%7Cspring-data-gemfire%7C1.8.2.RELEASE%7Cjar

http://search.maven.org/#artifactdetails%7Corg.springframework.data%7Cspring-data-geode%7C1.0.0.APACHE-GEODE-INCUBATING-M2%7Cjar

Page 20: Getting Started with Apache Geode

20© 2014 Pivotal Software, Inc. All rights reserved.

Examples

Page 21: Getting Started with Apache Geode

21© 2014 Pivotal Software, Inc. All rights reserved.

Existing Annotations @EnableGemFireFunctions

@EnableGemFireFunctionExecutions

@EnableGemFireRepositories

Page 22: Getting Started with Apache Geode

22© 2014 Pivotal Software, Inc. All rights reserved.

More enabling annotations… @EnableAuth

@EnableExpiration

@EnableHttpService

@EnableLogging

@EnableOffHeap (Geode)

@EnableStatistics

@WithGemFireProperties

Page 23: Getting Started with Apache Geode

23© 2014 Pivotal Software, Inc. All rights reserved.

What’s Next…

Annotation Support for GemFire / Geode Callbacks Annotation-based Test Framework Extensions for Pivotal CloudFoundry (PCF)

Page 24: Getting Started with Apache Geode

24© 2014 Pivotal Software, Inc. All rights reserved.

Annotations for Callbacks@Componentpublic class ExampleApplicationCallbacks {

@CacheListener(region = “EventSource”) public void afterCreate(EntryEvent<K, V> event) { .. }

@CacheLoader(region = “DataSink”) public void load(LoaderHelper<K, V> helper) { .. }

@CacheWriter(region = “DataSource”) public void beforeUpdate(EntryEvent<K, V> event) { .. }}

Page 25: Getting Started with Apache Geode

25© 2014 Pivotal Software, Inc. All rights reserved.

Annotation-based Test Framework@RunWith(SpringRunner.class)@SpringBootTest@ClientServerIntegrationTestpublic class ExampleClientServerTests {

}

@RunWith(SpringRunner.class)@SpringBootTest@PeerIntegrationTestpublic class ExamplePeerMemberTests {

}

Page 26: Getting Started with Apache Geode

26© 2014 Pivotal Software, Inc. All rights reserved.

Other Things Brewing…

Page 27: Getting Started with Apache Geode

27© 2014 Pivotal Software, Inc. All rights reserved.

Spring Boot

27

PR #5445 – Spring Boot Starter Data Geode

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-geode</artifactId> <version>???</version></dependency>`

Page 28: Getting Started with Apache Geode

28© 2014 Pivotal Software, Inc. All rights reserved.

Spring Boot

28

PR #6224 – Auto-configuration support for SDG Repositories

interface CustomerRepository extends Repository<Customer, Long> {}

@Region(“Customers”)class Customer {}

compile “org.springframework.boot:spring-boot-starter-data-gemfire:1.5.0.M1”

No longer necessary…@SpringBootApplication@EnableGemfireRepositoriesclass ExampleSpringBootApplication {}

Page 29: Getting Started with Apache Geode

29© 2014 Pivotal Software, Inc. All rights reserved.

Try It Out…

Spring Data GemFire<dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-gemfire</artifactId> <version>1.9.0.M1</version></dependency>

Spring Data Geode<dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-geode</artifactId> <version> 1.0.0.APACHE-GEODE-INCUBATING-M3-SNAPSHOT </version></dependency>

Pivotal GemFire

https://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-gemfire/1.9.0.M1/spring-data-gemfire-1.9.0.M1.jar

https://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-geode/1.0.0.APACHE-GEODE-INCUBATING-M3-SNAPSHOT/spring-data-geode-1.0.0.APACHE-GEODE-INCUBATING-M3-SNAPSHOT.jar

Page 30: Getting Started with Apache Geode

30© 2014 Pivotal Software, Inc. All rights reserved.

ReferencesSlides @ http://www.slideshare.net/john_blum/getting-started-with-apache-geode

Examples @ https://github.com/SpringOnePlatform2016/spring-data-gemfire-in-action

Page 31: Getting Started with Apache Geode

31© 2014 Pivotal Software, Inc. All rights reserved. 31© 2014 Pivotal Software, Inc. All rights reserved.

QuestionsAnswers

Page 32: Getting Started with Apache Geode