cshannon opened a new pull request, #4204: URL: https://github.com/apache/accumulo/pull/4204
This updates FATE to support creating a transaction by a key which will be hashed to a transaction id. This can be used to guarantee only one transaction exists at the same time if the key is the same. Currently the key is just a byte array so anything can be used for the key. I marked this as a draft PR for now to get some feedback as some changes are probably needed, in particular maybe changing the key from a byte array to something more strongly typed (see below) I added a few store tests but some tests are missing such as testing the collision detection. (Probably will require manually modifying some things in the store or ZK to simulate a collision or googling the algorithm to find two keys that cause a collision). For now the key is just a byte array to keep things simple but we can change it. The goal is to have unique fate operations a byte array is the most flexible as we can put anything into it. For example, if we wanted to create a key for a split operation for an extent we could serialize the operation name (ie split) and append it to the serialized KeyExtent. In the tests for now I'm only serializing the KeyExtent. We could create some utility methods to help with the serialization and deserialization. However, we could also make the API more strongly typed and instead of a byte array as the key would create a new interface or class (maybe call it `FateKey`) and that could then contain an operation name and a KeyExtent and then handle the serialization. This could be nice as it would match up with the new `FateId` being created in #4191 but the downside is if we want different key types in the future it's not as flexible and we'd need to change or extend the API. If we just use an interface and had different key implementations it might be ok as we could add new key types in the future without changing the API. This closes #4183 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
