duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
<plugin> | |
<groupId>io.confluent</groupId> | |
<artifactId>kafka-schema-registry-maven-plugin</artifactId> | |
<version>${confluent.platform.version}</version> | |
<executions> | |
<execution> | |
<phase>initialize</phase> | |
<goals> | |
<goal>register</goal> | |
</goals> |
<plugin> | |
<groupId>io.confluent</groupId> | |
<artifactId>kafka-schema-registry-maven-plugin</artifactId> | |
<version>${confluent.platform.version}</version> | |
<executions> | |
<execution> | |
<phase>initialize</phase> | |
<goals> | |
<goal>download</goal> | |
</goals> |
{ | |
"namespace": "org.maz.schema", | |
"type": "record", | |
"name": "FlatSampleData", | |
"fields": [ | |
{ | |
"name": "FlatSampleData", | |
"type": { | |
"avro.java.string": "String", | |
"type": "string" |
{ | |
"namespace": "org.maz.schema", | |
"name": "SplitEnumerationSample", | |
"type": "enum", | |
"symbols": [ | |
"SAMPLE1", | |
"SAMPLE2", | |
"SAMPLE3" | |
], | |
"default": "SAMPLE1" |
{ | |
"namespace": "org.maz.schema", | |
"type": "record", | |
"name": "SplitSampleData", | |
"fields": [ | |
{ | |
"name": "SplitSampleData", | |
"type": { | |
"avro.java.string": "String", | |
"type": "string" |
spring: | |
kafka: | |
bootstrap-servers: localhost:9092 | |
properties: | |
schema.registry.url: http://localhost:8081 | |
producer: | |
key-serializer: org.apache.kafka.common.serialization.StringSerializer | |
value-serializer: io.confluent.kafka.serializers.KafkaAvroSerializer | |
properties: | |
value.subject.name.strategy: io.confluent.kafka.serializers.subject.RecordNameStrategy # so that the name of the subject will be derived from record name ie, org.maziz.something |
public List<SomeDataFull> methodWithNoAbstraction() { | |
// get data from DB for instance | |
final List<SomeData> listOfDataFromDb = getDataFromDb(); // a.1 | |
final List<String> someDataRetrievedIds = listOfDataFromDb.stream().map(SomeData::getId).collect(Collectors.toList()); //a.2 | |
final Map<String, Boolean> someDataIdMapping = getVerificationFromExternalSystem(someDataRetrievedIds) | |
.stream().collect(Collectors.toMap(SomeDataVerification::getId, SomeDataVerification::isOk)); | |
final List<SomeData> verifiedSomeData = listOfDataFromDb.stream().filter(eachData -> someDataIdMapping.getOrDefault(eachData.getId(), false)) //a.3 | |
.collect(Collectors.toList()); |
public void buildThumbnailWithUrl() { | |
final List<Thumbnail> rawThumbnailList = getThumbnailListFromSomeWhere(); | |
final String appropriateCdn = getTheRightCdnBasedOnRegion(); | |
final String defaultCdn = getDefaultCdn(); | |
final List<Thumbnail> thumbnailListWithCdn = rawThumbnailList.stream().map(eachThumbnail -> { | |
final String cdnChose = eachThumbnail.isHasLarge() ? defaultCdn : appropriateCdn; | |
eachThumbnail.setThumbnailUri(cdnChose + eachThumbnail.getThumbnailUri()); | |
return eachThumbnail; | |
}).collect(Collectors.toList()); |
public void exampleMinimizingIfElse() { | |
final List<String> someExampleArray = new ArrayList<>(); | |
Optional.ofNullable(someExampleArray).orElse(Collections.emptyList()).forEach(this::doSomethingWithIt); | |
ObjectUtils.defaultIfNull(someExampleArray, Collections.<String>emptyList()).forEach(this::doSomethingWithIt); | |
returnEmptyArrayIfNecessary(someExampleArray).forEach(this::doSomethingWithIt); | |
} |