Skip to content

Commit

Permalink
Remove calls to deprecated APIs
Browse files Browse the repository at this point in the history
Except KStream and KTable APIs
  • Loading branch information
Gilles Philippart committed Jun 10, 2022
1 parent 1dc8280 commit f9dc7cd
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/jackdaw/admin.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(def client-impl
{:alter-topics* (fn [this topics]
(d/future
@(.all (.alterConfigs ^AdminClient this topics))))
@(.all (.incrementalAlterConfigs ^AdminClient this topics))))
:create-topics* (fn [this topics]
(d/future
@(.all (.createTopics ^AdminClient this topics))))
Expand Down
2 changes: 1 addition & 1 deletion src/jackdaw/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
of datafied messages."
[^Consumer consumer timeout]
(some->> (if (int? timeout)
(.poll consumer ^long timeout)
(.poll consumer (Duration/ofMillis timeout))
(.poll consumer ^Duration timeout))
(map jd/datafy)))

Expand Down
6 changes: 2 additions & 4 deletions src/jackdaw/streams.clj
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@
[kstream]
(p/print! kstream))

(defn ^{:deprecated "2.6.0"
:superseded-by "repartition"}
(defn ^{:deprecated "2.6.0"}
through
"Materializes a stream to a topic, and returns a new KStream that will
consume messages from the topic."
Expand All @@ -133,8 +132,7 @@

;; IKStream

(defn ^{:deprecated "2.8.0"
:superseded-by "split"}
(defn ^{:deprecated "2.8.0"}
branch
"Returns a list of KStreams, one for each of the `predicate-fns`
provided."
Expand Down
2 changes: 1 addition & 1 deletion src/jackdaw/streams/describe.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(base-node :node n))

(defmethod describe-node :source [n]
(let [topics (map str/trim (-> (.topics ^TopologyDescription$Source n)
(let [topics (map str/trim (-> (.topicSet ^TopologyDescription$Source n)
(str/replace "[" "")
(str/replace "]" "")
(str/split #",")))]
Expand Down
4 changes: 2 additions & 2 deletions src/jackdaw/streams/extras.clj
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
`(let [t# ~topic]
(-> ~builder
(map-validating! t# ~topic-spec ~(with-file (meta &form)))
(js/to t#))))
(js/to! t#))))
([builder partition-fn topic topic-spec]
`(let [t# ~topic]
(-> ~builder
(map-validating! t# ~topic-spec ~(with-file (meta &form)))
(js/to ~partition-fn t#)))))
(js/to! ~partition-fn t#)))))

(defmacro through
"Wraps `#'jackdaw.streams/through`, providing validation of records
Expand Down
2 changes: 1 addition & 1 deletion test/jackdaw/serdes/avro_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
:namespace "com.fundingcircle"})
schema-type (schema-type avro-schema)
clj-data 4
avro-data (Integer. 4)]
avro-data (Integer/valueOf 4)]
(is (= clj-data (avro/avro->clj schema-type avro-data)))
(is (= avro-data (avro/clj->avro schema-type clj-data [])))

Expand Down
2 changes: 1 addition & 1 deletion test/jackdaw/serdes/edn2_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(defspec edn-print-length-test 20
(testing "EDN data is the same after serialization and deserialization with *print-length*."
(binding [*print-length* 100]
(prop/for-all [x (gen/vector gen/int (inc *print-length*))]
(prop/for-all [x (gen/vector gen/small-integer (inc *print-length*))]
(is (= x (->> (.serialize (jse/edn-serializer) nil x)
(.deserialize (jse/edn-deserializer) nil))))))))

Expand Down
2 changes: 1 addition & 1 deletion test/jackdaw/serdes/edn_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(defspec edn-print-length-test 20
(testing "EDN data is the same after serialization and deserialization with *print-length*."
(binding [*print-length* 100]
(prop/for-all [x (gen/vector gen/int (inc *print-length*))]
(prop/for-all [x (gen/vector gen/small-integer (inc *print-length*))]
(is (= x (->> (.serialize (jse/serializer) nil x)
(.deserialize (jse/deserializer) nil))))))))

Expand Down
112 changes: 56 additions & 56 deletions test/jackdaw/streams_test.clj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/jackdaw/test/transports/kafka_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(let [in (-> (k/kstream builder in)
(k/map (fn [[k v]]
[k v])))]
(k/to in out)
(k/to! in out)
builder)))

(def test-in
Expand Down
2 changes: 1 addition & 1 deletion test/jackdaw/test/transports/mock_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(let [in (-> (k/kstream builder in)
(k/map (fn [[k v]]
[k v])))]
(k/to in out)
(k/to! in out)
builder)))

(defn test-driver
Expand Down
2 changes: 1 addition & 1 deletion test/jackdaw/test/transports/rest_proxy_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
(let [in (-> (k/kstream builder in)
(k/map (fn [[k v]]
[k v])))]
(k/to in out)
(k/to! in out)
builder)))

(def test-in
Expand Down

0 comments on commit f9dc7cd

Please sign in to comment.