Lookup() 보호된 추상적인 메소드

protected abstract Lookup ( key, Org.Neo4j.Kernel.impl.store.kvstore.ValueSink sink ) : bool
sink Org.Neo4j.Kernel.impl.store.kvstore.ValueSink
리턴 bool
예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static <Key> boolean performLookup(ReadableState<Key> store, org.neo4j.io.pagecache.tracing.cursor.context.VersionContext versionContext, java.util.concurrent.ConcurrentMap<Key,ChangeEntry> changes, Key key, ValueSink sink) throws java.io.IOException
        private static bool PerformLookup <Key>(ReadableState <Key> store, VersionContext versionContext, ConcurrentMap <Key, ChangeEntry> changes, Key key, ValueSink sink)
        {
            ChangeEntry change = changes.get(key);

            if (change != null)
            {
                if (change.Version > versionContext.LastClosedTransactionId())
                {
                    versionContext.MarkAsDirty();
                }
                sink.Value(new BigEndianByteArrayBuffer(change.Data));
                return(true);
            }
            return(store.Lookup(key, sink));
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") static <Key> void applyUpdate(ReadableState<Key> store, java.util.concurrent.ConcurrentMap<Key, ChangeEntry> changes, Key key, ValueUpdate update, boolean reset, long version) throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal static void ApplyUpdate <Key>(ReadableState <Key> store, ConcurrentMap <Key, ChangeEntry> changes, Key key, ValueUpdate update, bool reset, long version)
        {
            ChangeEntry value = changes.get(key);

            if (value == null)
            {
                ChangeEntry newEntry = ChangeEntry.Of(new sbyte[store.KeyFormat().valueSize()], version);
                lock ( newEntry )
                {
                    value = changes.putIfAbsent(key, newEntry);
                    if (value == null)
                    {
                        BigEndianByteArrayBuffer buffer = new BigEndianByteArrayBuffer(newEntry.Data);
                        if (!reset)
                        {
                            PreviousValue lookup = new PreviousValue(newEntry.Data);
                            if (!store.Lookup(key, lookup))
                            {
                                buffer.Clear();
                            }
                        }
                        update.Update(buffer);
                        return;
                    }
                }
            }
            lock ( value )
            {
                BigEndianByteArrayBuffer target = new BigEndianByteArrayBuffer(value.Data);
                value.Version = version;
                if (reset)
                {
                    target.Clear();
                }
                update.Update(target);
            }
        }