<commit_before>leveldb-server4j
================

Client/server wrapper for LevelDB for Java, written in Scala. Implemented using RPCs generated by Thrift. Some relevant resources:

- LevelDB (which is a pure library without native client/server support): https://github.com/google/leveldb 
- Thrift: https://thrift.apache.org
- LevelDB Java implementation used by server: https://github.com/dain/leveldb
 
## Starting the server
The quickest way to get started is to clone the source code and use sbt to run the server. Once you've installed sbt, open your terminal and enter:
    
    sbt run
    
The console should print:

    LevelDB server now running on 127.0.0.1:8001
    
That's it! You're up and running. 
 
### Custom configuration
This project uses Typesafe's config library. The default configuration (reference.conf) for the server is:
       
    leveldb-server {
      host-address = "127.0.0.1"  # address to listen on
      port = 8001  # port to listen on
      data-dir = "/opt/leveldb-server/"  # local directory for storing LevelDB data
    }
    
To run with a custom configuration, create a custom config file and pass the file location as the first argument to the main method:

    sbt
    > run "/home/jane/code/custom.conf"
    
## Starting the client
Following the lead of existing LevelDB libraries for Java (https://github.com/dain/leveldb and https://github.com/fusesource/leveldbjni), you create a DB object using an instance of a factory class.
 
    String serverHost = "127.0.0.1";
    int serverPort = 8001;<commit_msg>readme formatting<commit_after>leveldb-server4j
================

Client/server wrapper for LevelDB for Java, written in Scala. Implemented using RPCs generated by Thrift. Some relevant resources:

- LevelDB (which is a pure library without native client/server support): https://github.com/google/leveldb 
- Thrift: https://thrift.apache.org
- LevelDB Java implementation used by server: https://github.com/dain/leveldb
 
## Starting the server
The quickest way to get started is to clone the source code and use sbt to run the server. Once you've installed sbt, open your terminal and enter:
    
    sbt run
    
The console should print:

    LevelDB server now running on 127.0.0.1:8001
    
That's it! You're up and running. 
 
### Custom configuration
This project uses Typesafe's config library. The default configuration (reference.conf) for the server is:
       
    leveldb-server {
      host-address = "127.0.0.1"        # address to listen on
      port = 8001                       # port to listen on
      data-dir = "/opt/leveldb-server/" # local directory for storing LevelDB data
    }
    
To run with a custom configuration, create a custom config file and pass the file location as the first argument to the main method:

    sbt
    > run "/home/jane/code/custom.conf"
    
## Starting the client
Following the lead of existing LevelDB libraries for Java (https://github.com/dain/leveldb and https://github.com/fusesource/leveldbjni), you create a DB object using an instance of a factory class.
 
    String serverHost = "127.0.0.1";
    int serverPort = 8001;
{'fraction_non_alphanumeric': 0.0852959898154042, 'fraction_numerical': 0.019732654360280075, 'mean_word_length': 3.224462365591398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4680381', 'n_tokens_mistral': 914, 'n_tokens_neox': 848, 'n_words': 370}