+ res.add(structure);
+ final long endTime = System.currentTimeMillis();
+ System.out.println(c + " rows analysed, execution time is " + (endTime - startTime) + " msec");
+ return res;
+ }
+
+
+ /*
+ * getting jobs by ip
+ */
+ public Map<String, String[]> ReadIpWithJobs(String ip) {
+ final long startTime = System.currentTimeMillis();
+ String com = "SELECT JobID, Protein, FinalStatus, DataBegin FROM ProteinLog WHERE ip = '" + ip + "';";
+ System.out.println("Command: " + com);
+ ResultSet results = session.execute(com);
+ if (results.isExhausted())
+ return null;
+ final long queryTime = System.currentTimeMillis();
+ List<Row> rows = results.all();
+ Map<String, String[]> res = new HashMap<String, String[]>();
+ System.out.println("Query time is " + (queryTime - startTime) + " msec");
+ System.out.println(" rows analysed, " + rows.size());
+ int c = 0;
+ for (Row r : rows) {
+ if (r.getString("FinalStatus").equals("OK")) {
+ String date = r.getString("DataBegin");
+ res.put(r.getString("JobID"), new String[] {date.substring(0, date.indexOf(":")), r.getString("Protein")});
+ ++c;
+ }
+ }