Titan から頂点を削除すると、一貫性のない読み取り動作が発生します。Cassandra を実行している単一のマシンでこれをテストしています。これが私の conf.properties です。
storage.backend=cassandra
storage.hostname=localhost
storage.cassandra.keyspace=test
次のメソッドは、適切な頂点を削除します。
public void deleteProfile(String uuid, String puuid) {
for(Person person : this.graph.getVertices("uuid", uuid, Person.class)) {
if (person != null) {
for (Profile profile : this.graph.getVertices("uuid", puuid, Profile.class)) {
person.removeProfile(profile);
graph.removeVertex(profile.asVertex());
}
}
}
this.graph.getBaseGraph().commit();
}
次のメソッドが呼び出されると、2 つの異なる結果セットが返されます。
public Iterable<ProfileImpl> getProfiles(String uuid) {
List<ProfileImpl> profiles = new ArrayList<>();
for(Person person : this.graph.getVertices("uuid", uuid, Person.class)) {
if (person != null) {
for (Profile profile : person.getProfiles()) {
profiles.add(profile.toImpl());
}
}
}
return profiles;
}
1 つの結果は期待どおりで、削除されたプロファイルは含まれません。ただし、十分な回数実行すると、削除されたプロファイルが1つ追加されることがあります。
同じ頂点を再度削除しようとすると、その「uuid」を持つ頂点が存在しないことが示され、反復子の hasNext() は false を返します。
ただし、プログラムを再起動すると、削除された頂点は返されません。この一貫性のない動作を修正するにはどうすればよいですか?