示例#1
0
 public virtual void Init(MutableObjectIntMap <string> indexNames, MutableObjectIntMap <string> keys)
 {
     this._indexNameIdRange = requireNonNull(indexNames, "indexNames");
     this._keyIdRange       = requireNonNull(keys, "keys");
     this._idToIndexName    = indexNames.flipUniqueValues();
     this._idToKey          = keys.flipUniqueValues();
 }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private Command visitIndexDefineCommand(org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException
        private Command VisitIndexDefineCommand(ReadableChannel channel)
        {
            ReadIndexCommandHeader(channel);
            MutableObjectIntMap <string> indexNames = ReadMap(channel);
            MutableObjectIntMap <string> keys       = ReadMap(channel);
            IndexDefineCommand           command    = new IndexDefineCommand();

            command.Init(indexNames, keys);
            return(command);
        }
示例#3
0
        private int GetOrAssignId(MutableObjectIntMap <string> stringToId, MutableIntObjectMap <string> idToString, AtomicInteger nextId, string @string)
        {
            if (string.ReferenceEquals(@string, null))
            {
                return(-1);
            }

            if (stringToId.containsKey(@string))
            {
                return(stringToId.get(@string));
            }

            int id = nextId.incrementAndGet();

            if (id > HighestPossibleId || stringToId.size() >= HighestPossibleId)
            {
                throw new System.InvalidOperationException(format("Modifying more than %d indexes or keys in a single transaction is not supported", HighestPossibleId + 1));
            }

            stringToId.put(@string, id);
            idToString.put(id, @string);
            return(id);
        }