在Google的AppEngine上升级到Java 7

如果您仍在Google AppEngine上运行Java 6应用程序,则将遇到严重的麻烦。 现在,AppEngine团队将随时发布1.8.9版,该版本将不再支持Java 6应用程序的部署。

现有的应用程序将继续运行。 但是您可能应该以必要的紧迫性升级应用程序,因为您将不再能够修复错误。

更多维护

大多数PaaS提供商都会非常定期地更新其平台,以跟上最新的安全修复程序并添加新的服务和API。 在这方面,AppEngine采用了一种非常激进的方法。 当他们认为删除旧代码是正确的事情时,他们不会等待客户。

这些更新通常将向后兼容,但是,如果有足够的时间,将会有一些更新破坏旧代码。 Java 7与Java 6向后兼容,但有些库则不兼容。

好东西吗

我尝试将这项维护工作视为一件好事。 它迫使您紧跟最新技术,就安全而言,就我而言,这是最重要的。

在Google的AppEngine上升级到Java 7

因此,让我们进入细节。 在大多数情况下,此升级就像更改用于构建和部署到AppEngine的JDK一样简单。 就我而言,不是。

主要的问题是我正在使用的JDO / DataNucleus / AppEngine组合的某些部分不适用于Java7。根据它们各自的页面,这应该不是问题,但它不适用于运行时错误。表示版本不兼容。

我一直想升级DataNucleus ,所以我想“为什么不呢?” 这变成了长时间的牛剃毛

首先, 升级appengine-datanucleus ,这是AppEngine和DataNucleus之间的集成库。 当前有3个版本 。 仅最新版本使用不推荐使用的代码。 遗憾的是,据我所知,该版本尚未正式发布。 因此,经过深思熟虑后,我最终选择了2.1版(我希望今年摆脱JDO的支持,改用Objectify)

接下来,我发现这也意味着我需要迁移数据存储内容根本没有很好的记录 。 即使您设法找到该Wiki文章,也使用的是旧库。 我无法在我的项目上进行此工作,也没有时间也没有能力找出AppEngine的新mapreduce框架。

最终,我创建了一个可以执行升级的小型任务队列。 幸运的是,实体的数量足够小,可以正常工作。 如果您有更大的数据集,您可能已经知道如何使用mapreduce了。

这样一来,仍然会弹出一些小错误。 他们都被我的单元测试抓住了。 例如,事实证明, 从数据存储区加载空集合现在可以返回null而不是空collection 。 可以解决的小问题,但是如果在某个地方进行了记录,那就太好了。

结论

确保花时间在AppEngine上进行Java 6到7的升级。 这可能对您来说是透明的,但是如果不是这样怎么办?


翻译自: https://www.javacodegeeks.com/2014/01/upgrading-to-java-7-on-googles-appengine.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Google App Engine is a web application hosting service. By “web application,” we mean an application or service accessed over the Web, usually with a web browser: storefronts with shopping carts, social networking sites, multiplayer games, mobile applications, survey applications, project management, collaboration, publishing, and all the other things we’re discovering are good uses for the Web. App Engine can serve traditional website content too, such as documents and images, but the environment is especially designed for real-time dynamic applications. In particular, Google App Engine is designed to host applications with many simulta- neous users. When an application can serve many simultaneous users without degrad- ing performance, we say it scales. Applications written for App Engine scale automat- ically. As more people use the application, App Engine allocates more resources for the application and manages the use of those resources. The application itself does not need to know anything about the resources it is using. Unlike traditional web hosting or self-managed servers, with Google App Engine, you only pay for the resources you use. These resources are measured down to the gigabyte. Billed resources include CPU usage, storage per month, incoming and outgoing band- width, and several resources specific to App Engine services. To help you get started, every developer gets a certain amount of resources for free, enough for small applica- tions with low traffic. App Engine can be described as three parts: application instances, scalable data storage, and scalable services. In this chapter, we look at each of these parts at a high level. We also discuss features of App Engine for deploying and managing web applications, and for building websites integrated with other Google offerings such as Google Apps, Google Accounts, and Google Cloud Storage.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值