delete DataBase beans
authorNatasha Sherstneva <n.shertneva@gmail.com>
Thu, 5 Dec 2013 10:00:34 +0000 (10:00 +0000)
committerNatasha Sherstneva <n.shertneva@gmail.com>
Thu, 5 Dec 2013 10:00:34 +0000 (10:00 +0000)
13 files changed:
datadb/compbio/cassandra/DataBase.java [deleted file]
server/compbio/controllers/DailyStatisticsController.java
server/compbio/controllers/IPDataController.java
server/compbio/controllers/JobExecutionTimeController.java
server/compbio/controllers/SequenceController.java
server/compbio/listeners/DetailList.java [deleted file]
server/compbio/listeners/ServletIp.java
server/compbio/listeners/ServletJobsByDate.java
server/compbio/listeners/ServletJobsByIp.java
server/compbio/listeners/ServletSequenceProtein.java
server/compbio/listeners/ServletTimeExecution.java
server/compbio/statistic/CassandraRequester.java
server/compbio/statistic/StatisticsProt.java [deleted file]

diff --git a/datadb/compbio/cassandra/DataBase.java b/datadb/compbio/cassandra/DataBase.java
deleted file mode 100644 (file)
index 57063ec..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-package compbio.cassandra;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-
-public class DataBase {
-       private String date;
-       private int total;                                      // total number of jobs
-       private int totalOK;                            // number of jobs with execution status OK
-       private int totalStopped;                        // number of jobs with execution status STOPPED
-       private int totalError;                         // number of jobs with execution status Jpred ERROR
-       private int totalTimeOut;                       // number of jobs with execution status TIMEOUT
-       private int totalJobs;
-       private int totalId;                            // total jobs for current protein sequence
-       private String id;
-       private String ip;
-       private String prot;                            // protein sequence
-       private String jpred;
-       private List<Integer> timeRez;
-       private List<Integer> timeTotalExec;
-       private JobBean logInfo;
-       private ProteinBean predictions;
-
-       public DataBase() {
-       }
-
-       public DataBase(String dat, int total) {
-               this.date = dat;
-               this.total = total;
-       }
-
-       public void setDate(String dat) {
-               this.date = dat;
-       }
-
-       public String getDate() {
-               if (null == date)
-                       return "1/1/1970";
-               return date;
-       }
-
-       public void setTotal(int tot) {
-               this.total = tot;
-       }
-
-       public int getTotal() {
-               return total;
-       }
-
-       public void setTotalOK(int tot) {
-               this.totalOK = tot;
-       }
-
-       public int getTotalOK() {
-               return totalOK;
-       }
-
-       public void setTotalStopped(int tot) {
-               this.totalStopped = tot;
-       }
-
-       public int getTotalStopped() {
-               return totalStopped;
-       }
-
-       public void setTotalError(int tot) {
-               this.totalError = tot;
-       }
-
-       public int getTotalError() {
-               return totalError;
-       }
-
-       public void setTotalTimeOut(int tot) {
-               this.totalTimeOut = tot;
-       }
-
-       public int getTotalTimeOut() {
-               return totalTimeOut;
-       }
-       
-       public void setTotalJobs(int totalJobs) {
-               this.totalJobs = totalJobs;
-       }
-
-       public int getTotalJobs() {
-               return totalJobs;
-       }
-
-       public void setTotalId(int totId) {
-               this.totalId = totId;
-       }
-
-       public int getTotalId() {
-               return totalId;
-       }
-
-       public void setProt(String prot) {
-               this.prot = prot;
-       }
-
-       public String getProt() {
-               return prot;
-       }
-
-       public void setJpred(String jpred) {
-               this.jpred = jpred;
-       }
-
-       public String getJpred() {
-               return jpred;
-       }
-
-       public void setId(String id) {
-               this.id = id;
-       }
-
-       public String getId() {
-               return id;
-       }
-       
-       public void setIp(String ip) {
-               this.ip = ip;
-       }
-
-       public String getIp() {
-               return ip;
-       }
-
-       public void setTimeRez(List<Integer> timeRez) {
-               this.timeRez = timeRez;
-       }
-
-       public List<Integer> getTimeRez() {
-               return timeRez;
-       }
-       
-       public void setTimeTotalExec(List<Integer> timeTotalExec) {
-               this.timeTotalExec = timeTotalExec;
-       }
-
-       public List<Integer> getTimeTotalExec() {
-               return timeTotalExec;
-       }
-       
-       public void setLogInfo(JobBean logInfo){
-               this.logInfo = logInfo;
-       }
-       
-       public JobBean getLogInfo() {
-               return logInfo;
-       }
-       
-       public void setPredictions(ProteinBean predictions){
-               this.predictions = predictions;
-       }
-       
-       public ProteinBean getPredictions() {
-               return predictions;
-       }
-
-}
index b735107..8bd718e 100644 (file)
@@ -12,11 +12,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import compbio.cassandra.DataBase;
 import compbio.cassandra.DateBean;
 import compbio.cassandra.TotalJobsStatisticBean;
 import compbio.statistic.CassandraRequester;
