-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
AVRO-3666: [JAVA] Separate parsing from Schema class #2513
AVRO-3666: [JAVA] Separate parsing from Schema class #2513
Conversation
e5179e9
to
4d88a15
Compare
34971c0
to
e92eac8
Compare
This allows using pluggable parser implementations, allowing multiple formats to be parsed with the same code.
Includes the use of NameValidator and parsing multiple files with circular references between them.
588b055
to
5b024c1
Compare
Fix the compile error by disabling the cache for the Hadoop2 build. This cannot be code related, as the other test builds succeed.
5e10934
to
d74a925
Compare
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.
Nice first stepto refactor Schema parsing (full would be to externalize all static parsing function from schema to a SchemaParser like class).
Just one question with ParseContext.namespace field.
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.
ParseContext::fullName method seems useless (always called with "space" argument as null ?), but, LGTM globally (and enhance current code)
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.
👍
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* |
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 seems to be a double license here?
Protocol protocol = idlFile.getProtocol(); | ||
System.out.println(protocol); | ||
Assert.assertEquals(5, protocol.getTypes().size()); | ||
// Path testIdl = Paths.get(".", "src", "test", "idl", |
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 we remove this test if it isn't being used?
@@ -1,3 +1,21 @@ | |||
/* |
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.
Double header?
This allows using pluggable parser implementations, allowing multiple formats to be parsed with the same code. This includes the use of NameValidator and parsing multiple files with circular references between them.
What is the purpose of the change
Allow using pluggable parser implementations, allowing multiple formats to be parsed with the same code.
Verifying this change
This change adds test for all added code. The change in
IDLReader
is for readability and is covered by existing tests.Question: how can I better handle the collection parameter to the
FormattedSchemaParser
interface?Documentation
This code introduces a new feature: the documentation (Getting Started with Java) now refers to the new code, and the Javadoc documents the rest.