Created
February 24, 2015 18:54
-
-
Save mattwigway/a882c7ac360836df939b to your computer and use it in GitHub Desktop.
Cannot use empty pump source with MapDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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