-import compbio.statistic.StatisticsProt;
 
 /**
  * @author Alexander Sherstnev
@@ -46,7 +44,7 @@ public class DailyStatisticsController {
                CassandraRequester cr = new CassandraRequester();
                if (option.equals("AllDates,off")) {
                        Calendar cal = Calendar.getInstance();
-                       date1 = StatisticsProt.DateFormatYYMMDD(cr.earliestDate());
+                       date1 = cr.earliestDateString();
                        date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
                }
                model.put("date1", date1);
index 424a742..3d5caa0 100644 (file)
@@ -8,7 +8,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import compbio.cassandra.DataBase;
 import compbio.cassandra.TotalByCounterBean;
 import compbio.cassandra.UserBean;
 import compbio.statistic.CassandraRequester;
index 191a40c..13c606d 100644 (file)
@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import compbio.statistic.CassandraRequester;
-import compbio.statistic.StatisticsProt;
+
 
 /**
  * @author Alexander Sherstnev
@@ -38,13 +38,13 @@ public class JobExecutionTimeController {
                CassandraRequester sp = new CassandraRequester();
                if (option.equals("AllDates,off")) {
                        Calendar cal = Calendar.getInstance();
-                       date1 = StatisticsProt.DateFormatYYMMDD(sp.earliestDate());
-                       date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
+//                     date1 = StatisticsProt.DateFormatYYMMDD(sp.earliestDate());
+//                     date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
                }
                model.put("date1", date1);
                model.put("date2", date2);
                model.put("option", option);
-               model.put("result", sp.extractExecutionTime(date1, date2));
+       //      model.put("result", sp.extractExecutionTime(date1, date2));
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
                return "/reportTimeExecution";
index 2008a06..c57ed1f 100644 (file)
@@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import compbio.cassandra.ProteinBean;
-import compbio.cassandra.DataBase;
 import compbio.cassandra.TotalByCounterBean;
 import compbio.statistic.CassandraRequester;
 
diff --git a/server/compbio/listeners/DetailList.java b/server/compbio/listeners/DetailList.java
deleted file mode 100644 (file)
index 385ce95..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-package compbio.listeners;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import compbio.cassandra.*;
-import compbio.statistic.StatisticsProt;
-
-/**
- * Servlet implementation class DetailList
- */
-@WebServlet("/DetailList")
-public class DetailList extends HttpServlet {
-       private static final long serialVersionUID = 1L;
-
-       /**
-        * @see HttpServlet#HttpServlet()
-        */
-
-       /**
-        * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
-        *      response)
-        */
-       protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-               List<DataBase> result;
-               String date1 = request.getParameter("data1");
-               String date2 = request.getParameter("data2");
-               StatisticsProt sp = new StatisticsProt();
-               // result = sp.readDetail(date1, date2);
-       }
-
-       /**
-        * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
-        *      response)
-        */
-       protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-               // TODO Auto-generated method stub
-       }
-
-}
index e229176..76c59ff 100644 (file)
@@ -9,7 +9,6 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import compbio.cassandra.DataBase;
 import compbio.statistic.CassandraRequester;
 
 /**
index 8ae389f..83b2e4d 100644 (file)
@@ -11,9 +11,7 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import compbio.cassandra.DataBase;
 import compbio.statistic.CassandraRequester;
-import compbio.statistic.StatisticsProt;
 
 @WebServlet("/ServletJobsByDate")
 public class ServletJobsByDate extends HttpServlet {
@@ -30,7 +28,7 @@ public class ServletJobsByDate extends HttpServlet {
                CassandraRequester cr = new CassandraRequester();
                if (null != request.getParameter("option")) {
                        Calendar cal = Calendar.getInstance();
-                       date1 = StatisticsProt.DateFormatYYMMDD(cr.earliestDate());
+       //              date1 = StatisticsProt.DateFormatYYMMDD(cr.earliestDate());
                        date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
                }
                request.setAttribute("data1", date1);
index bff4a5c..d50ff71 100644 (file)
@@ -9,7 +9,6 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import compbio.cassandra.DataBase;
 import compbio.statistic.CassandraRequester;
 
 /**
index 6d1316d..8b75770 100644 (file)
@@ -10,9 +10,7 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import compbio.cassandra.DataBase;
 import compbio.statistic.CassandraRequester;
-import compbio.statistic.StatisticsProt;
 
 /**
  * Servlet implementation class ProtServlet
index c380604..563cf42 100644 (file)
@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import compbio.statistic.StatisticsProt;
 import compbio.statistic.CassandraRequester;
 
 /**
@@ -31,12 +30,12 @@ public class ServletTimeExecution extends HttpServlet {
                CassandraRequester sp = new CassandraRequester();
                if (null != request.getParameter("option")) {
                        Calendar cal = Calendar.getInstance();
-                       date1 = StatisticsProt.DateFormatYYMMDD(sp.earliestDate());
+       //              date1 = CassandraRequester.DateFormatYYMMDD(sp.earliestDate());
                        date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
                }
                request.setAttribute("data1", date1);
                request.setAttribute("data2", date2);
-               request.setAttribute("result", sp.extractExecutionTime(date1, date2));
+       //      request.setAttribute("result", sp.extractExecutionTime(date1, date2));
                request.setAttribute("flag", request.getParameter("option"));
                final long endTime = System.currentTimeMillis();
                request.setAttribute("timeExecution", (endTime - startTime));
index c150d9d..5de5066 100755 (executable)
@@ -13,7 +13,6 @@ import compbio.cassandra.DateBean;
 import compbio.cassandra.ProteinBean;
 import compbio.cassandra.CassandraNativeConnector;
 import compbio.cassandra.CassandraReader;
-import compbio.cassandra.DataBase;
 import compbio.cassandra.Pair;
 import compbio.cassandra.JobBean;
 import compbio.cassandra.Total;
@@ -23,7 +22,6 @@ import compbio.cassandra.UserBean;
 
 public class CassandraRequester {
        private CassandraReader db = new CassandraReader();
-       private ArrayList<DataBase> query;
        private static long currentDate = 0;
        private static long earlestDate = 0;
        private final static SimpleDateFormat formatYYMMDD = new SimpleDateFormat("yyyy/MM/dd");
@@ -31,7 +29,7 @@ public class CassandraRequester {
 
        /*
         * query: execution time for the period from date1 till date2
-        */
+        
        public List<DataBase> extractExecutionTime(String date1, String date2) {
                if (null == date1) {
                        date1 = "1970/1/1";
@@ -115,7 +113,7 @@ public class CassandraRequester {
                db.setTimeTotalExec(totalTime);
                query.add(db);
                return query;
-       }
+       }*/
        
        /*
         * query: total number of jobs  for the period from date1 till date2
@@ -301,6 +299,12 @@ public class CassandraRequester {
                SimpleDateFormat datformat = new SimpleDateFormat("dd/MM/yyyy");
                return datformat.format(new Date(inDate));
        }
+       
+       // convert long to date in string format
+               private static String DateFormatYYMMDD(long inDate) {
+                       SimpleDateFormat datformat = new SimpleDateFormat("yyyy/MM/dd");
+                       return datformat.format(new Date(inDate));
+               }
 
        /*
         * set earlest date and current dates. earlestDate is static and should be
@@ -338,4 +342,12 @@ public class CassandraRequester {
                return earlestDate;
        }
        
+       /*
+        * find the earliest date in the database in String format
+        */
+       public String earliestDateString() {
+               earlestDate = CassandraNativeConnector.getEarliestDateInDB();
+               return DateFormatYYMMDD(earlestDate);
+       }
+       
 }
