-
Notifications
You must be signed in to change notification settings - Fork 96
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
Config slurper master #191
Config slurper master #191
Conversation
autoformatting the groovy file changed the expected string
Wiki enums are now only used in testing
…d imports stopped modifying string cases (camel/lowercase) for metrics
*/ | ||
public class GenericBinder { | ||
private static GenericBinder genericBinder; | ||
private DruidWebService druidWebService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class has no longer has unused private fields
public static final int DEFAULT_KILOBYTES_PER_SKETCH = 16; | ||
public static final int DEFAULT_SKETCH_SIZE_IN_BYTES = DEFAULT_KILOBYTES_PER_SKETCH * BYTES_PER_KILOBYTE; | ||
private static final Logger LOG = LoggerFactory.getLogger(GenericMetricLoader.class); | ||
final int sketchSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied directly from WikiMetricLoader so same issue would apply there
|
||
private final SystemConfig systemConfig = SystemConfigProvider.getInstance(); | ||
|
||
private final String defaultDimensionBackendKey = systemConfig.getPackageVariableName("dimension_backend"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also copied directly from WikiDimensions
|
||
public static FiliMetricName getFiliMetricName(String name) { | ||
if (defaultTimeGrain == null) { | ||
throw new RuntimeException("Default time grain must be specified if no time grains are given"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generally an OK warning to ignore
GenericMain is not working when actually running in front of druid.
…' into configSlurperDevelopment
* @param args command line arguments | ||
* @throws Exception if the server fails to start or crashes | ||
*/ | ||
public static void main(String[] args) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Created by kevin on 3/3/2017. | ||
*/ | ||
public interface ConfigLoader { | ||
public List<? extends DruidConfig> getTableNames(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer that these get removed?
* Created by kevin on 3/3/2017. | ||
*/ | ||
public interface ConfigLoader { | ||
public List<? extends DruidConfig> getTableNames(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, in general comments on classes are a good idea, and necessary on interfaces.
However, I'm not sure I understand the connection between this interface and it's name. Further, there's already a class ConfigurationLoader, which I think this interface could easily be confused with.
Also, this interface appears to be a single method function. It's possible rather than have this be an explicit interface, you could instead make anything that is currently implementing it instead to implement:
Supplier<List<? extends DruidConfig>>
https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html
…ong/fili into configSlurperMaster
…' into configSlurperDevelopment Merge upstream changes and fix tests
Config slurper development
* | ||
* @param table The TableConfig to be loaded with queries against druid. | ||
*/ | ||
private void loadTable(TableConfig table) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should have javadoc comments showing example json being parsed
Add expected druid responses to druid navigator
…SlurperMaster # Conflicts: # fili-core/src/main/java/com/yahoo/bard/webservice/util/IntervalUtils.java # fili-core/src/test/groovy/com/yahoo/bard/webservice/util/IntervalUtilsSpec.groovy
<version>0.8-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>fili-generic-example</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I change the the name fili-generic-example
?
</execution> | ||
</executions> | ||
<configuration> | ||
<mainClass>com.yahoo.wiki.webservice.application.GenericMain</mainClass> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor .wiki
…SlurperMaster # Conflicts: # fili-core/src/main/java/com/yahoo/bard/webservice/util/IntervalUtils.java # fili-core/src/test/groovy/com/yahoo/bard/webservice/util/IntervalUtilsSpec.groovy
String url = COORDINATOR_TABLES_PATH + table.getName() + "/?full"; | ||
queryDruid(rootNode -> { | ||
JsonNode segments = rootNode.get("segments").get(0); | ||
loadMetrics(table, segments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a note in class comments that the schema of the first segment is for configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NPE will be thrown if the segment list is empty. Perhaps we should catch and rethrow with a better error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* @param metricDictionary Metric dictionary to use for generating the metric makers. | ||
*/ | ||
protected void buildMetricMakers(MetricDictionary metricDictionary) { | ||
// Create the various metric makers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it's a big issue, but why is this implemented this way rather than having an initialize-once pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want something like this?
if (doubleSumMaker == null) {
doubleSumMaker = new DoubleSumMaker(metricDictionary);
}
}); | ||
|
||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra vertical whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…' into configSlurperDevelopment
…' into configSlurperDevelopment
Config slurper development
Update for upstream changes
Merged in #251 Thx for the hard work! 🎉 |
The config slurper allows fili to be set up in front of any instance of druid and probe druid to build metrics, dimensions, and tables.