public _IVisitor4_284(IPassCommand command, DefragmentServicesImpl context, ClassMetadata curClass) { this.command = command; this.context = context; this.curClass = curClass; }
/// <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(); }
/// <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); } }
// TODO order of class index/object slot processing is crucial: // - object slots before field indices (object slots register addresses for // use by string indices) // - class index before object slots, otherwise phantom btree entries from // deletions appear in the source class index?!? // reproducable with SelectiveCascadingDeleteTestCase and ObjectSetTestCase // - investigate. /// <exception cref="Db4objects.Db4o.CorruptionException"></exception> /// <exception cref="System.IO.IOException"></exception> private static void ProcessClass(DefragmentServicesImpl context, ClassMetadata curClass , IPassCommand command) { ProcessClassIndex(context, curClass, command); if (!ParentHasIndex(curClass)) { ProcessObjectsForClass(context, curClass, command); } ProcessClassAndFieldIndices(context, curClass, command); }
/// <exception cref="Db4objects.Db4o.CorruptionException"></exception> /// <exception cref="System.IO.IOException"></exception> private static void ProcessClassAndFieldIndices(DefragmentServicesImpl context, ClassMetadata curClass, IPassCommand command) { int sourceClassIndexID = 0; int targetClassIndexID = 0; if (curClass.HasClassIndex()) { sourceClassIndexID = curClass.Index().Id(); targetClassIndexID = context.MappedID(sourceClassIndexID, -1); } command.ProcessClass(context, curClass, curClass.GetID(), targetClassIndexID); }
private static void ProcessObjectsForClass(DefragmentServicesImpl context, ClassMetadata curClass, IPassCommand command) { context.TraverseAll(curClass, new _IVisitor4_284(command, context, curClass)); }
private static void Registra(IPassCommand cmd) { _commands.Add(cmd.GetName(), cmd); }