当前位置: 首页 > news >正文

哪个网站做非洲的生意最新wordpress漏洞

哪个网站做非洲的生意,最新wordpress漏洞,wordpress设置主页标题,北京官网seo推广1. Spring Data Pivotal Gemfire –简介 在这篇文章中#xff0c;我们将介绍有关Spring Data Pivotal Gemfire的全面教程。 Pivotal Gemfire是由Apache Geode支持的内存中数据网格解决方案。 使用Pivotal Gemfire构建的应用程序使您可以在分布式服务器节点之间轻松扩展系统。 … 1. Spring Data Pivotal Gemfire –简介 在这篇文章中我们将介绍有关Spring Data Pivotal Gemfire的全面教程。 Pivotal Gemfire是由Apache Geode支持的内存中数据网格解决方案。 使用Pivotal Gemfire构建的应用程序使您可以在分布式服务器节点之间轻松扩展系统。 无论分布结构如何Pivotal Gemfire均可确保数据一致性。 它使应用程序能够向数百万用户提供实时数据。 另一方面Spring框架是一种广泛使用的框架它为构建企业级应用程序提供了基础。 在本文中我们将讨论Spring数据Spring框架的众多模块之一如何与Pivotal Gemfire集成以加快开发过程并将Spring框架的功能引入Pivotal Gemfire应用程序。 2.本教程的先决条件 在进入本教程之前有必要了解进行的假设以及继续进行本教程所需的工具。 在此我假设您了解以下内容 了解访问关键数据 对Spring框架的基本了解 对Pivotal API调用的基本了解 在整个教程中我们将使用以下工具和规范 JDK 1.8 弹簧工具套件/ IntelliJ Maven的3.2 3.开始 首先从项目开始让我们创建一个Maven项目并添加以下依赖项。 pom.xml project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdorg.springframework.samples/groupIdartifactIdpivotal_tutorial/artifactIdversion0.0.1-SNAPSHOT/versionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.0.3.RELEASE/version/parentpropertiesspring-shell.version1.2.0.RELEASE/spring-shell.version/propertiesrepositoriesrepositoryidspring-releases/idurlhttps://repo.spring.io/libs-release/url/repository/repositoriesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactIdexclusionsexclusiongroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-logging/artifactId/exclusion/exclusions/dependencydependencygroupIdorg.springframework.data/groupIdartifactIdspring-data-gemfire/artifactId/dependencydependencygroupIdorg.springframework.shell/groupIdartifactIdspring-shell/artifactIdversion${spring-shell.version}/versionscoperuntime/scope/dependencydependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactId/dependency/dependenciesbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build/project 保存具有这些依赖项的项目并允许其进行构建。 上面的文件包含必需的Spring Boot依赖关系以及Pivotal Gemfire的Spring Data依赖关系。 一旦项目下载了相关的依赖项就可以继续编码部分。 带有Pivotal Gemfire的Spring Data帮助我们配置对分布式数据访问中心的访问。 这种结合可以帮助我们降低对磁盘的命中率并使用内存中的缓存级别来维持更好的响应时间。 本教程将带您完成完整的设置和配置过程。 4.创建一个实体 首先主要要求是创建一个实体。 让我们创建一个简单的Person实体其中包含一个人的详细信息例如人的姓名和年龄。 要创建这样的实体请使用以下代码。 PersonEntity.java package pivotal_tutorial;import java.io.Serializable;import org.springframework.data.annotation.Id; import org.springframework.data.annotation.PersistenceConstructor; import org.springframework.data.gemfire.mapping.annotation.Region;import lombok.Getter;Region(value People) public class PersonEntity implements Serializable {IdGetterprivate final String name;Getterprivate final int age;PersistenceConstructorpublic PersonEntity(String name, int age) {this.name name;this.age age;}public String getName() {return name;}public int getAge() {return age;}Overridepublic String toString() {return String.format(%s is %d years old, getName(), getAge());} } 如您所见有两个属性-名称和年龄以及一个持久性构造函数。 在这里请注意该类已使用注释Region进行注释。 此批注是枢轴指示符用于指示框架使用特定名称存储此类的实例。 当它读取注释Region(People) 它将理解必须将PersonEntity的实例存储为People的名称。 带有注释Id的字段将是实例的唯一键。 这里假设您了解Pivotal没有任何自动密钥生成系统。 因此在实际进行数据持久化之前您需要确保设置了id字段。 5.创建简单的查询 与Pivotal Gemfire框架结合的Spring Data就是关于存储和持久化数据的。 它着重于此管理对数据的访问。 此外它还继承了Spring Data框架的强大功能例如获得查询的功能。 框架的强大功能是您不再需要学习关键的gemfire查询语言。 您所需要做的就是编写一些Java代码段该框架将在后端构建查询。 让我们从为上面显示的实体创建类似的片段开始。 PersonQueries.java package pivotal_tutorial; import org.springframework.data.gemfire.repository.query.annotation.Trace; import org.springframework.data.repository.CrudRepository;public interface PersonRepo extends CrudRepositoryPersonEntity, String {TracePersonEntity findByName(String name);TraceIterable findByAgeGreaterThan(int age);TraceIterable findByAgeLessThan(int age);TraceIterable findByAgeGreaterThanAndAgeLessThan(int greaterThanAge, int lessThanAge); } 在上面的代码中请注意该类扩展了CrudRepository 该类是Spring Data框架提供的类。 注释Trace标识需要使用相关的函数来为后端运行的Pivotal Gemfire框架创建查询。 这些功能很容易理解。 下面提供了简要说明 findByName 通过作为参数提供的name值查找实体 findByAgeGreaterThan 查找年龄大于提供的值的实体。 返回PersonEntity实例的可迭代列表。 findAgeLessThan 查找年龄小于提供的值的实体。 返回PersonEntity实例的可迭代列表。 findByAgeGreaterThanAndLessThan 查找年龄大于或小于提供的值的实体。 返回PersonEntity实例的可迭代列表。 6.创建一个应用程序 现在我们已经准备好查询和实体让我们开始创建有助于数据事务的实际应用程序。 将创建具有视图的应用程序以实例化实体并处理数据。 以下代码创建具有所有必要组件的应用程序。 App.java package pivotal_tutorial; import static java.util.Arrays.asList; import static java.util.stream.StreamSupport.stream;import java.io.IOException;import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.boot.ApplicationRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.config.annotation.ClientCacheApplication; import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions; import org.springframework.data.gemfire.repository.config.EnableGemfireRepositories;SpringBootApplication ClientCacheApplication(name AccessingDataGemFireApplication, logLevel error) EnableEntityDefinedRegions(basePackageClasses PersonEntity.class,clientRegionShortcut ClientRegionShortcut.LOCAL) EnableGemfireRepositories public class App {public static void main(String[] args) throws IOException {SpringApplication.run(App.class, args);}BeanApplicationRunner run(PersonRepo personRepository) {return args - {PersonEntity abk new PersonEntity(Abhishek Kothari, 26);PersonEntity sumit new PersonEntity(Sumit Punjabi, 25);PersonEntity john new PersonEntity(John Doe, 34);System.out.println(Entering into accessing data from Pivotal GemFire framework);asList(abk, sumit, john).forEach(person - System.out.println(\t person));System.out.println(Saving Alice, Bob and Carol to Pivotal GemFire...);personRepository.save(abk);personRepository.save(sumit);personRepository.save(john);System.out.println(Lookup each person by name...);asList(abk.getName(), sumit.getName(), john.getName()).forEach(name - System.out.println(\t personRepository.findByName(name)));System.out.println(Query adults (over 18):);stream(personRepository.findByAgeGreaterThan(18).spliterator(), false).forEach(person - System.out.println(\t person));System.out.println(Query teens (less than 30):);stream(personRepository.findByAgeLessThan(30).spliterator(), false).forEach(person - System.out.println(\t person));System.out.println(Query teens (between 12 and 30):);stream(personRepository.findByAgeGreaterThanAndAgeLessThan(12, 30).spliterator(), false).forEach(person - System.out.println(\t person));};} } 上面的类包含对已定义实体的所有可能的查询调用。 请注意在该类中已注释了许多注释。 下面提供了每个注释的描述 SpringBootApplication 此批注指定该类将被视为Spring引导应用程序的起点。 ClientCacheApplication 此注释指定应用程序应在后端使用由Spring Data支持的数据的客户端缓存。 EnableDefinedRegions 注释用于指定需要使用并可用的实体。 该注释基本上完成了公开该类的相应实体的方法的任务。 EnableGemfireRepositories 这是最重要的注释。 从名称本身可以清楚地看到注释的目的。 为了在Spring应用程序启动时启用gemfire存储库此注释是必需的。 该注释将强制扫描当前包以查找扩展Spring Data仓库类之一例如PersonEntity 。 有时候我们可能不希望将所有Spring Data实体公开到Gemfire框架中。 可以通过显式指定所需实体扩展的类来防止这种情况。 可以使用其属性basePackageClasses TheRepository.class完成此操作 这里要注意的是在区域定义中我们指定了局部区域。 这对于Pivotal Gemfire很重要。 为了存储数据Pivotal需要至少1个或更多区域。 7.缓存配置 Pivotal中可能有三种不同的缓存配置。 根据我们计划使用的区域我们可以使用所需的批注之一使用Spring Data框架通过Pivotal Gemfire后端指定缓存和数据持久性。 以下是可以使用的三种可能的注释 ClientCacheApplication 将数据客户端缓存在本地存储中 PeerCacheApplication 在同级之间缓存数据 CacheServerApplication 在服务器端缓存数据 Pivotal Gemfire支持多种缓存拓扑例如客户端/服务器对等甚至WAN或LAN安排。 在客户端/服务器缓存拓扑中客户端缓存查询的数据而服务器缓存所有数据。 在对等拓扑中即使网络中的设备也将缓存数据以将其提供给最近的对等体。 对于WAN或LAN拓扑如果您已连接到特定网络则设备将缓存数据并开始将数据分发给其他用户。 在上述情况下我们使用了客户端缓存因此一旦执行查询缓存将完全在客户端完成。 出于相同的原因我们指定了LOCAL区域。 我们将实体连接到名为People的区域。 这是使用注释Region指定的。 该注释是从Spring Data框架使用的。 稍后使用代码片段ClientRegionFactoryBeanString, PersonEntity用于bean定义在应用程序层中映射此区域。 因此我们注入了bean定义并在People区域中定义了实例否则如果没有Spring Data框架这是不可能的。 8.存放物件 在本指南中您将创建三个本地Person对象AbhishekSumit John。 最初它们仅存在于内存中。 创建它们之后您必须将它们保存到Pivotal GemFire。 现在您运行几个查询。 第一个按名称查找所有人。 然后您使用年龄属性执行少量查询以查找成人婴儿和青少年。 打开日志记录后您可以看到Spring Data for Pivotal GemFire代表您编写的查询。 9.执行代码并构建一个jar 现在我们已经了解了代码的性能以及下一步的时间。 下一步是实际执行代码并查看代码如何工作。 要执行代码请在您的Spring Tool Suite或IntelliJ中将该应用程序作为Java应用程序运行。 在执行该应用程序时您将看到类似于以下所示的输出。 它可能会略有不同具体取决于您使用的库的版本。 . ____ _ __ _ _/\\ / ____ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | _ | _| | _ \/ _ | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) ) |____| .__|_| |_|_| |_\__, | / / / /|_||___//_/_/_/:: Spring Boot :: (v2.0.3.RELEASE)[info 2018/08/30 20:36:45.110 IST tid0x1] Starting App on MacBook-Air.local with PID 96473 (/Users/abhishekkothari/Documents/workspace-sts-3.9.5.RELEASE/pivotal_tutorial/target/classes started by abhishekkothari in /Users/abhishekkothari/Documents/workspace-sts-3.9.5.RELEASE/pivotal_tutorial)[info 2018/08/30 20:36:45.118 IST tid0x1] No active profile set, falling back to default profiles: default[info 2018/08/30 20:36:45.219 IST tid0x1] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext6c1a5b54: startup date [Thu Aug 30 20:36:45 IST 2018]; root of context hierarchySLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Entering into accessing data from Pivotal GemFire frameworkAbhishek Kothari is 26 years oldSumit Punjabi is 25 years oldJohn Doe is 34 years old Saving Alice, Bob and Carol to Pivotal GemFire... Lookup each person by name...Abhishek Kothari is 26 years oldSumit Punjabi is 25 years oldJohn Doe is 34 years old Query adults (over 18):Sumit Punjabi is 25 years oldJohn Doe is 34 years oldAbhishek Kothari is 26 years old Query teens (less than 30):Sumit Punjabi is 25 years oldAbhishek Kothari is 26 years old Query teens (between 12 and 30):Sumit Punjabi is 25 years oldAbhishek Kothari is 26 years old 可以看出该应用程序已执行并且提取的lamba函数根据指定的过滤器使用数据。 请注意这里我们创建了一个完成实体存储并检索它而没有真正对Pivotal gemfire数据库进行任何设置。 这些查询返回了我们这些实例而没有进行任何大的努力。 通过这种方式Spring Data批注有助于简化Pivotal Gemfire应用程序的应用程序开发并帮助您减少从头开始进行编码和设置的整个工作量。 为了构建该应用程序并将其导出到其他地方以供远程使用您需要做的就是使用Maven来构建应用程序jar。 为此只需执行以下命令。 ./mvnw spring-boot:run 上面的命令将构建一个可运行的jar供您在任何系统中执行。 因此您可以使用带有Pivotal Gemfire数据分发的Spring Data Framework轻松构建可移植的应用程序。 10.下载项目 上面已经讨论过的STS项目可以在下面的链接中找到。 下载 您可以在此处下载此示例的完整源代码 pivotal-tutorial.zip 翻译自: https://www.javacodegeeks.com/2018/08/spring-data-pivotal-gemfire-tutorial.html
http://wiki.neutronadmin.com/news/228080/

