[appengine-java] Optimise billing on app engine for continual polling

2011-12-21 Thread Gerald Tan
Use frontend instances, set up a cron job to trigger every 15 mins, set min and max idle instance to 1. You should end up using 24.01 instance hour per day, well below the 28 cap -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To

[appengine-java] Re: Best Implementation of Singleton in GAE.

2011-11-27 Thread Gerald Tan
In this case if your data is read-only and does not change, I don't see anything with using a Singleton. Your app may spin up new instances, and each instance will create its own private instance of the Singleton, this should not affect the integrity of the data. -- You received this message

[appengine-java] Re: Serializing crypto classes

2011-11-15 Thread Gerald Tan
Only Serializable objects can be used as properties, and Cipher isn't serializable. The solution is to store the algorithm as a String, then reinstantiating the Cipher from the algorithm string after retrieving it from the datastore. -- You received this message because you are subscribed to

Re: [appengine-java] Re: many different Properties or Entity for name/value pairs

2011-11-06 Thread Gerald Tan
It's possible to make it searchable, you will need to store and update two entities. MyEntity will have a Properties to Values map, and you have a PropertiesEntity that has a MyEntity to Values map. class MyEntity { @Id Long id; @Serialized MapString,Object properties } class

[appengine-java] Re: Number of writes per second limitation

2011-11-04 Thread Gerald Tan
If there is no need to reference the objects from outside the group, you would probably find it a lot more efficient to store the while array serialized as a byte array. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this

[appengine-java] Re: many different Properties or Entity for name/value pairs

2011-11-04 Thread Gerald Tan
You can serialize a MapString,String property into a byte array to be stored in the entity The easiest way to do this would be to use Objectify with the @Serialized annotation http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#@Embedded -- You received this message

[appengine-java] Re: many different Properties or Entity for name/value pairs

2011-11-04 Thread Gerald Tan
You can serialize a MapString,String property into a byte array to be stored in the entity The easiest way to do this would be to use Objectify with the @Serialized annotation http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#@Serialized -- You received this message

Re: [appengine-java] Re: many different Properties or Entity for name/value pairs

2011-11-04 Thread Gerald Tan
This is pretty awesome feature, but did you forget to document it? :) -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/z7iXjUGzMLQJ. To

[appengine-java] Re: convert AppEngineFile to File

2011-10-19 Thread Gerald Tan
No, but you might want to look deeper into the API to see if InputStream is acceptable, I remember seeing APIs that accept InputStream -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit

[appengine-java] Re: long running jobs

2011-10-18 Thread Gerald Tan
Sure, you can use Backend Instances, for a limited time per day. 4.5 hours per day on the default B2 instance I believe. If you need it to run for more than that per day you'll have to pay. Alternatively you can break your job down into smaller pieces and run them through cronjobs and/or task

[appengine-java] Re: Crons Optimization

2011-10-13 Thread Gerald Tan
I can think of two methods 1. Schedule the cronjob for every 2 minutes, keep a counter to check which task is next in line. 2. Create a task queue with 1/120s frequency. Make the cronjob push the 14 task onto the taskqueue -- You received this message because you are subscribed to the Google

Re: [appengine-java] Help with sharded counters and loading results.

2011-10-07 Thread Gerald Tan
That's 50k reads every 5 minutes if applied to dnkoutso's use case, which could hurt a bit. The alternative I've mentioned may be cheaper if the number of items tracked is very large compared to the frequency of the count increments. I believe my method incurs 6 write ops per increment (1 + 2

Re: [appengine-java] Prerelease SDK 1.5.5 available for download!

2011-10-07 Thread Gerald Tan
It's a pre-release, so my guess is the server doesn't have it yet -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/oQfnvDDN31gJ. To

[appengine-java] Re: Help with sharded counters and loading results.

2011-10-06 Thread Gerald Tan
I've not personally tried it before, but a possible alternative to shard counters is increment logs. Basically, you store the count with your entity, and each time you need to increment the count you will instead store an new increment entry that references the entity that needs to be

[appengine-java] Re: Server Code vs DataStore

2011-10-05 Thread Gerald Tan
Either using the blobstore api, or urlfetch api is also possible if you can put the data as files up on the web somewhere they can be downloaded from. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the

[appengine-java] Re: Read appengine file and save it's contents into a byte[]

2011-10-04 Thread Gerald Tan
FileReadChannel implements http://download.oracle.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html You should be able to figure out it out from there -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this

[appengine-java] Re: Server Code vs DataStore

2011-10-04 Thread Gerald Tan
It would probably be most efficient to use the Datastore together with the Memcache. If you are new to all these things, I'd definitely recommend using the Objectify framework which completely trivializes the transfer of entities between GWT and GAE without having to use those awful DTOs.

[appengine-java] Re: Quick way to delete datastore entities?

2011-10-03 Thread Gerald Tan
I believe you can do it from Datastore Admin, pretty sure I've done that before. That page seems blank to me atm though, weird. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit

Re: [appengine-java] .A research: how long will your java app instance start up fully?

2011-10-01 Thread Gerald Tan
Switching from JDO to Objectify reduced my startup time from 8s to about 4s -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit

[appengine-java] Re: Writing to google spreadsheet from GAE

2011-09-17 Thread Gerald Tan
It should be: http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit

[appengine-java] Re: disable warmup-requests-enabled

2011-09-14 Thread Gerald Tan
It's only available if you enable billing -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/djKcaK6yVBAJ. To post to this group, send

[appengine-java] Re: How to detect the event of instantiating another instance of app

2011-09-14 Thread Gerald Tan
AFAIK there's no way of being informed about the instantiation of another instance or change on a memcache value without accessing the memcache itself. The best solution is to use vm memory cache only for data that is going to be unchanged, changed only during known specific intervals, or that

[appengine-java] Re: Google App Engine NO LONGER FOR SMALL DEVELOPERS!!!!!!!

2011-09-09 Thread Gerald Tan
If 5 visits per day is causing you to go over your Datastore Read/Write limits of 50k each per day, I think you may want to look at your app to see if you are doing something wrong -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group.

[appengine-java] Re: persistence of static values between instances

2011-09-08 Thread Gerald Tan
No, static values are only static within a VM, which is the one instance. The best way to share an entity between instances is memcache, but you will still need a datastore backup in case memcache is unavailable or the memcache entry expires. -- You received this message because you are

[appengine-java] Is there a way to define a Field as non-Index using JDO?

2011-09-05 Thread Gerald Tan
Is there a way to define a Field as non-Index using JDO? I'm thinking the only way seems to be using Text instead of String... but that would involve quite a lot of work updating the entire datastore -- You received this message because you are subscribed to the Google Groups Google App Engine