Skip to content

Clarify Accumulo API#28

Closed
keith-turner wants to merge 3 commits intoapache:masterfrom
keith-turner:api-cleanup
Closed

Clarify Accumulo API#28
keith-turner wants to merge 3 commits intoapache:masterfrom
keith-turner:api-cleanup

Conversation

@keith-turner
Copy link
Contributor

This pull request attempts to clarify what the Accumulo API is. The existing API statement does not include all types that a user would realistically need to use. A new API statement is proposed in 2f7d095.

This pull request also prunes (via deprecation) things from the API that were not intended to be in the API, but ended up there. For example parts of the API that referenced non API types and as a result may not be stable were deprecated.

I am requesting this review on GH instead of ReviewBoard because I thought it would be much easier to review the commits in this PR individually rather than squasing them for RB. For example the commit that deprecated and moved KeyExtent was very noisy and would make reviewing other changes difficult.

One thing that I was not able to deprecate move was o.a.a.c.security.crypto. I would have liked to have moved this to o.a.a.c.crypto. Its not really client API code, its more server side extension code. However the class names are possibly referenced by user config. Also users may have extended the classes. I added an exception for the package in the README's API stmt. Does anyone have any ideas about making this less confusing w/o causing existing users any pain.

@asfbot
Copy link

asfbot commented Apr 14, 2015

Accumulo-Pull-Requests #39 FAILURE
Looks like there's a problem with this pull request

@keith-turner
Copy link
Contributor Author

@ctubbsii I meant to do something about secrutiy.Credentials in this change, but forgot. I was thinking of moving it to another package so that it would not be in public API. I don't think its using any public API methods. Need to do something about it because it will end up in public API.

@asfbot
Copy link

asfbot commented Apr 15, 2015

Accumulo-Pull-Requests #40 FAILURE
Looks like there's a problem with this pull request

@asfbot
Copy link

asfbot commented Apr 15, 2015

Accumulo-Pull-Requests #41 SUCCESS
This pull request looks good

@ctubbsii
Copy link
Member

@keith-turner Moving it to another package makes sense to me. It's not intended to be public API.

@asfbot
Copy link

asfbot commented Apr 15, 2015

Accumulo-Pull-Requests #42 SUCCESS
This pull request looks good

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't say that I love the name "TabletID". Maybe TableRowRange?

Copy link
Member

Choose a reason for hiding this comment

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

Interface and methods need javadoc.

Not a fan of TabletID either, but it does make sense (it uniquely identifies a Tablet). TabletIdentifier? I dunno.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really like TabletID or TableRowRange that much. Personally I would prefer TabletID because its shorter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to hear more suggestions.

@ericnewton
Copy link
Contributor

Pull looks good. Thanks for putting in the tedious work to clarify the API.

Copy link
Member

Choose a reason for hiding this comment

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

Can this be clarified to include package-protected as that's what we've been going on to date?

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't think package-protected had been included to date. has it?

Copy link
Member

Choose a reason for hiding this comment

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

I thought you were the one who argued that package-protected still allows users to access the class/methods/whatever. Maybe I'm misremembering things? Anything not private == fair-game is the assumption I've been operating under at least.

Copy link
Contributor

Choose a reason for hiding this comment

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

If I did then past-me was wrong. :)

