use of org.neo4j.kernel.impl.store.NotCurrentStoreVersionException in project neo4j by neo4j.
the class IndexProviderStore method compareExpectedVersionWithStoreVersion.
private boolean compareExpectedVersionWithStoreVersion(long expectedVersion, boolean allowUpgrade, Long readIndexVersion) {
boolean versionDiffers = readIndexVersion == null || readIndexVersion.longValue() != expectedVersion;
if (versionDiffers) {
// with an older version than the store is.
if (readIndexVersion != null && expectedVersion < readIndexVersion.longValue()) {
String expected = versionLongToString(expectedVersion);
String readVersion = versionLongToString(readIndexVersion.longValue());
throw new NotCurrentStoreVersionException(expected, readVersion, "Your index has been upgraded to " + readVersion + " and cannot run with an older version " + expected, false);
} else if (!allowUpgrade) {
// We try to run with a newer version than the store is but isn't allowed to upgrade.
throw new UpgradeNotAllowedByConfigurationException();
}
}
return versionDiffers;
}
Aggregations