Skip to main content

Home/ Groups/ Google AppEngine
Esfand S

KeyRange - 0 views

  • public final class KeyRangeextends java.lang.Objectimplements java.lang.Iterable<Key>, java.io.Serializable Represents a range of unique datastore identifiers from getStart().getId() to getEnd().getId() inclusive. The Keys returned by an instance of this class have been consumed in the datastore's id-space and are guaranteed never to be reused. This class can be used to construct Entities with Keys that have specific id values without fear of the datastore creating new records with those same ids at a later date. This can be helpful as part of a data migration or large bulk upload where you may need to preserve existing ids and relationships between entities. This class is threadsafe but the Iterators returned by iterator() are not.
Esfand S

Effectively Parallelizing Fetches (with pictures, yay!) - Google App Engine | Google Gr... - 0 views

  • As I understand it, the process of performing a single fetch (call to get())  from the dastastore using a key basically involves finding the host housing the entity, opening a socket, fetching the data, and then cleaning up the connection.  So to fetch something like 30 entities from the datastore, you're repeating the process 30 times over in serial, each time incurring whatever overhead is involved.  I also read that if you perform bulk fetches, (ie passing multiple keys at once) you can eliminate a great deal of that overhead.  In one of the videos I watched from Google I/0 2009, the presenter (whose name I forget - d'oh) said that performing a bulk fetch actually performs the fetches in parallel from the data store and you shoudl see requests noticeably faster.
Esfand S

App Engine Fan: Are You The Key Master ? - 0 views

  • I figure it is going to take me at least four iterations to get this right. The first one will be building a GWT application with a simple UI that has no server logic behind it (just to learn how layout in GWT works). Step two will be adding a fake servlet backend (not app engine, just in memory). While not exactly App Engine yet, I should have a completely specified client-server API by the end of this process that I can subsequently implement on App Engine (iteration 3). Iteration four will handle deployment, CSS and whatever I may screw up in iterations one and two. I will log my notes of things I run into while I code.
  •  
    this is the para 1this is the second para
Esfand S

Works fine on App Engine locally but get (session-related?) error after deploying to pr... - 0 views

  • the necessary changes to appengine-web.xml to get Sitebricks to run in development mode:         <sessions-enabled>true</sessions-enabled>         <system-properties>                 <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>                 <property name="mvel2.disable.jit" value="true"/>         </system-properties>
Esfand S

Works fine on App Engine locally but get (session-related?) error after deploying to pr... - 0 views

  • the necessary changes to appengine-web.xml to get Sitebricks to run in development mode:         <sessions-enabled>true</sessions-enabled>         <system-properties>                 <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>                 <property name="mvel2.disable.jit" value="true"/>         </system-properties>
  • the necessary changes to appengine-web.xml to get Sitebricks to run in development mode:         <sessions-enabled>true</sessions-enabled>         <system-properties>                 <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>                 <property name="mvel2.disable.jit" value="true"/>         </system-properties>
  • We had a GaeFlashCache built specifically for appengine. Try doing: bind(FlashCache.class).to(GaeFlashCache.class).in(Singleton.class);
Esfand S

Pagination - Google App Engine | Google Groups - 0 views

  • The next problem that arises is that if the database has grown too big, then the csv generation will be slow(as it has to jump a lot of times). So the next idea is , instead of generating all cursors in the main cgi , the main cgi generates only first few set of page links, and then triggers a task queue entry to continue from there. By the time the user would have read the first page and clicks on "next page", the task would have generated few more entries. As the set of cursors for pagination is in memcache, you can use it even in your first page, if you are using AJAX (guessing, not that sure.)
Esfand S

com.google.appengine.api.datastore - 0 views

  • If using the datastore API directly, a common pattern of usage is: // Get a handle on the datastore itself DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); // Lookup data by known key name Entity userEntity = datastore.get(KeyFactory.createKey("UserInfo", email)); // Or perform a query Query query = new Query("Task", userEntity); query.addFilter("dueDate", Query.FilterOperator.LESS_THAN, today); for (Entity taskEntity : datastore.prepare(query).asIterable()) { if ("done".equals(taskEntity.getProperty("status"))) { datastore.delete(taskEntity); } else { taskEntity.setProperty("status", "overdue"); datastore.put(taskEntity); } }
  •  
    If using the datastore API directly, a common pattern of usage is: // Get a handle on the datastore itself DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); // Lookup data by known key name Entity userEntity = datastore.get(KeyFactory.createKey("UserInfo", email)); // Or perform a query Query query = new Query("Task", userEntity); query.addFilter("dueDate", Query.FilterOperator.LESS_THAN, today); for (Entity taskEntity : datastore.prepare(query).asIterable()) { if ("done".equals(taskEntity.getProperty("status"))) { datastore.delete(taskEntity); } else { taskEntity.setProperty("status", "overdue"); datastore.put(taskEntity); } }
Esfand S

How to Do Virtual Hosting on Google App Engine - 0 views

  • it could be implemented as follows: The developer creates a CName record from *.<developersAppSubDomain>.<developersDomain>.com to <appEngineAppId>.appspot.com (if wildcard CName values aren't available on the developer's DNS server, then the developer will have to create one entry per customer). When Google receives a request on the App Engine Server with an unknown host name such as <subdomain>.<customersDomain>.com, it does the CName look-up, until it finds a host name of the form <appEngineAppId>.appspot.com. It then sends the server request on to that App Engine application, ideally including the whole CName "chain" as a special CGI variable, so that the application can determine the user ID of the customer that owns the domain. (And if the App Engine server doesn't find a host name for an App Engine application, it returns 404.)
Esfand S

Handling very large lists of objects without paging? - Stack Overflow - 0 views

  • I have a class which can contain many small elements in a list. Looks like: public class Farm {    private ArrayList<Horse> mHorses;} just wondering what will happen if the mHorses array grew to something crazy like 15,000 elements. I'm assuming that trying to write and read this from the datastore would be crazy, because I'd get killed on the serialization process. It's important that I can get the entire array in one shot without paging, and each Horse element may only have two string properties in it, so they are pretty lightweight: public class Horse {    private String mId;    private String mName;} I don't need these horses indexed at all. Does it sound reasonable to just store the mHorse array as a raw Text field, and force my clients to do the deserialization? Something like: public class Farm {    private Text mHorsesSerialized;} then whenever the client receives a Farm instance, it has to take the raw string of horses, and split it in order to reinstantiate the list, something like: // GWT client perhapsFarm farm = rpcCall.getMyFarm();String horsesSerialized = farm.getHorses();String[] horseBlocks = horsesSerialized.split(",");for (int i = 0; i < horseBlocks.length; i++) {    // .. continue deserializing the individual objects ...} yeah...
Esfand S

Google App Engine Testing with Spring « objectuser.blog(brain) - 0 views

  • The GAE docs talk about how to setup a test to use the datastore.  But also follow the instructions here until the docs are fully updated.
Esfand S

test unit doesn't work more - Google App Engine for Java | Google Groups - 0 views

  •  If you're following the how-to article on unit testing ( http://code.google.com/appengine/docs/java/howto/unittesting.html) you'll need to update your TestEnvironment class to look like this one: http://code.google.com/p/datanucleus-appengine/source/browse/branches... (lines 34 - 66) We're working on getting the docs updated right now.
« First ‹ Previous 241 - 260 of 592 Next › Last »
Showing 20 items per page