Skip to content

DRILL-6053 & DRILL-6237#1163

Closed
vrozov wants to merge 2 commits intoapache:masterfrom
vrozov:DRILL-6237
Closed

DRILL-6053 & DRILL-6237#1163
vrozov wants to merge 2 commits intoapache:masterfrom
vrozov:DRILL-6237

Conversation

@vrozov
Copy link
Copy Markdown
Member

@vrozov vrozov commented Mar 13, 2018

  • Avoid excessive locking in LocalPersistentStore
  • Upgrade checkstyle version to 5.9 or above

@arina-ielchiieva Please review

Copy link
Copy Markdown
Member

@arina-ielchiieva arina-ielchiieva left a comment

Choose a reason for hiding this comment

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

Vlad, I really like the changes, thanks for making them.
Please address some minor points though.

import java.util.Map;

public interface Store<V> extends AutoCloseable
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please move to upper line.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will do. What is the reason it is not handled by checkstyle?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, we definitely need to improve Drill checkstyle. Tim used to bring up this topic on dev mailing list. For instance, there are many things we need to check, like javadocs for headers etc.

import org.apache.drill.exec.store.sys.store.DataChangeVersion;

public interface VersionedPersistentStore<V> extends Store<V>
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please move to upper line.


@Override
public PersistentStoreMode getMode()
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please move to the upper line.

*/
public class AutoCloseables {

public interface Closeable extends AutoCloseable {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure about benefit of this change... Could you please explain.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The change allows avoiding catch in try-with-resources when close() does not throw an exception.

Copy link
Copy Markdown
Member

@arina-ielchiieva arina-ielchiieva Mar 14, 2018

Choose a reason for hiding this comment

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

But java has already Closeable interface, that's confusing to have custom one with the same name.

Copy link
Copy Markdown
Member Author

@vrozov vrozov Mar 14, 2018

Choose a reason for hiding this comment

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

It is intentional:

  • There is a minimal difference between Drill Closeable and Java 'Closeable/AutoCloseable`, so name reflects that.
  • It won't be possible to use Drill Closeable in place of Java Closeable/AutoCloseable in case close() throws checked exception.
  • Drill Closeable is not a top level interface, so where it is necessary to distinguish Drill Closeable from Java Closeable full name AutoClosables.Closeable should be used.

*/
<V> PersistentStore<V> getOrCreateStore(PersistentStoreConfig<V> config) throws StoreException;

default <V> VersionedPersistentStore<V> getOrCreateVersionedStore(PersistentStoreConfig<V> config) throws StoreException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add javadoc here and in newly created classes as well.

pom.xml Outdated
<artifactId>checkstyle</artifactId>
<version>5.9</version>
</dependency>
</dependencies> <configuration>
Copy link
Copy Markdown
Member

@arina-ielchiieva arina-ielchiieva Mar 14, 2018

Choose a reason for hiding this comment

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

  1. Please move configuration to the next line.
  2. You indicated that we upgrade dependency but in fact we add new?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. thanks for catching
  2. each version of maven-checkstyle-plugin is preconfigured with a specific version of checkstyle (2.12.1 uses 5.7) that can be overridden by specifying that dependency explicitly.

@arina-ielchiieva
Copy link
Copy Markdown
Member

arina-ielchiieva commented Mar 21, 2018

@vrozov, please address code review comments so we can merge the chnages.

@vrozov
Copy link
Copy Markdown
Member Author

vrozov commented Mar 22, 2018

@arina-ielchiieva Addressed review comments. Please keep both commits (do not squash) during the merge.

@arina-ielchiieva
Copy link
Copy Markdown
Member

+1

vdiravka pushed a commit to vdiravka/drill that referenced this pull request Mar 24, 2018
vdiravka pushed a commit to vdiravka/drill that referenced this pull request Mar 24, 2018
vdiravka pushed a commit to vdiravka/drill that referenced this pull request Mar 24, 2018
@asfgit asfgit closed this in 9327ca6 Mar 26, 2018
@vrozov vrozov deleted the DRILL-6237 branch March 26, 2018 17:04
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.

2 participants