@Override public OIndexTxAware<T> clear() { database.getMicroOrRegularTransaction().addIndexEntry(delegate, super.getName(), OPERATION.CLEAR, null, null); return this; }
@Override public boolean remove(Object key) { key = getCollatingValue(key); database.getMicroOrRegularTransaction().addIndexEntry(delegate, super.getName(), OPERATION.REMOVE, key, null); return true; }
@Override public boolean remove(Object iKey, final OIdentifiable iRID) { iKey = getCollatingValue(iKey); database.getMicroOrRegularTransaction().addIndexEntry(delegate, super.getName(), OPERATION.REMOVE, iKey, iRID); return true; }
@Override public OIndexTxAware<T> put(Object iKey, final OIdentifiable iValue) { checkForKeyType(iKey); final ORID rid = iValue.getIdentity(); if (!rid.isValid()) if (iValue instanceof ORecord) // EARLY SAVE IT ((ORecord) iValue).save(); else throw new IllegalArgumentException("Cannot store non persistent RID as index value for key '" + iKey + "'"); iKey = getCollatingValue(iKey); database.getMicroOrRegularTransaction().addIndexEntry(delegate, super.getName(), OPERATION.PUT, iKey, iValue); return this; }
transaction.addIndexEntry(this, super.getName(), OTransactionIndexChanges.OPERATION.PUT, encodeKey(key), singleValue);
@Override public boolean remove(final Object key, final OIdentifiable value) { if (key != null) { OBasicTransaction transaction = getDatabase().getMicroOrRegularTransaction(); if (transaction.isActive()) { transaction.addIndexEntry(this, super.getName(), OTransactionIndexChanges.OPERATION.REMOVE, encodeKey(key), value); OLuceneTxChanges transactionChanges = getTransactionChanges(transaction); transactionChanges.remove(key, value); return true; } else { while (true) { try { return storage.callIndexEngine(false, false, indexId, engine -> { OLuceneIndexEngine indexEngine = (OLuceneIndexEngine) engine; return indexEngine.remove(key, value); }); } catch (OInvalidIndexEngineIdException e) { doReloadIndexEngine(); } } } } return true; }