[phylr] r56 committed - cleaned up code

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 17, 2009, 9:57:05 AM8/17/09
to phylr-...@googlegroups.com
Revision: 56
Author: dazhi.jiao
Date: Mon Aug 17 06:56:23 2009
Log: cleaned up code
http://code.google.com/p/phylr/source/detail?r=56

Modified:
/trunk/phylr-gsoc/README.txt

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLDCRecordResolver.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLQueryTranslator.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLResultSetHandler.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/CqlQueryTranslator.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RecordResolver.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalQueryResult.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalRecordIterator.java

/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/SRWRelationalDatabase.java

=======================================
--- /trunk/phylr-gsoc/README.txt Wed Jul 29 07:01:00 2009
+++ /trunk/phylr-gsoc/README.txt Mon Aug 17 06:56:23 2009
@@ -18,27 +18,5 @@
-Dexec.mainClass=org.nescent.phylr.lucene.NexmlIndexer \
-Dexec.args="-d data/phylr-nexml/ -i data/phylr-index/ -m
src/test/resources/predicates.txt"

-To Migrate Data from TreeBase (PostgreSQL)
-First create database
-# createdb biosql
-
-import treebase dump into the database
-# psql biosql < treebase.sql
-
-create biosql tables using the schema
-# psql biosql < biosqldb-pg.sql
-
-Because both treebase and biosql phylodb extension have a table
name "node_path",
-so rename "node_path" to "bs_node_path" in biosql-phylodb-pg.sql
-THen Create tables in the biosql-phylodb extension
-# psql biosql < biosql-phylodb-pg.sql
-
-Now import the ncbi taxonomy using the biosql import script
-# load_ncbi_taxonomy.pl --diver Pg --download yes --dbname biosql
-
-Then execute the migration script
-# psql biosql < TreeBaseBioSQLMig.sql
-
-All done.


=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLDCRecordResolver.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLDCRecordResolver.java
Mon Aug 17 06:56:23 2009
@@ -1,40 +1,13 @@
-/**
- * Copyright 2006 OCLC Online Computer Library Center, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * BasicLuceneRecordResolver.java
- *
- * Created on November 1, 2006, 1:40 PM
- */
-
package org.nescent.phylr.relational;

import gov.loc.www.zing.srw.ExtraDataType;

-import java.sql.ResultSet;
-import java.sql.SQLException;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.oclc.os.SRW.Record;

-/**
- *
- * @author djiao
- */
public class BioSQLDCRecordResolver implements RecordResolver {
static Log log = LogFactory.getLog(BioSQLDCRecordResolver.class);
static final String LUCENE_SCHEMA_ID = "info:srw/schema/1/LuceneDocument";
@@ -50,7 +23,6 @@
ExtraDataType extraDataType) {
Object[] result = (Object[])hit;
String str = null;
- int id = (Integer) result[0];
String xml = (String) result[1]; // it expects a list dc elements
StringBuffer sb = new StringBuffer(
"<dc xmlns:dc=\"http://purl.org/dc/elements/1.1/\">");
=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLQueryTranslator.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLQueryTranslator.java
Mon Aug 17 06:56:23 2009
@@ -4,7 +4,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import java.util.StringTokenizer;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLResultSetHandler.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/BioSQLResultSetHandler.java
Mon Aug 17 06:56:23 2009
@@ -9,8 +9,8 @@

public class BioSQLResultSetHandler implements ResultSetHandler {

- public List handle(ResultSet rs) throws SQLException {
- List result = new ArrayList();
+ public List<Object> handle(ResultSet rs) throws SQLException {
+ List<Object> result = new ArrayList<Object>();

while (rs.next()) {
Object[] row = new Object[2];
=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/CqlQueryTranslator.java
Sun Jul 12 07:58:40 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/CqlQueryTranslator.java
Mon Aug 17 06:56:23 2009
@@ -10,14 +10,11 @@
package org.nescent.phylr.relational;

import java.util.Properties;
+
import org.oclc.os.SRW.SRWDiagnostic;
import org.oclc.os.SRW.SortTool;
import org.z3950.zing.cql.CQLNode;

-/**
- *
- * @author levan
- */
public interface CqlQueryTranslator {
void init(Properties properties, SRWRelationalDatabase ldb) throws
InstantiationException;

=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RecordResolver.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RecordResolver.java
Mon Aug 17 06:56:23 2009
@@ -1,41 +1,20 @@
-/*
- * OCKHAM P2PREGISTRY Copyright 2006 Oregon State University
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
package org.nescent.phylr.relational;

import gov.loc.www.zing.srw.ExtraDataType;

-import java.sql.ResultSet;
import java.util.Properties;

import org.oclc.os.SRW.Record;

/**
* Interface for resolving records and schemas.
- *
- * @author peter
- * Date: Oct 25, 2005
- * Time: 9:49:08 AM
*/
public interface RecordResolver {

/**
* Resolves a record from the identifier
*
- * @param Document - the document that Lucene has stored
+ * @param hit - The search result that is trying to be resolved
* @param IdFieldName - the name of the field that contains the
identifier
* @param extraDataType - nonstandard SRW request parameters
* @return record if found.
=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalQueryResult.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalQueryResult.java
Mon Aug 17 06:56:23 2009
@@ -1,11 +1,9 @@
package org.nescent.phylr.relational;

-import java.sql.ResultSet;
-import java.sql.SQLException;
+import gov.loc.www.zing.srw.ExtraDataType;
+
import java.util.List;
-import java.util.ListIterator;
-
-import gov.loc.www.zing.srw.ExtraDataType;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.oclc.os.SRW.QueryResult;
=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalRecordIterator.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/RelationalRecordIterator.java
Mon Aug 17 06:56:23 2009
@@ -23,8 +23,6 @@

import gov.loc.www.zing.srw.ExtraDataType;

-import java.sql.ResultSet;
-import java.sql.SQLException;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
@@ -34,10 +32,6 @@
import org.oclc.os.SRW.Record;
import org.oclc.os.SRW.RecordIterator;

-/**
- *
- * @author levan
- */
public class RelationalRecordIterator implements RecordIterator {
static final Log log=LogFactory.getLog(RelationalRecordIterator.class);

=======================================
---
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/SRWRelationalDatabase.java
Thu Aug 13 13:00:59 2009
+++
/trunk/phylr-gsoc/src/main/java/org/nescent/phylr/relational/SRWRelationalDatabase.java
Mon Aug 17 06:56:23 2009
@@ -8,7 +8,6 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Enumeration;
@@ -24,7 +23,6 @@
import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
-import org.apache.commons.dbutils.handlers.ArrayListHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.pool.ObjectPool;

Reply all
Reply to author
Forward
0 new messages