public OPlaceholder(final ORecord iRecord) { rid = (ORecordId) iRecord.getIdentity().copy(); recordVersion = iRecord.getVersion(); }
protected void copyTo(final OrientElement iCopy) { iCopy.graph = graph; iCopy.settings = settings; if (rawElement instanceof ODocument) { iCopy.rawElement = new ODocument().fromStream(((ODocument) rawElement).toStream()); } else if (rawElement instanceof ORID) iCopy.rawElement = ((ORID) rawElement).copy(); else throw new IllegalArgumentException("Cannot clone element " + rawElement); }
@Override public void addIndexEntry(OIndex<?> index, String indexName, OTransactionIndexChanges.OPERATION type, Object key, OIdentifiable value) { final OTransactionIndexChanges indexOperation = indexOperations.computeIfAbsent(indexName, k -> new OTransactionIndexChanges()); if (type == OTransactionIndexChanges.OPERATION.CLEAR) indexOperation.setCleared(); else { final OTransactionIndexChangesPerKey changesPerKey = indexOperation.getChangesPerKey(key); changesPerKey.clientTrackOnly = false; changesPerKey.add(value, type); if (value == null) return; List<OTransactionRecordIndexOperation> transactionIndexOperations = recordIndexOperations.get(value.getIdentity()); if (transactionIndexOperations == null) { transactionIndexOperations = new ArrayList<>(); recordIndexOperations.put(value.getIdentity().copy(), transactionIndexOperations); } transactionIndexOperations.add(new OTransactionRecordIndexOperation(indexName, key, type)); } }
/** * Bufferizes index changes to be flushed at commit time. */ public void addIndexEntry(final OIndex<?> delegate, final String iIndexName, final OTransactionIndexChanges.OPERATION iOperation, final Object key, final OIdentifiable iValue, boolean clientTrackOnly) { OTransactionIndexChanges indexEntry = indexEntries.get(iIndexName); if (indexEntry == null) { indexEntry = new OTransactionIndexChanges(); indexEntries.put(iIndexName, indexEntry); } if (iOperation == OPERATION.CLEAR) indexEntry.setCleared(); else { OTransactionIndexChangesPerKey changes = indexEntry.getChangesPerKey(key); changes.clientTrackOnly = clientTrackOnly; changes.add(iValue, iOperation); if (iValue == null) return; List<OTransactionRecordIndexOperation> transactionIndexOperations = recordIndexOperations.get(iValue.getIdentity()); if (transactionIndexOperations == null) { transactionIndexOperations = new ArrayList<OTransactionRecordIndexOperation>(); recordIndexOperations.put(iValue.getIdentity().copy(), transactionIndexOperations); } transactionIndexOperations.add(new OTransactionRecordIndexOperation(iIndexName, key, iOperation)); } }
brokenRIDs.add(recordRid.copy());
} catch (Exception t) { if (rec != null) { final ORID rid = rec.getIdentity().copy();
final int scopeOrdinal = scope.ordinal(); final ORID identity = id.getIdentity().copy(); if (!pushInHook(identity)) return ORecordHook.RESULT.RECORD_NOT_CHANGED;
continue; final ORID oldVertex = fromVertex.getIdentity().copy(); final ORID newVertex = fromVertex.moveTo(className, clusterName);
continue; final ORID oldVertex = fromVertex.getIdentity().copy(); final ORID newVertex = fromVertex.moveTo(className, clusterName);
final ORecordId rid = (ORecordId) rec.getIdentity().copy(); final ORecordId oldRID = rid.copy();
throw new ORecordNotFoundException(getIdentity(), "The vertex " + getIdentity() + " has been deleted"); final ORID oldIdentity = getIdentity().copy();
throw new ORecordNotFoundException(getIdentity(), "The vertex " + getIdentity() + " has been deleted"); final ORID oldIdentity = getIdentity().copy();
if (rec.isDirty()) { final ORecordId rid = (ORecordId) rec.getIdentity().copy(); final ORecordId oldRID = rid.copy(); final OCluster cluster = getClusterById(rid.getClusterId());
graph.throwRecordNotFoundException(getIdentity(), "The vertex " + getIdentity() + " has been deleted"); final ORID oldIdentity = getIdentity().copy();