Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkClientsIdBounds() throws java.util.concurrent.ExecutionException, InterruptedException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void CheckClientsIdBounds()
        {
            int                threads     = 2;
            DefaultCounts      counts      = new DefaultCounts(threads);
            DefaultCacheAccess cacheAccess = new DefaultCacheAccess(counts, threads);

            cacheAccess.PrepareForProcessingOfSingleStore(34);

            CacheAccess_Client client1 = cacheAccess.Client();

            assertTrue(client1.WithinBounds(0));
            assertTrue(client1.WithinBounds(10));
            assertTrue(client1.WithinBounds(33));
            assertFalse(client1.WithinBounds(34));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.concurrent.Future<?> secondClientIdChecks = executor.submit(() ->
            Future <object> secondClientIdChecks = _executor.submit(() =>
            {
                CacheAccess_Client client = cacheAccess.Client();
                assertFalse(client.WithinBounds(5));
                assertFalse(client.WithinBounds(33));
                assertTrue(client.WithinBounds(34));
                assertTrue(client.WithinBounds(67));
                assertFalse(client.WithinBounds(68));
            });

            secondClientIdChecks.get();
        }
Esempio n. 2
0
            protected internal override void ProcessCache()
            {
                RecordStore <NodeRecord> nodeStore = StoreAccess.NodeStore;
                CacheAccess_Client       client    = CacheAccess.client();
                long highId = nodeStore.HighId;

                for (long nodeId = 0; nodeId < highId; nodeId++)
                {
                    if (client.GetFromCache(nodeId, CacheSlots_NextRelationship_Fields.SLOT_FIRST_IN_TARGET) == 0)
                    {
                        NodeRecord node = nodeStore.GetRecord(nodeId, nodeStore.NewRecord(), FORCE);
                        if (node.InUse() && !node.Dense)
                        {
                            StoreProcessor.processNode(nodeStore, node);
                        }
                    }
                }
            }
Esempio n. 3
0
            protected internal override void ProcessCache()
            {
                CacheAccess.clearCache();
                long[]             fields = new long[] { -1, 1, 0 };
                CacheAccess_Client client = CacheAccess.client();

                using (ResourceIterator <NodeRecord> nodeRecords = Nodes.GetEnumerator())
                {
                    while (nodeRecords.MoveNext())
                    {
                        NodeRecord node = nodeRecords.Current;
                        if (node.InUse())
                        {
                            fields[CacheSlots_NextRelationship_Fields.SLOT_RELATIONSHIP_ID] = node.NextRel;
                            client.PutToCache(node.Id, fields);
                        }
                    }
                }
            }