kagamihogeの日記

kagamihogeの日記です。

Java

RedisのkeysがO(N)を実際に見る

RedisのKEYSはO(n)な点に注意が必要、と各種文献に書かれている。なので実際にデータ作ってみて試してみる。 ソースコード <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.7.RELEASE</version> <relativePath /> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceencoding></properties>

spring-data-redisでpipelineによるバルク処理

redis初心者です。以下は https://docs.spring.io/spring-data-redis/docs/current/reference/html/#pipeline の抄訳。 5.11. Pipelining Redisにはパイプライン(https://redis.io/topics/pipelining)があり、これはリプライを待たずにサーバへ複数コマン…

JEP 358: Helpful NullPointerExceptionsをテキトーに訳した

http://openjdk.java.net/jeps/358 JEP 358: Helpful NullPointerExceptions Authors Goetz Lindenmaier, Ralf Schmelter Owner Goetz Lindenmaier Type Feature Scope JDK Status Candidate Component hotspot / runtime Discussion hotspot dash runtime d…

spring-batchのMapJobRepositoryFactoryBeanでメタテーブルをDBに保存せず大量にstepを実行するとスローダウン

現象 ほぼタイトルで言い切っているけど。spring-batchでメタデータ保存でDBを使わなないようインメモリに格納するMapJobRepositoryFactoryBeanを使う場合が稀に良くある。この状況下で大量のstepを含むjobを実行すると徐々に実行速度が低下していく、という…

spring-integrationでjob名渡してspring-batchを起動

spring-integration勉強中です。 spring-integrationに文字列でjob名を渡し、その先でspring-batchを起動、をつくる。https://github.com/pakmans/spring-batch-integration-example/blob/master/pom.xml を参考にした。

spring-integrationでメッセージ送信

spring-integration勉強中です。 非常にシンプルな、spring-integrationのチャネルに文字列メッセージ送信して表示するだけ、を作ってみる。 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> </project>

spring-integrationでファイル作成を検出するサンプル

spring-integration勉強中です。 というわけで https://github.com/pakmans/spring-batch-integration-example の方のコードを参考に、監視先ディレクトリにファイルが作られたらメッセージハンドラが呼び出される、というだけのコードを動かした。詳しいこ…

JEP 353: Reimplement the Legacy Socket APIをテキトーに訳した

http://openjdk.java.net/jeps/353 JEP 353: Reimplement the Legacy Socket API Owner Alan Bateman Type Feature Scope JDK Status Proposed to Target Release 13 Component core-libs / java.net Discussion net dash dev at openjdk dot java dot net E…

JEP 310: Application Class-Data Sharingをテキトーに訳した

https://openjdk.java.net/jeps/310 JEP 310: Application Class-Data Sharing Owner Ioi Lam Type Feature Scope Implementation Status Closed / Delivered Release 10 Component hotspot / runtime Discussion hotspot dash dev at openjdk dot java dot …

Spring Batch 4.1.x - Reference Documentation - Spring Batch Integrationのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/spring-batch-integration.html#springBatchIntegration https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Spring Batch Integration 1.1. Spring Batch Integratio…

JEP 351: ZGC: Uncommit Unused Memoryをテキトーに訳した

http://openjdk.java.net/jeps/351 JEP 351: ZGC: Uncommit Unused Memory Owner Per Liden Type Feature Scope Implementation Status Candidate Component hotspot / gc Discussion hotspot dash gc dash dev at openjdk dot java dot net Effort S Durati…

Spring Batch 4.1.x - Reference Documentation - JSR-352 Supportのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/jsr-352.html#jsr-352 https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト *1 1. JSR-352 Support Spring Batch 3.0以降はJSR-352を完全に実装しています。このセクショ…

Spring Batch 4.1.x - Reference Documentation - Common Batch Patternsのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/common-patterns.html#commonPatterns https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Common Batch Patterns ある種のジョブはSpring Batch標準コンポーネントの…

Spring Batch 4.1.x - Reference Documentation - Unit Testingのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/testing.html#testing https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Unit Testing バッチ以外のアプリケーション同様に、バッチジョブの一部として書いたコード…

Spring Batch 4.1.x - Reference Documentation - Retryのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/retry.html#retry https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Retry 処理をロバストかつ失敗の可能性を下げるには、次回以降には成功する確率が高い場合、そ…

