Example #1
0
        public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
                                    sio, DefragmentContextImpl context)
        {
            base.Defrag(classMetadata, aspect, sio, context);
            if (!(aspect is FieldMetadata))
            {
                return;
            }
            var field = (FieldMetadata)aspect;

            if (field.IsVirtual())
            {
                return;
            }
            if (field.HasIndex())
            {
                var index         = field.GetIndex(context.SystemTrans());
                var targetIndexID = context.CopyID();
                if (targetIndexID != 0)
                {
                    index.DefragBTree(context.Services());
                }
            }
            else
            {
                context.WriteInt(0);
            }
        }
Example #2
0
 public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
     sio, DefragmentContextImpl context)
 {
     base.Defrag(classMetadata, aspect, sio, context);
     if (!(aspect is FieldMetadata))
     {
         return;
     }
     var field = (FieldMetadata) aspect;
     if (field.IsVirtual())
     {
         return;
     }
     if (field.HasIndex())
     {
         var index = field.GetIndex(context.SystemTrans());
         var targetIndexID = context.CopyID();
         if (targetIndexID != 0)
         {
             index.DefragBTree(context.Services());
         }
     }
     else
     {
         context.WriteInt(0);
     }
 }