Beispiel #1
0
 public bool Contains(IIndexTask instance)
 {
     lock (padlock)
     {
         return cq.Contains(instance);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Perform indexing for a given checkpoint type.
        /// </summary>
        /// <param name="type">The checkpoint type to index.</param>
        /// <param name="fromHeight">The height to index from.</param>
        /// <param name="toHeight">The height to index to.</param>
        private void PerformIndexing(IndexerCheckpoints type, int fromHeight, int toHeight)
        {
            if (!this.nodeLifetime.ApplicationStopping.IsCancellationRequested)
            {
                // Index a batch of blocks/transactions/balances/wallets
                var fetcher = this.GetBlockFetcher(type);
                if (toHeight > fetcher._LastProcessed.Height)
                {
                    fetcher.FromHeight = Math.Max(fetcher._LastProcessed.Height + 1, fromHeight);
                    fetcher.ToHeight   = toHeight;
                    IIndexTask task = null;
                    switch (type)
                    {
                    case IndexerCheckpoints.Blocks:
                        task = new IndexBlocksTask(this.IndexerConfig, this.loggerFactory);
                        break;

                    case IndexerCheckpoints.Transactions:
                        task = new IndexTransactionsTask(this.IndexerConfig, this.loggerFactory);
                        break;

                    case IndexerCheckpoints.Balances:
                        task = new IndexBalanceTask(this.IndexerConfig, null, this.loggerFactory);
                        break;

                    case IndexerCheckpoints.Wallets:
                        task = new IndexBalanceTask(this.IndexerConfig, this.IndexerConfig.CreateIndexerClient().GetAllWalletRules(), this.loggerFactory);
                        break;
                    }
                    task.SaveProgression = !this.indexerSettings.IgnoreCheckpoints;
                    task.Index(fetcher, this.AzureIndexer.TaskScheduler, this.FullNode.Network);
                }
            }
        }
Beispiel #3
0
 public bool Contains(IIndexTask instance)
 {
     lock (padlock)
     {
         return(cq.Contains(instance));
     }
 }
Beispiel #4
0
 void AddTaskIndex(Checkpoint checkpoint, IIndexTask indexTask)
 {
     _IndexTasks.Add(checkpoint.CheckpointName, Tuple.Create(checkpoint, indexTask));
 }
Beispiel #5
0
 public bool TryDequeue(out IIndexTask task)
 {
     return cq.TryDequeue(out task);
 }
Beispiel #6
0
 public void Queue(IIndexTask task)
 {
     cq.Enqueue(task);
 }
Beispiel #7
0
 public bool TryDequeue(out IIndexTask task)
 {
     return(cq.TryDequeue(out task));
 }
Beispiel #8
0
 public void Queue(IIndexTask task)
 {
     cq.Enqueue(task);
 }