예제 #1
0
 @Override
 public Map<String, Object> getRelationshipProperties(long relId) {
   RelationshipRecord record = getRelationshipRecord(relId);
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     return getPropertyChain(record.getNextProp());
   }
   return Collections.emptyMap();
 }
예제 #2
0
 @Override
 public Map<String, Object> getRelationshipProperties(long relId) {
   RelationshipRecord record =
       recordAccess.getRelRecords().getOrLoad(relId, null).forChangingData();
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     return getPropertyChain(record.getNextProp());
   }
   return Collections.emptyMap();
 }
예제 #3
0
 @Override
 public void setRelationshipProperties(long rel, Map<String, Object> properties) {
   RelationshipRecord record = getRelationshipRecord(rel);
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     deletePropertyChain(record.getNextProp());
     /*
      * See setNodeProperties above for an explanation of what goes on
      * here
      */
     record.setNextProp(Record.NO_NEXT_PROPERTY.intValue());
     getRelationshipStore().updateRecord(record);
   }
   record.setNextProp(createPropertyChain(properties));
   getRelationshipStore().updateRecord(record);
 }
예제 #4
0
 @Override
 public void setRelationshipProperties(long rel, Map<String, Object> properties) {
   RelationshipRecord record = recordAccess.getRelRecords().getOrLoad(rel, null).forChangingData();
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     propertyDeletor.getAndDeletePropertyChain(record, recordAccess.getPropertyRecords());
   }
   record.setNextProp(
       propertyCreator.createPropertyChain(
           record, propertiesIterator(properties), recordAccess.getPropertyRecords()));
   recordAccess.commit();
 }
    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();
    }