Permalink
Browse files

refactoring

  • Loading branch information...
Otávio Santana
Otávio Santana committed Jan 29, 2012
1 parent 571c922 commit 80bbe90f4fdc326c98679be8ae41d453fe3da64c
@@ -3,9 +3,6 @@
import java.nio.ByteBuffer;
import java.util.Map;
-import org.easycassandra.annotations.write.DefaultWrite;
-import org.easycassandra.util.EncodingUtil;
-import org.easycassandra.util.ReflectionUtil;
/**
* This class see and verify the Object to transform Byte to Object
@@ -68,7 +68,7 @@
* field for lock or unlock for run
* the Thread
*/
- private static AtomicBoolean LOCKWRITE= new AtomicBoolean(false);
+ private static AtomicBoolean DOCUMENTDAEMON= new AtomicBoolean(false);
/**
* Thread for write the id in the Document
@@ -160,7 +160,7 @@ private Field getField(Class object, Class annotation) {
* @param persistenceClass - Class of the object viewed
* @return the Field if there are not will be return null
*/
- @SuppressWarnings({ "rawtypes" })
+ @SuppressWarnings("rawtypes")
protected Field getKeyField(Class persistenceClass) {
return getField(persistenceClass, KeyValue.class);
@@ -172,7 +172,7 @@ protected Field getKeyField(Class persistenceClass) {
* @param persistenceClass - Class of the object viewed
* @return the Field if there are not will be return null
*/
- @SuppressWarnings({ "rawtypes" })
+ @SuppressWarnings("rawtypes" )
protected Field getIndexField(Class persistenceClass) {
return getField(persistenceClass, IndexValue.class);
}
@@ -195,8 +195,8 @@ protected ByteBuffer getKey(Object object, boolean autoEnable) throws IOExceptio
if (chave.auto() && autoEnable) {
id = referenciaSuperColunas.get().getId(colunaFamilia,keyStore);
- if(!LOCKWRITE.get()){
- LOCKWRITE.set(true);
+ if(!DOCUMENTDAEMON.get()){
+ DOCUMENTDAEMON.set(true);
writeDocumentThread.start();
}
@@ -457,13 +457,13 @@ public void setKeyStore(String keyStore) {
* @param lockWrite the LOCK_WRITE to set
*/
public static void setLockWrite(AtomicBoolean lockWrite) {
- LOCKWRITE= lockWrite;
+ DOCUMENTDAEMON= lockWrite;
}
/**
* @param LOCK_WRITE_VALUE the LOCK_WRITE to set
*/
public static AtomicBoolean getLockWrite() {
- return LOCKWRITE;
+ return DOCUMENTDAEMON;
}
}
@@ -181,7 +181,7 @@ public List findAll(Class persistenceClass) {
* @see #findAll(java.lang.Class, org.easycassandra.ConsistencyLevelCQL, int)
* @return the list with Object is retrive
*/
- @SuppressWarnings("rawtypes")
+
public List findAll(Class persistenceClass, int limit) {
return findAll(persistenceClass, ConsistencyLevelCQL.ONE, limit);
}
@@ -281,8 +281,7 @@ public Object findByKey(Object key, Class persistenceClass, ConsistencyLevelCQL
int limit = 1;
- Field keyField = getKeyField(persistenceClass);
-
+
ByteBuffer keyBuffer = getWriteManager().convert(key);
String keyString = new UTF8Read().getObjectByByte(keyBuffer).toString();
String condicao = "KEY";

0 comments on commit 80bbe90

Please sign in to comment.