Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluoConfiguration should derive table name from application name if not set #631

Open
ctubbsii opened this issue Mar 30, 2016 · 3 comments

Comments

@ctubbsii
Copy link
Member

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.

@ctubbsii
Copy link
Member Author

If table name was required, the application name could be automatically derived from the table name.

@kennethmcfarland
Copy link
Contributor

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:


calls this
public String getAccumuloTable() {
return getDepNonEmptyString(ACCUMULO_TABLE_PROP, ADMIN_ACCUMULO_TABLE_PROP);
}

calls this
private String getDepNonEmptyString(String property, String depProperty) {
if (containsKey(property)) {
return getNonEmptyString(property);
} else if (containsKey(depProperty)) {
return getNonEmptyString(depProperty);
} else {
throw new NoSuchElementException(property + " is not set!");
}
}

calls this
private String getNonEmptyString(String property) {
String value = getString(property);
Objects.requireNonNull(value, property + " cannot be null");
Preconditions.checkArgument(!value.isEmpty(), property + " cannot be empty");
return value;
}

This validation is also there:

public boolean hasRequiredAdminProps() {
boolean valid = true;
valid &= hasRequiredClientProps();
valid &= verifyStringPropSet(ACCUMULO_TABLE_PROP, ADMIN_ACCUMULO_TABLE_PROP);
return valid;
}

Hope this is helpful, thanks @ctubbsii !

@ctubbsii
Copy link
Member Author

ctubbsii commented Jun 19, 2018

@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:

// configuration that only needs to be set if not by user
if ((config.containsKey(FluoConfiguration.ACCUMULO_TABLE_PROP) == false)
|| config.getAccumuloTable().trim().isEmpty()) {
config.setAccumuloTable("fluo");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants