use of org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException in project neo4j by neo4j.
the class SchemaRuleSerialization method readIndexRule.
// PRIVATE
// READ INDEX
private static IndexRule readIndexRule(long id, ByteBuffer source) throws MalformedSchemaRuleException {
SchemaIndexProvider.Descriptor indexProvider = readIndexProviderDescriptor(source);
LabelSchemaDescriptor schema;
byte indexRuleType = source.get();
String name;
switch(indexRuleType) {
case GENERAL_INDEX:
schema = readLabelSchema(source);
name = readRuleName(id, IndexRule.class, source);
return IndexRule.indexRule(id, NewIndexDescriptorFactory.forSchema(schema), indexProvider, name);
case UNIQUE_INDEX:
long owningConstraint = source.getLong();
schema = readLabelSchema(source);
NewIndexDescriptor descriptor = NewIndexDescriptorFactory.uniqueForSchema(schema);
name = readRuleName(id, IndexRule.class, source);
return IndexRule.constraintIndexRule(id, descriptor, indexProvider, owningConstraint == NO_OWNING_CONSTRAINT_YET ? null : owningConstraint, name);
default:
throw new MalformedSchemaRuleException(format("Got unknown index rule type '%d'.", indexRuleType));
}
}
use of org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException in project neo4j by neo4j.
the class PhysicalLogCommandReaderV2_2_10 method readSchemaRule.
private SchemaRule readSchemaRule(Collection<DynamicRecord> recordsBefore) {
// TODO: Why was this assertion here?
// assert first(recordsBefore).inUse() : "Asked to deserialize schema records that were not in
// use.";
SchemaRule rule;
ByteBuffer deserialized = AbstractDynamicStore.concatData(recordsBefore, new byte[100]);
try {
rule = SchemaRuleSerialization.deserialize(Iterables.first(recordsBefore).getId(), deserialized);
} catch (MalformedSchemaRuleException e) {
return null;
}
return rule;
}
use of org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException in project neo4j by neo4j.
the class PhysicalLogCommandReaderV2_2_4 method readSchemaRule.
private SchemaRule readSchemaRule(Collection<DynamicRecord> recordsBefore) {
// TODO: Why was this assertion here?
// assert first(recordsBefore).inUse() : "Asked to deserialize schema records that were not in
// use.";
SchemaRule rule;
ByteBuffer deserialized = AbstractDynamicStore.concatData(recordsBefore, new byte[100]);
try {
rule = SchemaRuleSerialization.deserialize(Iterables.first(recordsBefore).getId(), deserialized);
} catch (MalformedSchemaRuleException e) {
return null;
}
return rule;
}
use of org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException in project neo4j by neo4j.
the class PhysicalLogCommandReaderV3_0_2 method readSchemaRule.
private SchemaRule readSchemaRule(Collection<DynamicRecord> recordsBefore) {
// TODO: Why was this assertion here?
// assert first(recordsBefore).inUse() : "Asked to deserialize schema records that were not in
// use.";
SchemaRule rule;
ByteBuffer deserialized = AbstractDynamicStore.concatData(recordsBefore, new byte[100]);
try {
rule = SchemaRuleSerialization.deserialize(Iterables.first(recordsBefore).getId(), deserialized);
} catch (MalformedSchemaRuleException e) {
return null;
}
return rule;
}
use of org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException in project neo4j by neo4j.
the class PhysicalLogCommandReaderV3_0 method readSchemaRule.
private SchemaRule readSchemaRule(Collection<DynamicRecord> recordsBefore) {
// TODO: Why was this assertion here?
// assert first(recordsBefore).inUse() : "Asked to deserialize schema records that were not in
// use.";
SchemaRule rule;
ByteBuffer deserialized = AbstractDynamicStore.concatData(recordsBefore, new byte[100]);
try {
rule = SchemaRuleSerialization.deserialize(Iterables.first(recordsBefore).getId(), deserialized);
} catch (MalformedSchemaRuleException e) {
return null;
}
return rule;
}
Aggregations