diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2022-01-02 01:11:27 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-02 01:11:27 -0800 |
| commit | 077f831749e6bbf12ff52fd369b493e4dd751817 (patch) | |
| tree | 81912d857c0dcc0dba64661aa8f06ba81e68a40a /other/java/client/src | |
| parent | 9b941773805400c520558d83aed633adc821988c (diff) | |
| parent | 42c849e0df74610d38453db67670db715ceb80aa (diff) | |
| download | seaweedfs-077f831749e6bbf12ff52fd369b493e4dd751817.tar.xz seaweedfs-077f831749e6bbf12ff52fd369b493e4dd751817.zip | |
Merge pull request #2550 from chrislusf/metadata_follow_with_client_id
add client id for all metadata listening clients
Diffstat (limited to 'other/java/client/src')
3 files changed, 5 insertions, 0 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 84ee66e7d..10d263968 100644 --- a/other/java/client/src/main/java/seaweedfs/client/FilerClient.java +++ b/other/java/client/src/main/java/seaweedfs/client/FilerClient.java @@ -368,6 +368,7 @@ public class FilerClient extends FilerGrpcClient { .setPathPrefix(prefix) .setClientName(clientName) .setSinceNs(sinceNs) + .setClientId(this.randomClientId) .build() ); } diff --git a/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java b/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java index 54e7ccb68..0a2e6332e 100644 --- a/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java +++ b/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java @@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory; import javax.net.ssl.SSLException; import java.util.HashMap; import java.util.Map; +import java.util.Random; import java.util.concurrent.TimeUnit; public class FilerGrpcClient { @@ -30,6 +31,7 @@ public class FilerGrpcClient { public final int VOLUME_SERVER_ACCESS_PUBLIC_URL = 1; public final int VOLUME_SERVER_ACCESS_FILER_PROXY = 2; public final Map<String, FilerProto.Locations> vidLocations = new HashMap<>(); + protected int randomClientId; private final ManagedChannel channel; private final SeaweedFilerGrpc.SeaweedFilerBlockingStub blockingStub; private final SeaweedFilerGrpc.SeaweedFilerStub asyncStub; @@ -62,6 +64,7 @@ public class FilerGrpcClient { cipher = filerConfigurationResponse.getCipher(); collection = filerConfigurationResponse.getCollection(); replication = filerConfigurationResponse.getReplication(); + randomClientId = new Random().nextInt(); } diff --git a/other/java/client/src/main/proto/filer.proto b/other/java/client/src/main/proto/filer.proto index ba5c1c694..3303dc444 100644 --- a/other/java/client/src/main/proto/filer.proto +++ b/other/java/client/src/main/proto/filer.proto @@ -329,6 +329,7 @@ message SubscribeMetadataRequest { int64 since_ns = 3; int32 signature = 4; repeated string path_prefixes = 6; + int32 client_id = 7; } message SubscribeMetadataResponse { string directory = 1; |
