use of org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor in project neo4j by neo4j.
the class IndexIT method committedAndTransactionalIndexRulesShouldBeMerged.
@Test
public void committedAndTransactionalIndexRulesShouldBeMerged() throws Exception {
// GIVEN
SchemaWriteOperations schemaWriteOperations = schemaWriteOperationsInNewTransaction();
NewIndexDescriptor existingRule = schemaWriteOperations.indexCreate(SchemaBoundary.map(descriptor));
commit();
// WHEN
Statement statement = statementInNewTransaction(AnonymousContext.AUTH_DISABLED);
NewIndexDescriptor addedRule = statement.schemaWriteOperations().indexCreate(SchemaDescriptorFactory.forLabel(labelId, 10));
Set<NewIndexDescriptor> indexRulesInTx = asSet(statement.readOperations().indexesGetForLabel(labelId));
commit();
// THEN
assertEquals(asSet(existingRule, addedRule), indexRulesInTx);
}
use of org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor in project neo4j by neo4j.
the class HaCountsIT method shouldUpdateCountsOnSlavesWhenCreatingAnIndexOnMaster.
@Test
public void shouldUpdateCountsOnSlavesWhenCreatingAnIndexOnMaster() throws Exception {
// when creating a node on the master
createANode(master, LABEL, PROPERTY_VALUE, PROPERTY_NAME);
NewIndexDescriptor indexDescriptor = createAnIndex(master, LABEL, PROPERTY_NAME);
long indexId = awaitOnline(master, indexDescriptor);
// and the slaves got the updates
cluster.sync(master);
long index1 = awaitOnline(slave1, indexDescriptor);
long index2 = awaitOnline(slave2, indexDescriptor);
// then the slaves has updated counts
assertOnIndexCounts(0, 1, 1, 1, indexId, master);
assertOnIndexCounts(0, 1, 1, 1, index1, slave1);
assertOnIndexCounts(0, 1, 1, 1, index2, slave2);
}
use of org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor in project neo4j by neo4j.
the class HaCountsIT method shouldUpdateCountsOnClusterWhenCreatingANodeOnSlaveAndAnIndexOnMaster.
@Test
public void shouldUpdateCountsOnClusterWhenCreatingANodeOnSlaveAndAnIndexOnMaster() throws Exception {
// when creating a node on the master
createANode(slave1, LABEL, PROPERTY_VALUE, PROPERTY_NAME);
NewIndexDescriptor indexDescriptor = createAnIndex(master, LABEL, PROPERTY_NAME);
long indexId = awaitOnline(master, indexDescriptor);
// and the updates are propagate in the cluster
cluster.sync();
long index1 = awaitOnline(slave1, indexDescriptor);
long index2 = awaitOnline(slave2, indexDescriptor);
// then the slaves has updated counts
assertOnIndexCounts(0, 1, 1, 1, indexId, master);
assertOnIndexCounts(0, 1, 1, 1, index1, slave1);
assertOnIndexCounts(0, 1, 1, 1, index2, slave2);
}
use of org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor in project neo4j by neo4j.
the class DumpCountsStore method visitIndexStatistics.
@Override
public void visitIndexStatistics(long indexId, long updates, long size) {
NewIndexDescriptor index = indexes.get(indexId);
out.printf("\tIndexStatistics[(%s {%s})]:\tupdates=%d, size=%d%n", label(index.schema().getLabelId()), propertyKeys(index.schema().getPropertyIds()), updates, size);
}
use of org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor in project neo4j by neo4j.
the class DumpCountsStore method visitIndexSample.
@Override
public void visitIndexSample(long indexId, long unique, long size) {
NewIndexDescriptor index = indexes.get(indexId);
out.printf("\tIndexSample[(%s {%s})]:\tunique=%d, size=%d%n", label(index.schema().getLabelId()), propertyKeys(index.schema().getPropertyIds()), unique, size);
}
Aggregations