Esempio n. 1
0
        public virtual void PropertyKey(int id, string key, params int[] dynamicIds)
        {
            PropertyKeyTokenRecord before = new PropertyKeyTokenRecord(id);
            PropertyKeyTokenRecord after  = WithName(new PropertyKeyTokenRecord(id), dynamicIds, key);

            _otherCommands.Add(new Command.PropertyKeyTokenCommand(before, after));
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord readPropertyKeyTokenRecord(int id, org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException
        private PropertyKeyTokenRecord ReadPropertyKeyTokenRecord(int id, ReadableChannel channel)
        {
            // in_use(byte)+count(int)+key_blockId(int)
            sbyte inUseFlag = channel.Get();
            bool  inUse     = false;

            if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue())
            {
                inUse = true;
            }
            else if (inUseFlag != Record.NOT_IN_USE.byteValue())
            {
                throw new IOException("Illegal in use flag: " + inUseFlag);
            }
            PropertyKeyTokenRecord record = new PropertyKeyTokenRecord(id);

            record.InUse         = inUse;
            record.PropertyCount = channel.Int;
            record.NameId        = channel.Int;
            if (ReadDynamicRecords(channel, record, PROPERTY_INDEX_DYNAMIC_RECORD_ADDER) == -1)
            {
                return(null);
            }
            return(record);
        }
Esempio n. 3
0
        public static PropertyKeyTokenCommand CreatePropertyKeyToken(int id, int nameId)
        {
            PropertyKeyTokenRecord before = new PropertyKeyTokenRecord(id);
            PropertyKeyTokenRecord after  = new PropertyKeyTokenRecord(id);

            PopulateTokenRecord(after, nameId);
            return(new PropertyKeyTokenCommand(before, after));
        }
Esempio n. 4
0
        private PropertyKeyTokenRecord CreatePropertyKeyTokenRecord(int id)
        {
            PropertyKeyTokenRecord propertyKeyTokenRecord = new PropertyKeyTokenRecord(id);

            propertyKeyTokenRecord.InUse  = true;
            propertyKeyTokenRecord.NameId = 333;
            propertyKeyTokenRecord.AddNameRecord(new DynamicRecord(43));
            return(propertyKeyTokenRecord);
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private Command visitPropertyKeyTokenCommand(org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException
        private Command VisitPropertyKeyTokenCommand(ReadableChannel channel)
        {
            int id = channel.Int;
            PropertyKeyTokenRecord before = ReadPropertyKeyTokenRecord(id, channel);

            if (before == null)
            {
                return(null);
            }

            PropertyKeyTokenRecord after = ReadPropertyKeyTokenRecord(id, channel);

            if (after == null)
            {
                return(null);
            }

            return(new Command.PropertyKeyTokenCommand(before, after));
        }
Esempio n. 6
0
        private GraphDatabaseAPI DatabaseWithManyPropertyKeys(int propertyKeyCount)
        {
            PageCache             pageCache    = _pageCacheRule.getPageCache(_fileSystemRule.get());
            StoreFactory          storeFactory = new StoreFactory(_testDirectory.databaseLayout(), Config.defaults(), new DefaultIdGeneratorFactory(_fileSystemRule.get()), pageCache, _fileSystemRule.get(), NullLogProvider.Instance, EmptyVersionContextSupplier.EMPTY);
            NeoStores             neoStores    = storeFactory.OpenAllNeoStores(true);
            PropertyKeyTokenStore store        = neoStores.PropertyKeyTokenStore;

            for (int i = 0; i < propertyKeyCount; i++)
            {
                PropertyKeyTokenRecord record = new PropertyKeyTokenRecord(( int )store.nextId());
                record.InUse = true;
                ICollection <DynamicRecord> nameRecords = store.AllocateNameRecords(PropertyStore.encodeString(Key(i)));
                record.AddNameRecords(nameRecords);
                record.NameId = ( int )Iterables.first(nameRecords).Id;
                store.UpdateRecord(record);
            }
            neoStores.Close();

            return(Database());
        }
Esempio n. 7
0
 protected internal abstract void CheckPropertyKeyToken(RecordStore <PropertyKeyTokenRecord> store, PropertyKeyTokenRecord record, RecordCheck <PropertyKeyTokenRecord, ConsistencyReport_PropertyKeyTokenConsistencyReport> checker);
Esempio n. 8
0
 public override void ProcessPropertyKeyToken(RecordStore <PropertyKeyTokenRecord> store, PropertyKeyTokenRecord record)
 {
     CheckPropertyKeyToken(store, record, _propertyKeyTokenChecker);
 }
Esempio n. 9
0
 public override void ForPropertyKey(PropertyKeyTokenRecord key, RecordCheck <PropertyKeyTokenRecord, ConsistencyReport_PropertyKeyTokenConsistencyReport> checker)
 {
     Dispatch(RecordType.PROPERTY_KEY, _propertyKeyReport, key, checker);
 }
Esempio n. 10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public abstract void processPropertyKeyToken(RecordStore<org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord> store, org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord record) throws FAILURE;
        public abstract void ProcessPropertyKeyToken(RecordStore <PropertyKeyTokenRecord> store, PropertyKeyTokenRecord record);
Esempio n. 11
0
 protected internal override void CheckPropertyKeyToken(RecordStore <PropertyKeyTokenRecord> store, PropertyKeyTokenRecord key, RecordCheck <PropertyKeyTokenRecord, Org.Neo4j.Consistency.report.ConsistencyReport_PropertyKeyTokenConsistencyReport> checker)
 {
     _report.forPropertyKey(key, checker);
 }
Esempio n. 12
0
 public override void check(PropertyKeyTokenRecord record, CheckerEngine <PropertyKeyTokenRecord, ConsistencyReport_PropertyKeyTokenConsistencyReport> engine, RecordAccess records)
 {
 }
Esempio n. 13
0
 public virtual void Add(PropertyKeyTokenRecord before, PropertyKeyTokenRecord after)
 {
     _otherCommands.Add(new Command.PropertyKeyTokenCommand(before, after));
 }
Esempio n. 14
0
 public virtual void Update(PropertyKeyTokenRecord before, PropertyKeyTokenRecord after)
 {
     after.InUse = true;
     Add(before, after);
 }
Esempio n. 15
0
 public virtual void Create(PropertyKeyTokenRecord token)
 {
     token.SetCreated();
     Update(new PropertyKeyTokenRecord(token.IntId), token);
 }