Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feature sharding #325

Closed
wants to merge 6 commits into from
Closed

Conversation

tecbot
Copy link

@tecbot tecbot commented Jun 11, 2012

Hi,

i have implemented a first version of sharding support. I added a new annotation "QueryFields" to change the core query routine for a document.

The next step is to update the reference mappings to include the query fields in the reference object. But first I want some feedback from you.

Issue: #304

Regards
Thomas

*/
public function getDocumentQuery($document)
{
if($this->class->hasQueryFields()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other code in Doctrine has a space between if and (

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@jwage
Copy link
Member

jwage commented Jun 11, 2012

Looks interesting. So the queryFields will be stored in the reference document? What else do you see as being needed to support sharding fully?

@tecbot
Copy link
Author

tecbot commented Jun 11, 2012

Yes we need to add the query fields to the reference document to make a correct shard query and after this we support sharding fully so we need nothing more.

@jwage
Copy link
Member

jwage commented Jun 11, 2012

Ok. Can't wait to see the rest.

@tecbot
Copy link
Author

tecbot commented Jun 11, 2012

Ok, I will finish it tomorrow :)

@balboah
Copy link

balboah commented Jun 13, 2012

Did you? :)

@jmikola
Copy link
Member

jmikola commented Jun 13, 2012

I'll plan to take a look at this tomorrow on my local machine with a small sharding setup. @tecbot: Please let me know if anything is still TODO.

@tecbot
Copy link
Author

tecbot commented Jun 14, 2012

@jmikola currently i'm working on the db ref stuff for reference mapping.

*/
public function hasQueryFields()
{
return $this->queryFields ? true : false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldnt this be return (boolean) $this->queryFields ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in the next commits

@tecbot
Copy link
Author

tecbot commented Jun 15, 2012

@jmikola, @jwage : I pushed the initial DBref logic for sharding also I implemented lazy loading for referenece one inverse side. Currently shard keys for embedded or reference documents are not supported.

@jmikola
Copy link
Member

jmikola commented Jun 19, 2012

@tecbot: I can't find contact info for you, but could we sync up in IRC or Google chat later today to discuss the PR? I'm in the #doctrine-dev channel.

@tecbot
Copy link
Author

tecbot commented Jun 19, 2012

@jmikola ok. I'm in the the #doctrine-dev channel now.

@balboah
Copy link

balboah commented Jul 9, 2012

What's the progress on this feature?

@tecbot
Copy link
Author

tecbot commented Jul 9, 2012

I want to finish the feature end of this week.

@balboah
Copy link

balboah commented Jul 9, 2012

What is left to be done? Can I help in some way?

@tecbot
Copy link
Author

tecbot commented Jul 9, 2012

  • rename QueryFields to ShardedFields
  • throw exceptions if user want to change sharded fields
  • add the possibility to set sharded fields for embedded and reference documents
  • code cleanup and more unit testing

if you want you can help :), i haven't started any task of this at the moment.

@@ -148,7 +148,7 @@ public function testReferencesUsesMinimalKeys()

$dm->expects($this->once())
->method('createDBRef')
->will($this->returnValue(array('$ref' => 'coll', '$id' => '1234', '$db' => 'db')));
->will($this->returnValue(array('$id' => '1234')));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is $ref missing here? I can understand removing $db, as it's optional, but reference objects require $ref and $id.

* @return mixed|object The document reference.
*/
public function getReference($documentName, $identifier)
public function getReference($documentName, $identifier, $query = null, array $sort = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the $sort parameter used for, if this is for creating a proxy object?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes its for the inverse side proxy. in this case we need the $sort parameter

@daviddesberg
Copy link

@jmikola Ping, just curious on what the progress of this is/if it's going to be implemented in 1.0

@alcaeus
Copy link
Member

alcaeus commented Mar 14, 2016

Superseded by #1385.

@alcaeus alcaeus closed this Mar 14, 2016
@lhecker lhecker deleted the feature-sharding branch May 18, 2019 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants