Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private java.util.stream.Stream<BuiltInProcedures.SchemaIndexInfo> createIndex(String indexSpecification, String providerName, String statusMessage, IndexCreator indexCreator) throws org.neo4j.internal.kernel.api.exceptions.ProcedureException
        private Stream <BuiltInProcedures.SchemaIndexInfo> CreateIndex(string indexSpecification, string providerName, string statusMessage, IndexCreator indexCreator)
        {
            AssertProviderNameNotNull(providerName);
            IndexSpecifier index   = IndexSpecifier.ByPattern(indexSpecification);
            int            labelId = GetOrCreateLabelId(index.Label());

            int[] propertyKeyIds = GetOrCreatePropertyIds(index.Properties());
            try
            {
                SchemaWrite           schemaWrite           = _ktx.schemaWrite();
                LabelSchemaDescriptor labelSchemaDescriptor = SchemaDescriptorFactory.forLabel(labelId, propertyKeyIds);
                indexCreator(schemaWrite, labelSchemaDescriptor, providerName);
                return(Stream.of(new BuiltInProcedures.SchemaIndexInfo(indexSpecification, providerName, statusMessage)));
            }
            catch (Exception e) when(e is InvalidTransactionTypeKernelException || e is SchemaKernelException)
            {
                throw new ProcedureException(e.status(), e, e.Message);
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.internal.kernel.api.SchemaWrite schemaWrite() throws org.neo4j.internal.kernel.api.exceptions.InvalidTransactionTypeKernelException
            public override SchemaWrite SchemaWrite()
            {
                return(Internal.schemaWrite());
            }