@@ -35,8 +35,11 @@ public abstract class AssignerSettings {
35
35
36
36
abstract PartitionAssignmentServiceClient serviceClient ();
37
37
38
+ // Optional parameters.
39
+ abstract UUID uuid ();
40
+
38
41
public static Builder newBuilder () {
39
- return new AutoValue_AssignerSettings .Builder ();
42
+ return new AutoValue_AssignerSettings .Builder (). setUuid ( UUID . randomUUID ()) ;
40
43
}
41
44
42
45
@ AutoValue .Builder
@@ -48,15 +51,18 @@ public abstract static class Builder {
48
51
49
52
public abstract Builder setServiceClient (PartitionAssignmentServiceClient serviceClient );
50
53
54
+ // Optional parameters.
55
+ public abstract Builder setUuid (UUID uuid );
56
+
51
57
public abstract AssignerSettings build ();
52
58
}
53
59
54
60
public Assigner instantiate () {
55
- UUID uuid = UUID .randomUUID ();
56
61
ByteBuffer uuidBuffer = ByteBuffer .allocate (16 );
57
- uuidBuffer .putLong (uuid .getMostSignificantBits ());
58
- uuidBuffer .putLong (uuid .getLeastSignificantBits ());
59
- logger .atInfo ().log ("Subscription %s using UUID %s for assignment." , subscriptionPath (), uuid );
62
+ uuidBuffer .putLong (uuid ().getMostSignificantBits ());
63
+ uuidBuffer .putLong (uuid ().getLeastSignificantBits ());
64
+ logger .atInfo ().log (
65
+ "Subscription %s using UUID %s for assignment." , subscriptionPath (), uuid ());
60
66
61
67
InitialPartitionAssignmentRequest initial =
62
68
InitialPartitionAssignmentRequest .newBuilder ()
0 commit comments