コード例 #1
0
ファイル: IndexUpdateStorage.cs プロジェクト: Neo4Net/Neo4Net
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void add(org.neo4j.kernel.api.index.IndexEntryUpdate<?> update, org.neo4j.io.pagecache.PageCursor pageCursor) throws java.io.IOException
        public override void Add <T1>(IndexEntryUpdate <T1> update, PageCursor pageCursor)
        {
            int        entrySize  = TYPE_SIZE;
            UpdateMode updateMode = update.UpdateMode();

            switch (updateMode.innerEnumValue)
            {
            case UpdateMode.InnerEnum.ADDED:
                initializeKeyAndValueFromUpdate(_key1, _value, update.EntityId, update.Values());
                entrySize += BlockEntry.EntrySize(_layout, _key1, _value);
                break;

            case UpdateMode.InnerEnum.REMOVED:
                initializeKeyFromUpdate(_key1, update.EntityId, update.Values());
                entrySize += BlockEntry.KeySize(_layout, _key1);
                break;

            case UpdateMode.InnerEnum.CHANGED:
                initializeKeyFromUpdate(_key1, update.EntityId, update.BeforeValues());
                initializeKeyAndValueFromUpdate(_key2, _value, update.EntityId, update.Values());
                entrySize += BlockEntry.KeySize(_layout, _key1) + BlockEntry.EntrySize(_layout, _key2, _value);
                break;

            default:
                throw new System.ArgumentException("Unknown update mode " + updateMode);
            }

            prepareWrite(entrySize);

            pageCursor.PutByte(( sbyte )updateMode.ordinal());
            IndexUpdateEntry.Write(pageCursor, _layout, updateMode, _key1, _key2, _value);
        }
コード例 #2
0
ファイル: IndexUpdateCursor.cs プロジェクト: Neo4Net/Neo4Net
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public boolean next() throws java.io.IOException
        public override bool Next()
        {
            sbyte updateModeType = _cursor.Byte;

            if (updateModeType == STOP_TYPE)
            {
                return(false);
            }

            _updateMode = UpdateMode.MODES[updateModeType];
            IndexUpdateEntry.Read(_cursor, _layout, _updateMode, _key1, _key2, _value);
            return(true);
        }
コード例 #3
0
ファイル: IndexUpdateEntry.cs プロジェクト: Neo4Net/Neo4Net
        public static void Write <KEY, VALUE>(PageCursor cursor, Layout <KEY, VALUE> layout, UpdateMode updateMode, KEY key1, KEY key2, VALUE value)
        {
            switch (updateMode.innerEnumValue)
            {
            case UpdateMode.InnerEnum.ADDED:
                BlockEntry.Write(cursor, layout, key1, value);
                break;

            case UpdateMode.InnerEnum.REMOVED:
                BlockEntry.Write(cursor, layout, key1);
                break;

            case UpdateMode.InnerEnum.CHANGED:
                BlockEntry.Write(cursor, layout, key1);
                BlockEntry.Write(cursor, layout, key2, value);
                break;

            default:
                throw new System.ArgumentException("Unknown update mode " + updateMode);
            }
        }