How it's different is they don't have to put any custom code on the server.
There are environments where pushing code to the server is not allowed but
they would still like to do co-located join queries.

--
Mike Stolz
Principal Engineer - Gemfire Product Manager
Mobile: 631-835-4771

On Jun 3, 2017 12:24 AM, "Jacob Barrett" <jbarr...@pivotal.io> wrote:

The "simplest implementation" overlooks the rational for implementing it.
The rational was to avoid customers having to implement classes to do
partitioning. How is that any different than forcing them to conform their
string keys to a very specific format we can parse in this solution. If
there keys already have multiple components and is represented already in a
string then why force them to change their code?

How is regex any more complicated in the simplest case? The regex
/^([^:]+):/ matches the proposed "partition:key" format.

-Jake



On Fri, Jun 2, 2017 at 8:57 PM Michael Stolz <mst...@pivotal.io> wrote:

> We are looking for the simplest implementation.  Not the best. Fixed
> delimeter, string only, SIMPLE.
>
> We as a team have a habit of always solving the bigger problem.
>
> Lets allow this one to be simple.
>
> --
> Mike Stolz
> Principal Engineer - Gemfire Product Manager
> Mobile: 631-835-4771 <(631)%20835-4771>
>
> On Jun 2, 2017 10:16 PM, "Jacob Barrett" <jbarr...@pivotal.io> wrote:
>
> > If you implement as regular expression the user doesn't have to reformat
> > their key to a specific format (akin to making them implement a class).
I
> > would concat the matching groups for generate the routing key.
> >
> > Consider RegEx: .*\bcorrelation=(\d+).*\bmaybe-something-else=(\w)
> > With Keys:
> > A: my,key;with:any-chars;unique=12345;correlation=678/and,
> > maybe-something-else=a
> > B: my,key;unique=876324;correlation=678;and,maybe-something-else=a,foo
> > C: somthing;different=988975;correlation=678;then,maybe-
something-else=ba
> >
> > Keys A and B would have routing key '678a'. Key C would have routing key
> > '678b'.
> >
> > -Jake
> >
> >
> >
> > Consider
> >
> > On Fri, Jun 2, 2017 at 4:02 PM Darrel Schneider <dschnei...@pivotal.io>
> > wrote:
> >
> > > Geode partitioned regions usually partition the data based on the
key's
> > > hashcode.
> > > You can do your own partitioning by implementing the PartitionResolver
> > > interface and configuring it on the partitioned region.
> > >
> > > In some use cases needing to deploy your class that implements
> > > PartitionResolver can be problematic so we would like to find a way to
> > > offer partitioning based on a portion of the key (instead of the
> default
> > > which uses the entire key) that does not require you to implement your
> > own
> > > PartitionResolver and does not require you to deploy your own code to
> do
> > > the custom partitioning.
> > >
> > > Another group of users that do not want to implement PartitionResolver
> > are
> > > non-java clients. So the solution is required to be usable by non-java
> > > geode clients without needing to reimplement the client to support a
> new
> > > feature.
> > >
> > > Another constraint on the solution is for it to be both easy to use
and
> > > easy to implement.
> > >
> > > The proposed solution is to provide a class named:
> > >     org.apache.geode.cache.StringPrefixPartitionResolver
> > > This class will implement PartitionResolver and have a default
> > constructor.
> > > To use it you need to configure a partitioned region's
> PartitionResolver
> > > using the already existing mechanism for this (api, gfsh, or xml).
> > > The StringPrefixPartitionResolver will require all keys on its region
> to
> > be
> > > of type String.
> > > It also requires that the string key contains at least one ':'
> character.
> > > The substring of the key that precedes the first ':' is the prefix
that
> > > will be returned from "getRoutingObject".
> > >
> > > An example of doing this in gfsh is:
> > >     create region --name=r1 --type=PARTITION
> > > --partition-resolver=org.apache.geode.cache.
> > StringPrefixPartitionResolver
> > >
> > > Note that attempting to use a key that is not a String or does not
> > contain
> > > a ':' will throw an exception. This is to help developers realize they
> > made
> > > a mistake.
> > >
> > > Note that the delimiter is always a ':'. It would be easy to made the
> > > delimiter configurable when using apis or xml but currently gfsh does
> not
> > > provide a way to pass parameters to the --partition-resolver create
> > region
> > > option.
> > >
> > > The only public api change this proposal makes is the new
> > > StringPrefixPartitionResolver class.
> > >
> >
>

Reply via email to