fluo
fluo copied to clipboard
FluoConfiguration should derive table name from application name if not set
FluoConfiguration requires the application name to be set. However, it does not require the table name to be set (defaults to "fluo"). Problems can occur if separate applications use the same table. The table name should be derived from the application name, if not explicitly set. Or, the table name should be required.
Additionally, the configuration should have more javadocs explaining what the application name is used for, and how it relates to the table name, and explaining the pitfalls of using the same table for different applications.
If table name was required, the application name could be automatically derived from the table name.
I think this was handled but would like to confirm. I think basically it was made so the table name is required. This is the call chain that makes me believe so:
https://github.com/apache/fluo/blob/01fc804f5914e6f9f2f4bfed8fc6e3e2701c16dd/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L264 calls this https://github.com/apache/fluo/blob/01fc804f5914e6f9f2f4bfed8fc6e3e2701c16dd/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L551-L553 calls this https://github.com/apache/fluo/blob/01fc804f5914e6f9f2f4bfed8fc6e3e2701c16dd/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1196-L1204 calls this https://github.com/apache/fluo/blob/01fc804f5914e6f9f2f4bfed8fc6e3e2701c16dd/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1184-L1189
This validation is also there: https://github.com/apache/fluo/blob/01fc804f5914e6f9f2f4bfed8fc6e3e2701c16dd/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1030-L1035
Hope this is helpful, thanks @ctubbsii !
@kpm1985 I think you're right. It looks like either "ACCUMULO_TABLE_PROP" or "ADMIN_ACCUMULO_TABLE_PROP" must be set. There is no default. It will use one of those two only. However, I can't find the commit which changed this behavior, and it looks like we still have some code which assumes it could be unset:
https://github.com/apache/fluo/blob/01fc804f5914e6f9f2f4bfed8fc6e3e2701c16dd/modules/mini/src/main/java/org/apache/fluo/mini/MiniFluoImpl.java#L123-L127