Ejemplo n.º 1
0
            public override DateTime MoveN(DateTime time, int count)
            {
                DateTime normaltime = Intervals.Offset(2628000, time);//到标准月
                TimeSpan span       = normaltime - time;

                normaltime = normaltime.AddMonths(Ticks * count);
                return(normaltime.AddTicks(-span.Ticks));
            }
Ejemplo n.º 2
0
        private Shard createShard(long clock)
        {
            DateTime time       = new DateTime(clock);
            DateTime start      = Intervals.Round(_Interval, time, null);
            DateTime end        = Intervals.MoveN(_Interval, start, 1);
            ulong    newshardid = Database.Store.NewShardId();
            Shard    newshard   = new Shard(this, newshardid, start.Ticks, end.Ticks);

            newshard.Open(true);
            lock (lockthis)
            {
                shards.Add(newshard);
                info.Shards.Add(new ShardStartEnd()
                {
                    ShardId = newshardid, Start = start, End = end
                });
                save();
            }
            return(newshard);
        }