The following table shows the values that are used when -XX:+UseContainerSupport is set:
Less than 1 GB 50% <size>
1 GB - 2 GB <size> - 512 MB
Greater than 2 GB 75% <size>
The default heap size is capped at 25 GB
The default heap size for containers takes affect only when the following conditions are met:
The application is running in a container environment.
The memory limit for the container is set.
The -XX:+UseContainerSupport option is set, which is the default behavior.
["slug" being an entity attribute]
Spring Data offers an existsBy query method, which we can define in the PostRepository, as follows:
1
2
3
4
5
6
@Repository
public interface PostRepository
extends JpaRepository<Post, Long> {
boolean existsBySlug(String slug);
}
[another] option to emulate existence is using a CASE WHEN EXISTS native SQL query:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@Repository
public interface PostRepository
extends JpaRepository<Post, Long> {
@Query(value = """
SELECT
CASE WHEN EXISTS (
SELECT 1
FROM post
WHERE slug = :slug
)
THEN 'true'
ELSE 'false'
END
""",
nativeQuery = true
)
boolean existsBySlugWithCase(@Param("slug") String slug);
}
@Repository
public interface PostRepository extends BaseJpaRepository<Post, Long> {
@Query("""
select p
from Post p
where date(p.createdOn) >= :sinceDate
"""
)
@QueryHints(
@QueryHint(name = AvailableHints.HINT_FETCH_SIZE, value = "25")
)
Stream<Post> streamByCreatedOnSince(@Param("sinceDate") LocalDate sinceDate);
}
The FETCH_SIZE JPA query hint is necessary for PostgreSQL and MySQL to instruct the JDBC Driver to prefetch at most 25 records. Otherwise, the PostgreSQL and MySQL JDBC Drivers would prefetch all the query results prior to traversing the underlying ResultSet.
moving:
to the end of the command: ctrl-e
to the begin of the command: ctrl-a
forward a word: alt-f
backword a word: alt-b
deleting:
from current cursor position to the end of word: ald-d
from current cursor position to the begin of word: clt-w
B. Sacaleanu, and G. Neumann. Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC-2012), European Language Resources Association (ELRA), (2012)
H. Kim, J. Choi, D. Choi, H. Choi, and P. Kim. Proceedings of the 2012 ACM Research in Applied Computation Symposium, page 310--315. New York, NY, USA, ACM, (2012)
A. Sun, R. Grishman, W. Xu, and B. Min. Proceedings of the Fourth Text Analysis Conference (TAC 2011), National Institute of Standards and Technology (NIST), (November 2011)
D. Jurgens, and K. Stevens. Proceedings of the First workshop on Unsupervised Learning in NLP, page 113--123. Edinburgh, Scotland, Association for Computational Linguistics, (July 2011)
I. Titov, and A. Klementiev. Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, page 1445--1455. Portland, Oregon, USA, Association for Computational Linguistics, (June 2011)
C. Manning. Proceedings of the 12th international conference on Computational linguistics and intelligent text processing - Volume Part I, page 171--189. Berlin, Heidelberg, Springer-Verlag, (2011)
R. Gupta, and S. Sarawagi. Proceedings of the fourth ACM international conference on Web search and data mining, page 217--226. New York, NY, USA, ACM, (2011)
Y. Chan, and D. Roth. Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies - Volume 1, page 551--560. Stroudsburg, PA, USA, Association for Computational Linguistics, (2011)
E. Ponvert, J. Baldridge, and K. Erk. Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies - Volume 1, page 1077--1086. Stroudsburg, PA, USA, Association for Computational Linguistics, (2011)
K. Macherey, A. Dai, D. Talbot, A. Popat, and F. Och. Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies (ACL-11), Portland, OR, (2011)
V. Spitkovsky, H. Alshawi, and D. Jurafsky. Proceedings of the Conference on Empirical Methods in Natural Language Processing, page 1269--1280. Stroudsburg, PA, USA, Association for Computational Linguistics, (2011)