Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Eclipse Data Partition Question
Eclipse Data Partition Question [message #1061781] Tue, 04 June 2013 03:21 Go to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi,

I download the eclipselink data partition example and I can run it successfully. But I have a few questions about it.

1. In the Customer class, I see two partition policy annotation applied:
@ReplicationPartitioning(name="Replicate", connectionPools={"default","node2"})
@HashPartitioning(name="HashPartitionById", 
	partitionColumn=@Column(name="ID"), connectionPools={"default","node2"})

I think these two policies looks like incompatible, and in practise, only HashPartitoning policy takes effect.

2. Suppose I would like to issue a query like this:
SELECT c FROM Customer c WHERE c.id < 10 ORDER BY c.id

The result are not globally sorted and only partial sorted by each partition.
Is there a way to use a merge sort algorithm to sort the merged result?

Best wishes,
Oliver

[Updated on: Tue, 04 June 2013 03:22]

Report message to a moderator

Re: Eclipse Data Partition Question [message #1061886 is a reply to message #1061781] Tue, 04 June 2013 14:10 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

1 - You are correct, the ReplicationPartitioning is not used by Customer. It is defined there so it can be used as the session default policy in the persistence.xml, this allows for DDL to be replicated for schema generation.

2 - Two sort across partitions you need to sort in Java. You can just use the Java Collections sort() function.


James : Wiki : Book : Blog : Twitter
Re: Eclipse Data Partition Question [message #1061941 is a reply to message #1061886] Wed, 05 June 2013 03:37 Go to previous message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Okay, thanks
Previous Topic:EclipseLink 2.5 schema generation
Next Topic:DISTINCT and ORDER BY
Goto Forum:
  


Current Time: Fri Dec 06 15:10:14 GMT 2024

Powered by FUDForum. Page generated in 0.05020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top