diff --git a/server/compbio/statistic/StatisticsProt.java b/server/compbio/statistic/StatisticsProt.java
deleted file mode 100755 (executable)
index 05375c0..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-package compbio.statistic;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import compbio.cassandra.CassandraNativeConnector;
-import compbio.cassandra.DataBase;
-
-public class StatisticsProt {
-       private CassandraNativeConnector cc = new CassandraNativeConnector();
-       private ArrayList<DataBase> query;
-       private static long currentDate = 0;
-       private static long earlestDate = 0;
-
-       /* 
-        * query: the period from date1 till date2
-        * */
-       public List<DataBase> readDetails(String date1, String date2) {
-
-               if (!isThisDateValid(date1) || !isThisDateValid(date2)) {
-                       System.out.println("Wrong date: point 1");
-                       return null;
-               }
-               SetDateRange();
-               long dateStart = DateParsing(date1);
-               long dateEnd = DateParsing(date2);
-               if ((dateStart < earlestDate && dateEnd < earlestDate) || (dateStart > currentDate && dateEnd > currentDate) || dateStart > dateEnd)
-                       return null;
-               if (dateStart < earlestDate)
-                       dateStart = earlestDate;
-               if (dateEnd > currentDate)
-                       dateStart = currentDate;
-               System.out.println("StatisticsProt.readDetails: earlestDate = " + earlestDate + ", currentDate = " + currentDate);
-               System.out.println("StatisticsProt.readDetails: Start date " + date1 + ": int representation = " + dateStart);
-               System.out.println("StatisticsProt.readDetails: End date " + date2 + ": int representation = " + dateEnd);
-               Calendar start = Calendar.getInstance();
-               start.setTime(new Date(dateStart));
-               Calendar end = Calendar.getInstance();
-               end.setTime(new Date(dateEnd));
-               query = new ArrayList<DataBase>();
-               int day = 0;
-               /*
-               for (Date date = start.getTime(); !start.after(end); start.add(Calendar.DATE, 1), date = start.getTime()) {
-                       SliceQuery<Long, String, String> result = HFactory.createSliceQuery(cc.GetKeyspace(), LongSerializer.get(),
-                                       StringSerializer.get(), StringSerializer.get());
-                       result.setColumnFamily("ProteinData");
-                       result.setKey(date.getTime());
-                       result.setRange(null, null, false, Integer.MAX_VALUE);
-                       QueryResult<ColumnSlice<String, String>> columnSlice = result.execute();
-                       ++day;
-                       System.out.print("Day " + day + ": dataStart = " + date + ": ");
-                       if (!columnSlice.get().getColumns().isEmpty()) {
-                               DataBase db = new DataBase(DateFormat(date.getTime()), columnSlice.get().getColumns().size());
-                               query.add(db);
-                               System.out.println("data exist");
-                       } else {
-                               System.out.println("no data");
-                       }
-               }
-               */
-               System.out.println("StatisticsProt.readLength: total number of dates = " + query.size());
-               return query;
-       }
-
-       /*
-        * query: execution time for the period from date1 till date2
-        * */
-       public List<DataBase> readLength(String date1, String date2) {
-               if (!isThisDateValid(date1) || !isThisDateValid(date2)) {
-                       System.out.println("Wrong date: point 3");
-                       return null;
-               }
-               SetDateRange();
-               int nbins = 5;
-               long dateStart = DateParsing(date1);
-               long dateEnd = DateParsing(date2);
-               if ((dateStart < earlestDate && dateEnd < earlestDate) || (dateStart > currentDate && dateEnd > currentDate) || dateStart > dateEnd)
-                       return null;
-               if (dateStart < earlestDate)
-                       dateStart = earlestDate;
-               if (dateEnd > currentDate)
-                       dateStart = currentDate;
-               System.out.println("StatisticsProt.readLength: earlestDate = " + earlestDate + ", currentDate = " + currentDate);
-               System.out.println("StatisticsProt.readLength: Start date is " + date1 + ": int representation = " + dateStart);
-               System.out.println("StatisticsProt.readLength: End date is " + date2 + ": int representation = " + dateEnd);
-               Calendar start = Calendar.getInstance();
-               start.setTime(new Date(dateStart));
-               Calendar end = Calendar.getInstance();
-               end.setTime(new Date(dateEnd));
-               query = new ArrayList<DataBase>();
-               List<Integer> totalTime = new ArrayList<Integer>();
-               for (int i = 0; i < nbins; i++)
-                       totalTime.add(i, 0);
-               /*
-               for (Date date = start.getTime(); !start.after(end); start.add(Calendar.DATE, 1), date = start.getTime()) {
-                       List<Integer> timeResult = new ArrayList<Integer>();
-                       SliceQuery<Long, String, String> result = HFactory.createSliceQuery(cc.GetKeyspace(), LongSerializer.get(),
-                                       StringSerializer.get(), StringSerializer.get());
-                       result.setColumnFamily("ProteinData");
-                       result.setKey(date.getTime());
-                       result.setRange(null, null, false, Integer.MAX_VALUE);
-                       QueryResult<ColumnSlice<String, String>> columnSlice = result.execute();
-                       List<HColumn<String, String>> col = columnSlice.get().getColumns();
-                       if (!col.isEmpty()) {
-                               Iterator<HColumn<String, String>> itCol = col.iterator();
-                               for (int i = 0; i < nbins; i++)
-                                       timeResult.add(i, 0);
-                               // split all jobs into nbins bins
-                               while (itCol.hasNext()) {
-                                       String id = itCol.next().getName();
-                                       long lenResult = CountID(id);
-                                       if (lenResult <= 30)
-                                               timeResult.set(0, timeResult.get(0) + 1);
-                                       else if (lenResult > 30 && lenResult <= 60)
-                                               timeResult.set(1, timeResult.get(1) + 1);
-                                       else if (lenResult > 60 && lenResult <= 120)
-                                               timeResult.set(2, timeResult.get(2) + 1);
-                                       else if (lenResult > 120 && lenResult <= 600)
-                                               timeResult.set(3, timeResult.get(3) + 1);
-                                       else {
-                                               timeResult.set(4, timeResult.get(4) + 1);
-                                       }
-                               }
-                               for (int i = 0; i < nbins; i++)
-                                       totalTime.set(i, totalTime.get(i) + timeResult.get(i));
-                               DataBase db = new DataBase();
-                               db.setTimeRez(timeResult);
-                               db.setDate(DateFormat(date.getTime()));
-                               query.add(db);
-                       }
-               }
-               */
-               DataBase db = new DataBase();
-               db.setTimeTotalExec(totalTime);
-               query.add(db);
-               System.out.println("StatisticsProt.readLength: total number of dates = " + query.size());
-               return query;
-       }
-
-       /* 
-        * query: protein sequence
-        * */
-       public List<DataBase> readProteins(String protIn) {
-               query = new ArrayList<DataBase>();
-               /*
-               SliceQuery<String, String, String> result = HFactory.createSliceQuery(cc.GetKeyspace(), StringSerializer.get(),
-                               StringSerializer.get(), StringSerializer.get());
-               result.setColumnFamily("ProteinRow");
-               result.setKey(protIn);
-               result.setRange(null, null, false, Integer.MAX_VALUE);
-               QueryResult<ColumnSlice<String, String>> columnSlice = result.execute();
-               Iterator<HColumn<String, String>> it = columnSlice.get().getColumns().iterator();
-               while (it.hasNext()) {
-                       HColumn<String, String> col = it.next();
-                       String name = col.getName();
-                       if (name.matches("(.*)jnetpred")) {
-                               DataBase db = new DataBase();
-                               db.setProt(protIn);
-                               db.setId(col.getName());
-                               db.setJpred(col.getValue());
-                               query.add(db);
-                       }
-               }
-               */
-               return query;
-       }
-
-       /* 
-        * query by a protein sequence
-        * */
-       public List<DataBase> readProtID(int counter) {
-               query = new ArrayList<DataBase>();
-               int row_count = 100;
-               /*
-               RangeSlicesQuery<String, String, String> result = HFactory.createRangeSlicesQuery(cc.GetKeyspace(), StringSerializer.get(),
-                               StringSerializer.get(), StringSerializer.get());
-               result.setColumnFamily("ProteinRow");
-               result.setRange(null, null, false, 100);
-               result.setRowCount(row_count);
-               String last_key = null;
-               while (true) {
-                       result.setKeys(last_key, null);
-                       QueryResult<OrderedRows<String, String, String>> columnSlice = result.execute();
-                       OrderedRows<String, String, String> rows = columnSlice.get();
-                       Iterator<Row<String, String, String>> rowsIterator = rows.iterator();
-                       while (rowsIterator.hasNext()) {
-                               Row<String, String, String> row = rowsIterator.next();
-                               last_key = row.getKey();
-                               List<HColumn<String, String>> clms = row.getColumnSlice().getColumns();
-                               //int npred = 0;
-                               //for (HColumn<String, String> cln : clms) {
-                               //      String name = cln.getName();
-                               //      if (name.matches("(.*)jnetpred")) {
-                               //              ++npred;
-                               //      }
-                               //}
-                               int npred = clms.size();
-                               if (npred > counter) {
-                                       DataBase db = new DataBase();
-                                       db.setProt(last_key);
-                                       db.setTotalId(npred);
-                                       query.add(db);
-                               }
-                       }
-                       if (rows.getCount() < row_count)
-                               break;
-               }*/
-               return query;
-       }
-
-       /* 
-        * query by a part of sequence
-        * */
-       public List<DataBase> readPart(String protIn) {
-               int row_count = 10000;
-               query = new ArrayList<DataBase>();
-               /*
-               RangeSlicesQuery<String, String, String> result = HFactory.createRangeSlicesQuery(cc.GetKeyspace(), StringSerializer.get(),
-                               StringSerializer.get(), StringSerializer.get());
-               result.setColumnFamily("ProteinRow");
-               result.setRange(null, null, false, Integer.MAX_VALUE);
-               result.setRowCount(row_count);
-               String last_key = null;
-               while (true) {
-                       result.setKeys(last_key, null);
-                       QueryResult<OrderedRows<String, String, String>> columnSlice = result.execute();
-                       OrderedRows<String, String, String> rows = columnSlice.get();
-                       Iterator<Row<String, String, String>> rowsIterator = rows.iterator();
-                       while (rowsIterator.hasNext()) {
-                               Row<String, String, String> row = rowsIterator.next();
-                               last_key = row.getKey();
-                               if (last_key.matches("(.*)" + protIn + "(.*)")) {
-                                       Iterator<HColumn<String, String>> it = row.getColumnSlice().getColumns().iterator();
-                                       while (it.hasNext()) {
-                                               HColumn<String, String> col = it.next();
-                                               List<String> subProt = new ArrayList<String>();
-                                               String subStr = last_key;
-                                               while (subStr.length() > 0 && subStr.contains(protIn)) {
-                                                       String first = subStr.substring(0, subStr.indexOf(protIn));
-                                                       if (first.length() > 0)
-                                                               subProt.add(first);
-                                                       subProt.add(protIn);
-                                                       subStr = subStr.substring(subStr.indexOf(protIn) + protIn.length(), subStr.length());
-                                               }
-                                               if (subStr.length() > 0)
-                                                       subProt.add(subStr);
-                                               String name = col.getName();
-                                               if (name.matches("(.*)jnetpred")) {
-                                                       DataBase db = new DataBase();
-                                                       db.setProt(last_key);
-                                                       db.setId(col.getName());
-                                                       db.setJpred(col.getValue());
-                                                       db.setSubProt(subProt);
-                                                       query.add(db);
-                                               }
-                                       }
-                               }
-                       }
-                       if (rows.getCount() < row_count)
-                               break;
-               }
-               */
-               return query;
-       }
-
-       /* 
-        * convert String date into long date (miliseconds since the epoch start)
-        */
-       private static long DateParsing(String datInput) {
-               if (datInput == null) {
-                       return 0;
-               }
-               long dateWorkSt = 0;
-               SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
-               try {
-                       dateWorkSt = formatter.parse(datInput).getTime();
-               } catch (ParseException e) {
-                       e.printStackTrace();
-               }
-               return dateWorkSt;
-       }
-
-       /*
-        * convert String date:time into long date:time (miliseconds since the epoch start)
-        */
-       private static long TimeConvert(String datInput) {
-               long dateWorkSt = 0;
-               if (datInput == null) {
-                       return dateWorkSt;
-               }
-               SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd:hh:mm:ss");
-               try {
-                       dateWorkSt = formatter.parse(datInput).getTime();
-               } catch (ParseException e) {
-                       e.printStackTrace();
-               }
-               return dateWorkSt;
-       }
-
-       // convert long to date in string format
-       private static String DateFormat(long inDate) {
-               SimpleDateFormat datformat = new SimpleDateFormat("dd/MM/yyyy");
-               String dateString = datformat.format(new Date(inDate));
-               return dateString;
-       }
-
-       /*
-        * convert ???
-        */
-       public static String DateFormatYYMMDD(long indate) {
-               SimpleDateFormat datformat = new SimpleDateFormat("yyyy/MM/dd");
-               String dateString = datformat.format(new Date(indate));
-               return dateString;
-       }
-
-       /*
-        * ???
-        */
-       public long CountID(String id) {
-               /*
-               SliceQuery<String, String, String> sliceQuery = HFactory.createSliceQuery(cc.GetKeyspace(), StringSerializer.get(),
-                               StringSerializer.get(), StringSerializer.get());
-               sliceQuery.setColumnFamily("ProteinLog").setKey(id).setRange("", "", false, 100);
-               QueryResult<ColumnSlice<String, String>> result = sliceQuery.execute();
-               String datBegin = result.get().getColumnByName("DataBegin").getValue();
-               String datEnd = result.get().getColumnByName("DataEnd").getValue();
-
-               long datBeginLong = TimeConvert(datBegin);
-               long datEndLong = TimeConvert(datEnd);
-               return (datEndLong - datBeginLong) / 1000;
-               */
-               return 0;
-       }
-
-       /*
-        * set earlest date and current dates. 
-        * earlestDate is static and should be set at the 1st call
-        * currentDate should be re-calculated every time
-        */
-       private static void SetDateRange() {
-               if (0 == earlestDate) {
-                       StatisticsProt sp = new StatisticsProt();
-                       earlestDate = sp.earliestDate();
-                       System.out.println("Set earlest Date = " + earlestDate);
-               }
-               Calendar cal = Calendar.getInstance();
-               currentDate = DateParsing(cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH));
-       }
-
-       public boolean isThisDateValid(String dateToValidate) {
-               if (dateToValidate == null || dateToValidate.equals("")) {
-                       System.out.println("Undefined date");
-                       return false;
-               }
-               SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
-               try {
-                       // if not valid, this will throw ParseException
-                       sdf.setLenient(false);
-                       Date date = sdf.parse(dateToValidate);
-               } catch (ParseException e) {
-                       e.printStackTrace();
-                       return false;
-               }
-               return true;
-       }
-
-       /*
-        * find the earliest date in the database
-        */
-       public long earliestDate() {
-               ArrayList<Long> dateSort = new ArrayList<Long>();
-               int row_count = 10000;
-               /*
-               RangeSlicesQuery<Long, String, String> result = HFactory.createRangeSlicesQuery(cc.GetKeyspace(), LongSerializer.get(),
-                               StringSerializer.get(), StringSerializer.get());
-               result.setColumnFamily("ProteinData");
-               result.setRange(null, null, false, Integer.MAX_VALUE);
-               result.setRowCount(row_count);
-               Long last_key = null;
-               while (true) {
-                       result.setKeys(last_key, null);
-                       QueryResult<OrderedRows<Long, String, String>> columnSlice = result.execute();
-                       OrderedRows<Long, String, String> rows = columnSlice.get();
-                       Iterator<Row<Long, String, String>> rowsIterator = rows.iterator();
-                       while (rowsIterator.hasNext()) {
-                               Row<Long, String, String> row = rowsIterator.next();
-                               last_key = row.getKey();
-                               dateSort.add(last_key);
-                       }
-                       if (rows.getCount() < row_count)
-                               break;
-               }*/
-               Collections.sort(dateSort);
-               return dateSort.get(0);
-       }
-}