예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void distribute(org.neo4j.kernel.impl.store.record.RelationshipRecord relationship, org.neo4j.consistency.checking.full.RecordDistributor.RecordConsumer<org.neo4j.kernel.impl.store.record.RelationshipRecord> consumer) throws InterruptedException
        public override void Distribute(RelationshipRecord relationship, RecordConsumer <RelationshipRecord> consumer)
        {
            int qIndex1 = ( int )Math.Min(MaxAvailableThread, Math.Abs(relationship.FirstNode) / RecordsPerCpu);
            int qIndex2 = ( int )Math.Min(MaxAvailableThread, Math.Abs(relationship.SecondNode) / RecordsPerCpu);

            try
            {
                consumer.Accept(relationship, qIndex1);
                if (qIndex1 != qIndex2)
                {
                    consumer.Accept(relationship, qIndex2);
                }
            }
            catch (System.IndexOutOfRangeException e)
            {
                throw Exceptions.withMessage(e, e.Message + ", recordsPerCPU:" + RecordsPerCpu + ", relationship:" + relationship + ", number of threads: " + NumberOfThreads);
            }
        }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void distribute(RECORD record, org.neo4j.consistency.checking.full.RecordDistributor.RecordConsumer<RECORD> consumer) throws InterruptedException
        public override void Distribute(RECORD record, RecordConsumer <RECORD> consumer)
        {
            try
            {
                consumer.Accept(record, NextQIndex);
            }
            finally
            {
                NextQIndex = (NextQIndex + 1) % NumberOfThreads;
            }
        }