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

Implement BaseCompositePhysicalTable #242

Merged
merged 3 commits into from
Apr 14, 2017

Conversation

QubitPi
Copy link
Contributor

@QubitPi QubitPi commented Apr 14, 2017

screen shot 2017-04-14 at 10 38 14 am

PR #195 reveals a need to implement a common class between PartitionCompositeTable and MetricUnionCompositeTable.

@michael-mclawhorn
Copy link
Contributor

The changes seem fine. Rick and I discussed at some point whether or not we should take out the 'we'll calculate the grain for you' from the composite tables and replace it with only passing in an acceptable grain.

Copy link
Collaborator

@cdeszaq cdeszaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing too big

*/
public class BaseCompositePhysicalTable extends BasePhysicalTable {

private static final Logger LOG = LoggerFactory.getLogger(MetricUnionCompositeTable.class);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong logger

) {
super(
name,
IntervalUtils.getCoarsestTimeGrain(physicalTables).orElseThrow(() -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented before, just take in the grain, don't compute it. A param will need to be added, and the javadoc for physicalTables likely needs to be updated as well.

if (!physicalTables.stream()
.map(PhysicalTable::getSchema)
.map(PhysicalTableSchema::getTimeGrain)
.allMatch(grain -> grain.satisfiedBy(coarsestTimeGrain))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can switch to a method reference for the new satisfies method on grain: coarsestTimeGrain::satisfies

.map(PhysicalTableSchema::getTimeGrain)
.allMatch(grain -> grain.satisfiedBy(coarsestTimeGrain))) {
String message = String.format("There is no mutually satisfying grain among: %s for current table " +
"%s",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When wrapping, chop-wrap all parameters. That also means that the string doesn't need to be split either:

String message = String.format(
        "There is no mutually satisfying grain among: %s for current table %s",
        physicalTables,
        name.asName()
);

@cdeszaq cdeszaq merged commit b9529e9 into master Apr 14, 2017
@cdeszaq cdeszaq deleted the implement-BaseCompositePhysicalTable branch April 21, 2017 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants