diff options
Diffstat (limited to 'other/java')
4 files changed, 12 insertions, 49 deletions
diff --git a/other/java/client/src/main/java/seaweedfs/client/FilerClient.java b/other/java/client/src/main/java/seaweedfs/client/FilerClient.java index dae7753a4..e70f6befa 100644 --- a/other/java/client/src/main/java/seaweedfs/client/FilerClient.java +++ b/other/java/client/src/main/java/seaweedfs/client/FilerClient.java @@ -72,10 +72,6 @@ public class FilerClient extends FilerGrpcClient { } return entry; } else { - String fileId = entry.getChunks(0).getFileId(); - if (fileId != null && fileId.length() != 0) { - return entry; - } FilerProto.Entry.Builder entryBuilder = entry.toBuilder(); entryBuilder.clearChunks(); long fileSize = 0; diff --git a/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java index 384636601..011462a17 100644 --- a/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java +++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java @@ -64,10 +64,11 @@ public class SeaweedRead { startOffset += gap; } - FilerProto.Locations locations = knownLocations.get(parseVolumeId(chunkView.fileId)); + String volumeId = parseVolumeId(chunkView.fileId); + FilerProto.Locations locations = knownLocations.get(volumeId); if (locations == null || locations.getLocationsCount() == 0) { LOG.error("failed to locate {}", chunkView.fileId); - // log here! + volumeIdCache.clearLocations(volumeId); return 0; } diff --git a/other/java/client/src/main/java/seaweedfs/client/VolumeIdCache.java b/other/java/client/src/main/java/seaweedfs/client/VolumeIdCache.java index fd2649cc2..86263fff9 100644 --- a/other/java/client/src/main/java/seaweedfs/client/VolumeIdCache.java +++ b/other/java/client/src/main/java/seaweedfs/client/VolumeIdCache.java @@ -26,6 +26,13 @@ public class VolumeIdCache { return this.cache.getIfPresent(volumeId); } + public void clearLocations(String volumeId) { + if (this.cache == null) { + return; + } + this.cache.invalidate(volumeId); + } + public void setLocations(String volumeId, FilerProto.Locations locations) { if (this.cache == null) { return; diff --git a/other/java/client/src/main/proto/filer.proto b/other/java/client/src/main/proto/filer.proto index 2da575733..bb461936c 100644 --- a/other/java/client/src/main/proto/filer.proto +++ b/other/java/client/src/main/proto/filer.proto @@ -305,6 +305,7 @@ message GetFilerConfigurationResponse { string metrics_address = 9; int32 metrics_interval_sec = 10; string version = 11; + string cluster_id = 12; } message SubscribeMetadataRequest { @@ -336,6 +337,7 @@ message KeepConnectedResponse { message LocateBrokerRequest { string resource = 1; } + message LocateBrokerResponse { bool found = 1; // if found, send the exact address @@ -386,49 +388,6 @@ message FilerConf { ///////////////////////// // Remote Storage related ///////////////////////// -message RemoteConf { - string type = 1; - string name = 2; - string s3_access_key = 4; - string s3_secret_key = 5; - string s3_region = 6; - string s3_endpoint = 7; - string s3_storage_class = 8; - bool s3_force_path_style = 9; - - string gcs_google_application_credentials = 10; - - string azure_account_name = 15; - string azure_account_key = 16; - - string backblaze_key_id = 20; - string backblaze_application_key = 21; - string backblaze_endpoint = 22; - - string aliyun_access_key = 25; - string aliyun_secret_key = 26; - string aliyun_endpoint = 27; - string aliyun_region = 28; - - string tencent_secret_id = 30; - string tencent_secret_key = 31; - string tencent_endpoint = 32; - - string baidu_access_key = 35; - string baidu_secret_key = 36; - string baidu_endpoint = 37; - string baidu_region = 38; - -} - -message RemoteStorageMapping { - map<string,RemoteStorageLocation> mappings = 1; -} -message RemoteStorageLocation { - string name = 1; - string bucket = 2; - string path = 3; -} message DownloadToLocalRequest { string directory = 1; string name = 2; |