package-protected stuff (meaning java members with no access modifier, just to make sure we're on the same page) is only accessible if downstream folks make classes in our package space. IMHO that's a party foul and folks should expect such activity to be unsupported by us.

Copy link
Member

Choose a reason for hiding this comment

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

Haha, yeah, I remember having that same reaction of "really?", but who knows. It wouldn't be the first weird thing I dreamed up. Since you guys took the time to clarify this, let's try to make this as bullet-proof as possible. Sounds like package-protected should be mentioned with private as being inaccessible.

Copy link
Member

Choose a reason for hiding this comment

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

The only potential drawback I can think of is making the stmt so long that no one reads its

I think this is one time where it benefits us to be as specific as possible (see how often we had these "oops" moments already, and that Sean and I didn't know which was correct).

I have heard @ctubbsii mention that we build sealed jars that would prevent users from doing this.

Sealed jars are only relevant if the user downloads binary artifacts from us, not from users building the code themselves, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sealed jars are only relevant if the user downloads binary artifacts from us

I have no idea. If someone is using Accumulo's maven pom to build, I am not sure under what circumstances it seals. Someone could create jars w/o using the pom I suppose.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't think we sealed the jars by default but instead during the apache-release profile. I could be mistaken though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d7ffec1

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, Keith. Also, sorry all for confusion in using the wrong terminology. For some reason I kept thinking package-private was called package-protected.

@joshelser
Copy link
Member

Overall this looks pretty good, but needs a little bit of touch up still. Nice work Keith and Christopher, this took some doing. Some general thoughts:

  • DelegationToken move is awkward to me. I think this should be in public API and we just hide the impl details.
  • Regarding what to do with the crypto package, can we get @ohshazbot attention maybe? Perhaps he can help give some insight. I think it was designed to be extendable by users (CryptoModule and SecretKeyEncryptionStrategy), but there seems to be a lot of other stuff in there that shouldn't be (or be in an impl). Maybe we can get this figured out for 1.7.0 so we can start the deprecation cycle to remove the bits which shouldn't be there?

@madrob
Copy link
Contributor

madrob commented Apr 17, 2015

Regarding what to do with the crypto package, can we get @ohshazbot attention maybe? Perhaps he can help give some insight. I think it was designed to be extendable by users (CryptoModule and SecretKeyEncryptionStrategy), but there seems to be a lot of other stuff in there that shouldn't be (or be in an impl). Maybe we can get this figured out for 1.7.0 so we can start the deprecation cycle to remove the bits which shouldn't be there?

I know of somebody working with the crypto stuff, I'll reach out and make sure this gets noticed.

@asfbot
Copy link

asfbot commented Apr 17, 2015

Accumulo-Pull-Requests #44 FAILURE
Looks like there's a problem with this pull request

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in 2f5e415. How does that look? Javadoc look good?

The fix looks great. I don't think we need since or quite as verbose a javadoc here since it's already contained (and better worded) in the DelegationToken interface

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 9d5a6f5

@asfbot
Copy link

asfbot commented Apr 17, 2015

Accumulo-Pull-Requests #45 FAILURE
Looks like there's a problem with this pull request

@asfbot
Copy link

asfbot commented Apr 17, 2015

Accumulo-Pull-Requests #46 FAILURE
Looks like there's a problem with this pull request

@asfbot
Copy link

asfbot commented Apr 17, 2015

Accumulo-Pull-Requests #50 SUCCESS
This pull request looks good

@ctubbsii
Copy link
Member

@joshelser Regarding what to do about the crypto package... that stuff is still marked as experimental, and some of it is still incomplete for full on-disk encryption (ACCUMULO-981), so whatever we do, I think for now, it should not be moved into the public API, because it may require unstable API changes to finish that work.

@ctubbsii
Copy link
Member

If we do move it to the public API, it would need to be accompanied with a Beta annotation or something similar.

@joshelser
Copy link
Member

that stuff is still marked as experimental

That is a very good point. Putting something marked as experimental into public API would be precedent setting. I would agree with you that it should not be added until it is actually capable of performing complete encryption of Accumulo data.

@keith-turner
Copy link
Contributor Author

that stuff is still marked as experimental,

That is a good point. I will wait and see if there are any other comments on this. Moving it and removing the exception from the README would be nice.

@asfbot
Copy link

asfbot commented Apr 17, 2015

Accumulo-Pull-Requests #53 SUCCESS
This pull request looks good

@joshelser
Copy link
Member

Said it in irc, but, for the record, I'm +1 with these changes + no crypto stuff in public API.

@ctubbsii
Copy link
Member

I'm +1 with these changes

Also +1

  • no crypto stuff in public API.

Same, at least for now, until it's 100% feature complete and no longer experimental, because until that time, we can't really make strong API guarantees about it. I also don't see the sense in moving it, because it'd unnecessarily disrupt those taking advantage of it today as an experimental feature.

Use plugin to check for API problems
The following changes were made.

 * Fix API problems with IsolatedScanner
 * Deprecated public inner class in ClientSiderIteratorScanner that was not intended to be in public API
 * ACCUMULO-3488 Deprecated KeyExtent from public API
 * Deprecated use of Property in ClientConfiguration
 * deprecated ZooKeeperInstance.lookupIntanceName(ZooCache, UUID)
 * deprecated IteratorUtil.getProperty(IteratorScope)
 * deprecated class ComparableBytes
 * ACCUMULO-3724 moved DelegationToken and AuthenticationTokenIdentifier out of public API
 * deprecated getTabletLocator() in both AbstractInputFormat classes
 * deprecated getAccumuloConfiguration() in both AccumuloFileOutputFormat classes
 * deperecated and moved VisibilityConstraint
 * updated README to accurately communicate Accumulo's API.  Update APILyzer config to enforce ACCUMULO-3720
 * moved Credentials from core.security to core.client.impl
@keith-turner
Copy link
Contributor Author

I rebased on master and squished most of the commits. After rebasing on master, APILyzer found some new problems.

  FIELD                org.apache.accumulo.core.client.mapred.AbstractInputFormat$AbstractRecordReader split                               org.apache.accumulo.core.client.mapreduce.impl.AccumuloInputSplit
  METHOD_PARAM         org.apache.accumulo.core.client.mapred.RangeInputSplit       updateSplit(...)                    org.apache.accumulo.core.client.mapreduce.impl.AccumuloInputSplit
  FIELD                org.apache.accumulo.core.client.mapreduce.AbstractInputFormat$AbstractRecordReader split                               org.apache.accumulo.core.client.mapreduce.impl.AccumuloInputSplit
  METHOD_PARAM         org.apache.accumulo.core.client.mapreduce.RangeInputSplit    updateSplit(...)                    org.apache.accumulo.core.client.mapreduce.impl.AccumuloInputSplit

@asfbot
Copy link

asfbot commented Apr 17, 2015

Accumulo-Pull-Requests #55 FAILURE
Looks like there's a problem with this pull request

@asfbot
Copy link

asfbot commented Apr 21, 2015

Accumulo-Pull-Requests #62 SUCCESS
This pull request looks good

@joshelser
Copy link
Member

Newest changes look ok too. A few are a little confusing (notably (re)introducing protected RangeInputSplitsplit), but I assume that they were potentially visible before.

Also, do we want all the members on AccumuloInputSplit to be private and not package-private?

@keith-turner
Copy link
Contributor Author

Also, do we want all the members on AccumuloInputSplit to be private and not package-private?

Well I think some of the public members of AccumuloInputSplit used to be public methods if RangeInputSplit. I think some public members of AccumuloInputSplit were not intened to be in public API, but end up there because RangeInputSplit extends AccumuloInputSplit. I think public API types extending impl types is nothing but trouble.

I think another issue needs to be opened. I think the map reduce public API is a mess. Too much of the implementation is in the API, makes it very hard to add features.

@keith-turner
Copy link
Contributor Author

These changes were merged

@keith-turner keith-turner deleted the api-cleanup branch May 24, 2016 21:58
keith-turner pushed a commit to keith-turner/accumulo that referenced this pull request Jun 23, 2022
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.

7 participants