This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadbalancer <-> NB : Load Balance me | |
NB.shape: cloud | |
NB -- backend -> DB | |
DB --> NB | |
backend { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'org.springframework.boot' version '3.0.0' | |
id 'io.spring.dependency-management' version '1.1.0' | |
id 'org.jetbrains.kotlin.jvm' version '1.7.21' | |
id 'org.jetbrains.kotlin.plugin.spring' version '1.7.21' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"size" : 0, | |
"aggs": { | |
"groupByCid": { | |
"terms": { | |
"field": "cid.keyword", | |
"size": 1000, | |
}, | |
"aggs": { | |
"groupByOpName": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::: {node1.mycompany.net}{9GFXG3OWTsqz-dzQQblUmw}{UUtKg-5cSuaZuKtQAjfnMA}{10.48.112.217}{10.48.112.217:9300}{di}{aws_az=us-west-1b, xpack.installed=true} | |
Hot threads at 2020-05-18T20:16:02.896Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: | |
6.1% (30.3ms out of 500ms) cpu usage by thread 'elasticsearch[node1.mycompany.net][write][T#2]' | |
unique snapshot | |
[email protected]/java.util.stream.Streams$ConcatSpliterator.<init>(Streams.java:705) | |
[email protected]/java.util.stream.Streams$ConcatSpliterator$OfRef.<init>(Streams.java:773) | |
[email protected]/java.util.stream.Stream.concat(Stream.java:1380) | |
app//org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.putResponseHeaders(ThreadContext.java:522) | |
app//org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.access$1900(ThreadContext.java:440) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Autowired | |
lateinit var petRepository: PetRepository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun goToOwnersIndex() : Mono<ServerResponse> { | |
return ok().html().render("owners/index", | |
mapOf("owners" to ownersRepository.findAll().map { Pair(it, emptySet<Pet>()) }, | |
"pets" to petRepository.findAll().collectMultimap { it.owner })) | |
} | |
// using type inference | |
fun goToOwnersIndex() = ok().html().render("owners/index", | |
mapOf("owners" to ownersRepository.findAll().map { Pair(it, emptySet<Pet>()) }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun LocalDate.toStr(format:String = "dd/MM/yyyy") = DateTimeFormatter.ofPattern(format).format(this) | |
fun String.toDate(format:String = "dd/MM/yyyy") = LocalDate.parse(this, DateTimeFormatter.ofPattern(format)) | |
@Test | |
fun `Test LocalDate#toStr extension method`() { | |
Assert.assertEquals(LocalDate.of(1970, 1, 1).toStr(), "01/01/1970") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FunctionalInterface | |
public interface RouterFunction<T extends ServerResponse> { | |
Mono<HandlerFunction<T>> route(ServerRequest request); | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Servlet { | |
... | |
public void service(ServletRequest req, ServletResponse res) | |
throws ServletException, IOException; | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FunctionalInterface | |
public interface HandlerFunction<T extends ServerResponse> { | |
Mono<T> handle(ServerRequest request); | |
} |
NewerOlder