How to view Java App Engine local storage?

There seems to be no Python App Engine _ah / admin equivalent for implementing Java in the Google App Engine.

Is there a manual way that I can view in the data warehouse? Where are the files on my machine? (I am using the App Engine plug-in with Eclipse on OS X).

+83
java google-app-engine google-cloud-datastore
Jul 09 '09 at 8:00
source share
6 answers

http://googleappengine.blogspot.com/2009/07/google-app-engine-for-java-sdk-122.html : "Finally, there is a data viewer on the application server. Launch the application locally and specify http://localhost:8888/_ah/admin http://localhost:8000/datastore * to check this out. "

* from 1.7.7

+110
Jul 14 '09 at 13:33
source share

There is currently no viewing datastore for the Java SDK - you need to go in the next version of the SDK. At the same time, it’s best to write your own admin interface with the code for viewing the data warehouse β€” or wait for the next release of the SDK.

The Java App Engine now has a local data warehouse viewer available at http://localhost:8080/_ah/admin .

+37
Jul 09 '09 at 12:46
source share

I have a local data store in my Windows + Eclipse environment on \ war \ WEB-INF \ appengine-generated \ local_db.bin

As I understand it, it uses an internal format called "buffer buffers". I have no external tools for presenting the file in a human-readable format.

I use simple "viewer" code as follows:

 public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); final DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); final Query query = new Query("Table/Entity Name"); //query.addSort(Entity.KEY_RESERVED_PROPERTY, Query.SortDirection.DESCENDING); for (final Entity entity : datastore.prepare(query).asIterable()) { resp.getWriter().println(entity.getKey().toString()); final Map<String, Object> properties = entity.getProperties(); final String[] propertyNames = properties.keySet().toArray( new String[properties.size()]); for(final String propertyName : propertyNames) { resp.getWriter().println("-> " + propertyName + ": " + entity.getProperty(propertyName)); } } } 
+6
Jul 09 '09 at 10:10
source share

In the latest SDK versions (1.7.6+), the administrative part of the dev server comes with a changed location

Analyzing server output logs, we see that it is available at:

http://localhost:8000

And the Datastore viewer:

http://localhost:8000/datastore

It looks pretty neat - according to google new design recommendations.

+2
Apr 14 '13 at 17:45
source share

Since the Google App Engine Datastore application viewer does not support displaying sets of reference objects, I changed the version of Paul to display all descendant entities:

 public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String entityParam = req.getParameter("e"); resp.setContentType("text/plain"); final DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); // Original query final Query queryOrig = new Query(entityParam); queryOrig.addSort(Entity.KEY_RESERVED_PROPERTY, Query.SortDirection.ASCENDING); for (final Entity entityOrig : datastore.prepare(queryOrig).asIterable()) { // Query for this entity and all its descendant entities and collections final Query query = new Query(); query.setAncestor(entityOrig.getKey()); query.addSort(Entity.KEY_RESERVED_PROPERTY, Query.SortDirection.ASCENDING); for (final Entity entity : datastore.prepare(query).asIterable()) { resp.getWriter().println(entity.getKey().toString()); // Print properties final Map<String, Object> properties = entity.getProperties(); final String[] propertyNames = properties.keySet().toArray(new String[properties.size()]); for(final String propertyName : propertyNames) { resp.getWriter().println("-> " + propertyName + ": " + entity.getProperty(propertyName)); } } } } 

It should be noted that nothing is displayed for empty collections / reference objects.

+1
Aug 20 '12 at 19:08
source share

Open the file \war\WEB-INF\appengine-generated\local_db.bin using a text editor such as Notepad ++.

Data is scrambled, but at least you can read it, and you can copy it to extract it.

+1
Nov 15 '13 at 21:49
source share



All Articles