See Here:

http://www.billkatz.com/2009/9/Pre-allocating-IDs-for-App-Engine-datastore

<http://www.billkatz.com/2009/9/Pre-allocating-IDs-for-App-Engine-datastore>Seems
that allocate_ids() should work fine for what you want...


On Sun, Sep 19, 2010 at 7:42 PM, Tim Hoffman <[email protected]> wrote:

> Hi
>
> I don't think you can do that, id's aren't necessarily allocated
> starting at 0.
> Have a read of
> http://code.google.com/appengine/docs/python/datastore/functions.html
> (allocate_ids and allocate_id_range)
> You might be able to pre-allocate all the id's.
>
> But the docs specify id as a long, and in python long is a VERY big
> number.  For example.
>
> t...@chrome:~/qtrack/qtrack$ python2.5 console.py q-tracker
> 192.168.1.104:8080
> App Engine interactive console for q-tracker
> >>> x = 4294967295000000
> >>> import qtrack.models
> >>> y = db.Key.from_path('AuditItem',x)
> >>> repr(y)
> "datastore_types.Key.from_path(u'AuditItem', 4294967295000000,
> _app=u'q-tracker')"
> >>> a = qtrack.models.AuditItem(key=y)
> >>> a.put()
> >>> a.key()
> datastore_types.Key.from_path(u'AuditItem', 4294967295000000, _app=u'q-
> tracker')
>
>
> Hence I don't think overflow is going to be an issue, and that testing
> what you propose is probably futile ;-)
>
> Regards
>
> Tim
>
> On Sep 20, 1:58 am, esilver <[email protected]> wrote:
> > Hi folks,
> > I want to test that my client doesn't suffer from int overflow issues,
> > so I want to start inserting elements beginning at row id 4294967295,
> > instead of beginning at 0. I am happy to hack the app engine code
> > because I just need to run a simple test.
> >
> > If anyone has done this, or can tell me where to look in the GAE
> > codebase, I'd be grateful.
> >
> > Thanks!
> > -Eric
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to