Пример #1
0
        private static MutableObjectLongMap <SchemaDescriptor> IndexIdsByDescriptor(LongObjectMap <IndexProxy> indexesById)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.map.primitive.MutableObjectLongMap<org.neo4j.internal.kernel.api.schema.SchemaDescriptor> map = new org.eclipse.collections.impl.map.mutable.primitive.ObjectLongHashMap<>(indexesById.size());
            MutableObjectLongMap <SchemaDescriptor> map = new ObjectLongHashMap <SchemaDescriptor>(indexesById.size());

            indexesById.forEachKeyValue((id, indexProxy) => map.put(indexProxy.Descriptor.schema(), id));
            return(map);
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.eclipse.collections.api.map.primitive.ObjectLongMap<Class> getLogEntriesDistribution(org.neo4j.kernel.impl.transaction.log.files.LogFiles logFiles) throws java.io.IOException
        private static ObjectLongMap <Type> GetLogEntriesDistribution(LogFiles logFiles)
        {
            LogFile transactionLogFile = logFiles.LogFile;

            LogPosition fileStartPosition = new LogPosition(0, LogHeader.LOG_HEADER_SIZE);
            VersionAwareLogEntryReader <ReadableLogChannel> entryReader = new VersionAwareLogEntryReader <ReadableLogChannel>();

            MutableObjectLongMap <Type> multiset = new ObjectLongHashMap <Type>();

            using (ReadableLogChannel fileReader = transactionLogFile.GetReader(fileStartPosition))
            {
                LogEntry logEntry = entryReader.ReadLogEntry(fileReader);
                while (logEntry != null)
                {
                    multiset.addToValue(logEntry.GetType(), 1);
                    logEntry = entryReader.ReadLogEntry(fileReader);
                }
            }
            return(multiset);
        }