Esempio n. 1
0
        internal void Add(int docId, Hubble.Core.Data.Payload payLoad, PayloadProvider payloadProvider)
        {
            HBMonitor.Enter(_LockObj);

            try
            {
                _PayloadEntities.Add(new PayloadEntity(docId, payLoad, payloadProvider));
            }
            finally
            {
                HBMonitor.Exit(_LockObj);
            }
            //ASendMessage((int)Event.Add, new PayloadEntity(docId, payLoad, payloadProvider));
        }
Esempio n. 2
0
        public DateTime SetPayloadLastWriteTime(DateTime time)
        {
            HBMonitor.Enter(_LockObj);

            try
            {
                System.IO.File.SetLastWriteTime(_FileName, time);

                return(System.IO.File.GetLastWriteTime(_FileName));
            }
            finally
            {
                HBMonitor.Exit(_LockObj);
            }
        }
Esempio n. 3
0
        internal void Collect()
        {
            if (!HBMonitor.TryEnter(_LockObj, 300 * 1000))
            {
                throw new TimeoutException();
            }

            try
            {
                SaveToFile();
            }
            finally
            {
                HBMonitor.Exit(_LockObj);
            }

            //SSendMessage((int)Event.Collect, null, 300 * 1000);
        }
Esempio n. 4
0
        internal void Update(IList <int> docIds, IList <Data.Payload> payloads, PayloadProvider payloadProvider)
        {
            List <PayloadEntity> peList = new List <PayloadEntity>();

            for (int i = 0; i < docIds.Count; i++)
            {
                peList.Add(new PayloadEntity(docIds[i], payloads[i], payloadProvider));
            }

            HBMonitor.Enter(_LockObj);

            try
            {
                UpdateToFile(peList);
            }
            finally
            {
                HBMonitor.Exit(_LockObj);
            }

            //SSendMessage((int)Event.Update, peList, int.MaxValue);
        }