git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-networking-library@126720 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
59424dc2ab
commit
c759739bec
|
@ -1036,31 +1036,6 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
}
|
}
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param userid user identifier
|
|
||||||
* @return simply return a list of user messages notifications UUID in chronological order from the oldest to the more recent
|
|
||||||
*/
|
|
||||||
private ArrayList<String> getUserMessagesNotificationsIds(String userid) {
|
|
||||||
OperationResult<Rows<String, String>> result = null;
|
|
||||||
try {
|
|
||||||
result = conn.getKeyspace().prepareQuery(cf_UserMessageNotifications)
|
|
||||||
.getKeySlice(userid)
|
|
||||||
.execute();
|
|
||||||
} catch (ConnectionException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<String> toReturn = new ArrayList<String>();
|
|
||||||
|
|
||||||
// Iterate rows and their columns
|
|
||||||
for (Row<String, String> row : result.getResult()) {
|
|
||||||
for (Column<String> column : row.getColumns()) {
|
|
||||||
toReturn.add(column.getStringValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return toReturn;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Returns UUIDS of not read user notification messages
|
* Returns UUIDS of not read user notification messages
|
||||||
* @param userid user identifier
|
* @param userid user identifier
|
||||||
|
|
|
@ -18,7 +18,10 @@ import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.google.gwt.thirdparty.guava.common.collect.ImmutableMap;
|
||||||
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
|
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
|
||||||
|
import com.netflix.astyanax.model.ColumnFamily;
|
||||||
|
import com.netflix.astyanax.serializers.StringSerializer;
|
||||||
|
|
||||||
public class DatabookCassandraTest {
|
public class DatabookCassandraTest {
|
||||||
private static DBCassandraAstyanaxImpl store;
|
private static DBCassandraAstyanaxImpl store;
|
||||||
|
@ -195,24 +198,15 @@ public class DatabookCassandraTest {
|
||||||
// */
|
// */
|
||||||
// @Test
|
// @Test
|
||||||
// public void addInvitesDynamicColumnFamilies() {
|
// public void addInvitesDynamicColumnFamilies() {
|
||||||
// System.out.println("addInvitesColumnFamilies");
|
// System.out.println("UserNotificationsUnread");
|
||||||
// ColumnFamily<String, String> cf_HashtagsCounter = new ColumnFamily<String, String>(
|
// ColumnFamily<String, String> cf_UserNotificationsUnreadTimeline = new ColumnFamily<String, String>(
|
||||||
// DBCassandraAstyanaxImpl.VRE_INVITES, // Column Family Name
|
// DBCassandraAstyanaxImpl.USER_NOTIFICATIONS_UNREAD, // Column Family Name
|
||||||
// StringSerializer.get(), // Key Serializer
|
|
||||||
// StringSerializer.get()); // Column Serializer
|
|
||||||
// ColumnFamily<String, String> cf_HashtagTimeline = new ColumnFamily<String, String>(
|
|
||||||
// DBCassandraAstyanaxImpl.EMAIL_INVITES, // Column Family Name
|
|
||||||
// StringSerializer.get(), // Key Serializer
|
// StringSerializer.get(), // Key Serializer
|
||||||
// StringSerializer.get()); // Column Serializer
|
// StringSerializer.get()); // Column Serializer
|
||||||
//
|
//
|
||||||
// try {
|
// try {
|
||||||
// new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_HashtagsCounter, ImmutableMap.<String, Object>builder()
|
|
||||||
// .put("default_validation_class", "UTF8Type")
|
|
||||||
// .put("key_validation_class", "UTF8Type")
|
|
||||||
// .put("comparator_type", "UTF8Type")
|
|
||||||
// .build());
|
|
||||||
//
|
//
|
||||||
// new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_HashtagTimeline, ImmutableMap.<String, Object>builder()
|
// new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_UserNotificationsUnreadTimeline, ImmutableMap.<String, Object>builder()
|
||||||
// .put("default_validation_class", "UTF8Type")
|
// .put("default_validation_class", "UTF8Type")
|
||||||
// .put("key_validation_class", "UTF8Type")
|
// .put("key_validation_class", "UTF8Type")
|
||||||
// .put("comparator_type", "UTF8Type")
|
// .put("comparator_type", "UTF8Type")
|
||||||
|
@ -221,7 +215,7 @@ public class DatabookCassandraTest {
|
||||||
// } catch (ConnectionException e) {
|
// } catch (ConnectionException e) {
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// }
|
// }
|
||||||
// System.out.println("addInvitesColumnFamilies END");
|
// System.out.println("UserNotificationsUnread END");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue