Esempio n. 1
0
 public Mailbox(PostOffice postOffice, Runtime.Progress.ProgressUpdateCentralizer consumer, int id, int shardId)
 {
     this.postOffice = postOffice;
     this.consumer   = consumer;
     this.id         = id;
     this.shardId    = shardId;
     this.graphId    = this.consumer.Stage.InternalGraphManager.Index;
 }
Esempio n. 2
0
 public LocalMailbox(PostOffice postOffice, VertexInput <S, T> endpoint, int id, int shardId)
 {
     this.postOffice = postOffice;
     this.dirty      = false;
     this.endpoint   = endpoint;
     this.id         = id;
     this.shardId    = shardId;
     this.graphId    = endpoint.Vertex.Stage.InternalGraphManager.Index;
 }
Esempio n. 3
0
            public Mailbox(PostOffice postOffice, Runtime.Progress.ProgressUpdateConsumer consumer, int id, int shardId, int numProducers)
            {
                this.postOffice = postOffice;
                this.consumer   = consumer;
                this.graphid    = this.consumer.Stage.InternalGraphManager.Index;

                this.id      = id;
                this.shardId = shardId;

                this.nextSequenceNumbers = new int[numProducers];
            }
Esempio n. 4
0
        public LegacyLocalMailbox(PostOffice postOffice, VertexInput <S, T> endpoint, int id, int shardId)
            : base(postOffice, endpoint, id, shardId)
        {
            this.sharedQueue           = new ConcurrentQueue <Message <Pair <S, T> > >();
            this.sharedSerializedQueue = new ConcurrentQueue <SerializedMessage>();
            this.privateQueue          = new Queue <Message <Pair <S, T> > >();

            this.messagesFromLocalShards = new Message <Pair <S, T> > [this.postOffice.Controller.Workers.Count];
            for (int i = 0; i < this.postOffice.Controller.Workers.Count; ++i)
            {
                this.messagesFromLocalShards[i] = new Message <Pair <S, T> >(ThreadLocalBufferPools <Pair <S, T> > .pool.Value.Empty);
            }
        }
Esempio n. 5
0
        public SpillingLocalMailbox(PostOffice postoffice, VertexInput <S, T> endpoint, int id, int shardId, Runtime.Progress.ProgressUpdateBuffer <T> progressBuffer)
            : base(postoffice, endpoint, id, shardId)
        {
            this.pageSize = this.endpoint.Vertex.Stage.InternalGraphManager.Controller.Configuration.SendPageSize;

            this.progressBuffer = progressBuffer;

            this.messagesFromLocalThreads = new SendBufferPage[endpoint.Vertex.Stage.InternalGraphManager.Controller.Workers.Count];

            string fileName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            this.spillStream = new FileStream(fileName, FileMode.CreateNew, FileAccess.Write, FileShare.ReadWrite, 1 << 20);//, FileOptions.WriteThrough);

            this.consumeStream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

            this.pagesWritten = 0;
            this.pagesRead    = 0;
            this.pagesFlushed = 0;
        }
Esempio n. 6
0
 // if you provide a destinationCollectionId for the mailbox, it will use progress magic.
 public LegacyLocalMailbox(PostOffice postOffice, VertexInput <S, T> endpoint, int id, int shardId, Runtime.Progress.ProgressUpdateBuffer <T> progressBuffer)
     : this(postOffice, endpoint, id, shardId)
 {
     this.progressBuffer = progressBuffer;
 }