Exemple #1
0
        /// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
        /// <exception cref="System.IO.IOException"></exception>
        private static void Pass(DefragmentServicesImpl context, DefragmentConfig config,
                                 IPassCommand command)
        {
            command.ProcessClassCollection(context);
            IStoredClass[] classes = context.StoredClasses(DefragmentServicesImpl.Sourcedb);
            for (int classIdx = 0; classIdx < classes.Length; classIdx++)
            {
                ClassMetadata classMetadata = (ClassMetadata)classes[classIdx];
                if (!config.StoredClassFilter().Accept(classMetadata))
                {
                    continue;
                }
                ProcessClass(context, classMetadata, command);
                command.Flush(context);
                if (config.ObjectCommitFrequency() > 0)
                {
                    context.TargetCommit();
                }
            }
            BTree uuidIndex = context.SourceUuidIndex();

            if (uuidIndex != null)
            {
                command.ProcessBTree(context, uuidIndex);
            }
            command.Flush(context);
            context.TargetCommit();
        }
Exemple #2
0
 /// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
 /// <exception cref="System.IO.IOException"></exception>
 private static void ProcessClassIndex(DefragmentServicesImpl context, ClassMetadata
                                       curClass, IPassCommand command)
 {
     if (curClass.HasClassIndex())
     {
         BTreeClassIndexStrategy indexStrategy = (BTreeClassIndexStrategy)curClass.Index();
         BTree btree = indexStrategy.Btree();
         command.ProcessBTree(context, btree);
     }
 }
		/// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		private static void ProcessClassIndex(DefragmentServicesImpl context, ClassMetadata
			 curClass, IPassCommand command)
		{
			if (curClass.HasClassIndex())
			{
				BTreeClassIndexStrategy indexStrategy = (BTreeClassIndexStrategy)curClass.Index();
				BTree btree = indexStrategy.Btree();
				command.ProcessBTree(context, btree);
			}
		}
		/// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		private static void Pass(DefragmentServicesImpl context, DefragmentConfig config, 
			IPassCommand command)
		{
			command.ProcessClassCollection(context);
			IStoredClass[] classes = context.StoredClasses(DefragmentServicesImpl.Sourcedb);
			for (int classIdx = 0; classIdx < classes.Length; classIdx++)
			{
				ClassMetadata classMetadata = (ClassMetadata)classes[classIdx];
				if (!config.StoredClassFilter().Accept(classMetadata))
				{
					continue;
				}
				ProcessClass(context, classMetadata, command);
				command.Flush(context);
				if (config.ObjectCommitFrequency() > 0)
				{
					context.TargetCommit();
				}
			}
			BTree uuidIndex = context.SourceUuidIndex();
			if (uuidIndex != null)
			{
				command.ProcessBTree(context, uuidIndex);
			}
			command.Flush(context);
			context.TargetCommit();
		}