Multi-Cluster support for yamsql & support not-registering the driver with FRL#4042
Multi-Cluster support for yamsql & support not-registering the driver with FRL#4042ScottDugas merged 25 commits intoFoundationDB:mainfrom
Conversation
It now will run all the test types, but non-0 clusters always go to the embedded or jdbc connection
This breaks backwards compatibility, but I don't think this is really intended to be a public interface
| * @throws SQLException if the index is out of range | ||
| */ | ||
| @Nonnull | ||
| public Entry<T> get(int clusterIndex) throws SQLException { |
There was a problem hiding this comment.
Would it make it easier to track if cluster would be identified by its file name rather than an index? Is there a method to the naming of the actual cluster files that would make tests easier to write when they actually are implemented?
There was a problem hiding this comment.
File names are developer/environment dependent. We could give them names via the framework, but that would probably just be names like cluster1, which doesn't really improve the situation over using 1.
The idea here is primarily to support different identical clusters, so the key is not that 0 means something, just that it is consistent within the file so that you can control whether you are accessing the same or different clusters.
| public static List<String> allClusterFilesInRandomOrder() { | ||
| final List<String> randomized = new ArrayList<>(clusterFiles); | ||
| Collections.shuffle(randomized); | ||
| return List.copyOf(randomized); |
There was a problem hiding this comment.
Is the copy necessary in this case? Can also return immutableList()
| @Nonnull | ||
| private Clusters<FRL> clusters = Clusters.empty(); | ||
|
|
||
| public EmbeddedConfig(@Nullable final String clusterFile) { |
There was a problem hiding this comment.
Given the current setup, can clusterFile really be null?
Fixing names, javadoc, nullability annotations, removing unused code, using identical super method.
This ends up being slightly less useful than maybe desired, because most of the things that Clusters holds are production classes, and I don't want to add a new interface there (and we're not writing swift code)
I also cleaned up a couple of the yaml test tests that were more complicated than they needed to be.
The primary purpose here is to support multi-cluster testing to yaml tests.
In order to support this, a new option was added to FRL to not-register the driver so that you can create multiple different FRL instances, pointing to different clusters.
This is part of the work for: #3823