Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

final versio to 1.1.0

  • Loading branch information...
commit 97da28b5f558773818472d45f3f5efc26459e0e4 1 parent 01b9d17
otaviojava authored
2  pom.xml
View
@@ -5,7 +5,7 @@
<groupId>org.easycassandra</groupId>
<artifactId>EasyCassandra</artifactId>
- <version>1.1.0-RC2</version>
+ <version>1.1.0</version>
<packaging>jar</packaging>
<name>EasyCassandra</name>
6 src/main/java/org/easycassandra/persistence/EasyCassandraManager.java
View
@@ -201,7 +201,7 @@ public static Persistence getPersistence(String keySpace, String host,
if(client==null){
return null;
}
- return new PersistenceSingleClient(client, referenceSuperColunms, keySpace);
+ return new PersistenceSingle(client, referenceSuperColunms, keySpace);
}
/**
@@ -211,7 +211,7 @@ public static Persistence getPersistence(String keySpace, String host,
*/
public static Persistence getPersistenceRandom(String keySpace) {
- return new PersistenceRandomClient(getListClient(keySpace),referenceSuperColunms, keySpace);
+ return new PersistenceRandom(getListClient(keySpace),referenceSuperColunms, keySpace);
}
/**
* get the Persistence with many clients and sequential access
@@ -220,7 +220,7 @@ public static Persistence getPersistenceRandom(String keySpace) {
*/
public static Persistence getPersistenceSequencial(String keySpace) {
- return new PersistenceSequencialClient(getListClient(keySpace),referenceSuperColunms, keySpace);
+ return new PersistenceSequencial(getListClient(keySpace),referenceSuperColunms, keySpace);
}
/**
6 src/main/java/org/easycassandra/persistence/Persistence.java
View
@@ -752,5 +752,11 @@ public int hashCode() {
}
+ /**
+ * Return the number of connections in this client
+ * @return number of connection
+ */
+ public abstract int size();
+
}
5 ...assandra/persistence/PersistenceRandomClient.java → .../easycassandra/persistence/PersistenceRandom.java
View
@@ -26,10 +26,10 @@
* @author otavio
*
*/
-public class PersistenceRandomClient extends Persistence{
+public class PersistenceRandom extends Persistence{
private Random random;
- PersistenceRandomClient(List<Client> clients, AtomicReference<ColumnFamilyIds> superColumnsRef,
+ PersistenceRandom(List<Client> clients, AtomicReference<ColumnFamilyIds> superColumnsRef,
String keySpace) {
super(superColumnsRef, keySpace);
this.clients=clients;
@@ -46,6 +46,7 @@ public Client getClient() {
* Return the number of connections in this client
* @return number of connection
*/
+ @Override
public int size(){
return clients.size();
7 ...ndra/persistence/PersistenceSequencialClient.java → ...ycassandra/persistence/PersistenceSequencial.java
View
@@ -25,9 +25,9 @@
* @author otavio
*
*/
-public class PersistenceSequencialClient extends Persistence{
+public class PersistenceSequencial extends Persistence{
- PersistenceSequencialClient(List<Client> clients, AtomicReference<ColumnFamilyIds> superColumnsRef,
+ PersistenceSequencial(List<Client> clients, AtomicReference<ColumnFamilyIds> superColumnsRef,
String keySpace) {
super(superColumnsRef, keySpace);
this.clients=clients;
@@ -43,7 +43,7 @@
* value for count the acess
*/
private int counter;
- @Override
+ @Override
public Client getClient() {
counter++;
if(counter==clients.size()){
@@ -56,6 +56,7 @@ public Client getClient() {
* Return the number of connections in this client
* @return number of connection
*/
+ @Override
public int size(){
return clients.size();
9 ...assandra/persistence/PersistenceSingleClient.java → .../easycassandra/persistence/PersistenceSingle.java
View
@@ -10,8 +10,8 @@
* @author otavio
*
*/
-public class PersistenceSingleClient extends Persistence {
- PersistenceSingleClient(Client client, AtomicReference<ColumnFamilyIds> superColumnsRef, String keyStore) {
+public class PersistenceSingle extends Persistence {
+ PersistenceSingle(Client client, AtomicReference<ColumnFamilyIds> superColumnsRef, String keyStore) {
super(superColumnsRef, keyStore);
this.client=client;
}
@@ -26,6 +26,11 @@ public Client getClient() {
return client;
}
+ @Override
+ public int size() {
+ return 1;
+ }
+
}
4 src/test/java/org/easycassandra/persistence/EasyCassandraManagerTest.java
View
@@ -55,7 +55,7 @@ public void getPersistenceRandomNumberTest(){
@Test
public void getPersistenceRandomInstanceTest(){
EasyCassandraManager.getPersistence("javabahia", "localhost", 9160);
- Assert.assertTrue(EasyCassandraManager.getPersistenceRandom("javabahia") instanceof PersistenceRandomClient);
+ Assert.assertTrue(EasyCassandraManager.getPersistenceRandom("javabahia") instanceof PersistenceRandom);
}
@Test
@@ -71,7 +71,7 @@ public void getPersistenceSequencialNumberTest(){
@Test
public void getPersistenceSequencialInstanceTest(){
EasyCassandraManager.getPersistence("javabahia", "localhost", 9160);
- Assert.assertTrue(EasyCassandraManager.getPersistenceSequencial("javabahia") instanceof PersistenceSequencialClient);
+ Assert.assertTrue(EasyCassandraManager.getPersistenceSequencial("javabahia") instanceof PersistenceSequencial);
}
6 ...ndra/persistence/PersistenceRandomClientTest.java → ...ycassandra/persistence/PersistenceRandomTest.java
View
@@ -5,7 +5,7 @@
import org.junit.Assert;
import org.junit.Test;
-public class PersistenceRandomClientTest {
+public class PersistenceRandomTest {
@Test
public void sizeTest(){
@@ -13,7 +13,7 @@ public void sizeTest(){
EasyCassandraManager.getPersistence("javabahia", "localhost", 9160);
EasyCassandraManager.getPersistence("javabahia", "node2", 9160);
EasyCassandraManager.getPersistence("javabahia", "node3", 9160);
- PersistenceRandomClient persistence=(PersistenceRandomClient)EasyCassandraManager.getPersistenceRandom("javabahia");
+ Persistence persistence=EasyCassandraManager.getPersistenceRandom("javabahia");
Assert.assertTrue(persistence.size()==3);
}
@@ -26,7 +26,7 @@ public void sizeTwoTest(){
EasyCassandraManager.getPersistence("javabahia", "localhost", 9160);
EasyCassandraManager.getPersistence("javabahia", "node2", 9160);
EasyCassandraManager.getPersistence("javabahia", "node3", 9160);
- PersistenceRandomClient persistence=(PersistenceRandomClient)EasyCassandraManager.getPersistenceRandom("javabahia");
+ PersistenceRandom persistence=(PersistenceRandom)EasyCassandraManager.getPersistenceRandom("javabahia");
Assert.assertTrue(persistence.size()==3);
}
6 .../persistence/PersistenceSequencialClientTest.java → ...sandra/persistence/PersistenceSequencialTest.java
View
@@ -5,7 +5,7 @@
import org.junit.Assert;
import org.junit.Test;
-public class PersistenceSequencialClientTest {
+public class PersistenceSequencialTest {
@Test
public void sizeTest(){
@@ -13,7 +13,7 @@ public void sizeTest(){
EasyCassandraManager.getPersistence("javabahia", "localhost", 9160);
EasyCassandraManager.getPersistence("javabahia", "node2", 9160);
EasyCassandraManager.getPersistence("javabahia", "node3", 9160);
- PersistenceSequencialClient persistence=(PersistenceSequencialClient)EasyCassandraManager.getPersistenceSequencial("javabahia");
+ Persistence persistence=EasyCassandraManager.getPersistenceSequencial("javabahia");
Assert.assertTrue(persistence.size()==3);
}
@@ -27,7 +27,7 @@ public void sizeTowTest(){
EasyCassandraManager.getPersistence("javabahia", "localhost", 9160);
EasyCassandraManager.getPersistence("javabahia", "node2", 9160);
EasyCassandraManager.getPersistence("javabahia", "node3", 9160);
- PersistenceSequencialClient persistence=(PersistenceSequencialClient)EasyCassandraManager.getPersistenceSequencial("javabahia");
+ PersistenceSequencial persistence=(PersistenceSequencial)EasyCassandraManager.getPersistenceSequencial("javabahia");
Assert.assertTrue(persistence.size()==3);
}
@Test
Please sign in to comment.
Something went wrong with that request. Please try again.