protected boolean checkCurrentPosition() { if (currentEntry == ORID.CLUSTER_POS_INVALID || firstClusterEntry > currentEntry || lastClusterEntry < currentEntry) return false; current.setClusterPosition(currentEntry); return true; }
/** * @deprecated usage of this constructor may lead to deadlocks. */ @Deprecated public OIdentifiableIterator(final ODatabaseDocumentInternal iDatabase, final OStorage.LOCKING_STRATEGY iLockingStrategy) { database = iDatabase; lockingStrategy = iLockingStrategy; dbStorage = database.getStorage(); current.setClusterPosition(ORID.CLUSTER_POS_INVALID); // DEFAULT = START FROM THE BEGIN }
protected ORecordAbstract setIdentity(final int iClusterId, final long iClusterPosition) { if (_recordId == null || _recordId == ORecordId.EMPTY_RECORD_ID) _recordId = new ORecordId(iClusterId, iClusterPosition); else { _recordId.setClusterId(iClusterId); _recordId.setClusterPosition(iClusterPosition); } return this; }
protected ORecordAbstract fill(final ORID iRid, final int iVersion, final byte[] iBuffer, boolean iDirty, ODatabaseDocumentInternal db) { _recordId.setClusterId(iRid.getClusterId()); _recordId.setClusterPosition(iRid.getClusterPosition()); _recordVersion = iVersion; _status = ORecordElement.STATUS.LOADED; _source = iBuffer; _size = iBuffer != null ? iBuffer.length : 0; if (_source != null && _source.length > 0) { _dirty = iDirty; _contentChanged = iDirty; if (!iDirty && _dirtyManager != null) _dirtyManager.removePointed(this); } return this; }
protected ORecordAbstract fill(final ORID iRid, final int iVersion, final byte[] iBuffer, boolean iDirty) { _recordId.setClusterId(iRid.getClusterId()); _recordId.setClusterPosition(iRid.getClusterPosition()); _recordVersion = iVersion; _status = ORecordElement.STATUS.LOADED; _source = iBuffer; _size = iBuffer != null ? iBuffer.length : 0; if (_source != null && _source.length > 0) { _dirty = iDirty; _contentChanged = iDirty; if (!iDirty && _dirtyManager != null) _dirtyManager.removePointed(this); } return this; }
public static ODocument createProjectionDocument(final int iProgressive) { final ODocument doc = new ODocument().setOrdered(true).setTrackingChanges(false); // ASSIGN A TEMPORARY RID TO ALLOW PAGINATION IF ANY ((ORecordId) doc.getIdentity()).setClusterId(-2); ((ORecordId) doc.getIdentity()).setClusterPosition(iProgressive); return doc; }
ORecordInternal.setIdentity(rec.getRecord(), new ORecordId(newRid)); } else { recordId.setClusterPosition(newRid.getClusterPosition()); recordId.setClusterId(newRid.getClusterId());
ORecordInternal.setIdentity(rec.getRecord(), new ORecordId(newRid)); } else { recordId.setClusterPosition(newRid.getClusterPosition()); recordId.setClusterId(newRid.getClusterId());
oldId.setClusterPosition(((ORID) newRid).getClusterPosition()); } else if (s.equalsIgnoreCase("@version")) { Object v = getProperty(s);
protected boolean prevPosition() { if (positionsToProcess == null) { positionsToProcess = dbStorage.floorPhysicalPositions(current.getClusterId(), new OPhysicalPosition(lastClusterEntry)); if (positionsToProcess == null) return false; if (positionsToProcess.length == 0) return false; currentEntryPosition = positionsToProcess.length; } else { if (currentEntry < firstClusterEntry) return false; } decrementEntreePosition(); while (positionsToProcess.length > 0 && currentEntryPosition < 0) { positionsToProcess = dbStorage.lowerPhysicalPositions(current.getClusterId(), positionsToProcess[0]); currentEntryPosition = positionsToProcess.length; decrementEntreePosition(); } if (positionsToProcess.length == 0) return false; currentEntry = positionsToProcess[currentEntryPosition].clusterPosition; if (currentEntry < firstClusterEntry) return false; current.setClusterPosition(currentEntry); return true; }
protected boolean nextPosition() { if (positionsToProcess == null) { positionsToProcess = dbStorage.ceilingPhysicalPositions(current.getClusterId(), new OPhysicalPosition(firstClusterEntry)); if (positionsToProcess == null) return false; } else { if (currentEntry >= lastClusterEntry) return false; } incrementEntreePosition(); while (positionsToProcess.length > 0 && currentEntryPosition >= positionsToProcess.length) { positionsToProcess = dbStorage .higherPhysicalPositions(current.getClusterId(), positionsToProcess[positionsToProcess.length - 1]); currentEntryPosition = -1; incrementEntreePosition(); } if (positionsToProcess.length == 0) return false; currentEntry = positionsToProcess[currentEntryPosition].clusterPosition; if (currentEntry > lastClusterEntry || currentEntry == ORID.CLUSTER_POS_INVALID) return false; current.setClusterPosition(currentEntry); return true; }
try { ppos = cluster.createRecord(content, recordVersion, recordType, allocated); rid.setClusterPosition(ppos.clusterPosition);
rid.setClusterPosition(physicalPosition.clusterPosition);
final OCluster cluster = getClusterById(rid.getClusterId()); final OPhysicalPosition ppos = cluster.allocatePosition(ORecordInternal.getRecordType(rec)); rid.setClusterPosition(ppos.clusterPosition); clientTx.updateIdentityAfterCommit(oldRID, rid);
database.assignAndCheckCluster(record, clusterName); recordId.setClusterPosition(recordSerial--);
database.assignAndCheckCluster(iRecord, iClusterName); rid.setClusterPosition(newObjectCounter--);