new type date request
[proteocache.git] / datadb / compbio / cassandra / CassandraNativeConnector.java
index 6e6992d..8e76d43 100644 (file)
@@ -228,17 +228,16 @@ public class CassandraNativeConnector {
         */
        public Integer ReadDateTable(long queryDate) {
                final long startTime = System.currentTimeMillis();
-               String com = "SELECT jobtime, JobID FROM ProteinData WHERE jobtime = " + queryDate + ";";
+               String com = "SELECT count(*) FROM ProteinData WHERE jobtime = " + queryDate + ";";
                System.out.println("Command: " + com);
                ResultSet results = session.execute(com);
                final long queryTime = System.currentTimeMillis();
                System.out.println("Query time is " + (queryTime - startTime) + " msec");
-               if (results.isExhausted())
-                       return 0;
-               List<Row> rows = results.all();
+               Row row = results.one();
+               Integer count = (int) row.getLong(0);
                final long endTime = System.currentTimeMillis();
-               System.out.println("Processing time is " + (endTime - queryTime) + " msec");
-               return rows.size();
+               System.out.println("Processing time is " + (endTime - queryTime) + " msec");            
+               return count;
        }
 
        /*