io.permazen.kv.simple.MemoryKVImplementation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of permazen-kv-simple Show documentation
Show all versions of permazen-kv-simple Show documentation
A couple of simplistic Permazen key/value store implementations.
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package io.permazen.kv.simple;
import io.permazen.kv.KVDatabase;
import io.permazen.kv.KVImplementation;
import io.permazen.kv.mvcc.AtomicKVStore;
import java.util.ArrayDeque;
import java.util.Iterator;
public class MemoryKVImplementation extends KVImplementation {
@Override
public String[][] getCommandLineOptions() {
return new String[][] {
{ "--mem", "Use an initially empty, in-memory database" }
};
}
@Override
public Object parseCommandLineOptions(ArrayDeque options) {
Object config = null;
for (Iterator i = options.iterator(); i.hasNext(); ) {
final String option = i.next();
if (option.equals("--mem")) {
config = Boolean.TRUE;
i.remove();
}
}
return config;
}
@Override
public SimpleKVDatabase createKVDatabase(Object configuration, KVDatabase kvdb, AtomicKVStore kvstore) {
return new SimpleKVDatabase();
}
@Override
public String getDescription(Object configuration) {
return "Memory database";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy