Hi,
Further, on this... which leads to how changing of the namespace can be done
using mapreduce.
If I recreate entities, then if the keys are stored as references in other
entities also needs to be recreated.
Ex.
class Party {
@Long id
Key<Tenant> tenantKey; // partitioning/filtering
String fname
}
I have several other entitities dependent on the Party Key.
class Invoice {
@Long id
Key<party> partyKey
...
}
class Payment {
@Long id
Key<Party> partyKey
}
All invoices/Payments has to be re-created.
So, how can this be done using mapreduce jobs. One option is
- Using mapreduce, all the Party entities are recreated. The originalkey
and the newkey is stored in a different mapping table, something like this
and operates in the empty namespace.
class MigrationMappingKeys {
@Long id;
Key<Party> oldKey
Key<Party> newKey
}
Then, I run the mapreduce job on the Invoice and Payment, and recreate based
on the above class.
Any other options...?
-Aswath
On Thu, Oct 28, 2010 at 3:25 PM, Didier Durand <[email protected]>wrote:
> Hi,
>
>
> http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/NamespaceManager.html
> says
>
> "When a namespace aware class (e.g., Key, Query and MemcacheService)
> is constructed, it determines which namespace will be used by calling
> get() if it is otherwise unspecified. If get() returns null, the
> current namespace is unset and these APIs will use the empty ("")
> namespace in its place. "
>
> So, I would guess that you have to recreate / copy your entities after
> having set namespace via NameSpaceManager.set() if you want to move
> them into a new namespace
>
> regards
> didier
>
> On Oct 28, 11:34 am, aswath satrasala <[email protected]>
> wrote:
> > Hello,
> > I have an multi-tenant app-id, and I have designed on partitioning the
> > entities based on url parameters. I am not using the namespace yet.
> >
> > For example,
> >
> > Tenant {
> > @Id name+email;
> >
> > }
> >
> > class Party {
> > @Long id
> > Key<Tenant> tenantKey; // partitioning/filtering
> > String fname
> >
> > }
> >
> > Now, I am planning to use the NamespaceManager for the Party entities. I
> > want to use the mapreduce and apply the namespace on the existing Party
> > entities.
> > Can a namespace be changed from empty to certain value on the existing
> > entity.
> >
> > -Aswathhttp://vs-accounting.appspot.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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-java?hl=en.