diff options
| author | chrislu <chris.lu@gmail.com> | 2021-12-30 00:23:57 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2021-12-30 00:23:57 -0800 |
| commit | 5c87fcc6d28b230154db35cbe7735a5f1b84024f (patch) | |
| tree | accf7f2221083bb3aec27c5ba60b24570349b85d /other/java/client/src | |
| parent | fb434318e36ac8e78ab304bfd5421f110c10bdf1 (diff) | |
| download | seaweedfs-5c87fcc6d28b230154db35cbe7735a5f1b84024f.tar.xz seaweedfs-5c87fcc6d28b230154db35cbe7735a5f1b84024f.zip | |
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; |
