Clean up the code
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Mon, 27 Jan 2014 14:53:16 +0000 (14:53 +0000)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Mon, 27 Jan 2014 14:53:16 +0000 (14:53 +0000)
datadb/compbio/beans/DateBean.java
datadb/compbio/cassandra/DataBase.java
datadb/compbio/cassandra/JpredParserLocalFile.java
engine/compbio/engine/ExecutionInterval.java
engine/compbio/engine/JpredJob.java
server/compbio/statistic/CassandraRequester.java

index 7c593d3..b00e1d6 100644 (file)
@@ -1,7 +1,6 @@
 package compbio.beans;
 
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.Map;
 
 public class DateBean {
index e741b39..6ced180 100644 (file)
@@ -1,8 +1,6 @@
 package compbio.cassandra;
 
 import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
 
 import compbio.beans.JobBean;
 import compbio.beans.ProteinBean;
index e2e5dc9..c89fe59 100644 (file)
@@ -2,11 +2,8 @@ package compbio.cassandra;
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
 import java.io.FileInputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -19,7 +16,6 @@ import compbio.data.sequence.FastaReader;
 import compbio.data.sequence.FastaSequence;
 
 public class JpredParserLocalFile implements JpredParser {
-       private CassandraWriter cw = new CassandraWriter();
        private String dirprefix;
 
        public void setSource(String newsourceprefix) {
@@ -75,8 +71,6 @@ public class JpredParserLocalFile implements JpredParser {
                        if (in.matches(date + ":(.*)jp_[^\\s]+")) {
                                String[] table = in.split("\\s+");
                                String starttime = table[0];
-                               String finishtime = table[1];
-                               String ip = table[2];
                                String id = table[table.length - 1];
                                totalcount++;
                                String confilename = dirprefix + "/" + id + "/" + id + ".concise";
@@ -99,10 +93,8 @@ public class JpredParserLocalFile implements JpredParser {
                                                } else {
                                                        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
                                                        String dateInString1 = starttime.substring(0, starttime.indexOf(":"));
-                                                       long insertdate = 0;
                                                        try {
                                                                Date dat = formatter.parse(dateInString1);
-                                                               insertdate = dat.getTime();
                                                        } catch (ParseException e) {
                                                                e.printStackTrace();
                                                        }
index 522ad9f..99981e4 100644 (file)
@@ -17,7 +17,6 @@ public class JpredJob extends Job {
 
        public JpredJob(String jobid, String date1, String date2) {
                super(jobid, date1, date2);
-               this.protein = protein;
                predictions = new ArrayList<FastaSequence>();
                alignment = new ArrayList<FastaSequence>();
                log = "";
@@ -25,7 +24,6 @@ public class JpredJob extends Job {
 
        public JpredJob(String jobid, String date1, String date2, List<FastaSequence> alignment, List<FastaSequence> predictions) {
                super(jobid, date1, date2);
-               this.protein = protein;
                this.alignment = alignment;
                this.predictions = predictions;
        }
index ca59844..1791c0f 100755 (executable)
@@ -19,8 +19,8 @@ import compbio.beans.UserBean;
 import compbio.cassandra.CassandraNativeConnector;
 import compbio.cassandra.CassandraReaderOld;
 import compbio.cassandra.DataBase;
-import compbio.cassandra.Pair;
 import compbio.engine.JobStatus;
+import compbio.engine.Pair;
 
 public class CassandraRequester {
        private CassandraReaderOld db = new CassandraReaderOld();
@@ -112,17 +112,16 @@ public class CassandraRequester {
                        query.add(db);
                }
 
-               /* ???? Very strange code...
-               DataBase db = new DataBase();
-               db.setTimeTotalExec(totalTime);
-               query.add(db);
-               */
+               /*
+                * ???? Very strange code... DataBase db = new DataBase();
+                * db.setTimeTotalExec(totalTime); query.add(db);
+                */
                return query;
        }
 
        /*
         * query: total number of jobs for the period from date1 till date2
-       */ 
+        */
        public TotalJobsStatisticBean countJobs(String date1, String date2) {
                /*
                 * if (null == date1) { date1 = "1970/1/1"; } if (null == date2) { date1