相关文章:

  • 网站开通宣传怎么写h5网站是什么意思
  • 网站根目录多出一.php做企业网站注意事项
  • 网站建设及推广开发wordpress 火箭加速
  • 观音桥网站建设网站建设设计公司怎么找
  • 有没有什么免费的网站如何建立一家网站
  • 搭建网站设计站长工具官网
  • 常德网站建设设计推广营销
  • 网站第一步建立成都seo网站开发
  • 网站站内关键词优化wordpress 撰写设置
  • 什么颜色做网站显的大气idea怎么做网站
  • 买到域名网站怎么做淘客网站怎么做排名
  • qq在线网站代码生成网站建设如何上传文件
  • 软件系统网站建设各网站网络营销产品价格策略
  • 漳州城乡住房建设部网站医院网站建设预算
  • 南昌做微信网站兰州学校网站建设
  • 做网站网上怎么挂公告网站改版方案
  • 大兴手机网站建设新塘网站seo优化
  • 口碑好的大良网站建设红铃铛网站建设
  • 制作公司网站需要购买域名和服务器吗做淘宝详情页好的网站
  • 龙岗企业网站建设路由器通过域名解析做网站
  • 成都网站建设外包3d建模师
  • 做网站专题的软件做个小程序多少钱
  • 百度商桥接入网站网站建设程序策划书
  • 北京门户网站设计珠海网站建设杰作
  • 做外贸网站需要缴什么税网站创建于
  • 网站建设及推广预算表WordPress时间倒序
  • 成都专业网站制作哪家好wordpress静态链接
  • 网站建设公司果动c网络域名备案流程
  • 如何进行网站制作wordpress汉化杂志主题
  • 商务网站设计素材php专业网站