Changeset 31310


Ignore:
Timestamp:
2017-01-21T21:18:02+13:00 (4 years ago)
Author:
davidb
Message:

Initial cut at files for working with MongoDB

Location:
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/pom.xml

    r31309 r31310  
    2121
    2222    <dependency>
     23      <groupId>org.mongodb</groupId>
     24      <artifactId>mongo-java-driver</artifactId>
     25      <version>3.4.1</version>
     26    </dependency>
     27<!--
     28    <dependency>
    2329      <groupId>org.mongodb.spark</groupId>
    2430      <artifactId>mongo-spark-connector_2.10</artifactId>
    2531      <version>0.1</version>
    2632    </dependency>
     33-->
    2734
    2835    <!--
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/ClusterFileIO.java

    r31228 r31310  
    2121import org.apache.hadoop.fs.FileSystem;
    2222import org.apache.hadoop.fs.Path;
     23import org.json.JSONObject;
    2324
    2425public class ClusterFileIO {
     
    154155    }
    155156
     157    protected static String readTextFile(String filename)
     158    {
     159        StringBuilder sb = new StringBuilder();
     160       
     161        try {   
     162            BufferedReader br = ClusterFileIO.getBufferedReaderForCompressedFile(filename);
     163
     164            int cp;
     165            while ((cp = br.read()) != -1) {
     166                sb.append((char) cp);
     167            }
     168   
     169            br.close();
     170        }
     171        catch (Exception e) {
     172            e.printStackTrace();
     173        }
     174       
     175        return sb.toString();
     176    }
     177   
    156178    public static BufferedOutputStream getBufferedOutputStream(String fileOut)
    157179            throws IOException
Note: See TracChangeset for help on using the changeset viewer.