Esempio n. 1
0
		public override void DefragIndexEntry(DefragmentContextImpl context)
		{
			int sourceId = context.CopyIDReturnOriginalID(true);
			context.CurrentParentSourceID(sourceId);
		}
Esempio n. 2
0
		private int CopyDependentSlot(IDefragmentContext context, int sourceId)
		{
			try
			{
				ByteArrayBuffer sourceBuffer = context.SourceBufferById(sourceId);
				Slot targetPayloadSlot = context.AllocateTargetSlot(sourceBuffer.Length());
				int targetId = context.Services().TargetNewId();
				context.Services().MapIDs(sourceId, targetId, false);
				context.Services().Mapping().MapId(targetId, targetPayloadSlot);
				DefragmentContextImpl payloadContext = new DefragmentContextImpl(sourceBuffer, (DefragmentContextImpl
					)context);
				int clazzId = payloadContext.CopyIDReturnOriginalID();
				ITypeHandler4 payloadHandler = payloadContext.TypeHandlerForId(clazzId);
				ITypeHandler4 versionedPayloadHandler = HandlerRegistry.CorrectHandlerVersion(payloadContext
					, payloadHandler);
				versionedPayloadHandler.Defragment(payloadContext);
				payloadContext.WriteToTarget(targetPayloadSlot.Address());
				return targetId;
			}
			catch (IOException ioexc)
			{
				throw new Db4oIOException(ioexc);
			}
		}
Esempio n. 3
0
        public override void DefragIndexEntry(DefragmentContextImpl context)
        {
            int sourceId = context.CopyIDReturnOriginalID(true);

            context.CurrentParentSourceID(sourceId);
        }