use of org.neo4j.backup.OnlineBackup in project neo4j by neo4j.
the class BackupLoad method doWorkOnMember.
@Override
protected void doWorkOnMember(boolean isCore, int id) {
SocketAddress address = backupAddress.apply(isCore, id);
File backupDirectory = new File(baseDirectory, Integer.toString(address.getPort()));
OnlineBackup backup;
try {
backup = OnlineBackup.from(address.getHostname(), address.getPort()).backup(backupDirectory);
} catch (RuntimeException e) {
if (isTransientError.test(e)) {
// if we could not connect, wait a bit and try again...
LockSupport.parkNanos(10_000_000);
return;
}
throw e;
}
if (!backup.isConsistent()) {
throw new RuntimeException("Not consistent backup from " + address);
}
}
use of org.neo4j.backup.OnlineBackup in project neo4j by neo4j.
the class RollingUpgradeIT method backup.
private void backup(int sourceServerId, File targetDir) throws UnknownHostException {
OnlineBackup backup = OnlineBackup.from(localhost(), backupPort(sourceServerId)).backup(targetDir.getPath());
assertTrue("Something wrong with the backup", backup.isConsistent());
}
Aggregations