//~--- methods --------------------------------------------------------
public void execute(String key, String... obj) throws FrameworkException {
TxPageFile logDb = (TxPageFile) arguments.get("logDb");
if (logDb != null) {
if (key != null) {
synchronized (logDb) {
Transaction tx = logDb.tx();
MultiIndexFactory multiIndexFactory = new MultiIndexFactory(tx);
IndexFactory<String, Object> indexFactory = new BTreeIndexFactory<>();
SortedIndex<String, Object> index = null;
try {
index = (SortedIndex<String, Object>) multiIndexFactory.openOrCreate(key, indexFactory);
} catch (Throwable t) {
t.printStackTrace();
logger.log(Level.WARNING, "Could not open or create log db page for key {0}", key);
index = (SortedIndex<String, Object>) multiIndexFactory.create(key, indexFactory);
}
String uuid = UUID.randomUUID().toString().replaceAll("[\\-]+", "");
index.put(uuid, obj);
// disabled to avoid parameter evaluation
// logger.log(Level.FINE, "Logged for key {0}: {1}", new Object[] { key, StringUtils.join((String[]) obj, ",") });
tx.commit();
logDb.flush();
}
}
}