------------------------ part 1 --------------------- schema evolution 1: avro - в сообщении содержится схема данных. предоставляет API для сериализации данных соответственно схеме и десериализации по схеме. exactly once processing: тут проблема в том что нет контроля над тем какой partition будет назначен. есть две стратегии: range: round robin: rebalance listener: случай когда consumer group coordinator запустил rebalance и consumer, обработавший часть сообщений хочет commit offset. чтобы это сделать надо знать: how to commit a particular offset? how to know that a rebalance is triggered? ConsumerRebalanceListener onPartitionsRevoked - будет вызван перед переключением partition. onPartitionsAssigned - будет вызвано после назначения partition и перед передачей сообщений. offset management: current offset: kafka broker у себя хранит указатель на на отправленные сообщения клонкретному consumer. maintain offset from which send next banch of ...
B-tree is a self-balancing tree that maintains sorted data and allows operation in logarithmic time. B-trees can handle range queries on sorted data (<, ≤, >, ≥, between, in, is null, is not null) B-tree index can also be used for queries that involve pattern matching operator LIKE or ~ if the pattern is a constant and the anchor is at the beginning of the pattern. For example, you can try matching queries column_name LIKE ‘Apple%’ or column_name ~ ‘^Apple’ But, querying ‘%macbook%’ or ‘%pro’ will not be efficient. For such queries, the query planner will resort to full-text sequential search which is not optimized. Enter, GIN indexes. GIN stands for Generalized Inverted Indexes. We can create a GIN index to speed up text searches: CREATE INDEX index_name ON table USING GIN (to_tsvector(‘english’, column_name)); The query above specifies that the English configuration can be used to parse and normalize the strings. And for the part of searching, a simple query to print the tit...
static and super keyword super.static can't because: Overriding depends on having an instance of a class. The point of polymorphism is that you can subclass a class and the objects implementing those subclasses will have different behaviors for the same methods defined in the superclass (and overridden in the subclasses). A static method is not associated with any instance of a class so the concept is not applicable. There were two considerations driving Java's design that impacted this. One was a concern with performance: there had been a lot of criticism of Smalltalk about it being too slow (garbage collection and polymorphic calls being part of that) and Java's creators were determined to avoid that. Another was the decision that the target audience for Java was C++ developers. Making static methods work the way they do had the benefit of familiarity for C++ programmers and was also very fast, because there's...
Комментарии
Отправить комментарий