Skip to content

Conversation

NathanSpeidel
Copy link
Member

No description provided.

@akshaisarma akshaisarma changed the title Add int support Pluggable BulletRecord Jun 13, 2018
@coveralls
Copy link

coveralls commented Jun 14, 2018

Coverage Status

Coverage increased (+0.001%) to 99.62% when pulling c193f82 on NathanSpeidel:add-int-support into f045708 on bullet-db:master.

public BulletConfig(String file) {
super(file, DEFAULT_CONFIGURATION_NAME);
VALIDATOR.validate(this);
bulletRecordProvider = BulletRecordProvider.from((String) get(RECORD_PROVIDER_CLASS_NAME));
Copy link
Contributor

Choose a reason for hiding this comment

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

use getAs?

Copy link
Member Author

Choose a reason for hiding this comment

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

What getAs?

Copy link
Contributor

Choose a reason for hiding this comment

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

public BulletConfig() {
super(DEFAULT_CONFIGURATION_NAME);
VALIDATOR.validate(this);
bulletRecordProvider = BulletRecordProvider.from((String) get(RECORD_PROVIDER_CLASS_NAME));
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Member

@akshaisarma akshaisarma left a comment

Choose a reason for hiding this comment

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

For all instance variables, can we s/bulletRecordProvider/recordProvider or even provider?

sketch = threshold != null ? new FrequentItemsSketch(errorType, maxMapSize, threshold.longValue(), size) :
new FrequentItemsSketch(errorType, maxMapSize, size);
sketch = threshold != null ? new FrequentItemsSketch(errorType, maxMapSize, threshold.longValue(), size, config.getBulletRecordProvider()) :
new FrequentItemsSketch(errorType, maxMapSize, size, config.getBulletRecordProvider());
Copy link
Member

Choose a reason for hiding this comment

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

You can store a reference to the record provider above before the ternary since that seems to the be convention here

return new QuantileSketch(64, 6, Distribution.Type.QUANTILE, 10, bulletRecordProvider);
}

private BulletRecordProvider bulletRecordProvider;
Copy link
Member

Choose a reason for hiding this comment

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

Move this to before the methods


@BeforeMethod
private void setup() {
bulletRecordProvider = new BulletConfig().getBulletRecordProvider();
Copy link
Member

Choose a reason for hiding this comment

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

We don't need a before method. Just use a static variable. Ditto for other test files

bullet.pubsub.class.name: "com.yahoo.bullet.pubsub.MockPubSub"
bullet.pubsub.class.name: "com.yahoo.bullet.pubsub.MockPubSub"
bullet.pubsub.rest.connect.timeout.ms: 88
bullet.record.provider.class.name: "com.yahoo.bullet.record.AvroBulletRecordProvider"
Copy link
Member

Choose a reason for hiding this comment

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

The default should be enough no?

@akshaisarma akshaisarma merged commit 77b34bc into bullet-db:master Jun 18, 2018
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

Successfully merging this pull request may close these issues.

4 participants