Skip to content

Instantly share code, notes, and snippets.

@mattwigway
Created February 24, 2015 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattwigway/a882c7ac360836df939b to your computer and use it in GitHub Desktop.
Save mattwigway/a882c7ac360836df939b to your computer and use it in GitHub Desktop.
Cannot use empty pump source with MapDB
import java.util.Iterator;
import org.mapdb.DB;
import org.mapdb.DBMaker;
import org.mapdb.Fun.Tuple2;
public class MapDBEmptyPumpSource {
public static void main(String... args) {
Iterator<Tuple2<String, String>> data = new Iterator () {
@Override
public boolean hasNext() {
return false;
}
@Override
public Object next() {
return null;
}
@Override
public void remove() {
// TODO Auto-generated method stub
}
};
DB db = DBMaker.newTempFileDB()
.make();
db.createTreeMap("test")
.pumpSource(data)
.make();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment