mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
fixes
This commit is contained in:
@@ -268,7 +268,7 @@ public class DhfsFuse extends FuseStubFS {
|
||||
try {
|
||||
found = fileService.readDir(path);
|
||||
} catch (StatusRuntimeException e) {
|
||||
if (e.getStatus().equals(Status.NOT_FOUND))
|
||||
if (e.getStatus().getCode().equals(Status.NOT_FOUND.getCode()))
|
||||
return -ErrorCodes.ENOENT();
|
||||
else throw e;
|
||||
}
|
||||
|
||||
@@ -129,8 +129,9 @@ public class JObjectManagerImpl implements JObjectManager {
|
||||
try {
|
||||
readMd = objectPersistentStore.readObject("meta_" + name);
|
||||
} catch (StatusRuntimeException ex) {
|
||||
if (!ex.getStatus().equals(Status.NOT_FOUND)) throw ex;
|
||||
return Optional.empty();
|
||||
if (ex.getStatus().getCode().equals(Status.NOT_FOUND.getCode()))
|
||||
return Optional.empty();
|
||||
throw ex;
|
||||
}
|
||||
var meta = SerializationHelper.deserialize(readMd);
|
||||
if (!(meta instanceof ObjectMetadata))
|
||||
|
||||
@@ -4,10 +4,11 @@ import com.google.protobuf.ByteString;
|
||||
import com.usatiuk.dhfs.objects.repository.distributed.*;
|
||||
import com.usatiuk.dhfs.storage.objects.jrepository.JObject;
|
||||
import com.usatiuk.dhfs.storage.objects.jrepository.JObjectManager;
|
||||
import io.grpc.Status;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
import io.quarkus.logging.Log;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
@@ -57,7 +58,7 @@ public class RemoteObjectServiceClient {
|
||||
|
||||
if (outdated) {
|
||||
Log.error("Race when trying to fetch");
|
||||
throw new NotImplementedException();
|
||||
throw new StatusRuntimeException(Status.ABORTED.withDescription("Race when trying to fetch"));
|
||||
}
|
||||
return reply.getObject().getContent();
|
||||
});
|
||||
|
||||
@@ -40,9 +40,9 @@ public class RpcClientFactory {
|
||||
try {
|
||||
return withObjSyncClient(hostinfo.getAddr(), hostinfo.getPort(), Optional.empty(), fn);
|
||||
} catch (StatusRuntimeException e) {
|
||||
if (e.getStatus().equals(Status.ABORTED)) {
|
||||
if (e.getStatus().getCode().equals(Status.ABORTED.getCode())) {
|
||||
continue;
|
||||
} else if (e.getStatus().equals(Status.UNAVAILABLE)) {
|
||||
} else if (e.getStatus().getCode().equals(Status.UNAVAILABLE.getCode())) {
|
||||
Log.info("Host " + target + " is unreachable: " + e.getMessage());
|
||||
remoteHostManager.handleConnectionError(target);
|
||||
} else throw e;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DhfsFuseIT {
|
||||
.copy("/app", "/app")
|
||||
.cmd("java", "-Xmx128M", "--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED",
|
||||
"-Ddhfs.objects.distributed.peerdiscovery.interval=100",
|
||||
"-Ddhfs.objects.distributed.invalidation.delay=300", "-jar", "/app/quarkus-run.jar")
|
||||
"-Ddhfs.objects.distributed.invalidation.delay=100", "-jar", "/app/quarkus-run.jar")
|
||||
.build())
|
||||
.withFileFromPath("/app", Paths.get(buildPath, "quarkus-app"));
|
||||
container1 = new GenericContainer<>(image)
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DhfsFusex3IT {
|
||||
.copy("/app", "/app")
|
||||
.cmd("java", "-Xmx128M", "--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED",
|
||||
"-Ddhfs.objects.distributed.peerdiscovery.interval=100",
|
||||
"-Ddhfs.objects.distributed.invalidation.delay=300", "-jar", "/app/quarkus-run.jar")
|
||||
"-Ddhfs.objects.distributed.invalidation.delay=100", "-jar", "/app/quarkus-run.jar")
|
||||
.build())
|
||||
.withFileFromPath("/app", Paths.get(buildPath, "quarkus-app"));
|
||||
container1 = new GenericContainer<>(image)
|
||||
|
||||
Reference in New Issue
Block a user