Beispiel #1
0
        public static Neighborhood NewSiblingList(ShardID myAddr, int replicaLevel, bool forceAllLinksPassive)
        {
            int          at = 0;
            Neighborhood n  = new Neighborhood(replicaLevel - 1);

            for (int i = 0; i < replicaLevel; i++)
            {
                if (i != myAddr.ReplicaLevel)
                {
                    n.links[at] = new Link(new ShardID(myAddr.XYZ, i), i > myAddr.ReplicaLevel && !forceAllLinksPassive, at, true);
                    at++;
                }
            }
            return(n);
        }
Beispiel #2
0
        public static void Configure(ShardID addr, BaseDB.ConfigContainer config, bool forceAllLinksPassive)
        {
            CSLogicProvider.AsyncFactory = DB.GetLogicProviderAsync;

            ID      = addr;
            gridExt = config.extent;
            Ranges  = ToRanges(config);
            MySpace = SDToBox(addr.XYZ, config.extent);


            InconsistencyCoverage.CommonResolution = (int)Math.Ceiling(1f / Ranges.R);

            if (Extent.ReplicaLevel > 1)
            {
                siblings = Neighborhood.NewSiblingList(addr, Extent.ReplicaLevel, forceAllLinksPassive);
            }
            neighbors = Neighborhood.NewNeighborList(addr, Extent.XYZ, forceAllLinksPassive);
        }
Beispiel #3
0
 internal static void Shutdown()
 {
     if (neighbors != null)
     {
         foreach (var n in neighbors)
         {
             n.Dispose();
         }
     }
     if (siblings != null)
     {
         foreach (var s in siblings)
         {
             s.Dispose();
         }
     }
     siblings  = null;
     neighbors = null;
 }