Skip to content

Instantly share code, notes, and snippets.

View premrajm's full-sized avatar

Premraj Motling premrajm

  • Afterpay
  • Melbourne
View GitHub Profile
public class MapDBCreator {
public static void main(String[] args) {
DB db = DBMaker.newFileDB("mapdbFile").transactionDisable().mmapFileEnablePartial().make();
getEmployees().parallelStream().forEach(e -> createRecords(e, db));
}
private static List<Employee> getEmployees() {
/* return employees list */
}
@premrajm
premrajm / Main.java
Created May 22, 2015 15:47
Loading 1 GB file using BufferedSource
package test;
import com.google.common.base.CharMatcher;
import com.google.common.base.Stopwatch;
import okio.BufferedSource;
import okio.Okio;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;