This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Turanski
committed
Oct 31, 2013
1 parent
67012a6
commit 552696f
Showing
7 changed files
with
123 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
...ned/src/main/java/org/springframework/data/gemfire/examples/CountryPartitionResolver.java
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
basic/partitioned/src/main/java/org/springframework/data/gemfire/examples/OrderKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2002-2013 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package org.springframework.data.gemfire.examples; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author David Turanski | ||
* | ||
*/ | ||
@SuppressWarnings("serial") | ||
public class OrderKey implements Serializable { | ||
final String countryCode; | ||
final Long id; | ||
|
||
public OrderKey(Long id, String countryCode) { | ||
this.id = id; | ||
this.countryCode = countryCode; | ||
} | ||
|
||
public int hashCode() { | ||
return id.hashCode(); | ||
} | ||
|
||
public boolean equals(Object other) { | ||
if (!(other instanceof OrderKey)) { | ||
return false; | ||
} | ||
return ((OrderKey)other).id.equals(this.id); | ||
} | ||
|
||
public String toString() { | ||
return id + ":" + countryCode; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...titioned/src/main/java/org/springframework/data/gemfire/examples/PartitionedOrderKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2002-2013 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package org.springframework.data.gemfire.examples; | ||
|
||
import com.gemstone.gemfire.cache.EntryOperation; | ||
import com.gemstone.gemfire.cache.PartitionResolver; | ||
|
||
/** | ||
* @author David Turanski | ||
* | ||
*/ | ||
@SuppressWarnings({ "rawtypes", "serial" }) | ||
public class PartitionedOrderKey extends OrderKey implements PartitionResolver { | ||
|
||
|
||
public PartitionedOrderKey(Long id, String countryCode) { | ||
super(id,countryCode); | ||
} | ||
@Override | ||
public void close() { | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see com.gemstone.gemfire.cache.PartitionResolver#getName() | ||
*/ | ||
@Override | ||
public String getName() { | ||
return this.getClass().getName(); | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see com.gemstone.gemfire.cache.PartitionResolver#getRoutingObject(com.gemstone.gemfire.cache.EntryOperation) | ||
*/ | ||
@Override | ||
public Object getRoutingObject(EntryOperation op) { | ||
return this.countryCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters