@Override public OSBTreeCollectionManager getSbTreeCollectionManager() { if (internal == null) return null; return internal.getSbTreeCollectionManager(); }
public ORidBagDeleteSerializationOperation(OBonsaiCollectionPointer collectionPointer, OSBTreeRidBag ridBag) { this.collectionPointer = collectionPointer; this.ridBag = ridBag; collectionManager = ODatabaseRecordThreadLocal.instance().get().getSbTreeCollectionManager(); }
public ORidBagUpdateSerializationOperation(final NavigableMap<OIdentifiable, Change> changedValues, OBonsaiCollectionPointer collectionPointer) { this.changedValues = changedValues; this.collectionPointer = collectionPointer; collectionManager = ODatabaseRecordThreadLocal.instance().get().getSbTreeCollectionManager(); }
public int toStream(BytesContainer bytesContainer) throws OSerializationException { checkAndConvert(); final UUID oldUuid = uuid; final OSBTreeCollectionManager sbTreeCollectionManager = ODatabaseRecordThreadLocal.instance().get() .getSbTreeCollectionManager(); if (sbTreeCollectionManager != null) uuid = sbTreeCollectionManager.listenForChanges(this); else uuid = null; boolean hasUuid = uuid != null; final int serializedSize = OByteSerializer.BYTE_SIZE + delegate.getSerializedSize() + ((hasUuid) ? OUUIDSerializer.UUID_SIZE : 0); int pointer = bytesContainer.alloc(serializedSize); int offset = pointer; final byte[] stream = bytesContainer.bytes; byte configByte = 0; if (isEmbedded()) configByte |= 1; if (hasUuid) configByte |= 2; stream[offset++] = configByte; if (hasUuid) { OUUIDSerializer.INSTANCE.serialize(uuid, stream, offset); offset += OUUIDSerializer.UUID_SIZE; } delegate.serialize(stream, offset, oldUuid); return pointer; }
private void writeRidBag(BytesContainer bytes, ORidBag bag) { final OSBTreeCollectionManager sbTreeCollectionManager = ODatabaseRecordThreadLocal.instance().get() .getSbTreeCollectionManager(); UUID uuid = null; if (sbTreeCollectionManager != null)
@Override protected int writeRidBag(BytesContainer bytes, ORidBag ridbag) { ridbag.checkAndConvert(); UUID ownerUuid = ridbag.getTemporaryId(); int positionOffset = bytes.offset; final OSBTreeCollectionManager sbTreeCollectionManager = ODatabaseRecordThreadLocal.instance().get() .getSbTreeCollectionManager(); UUID uuid = null; if (sbTreeCollectionManager != null) uuid = sbTreeCollectionManager.listenForChanges(ridbag); byte configByte = 0; if (ridbag.isEmbedded()) configByte |= 1; if (uuid != null) configByte |= 2; //alloc will move offset and do skip int posForWrite = bytes.alloc(OByteSerializer.BYTE_SIZE); OByteSerializer.INSTANCE.serialize(configByte, bytes.bytes, posForWrite); //removed serializing UUID if (ridbag.isEmbedded()) { writeEmbeddedRidbag(bytes, ridbag); } else { writeSBTreeRidbag(bytes, ridbag, ownerUuid); } return positionOffset; }
assert clusterId > -1; try { collectionPointer = ODatabaseRecordThreadLocal.instance().get().getSbTreeCollectionManager() .createSBTree(clusterId, ownerUuid); } catch (IOException e) {
assert clusterId > -1; try { pointer = ODatabaseRecordThreadLocal.instance().get().getSbTreeCollectionManager().createSBTree(clusterId, ownerUuid); } catch (IOException e) { throw OException.wrapException(new ODatabaseException("Errur during ridbag creation"), e);
public void checkAndConvert() { ODatabaseInternal database = ODatabaseRecordThreadLocal.instance().getIfDefined(); if (database != null && !database.getStorage().isRemote()) { if (isEmbedded() && ODatabaseRecordThreadLocal.instance().get().getSbTreeCollectionManager() != null && delegate.size() >= topThreshold) { ORidBagDelegate oldDelegate = delegate;