Spring Batch 4.1.x - Reference Documentation - Repeatのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/repeat.html#repeat https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Repeat 1.1. RepeatTemplate バッチ処理とは繰り返し処理であり、simple optimizationとなる…

Spring Batch 4.1.x - Reference Documentation - Scaling and Parallel Processingのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/scalability.html#scalability https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Scaling and Parallel Processing 大半のバッチ処理はシングルスレッド・シングル…

Spring Batch 4.1.x - Reference Documentation - ItemReaders and ItemWriters - 1.7-1.15のテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/readersAndWriters.html#readersAndWriters https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1.7. XML Item Readers and Writers Spring BatchはXMLを読み込みJavaオ…

Spring Batch 4.1.x - Reference Documentation - ItemReaders and ItemWriters - 1.1-1.6のテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/readersAndWriters.html#readersAndWriters https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. ItemReaders and ItemWriters すべてのバッチ処理は、大規模データの…

Spring Batch 4.1.x - Reference Documentation - Configuring a Stepのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/step.html#configureStep https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Configuring a Step ドメインのチャプターで解説したように、Stepは、バッチjobのシーケ…

Spring Batch 4.1.x - Reference Documentation - Configuring and Running a Jobのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/job.html#configureJob https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Configuring and Running a Job domain sectionでは、以下図を用いてアーキテクチャデザイ…

Spring Batch 4.1.x - Reference Documentation - The Domain Language of Batchのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/domain.html#domainLanguageOfBatch https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. The Domain Language of Batch 何らかの経験のあるバッチアーキテクトにとっ…

Spring Batch 4.1.x - Reference Documentation - What’s New in Spring Batch 4.1のテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/whatsnew.html#whatsNew https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. What’s New in Spring Batch 4.1 Spring Batch 4.1 releaseは以下の新機能があります。 @…

Spring Batch 4.1.x - Reference Documentation - Spring Batch Introductionのテキトー翻訳

https://docs.spring.io/spring-batch/4.1.x/reference/html/spring-batch-intro.html#spring-batch-intro https://qiita.com/kagamihoge/items/12fbbc2eac5b8a5ac1e0 俺の訳一覧リスト 1. Spring Batch Introduction エンタープライズ領域の多くのアプリケ…

JEP 348: Java Compiler Intrinsics for JDK APIsをテキトーに訳した

http://openjdk.java.net/jeps/348 JEP 348: Java Compiler Intrinsics for JDK APIs Author Brian Goetz Owner Vicente Arturo Romero Zaldivar Type Feature Scope SE Status Candidate Component tools Discussion amber dash dev at openjdk dot java do…

Elasticsearch 6.6 + Spring Data Elasticsearch 3.1.5うごかす

やったこと Elasticsearch + docker http://tech.innovation.co.jp/2018/08/09/constructing-enviroment-for-Elasticsearch-and-Kibana.html https://qiita.com/sugikeitter/items/f3b2c57bf8bbdc47a8bc 上記URLを参考にElasticsearchをdockerで動かす環境を…

spring-batch内でトランザクションつかってるあたりを知る

背景 spring-batchは内部的に随所でメタテーブルなどトランザクション処理がある。軽くソースコード見た限りでは@Transactionalがついてるわけでもないのにトランザクションってどうやって実行してるのかな? と知りたくなったのでソースを見た。 しらべたソ…

spring-batchのBatchConfigurerのあたりをまなぶ

目的 たとえば、spring-batchで自前のPlatformTransactionManagerにカスタマイズしたい場合、自前のBatchConfigurerのbean定義を作成すれば有効になる。このへんの仕組みを知るために、その周辺のソースコードを読んでその動作をまなぶ。いわゆる個人の日記…

JEP 346: Promptly Return Unused Committed Memory from G1をテキトーに訳した

http://openjdk.java.net/jeps/346 JEP 346: Promptly Return Unused Committed Memory from G1 Authors Rodrigo Bruno, Thomas Schatzl, Ruslan Synytsky Owner Thomas Schatzl Type Feature Scope Implementation Status Proposed to Target Release 12 Co…

Jedisで単一コネクションをマルチスレッドで使用してはいけない

JedisはJavaのRedisクライアント。自明だが、単一コネクションをマルチスレッドで使いまわすとその動作は不定となる。 とりあえずソースコード。 package kagamihoge.jedissample; import java.util.concurrent.ExecutorService; import java.util.concurren…