在appengine上用compass来集成lucene实现全文搜索
using a compass + JDO Search on appengine
Information in 2.3.0-beta is.
How to use
InitializationThe demonstration video, PMF.java imitation because it was initialized with a static initializer.addScan () does, JDO specifies the name of the Entity package that contains classes. Entity Class
SearchIf you want to search for the name Field
If you specify a search for Kind
Resona
|
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x10)
org.apache.xmlrpc.XmlRpcException: Failed to parse XML-RPC request: An invalid XML character (Unicode: 0x10) was found in the element content of the document.
Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x10) was found in the element content of the document. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xmlrpc.server.XmlRpcStreamServer.getRequest(XmlRpcStreamServer.java:65)
Google云计算GAE开发的一个IT技术推荐应用
IT Technology Network是用Google App Engine - Google Code google的云计算服务开发的一个网站。
- IT Technology Network 是一个专注于IT技术的网站,包括软件开发、IT业界、Java、数据库、Unix、Web开发、开源项目、互联网等新闻和博客。
- 目标是提供一个有质量保证、简洁、经常更新的IT技术内容和搜索服务。
- IT Technology Network 其实也就是国内IT技术网站的一个聚合网站,例如,腾讯IT,Linux伊甸园,ChinaUnix,JavaEye博客,Java博客,ITPUB技术门户
这算是Google App Engine的试用应用吧,渐渐地才发现云计算不是一个概念,而中国的云计算可能还落后很多,而这个又像马云说的那样,云计算可能蕴藏颠覆性力量。“我最怕的是老酒装新瓶的东西,你看不清他在玩什么,突然爆发出来最可怕。假如从来没有听说的,这个不可怕。雅虎当年做搜索引擎,然后Google出来了,雅虎很多人认为跟我们也差不多,后来几乎把他们搞死。”
Google App Engine for Java数据备份下载
It is possible to use python tool bulkloader.py to create datastore backup of GAE Java app. You just have to set up remote_api by adding following lines to web.xml: After that you can use bulkloader.py with --dump to download backup and with --restore to upload backup to datastore. You can also use the You can download and upload every entity of a kind in a format suitable for backup and restore, all without writing any additional code or configuration. To download all entities of all kinds, run the folowing command: To start a data download, run If you are using a Google Apps domain name and need appcfg.py to sign in using an account on that domain, you must specify the If the transfer is interrupted, you can resume the transfer from where it left off using the <?xml version="1.0" encoding="utf-8"?>
<web-app>
<!-- Add this to your web.xml to enable remote API on Java. -->
<servlet>
<servlet-name>remoteapi</servlet-name>
<servlet-class>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>remoteapi</servlet-name>
<url-pattern>/remote_api</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>remoteapi</web-resource-name>
<url-pattern>/remote_api</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
</web-app> --kind=... argument to download all entities of a specific kind:
bulkloader.py --dump --app_id=<app-id> --kind=<kind> --url=http://<appname>.appspot.com/remote_api --filename=<data-filename>
bulkloader.py --dump --app_id=<app-id> --url=http://<appname>.appspot.com/remote_api --filename=<data-filename>
Downloading Data from App Engine
appcfg.py download_data with the appropriate arguments:
appcfg.py download_data --config_file=album_loader.py --filename=album_data_archive.csv --kind=Album <app-directory>
--auth_domain=... option, whose value is your domain name.--db_filename=... and --result_db_filename=... arguments. These arguments are the names of the progress file and the results file created by the tool, which are either names you provided with the arguments when you started the transfer, or default names that include a timestamp. This assumes you have sqlite3 installed, and did not disable progress files with --db_filename=skip.
Google App Engine for Java的Performance性能问题
Google App Engine - Google Code,会根据负载情况自动关闭或者启动Java web应用的JVM,这使得很多http请求会触发启动JVM并部署web应用,因此这样的http请求非常慢,响应性能很差,用户体验非常差。因为大部分的应用还是需要连接DataStore,那么就需要初始化Data类的MetaData和连接数据库,不可避免需要很多时间。这个问题甚至Google自己也没有很好的办法。
Some requests run slower because App Engine needs to create a new Java virtual machine to service the request. We call that kind of request, a Loading Request. During a loading request, your application undergoes initialization (such as class loading, JIT compiling, etc) which causes the request to take longer. For slow requests which are already close to App Engine's request deadline, the extra initialization can push it past the deadline, causing a DeadlineExceededException. App Engine spins up JVMs on demand, so there are several reasons why you may receive a loading request: You can expect that during the course of developing your application, you will often experience the first two scenarios. In comparison, for a production app receiving even a very small but steady amount of traffic, loading requests are relatively infrequent. You can register an HttpSessionListener in your web.xml which logs from its sessionCreated method. For example: In the future, the Admin Console logs viewer will mark loading requests specifically so that they can be easily identified. App Engine provides high CPU warnings to help you determine which requests might need optimization. In the case of loading requests, though, the execution time is artificially longer due to the extra application initialization required. In addition, the number of loading requests is inversely proportional to the amount of traffic your application receives. So, while your CPU usage due to additional traffic will increase, your CPU usage due to loading requests will decrease. Here are a few suggestions: We've seen this request from some developers with low-traffic applications who'd like to reduce the percentage of loading requests they receive. Although we have many improvements in the pipeline to improve loading request performance, we'd like to gauge the general interest in this feature. If you'd like to be able to reserve a JVM at a price, please star this issue. If there's a particular pricing scheme you're interested in, let us know. We discourage developers from doing this because it increases the average number of loading requests for all low-traffic applications. Instead, we will continue to improve the performance of loading requests for everyone, and you can use the advice on this page to optimize your application's startup performance.What is a loading request?
What causes loading requests?
How do I distinguish normal requests from loading requests in my application logs?
// web.xml snippet
<listener>
<listener-class>
com.example.LogLoadingRequest
</listener-class>
</listener>
// LogLoadingRequest.java
public class LogLoadingRequest implements ServletContextListener {
private static final Logger logger = Logger.getLogger(LogLoadingRequest.class.getName());
public void contextInitialized(ServletContextEvent sce) {
logger.log(Level.INFO, "Loading request occuring.");
}
public void contextDestroyed(ServletContextEvent sce) {
}
}Do I need to be concerned about high CPU warnings in the admin console for my loading requests?
Given that, your time is most often better spent focusing on optimizing other high CPU warnings in relation to your application's total CPU usage.How can I speed up loading requests?
What is Google doing to speed up loading requests?
<precompilation-enabled>true</precompilation-enabled>
In the future, we plan to turn this optimization on for all applications.Can I pay to keep a JVM reserved for my application?
Should I run a cron job to keep my JVMs alive and reduce my loading requests?
Google App Engine 云计算的限制
Google App Engine - Google Code,虽然是个令人兴奋的东西,但是它由于种种原因有很多限制,而有些限制还是挺恼火的。
- 开发者对于App Engine的文件系统只拥有读的权限。
- App Engine仅可以在HTTP请求时执行代码(除了计划的后台任务、任务队列和XMPP服务)。
- 用户可以上传任意的Python模块,但它们必须是纯Python,不包括任何C扩展程序或其他必须编译的代码。
- App Engine限制每次Datastore请求最多返回1000行数据。
- Java应用程序只能使用JRE基本版本类库中的一个子集(JRE类白名单)。
- Java应用程序不能创建新的线程。
指标
限制
每个开发者拥有的应用程序
10
每次请求的时间
30秒
每个应用程序的文件
1000个
HTTP响应大小
10 MB
Datastore大小
1 MB
应用程序代码大小
150 MB
