@Override
 public Iterator<Property> relationshipGetAllProperties(StatementState state, long relationshipId)
     throws EntityNotFoundException {
   try {
     return loadAllPropertiesOf(relationshipStore.getRecord(relationshipId));
   } catch (InvalidRecordException e) {
     throw new EntityNotFoundException(EntityType.RELATIONSHIP, relationshipId, e);
   }
 }
    private void migrateRelationships(
        RelationshipStore relationshipStore, PropertyWriter propertyWriter) throws IOException {
      long nodeMaxId = legacyStore.getNodeStoreReader().getMaxId();

      Iterable<RelationshipRecord> records =
          legacyStore.getRelationshipStoreReader().readRelationshipStore();
      for (RelationshipRecord relationshipRecord : records) {
        reportProgress(nodeMaxId + relationshipRecord.getId());
        relationshipStore.setHighId(relationshipRecord.getId() + 1);
        if (relationshipRecord.inUse()) {
          long startOfPropertyChain = relationshipRecord.getNextProp();
          if (startOfPropertyChain != Record.NO_NEXT_RELATIONSHIP.intValue()) {
            long propertyRecordId = migrateProperties(startOfPropertyChain, propertyWriter);
            relationshipRecord.setNextProp(propertyRecordId);
          }
          relationshipStore.updateRecord(relationshipRecord);
        } else {
          relationshipStore.freeId(relationshipRecord.getId());
        }
      }
      legacyStore.getRelationshipStoreReader().close();
    }
示例#3
0
 @Override
 public boolean relationshipExists(long relationshipId) {
   return relationshipStore.inUse(relationshipId);
 }