nokia-wroclaw / innovative-project-jackdaw Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Replace
topicProperties.get("property").toString();
with
topicProperties.getProperty("property");
in consumer Runner
class.
createFlight
heavily use put
and magic numbers to create a flight instance.
Avro plugin creates out-of-box a builder class with concise API. Please use it.
All is*Valid
methods define string arrays for a corresponding type. These should be represented as enumerations, whatmore, they exist but are not used, example.
Please refactor code to use enumeration types.
The producent class should have a single responsibility which is sending messages, not conversion from raw input to POJO record.
Please extract createFlight
method to a separate class and use it within the producer. Move corresponding unit tests.
It's way too harsh to throw an exception on simple value mappings (please refer to refs below). I think literal "null" should do fine for default case in the switch statement since null is a valid JSON value.
Please refactor duplications in Runners, see:
Properties topicProperties = new Properties();
topicProperties.load(new FileInputStream("/volume/topic.properties"));
Properties schemaProps = new Properties();
schemaProps.load(new FileInputStream("/volume/flightdata-kafka-producer.properties"));
InputStream input = new FileInputStream("/volume/flightdata-kafka-producer.properties");
Properties props = new Properties();
props.load(input);
There are plenty of io streams opened in Runner
classes but not closed.
Please use try-with-resources
mechanism.
There are plenty of magic numbers in the producer class.
Please do refactor, example resources:
http://www.thinkcode.se/blog/2011/07/28/magic-numbers
https://sourcemaking.com/refactoring/replace-magic-number-with-symbolic-constant
createFlight
throws exceptions when a single line is invalid and stops the application.
Please refactor code to apply a Option
return type.
https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html
http://www.baeldung.com/java-optional
Please use more liberal number conversion approach as well:
https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/math/NumberUtils.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.