我想更新一个 StoredMap 值,我不关心旧值。我找不到避免加载先前值的方法。
StoredMap<Integer, SyntaxDocument> tsCol = new StoredMap<Integer, SyntaxDocument>(tsdb, new IntegerBinding(), new PassageBinding(), true);
tsCol.put(1, doc); // insert value => ok
tsCol.put(1, doc); // <- load previous value but I don't care. I want to avoid the "heavy" PassageBinding process.
tsCol.putAll(Collections.singletonMap(1, doc)); // Even this one load the old value
有没有办法优化我的代码并更新现有值而不加载它(或至少防止绑定以处理旧的 DatabaseEntry 字节)?
注意:调用 remove 然后 put 更慢。