Esempio n. 1
0
        public HpcVertexWriter(HpcLinqVertexEnv denv, HpcLinqFactory <T> writerFactory, UInt32 portNum)
        {
            this.m_dvertexEnv      = denv;
            this.m_nativeHandle    = denv.NativeHandle;
            this.m_startPort       = portNum;
            this.m_numberOfOutputs = 1;
            this.m_writerFactory   = writerFactory;
            Int32 buffSize             = this.m_dvertexEnv.GetWriteBuffSize();
            HpcRecordWriter <T> writer = writerFactory.MakeWriter(this.m_nativeHandle, portNum, buffSize);

            this.m_writers = new HpcRecordWriter <T>[] { writer };
        }
Esempio n. 2
0
        public void WriteItemSequence(IEnumerable <T> source)
        {
            HpcRecordWriter <T> writer = this.m_writers[0];

            if (m_dvertexEnv.MultiThreading)
            {
                foreach (T item in source)
                {
                    writer.WriteRecordAsync(item);
                }
            }
            else
            {
                foreach (T item in source)
                {
                    writer.WriteRecordSync(item);
                }
            }
            this.CloseWriters();
        }