- Slides for this session (from Percona Live Santa Clara 2017)
- DBAs, A Priesthood No More - Silvia Botros
- Ozar's Hierarchy of Database Needs - Brent Ozar
singleuser: | |
profileList: | |
- display_name: "Default" | |
description: | | |
Tubi Data Runtime | |
default: True | |
kubespawner_override: | |
image: <private-docker-registry>/tubi-data-runtime | |
node_affinity_preferred: | |
- weight: 1 |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-rsocket</artifactId> | |
<version>${spring-boot.version}</version> | |
<exclusions> | |
<exclusion> | |
<groupId>io.netty</groupId> | |
<artifactId>netty-buffer</artifactId> | |
</exclusion> | |
<exclusion> |
import org.openjdk.jmh.annotations.*; | |
import java.util.Arrays; | |
import java.util.Random; | |
import java.util.concurrent.CountedCompleter; | |
import java.util.concurrent.ExecutionException; | |
/** | |
* 40 Core Xeon E5-2660 v3 @ 2.60GHz | |
* |
# wget -i this_file | |
http://www.oreilly.com/programming/free/files/files/microservices-for-java-developers.pdf | |
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.pdf | |
http://www.oreilly.com/programming/free/files/object-oriented-vs-functional-programming.pdf | |
http://www.oreilly.com/programming/free/files/java-the-legend.pdf | |
http://www.oreilly.com/programming/free/files/functional-programming-python.pdf | |
http://www.oreilly.com/programming/free/files/reactive-microservices-architecture-orm.pdf | |
http://www.oreilly.com/programming/free/files/migrating-cloud-native-application-architectures.pdf | |
http://www.oreilly.com/programming/free/files/software-architecture-patterns.pdf |
package examples; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
@EnableAutoConfiguration | |
public class GatewayApplication { |
producer.initTransactions(); | |
try { | |
producer.beginTransaction(); | |
producer.send(record1); | |
producer.send(record2); | |
producer.commitTransaction(); | |
} catch(ProducerFencedException e) { | |
producer.close(); | |
} catch(KafkaException e) { | |
producer.abortTransaction(); |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
import io.netty.buffer.ByteBuf; | |
import io.netty.buffer.ByteBufAllocator; | |
import io.netty.buffer.Unpooled; | |
import java.nio.ByteBuffer; | |
import java.nio.charset.Charset; | |
public class ByteBufTest { | |
public static void main(String[] args) { | |
// 4 types of buffers |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.