Skip to content

Commit

Permalink
Drop snappy nif support as its not working in otp 26
Browse files Browse the repository at this point in the history
  • Loading branch information
Argonus committed Feb 27, 2024
1 parent 70f6e88 commit d5e7364
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ The Slack channel is appropriate for quick questions or general design
discussions. The Slack discussion is archived at
[http://slack.elixirhq.com/kafkaex](http://slack.elixirhq.com/kafkaex).

## default snappy algorithm use snappy-erlang-nif package
## Default snappy algorithm use snappyer package

It can be changed to snappyer by using this:
It can be changed to snappy by using this:

``` elixir
config :kafka_ex, snappy_module: :snappyer
config :kafka_ex, snappy_module: :snappy
```

Snappy erlang nif is deprecated and will be changed to :snappyer in 1.0.0 release.
Snappy erlang nif is deprecated and will be dropped 1.0.0 release.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ config :kafka_ex,
certfile: File.cwd!() <> "/ssl/cert.pem",
keyfile: File.cwd!() <> "/ssl/key.pem"
],
snappy_module: :snappy,
snappy_module: :snappyer,
# set this to the version of the kafka broker that you are using
# include only major.minor.patch versions. must be at least 0.8.0
# use "kayrock" for the new client
Expand Down
4 changes: 2 additions & 2 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import Config

config :ex_unit, capture_log: is_nil(System.get_env("SHOW_LOGS"))

config :kafka_ex, snappy_module: :snappy
config :kafka_ex, snappy_module: :snappyer

config :kayrock, snappy_module: :snappy
config :kayrock, snappy_module: :snappyer

config :kafka_ex, sync_timeout: 60_000

Expand Down
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ defmodule KafkaEx.Mixfile do
{:excoveralls, "~> 0.18", only: :test, runtime: false},
{:ex_doc, "~> 0.23", only: :dev, runtime: false},
{:hammox, "~> 0.5.0", only: :test},
{:snappy, git: "https://github.com/fdmanana/snappy-erlang-nif", only: [:dev, :test]},
{:snappyer, "~> 1.2", only: [:dev, :test]}
]
end
Expand Down
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
"ordinal": {:hex, :ordinal, "0.2.0", "d3eda0cb04ee1f0ca0aae37bf2cf56c28adce345fe56a75659031b6068275191", [:mix], [], "hexpm", "defca8f10dee9f03a090ed929a595303252700a9a73096b6f2f8d88341690d65"},
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"},
"snappy": {:git, "https://github.com/fdmanana/snappy-erlang-nif", "e8907ee8e37cfa07d933a070669a88798082c3d7", []},
"snappyer": {:hex, :snappyer, "1.2.9", "9cc58470798648ce34c662ca0aa6daae31367667714c9a543384430a3586e5d3", [:rebar3], [], "hexpm", "18d00ca218ae613416e6eecafe1078db86342a66f86277bd45c95f05bf1c8b29"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm", "13104d7897e38ed7f044c4de953a6c28597d1c952075eb2e328bc6d6f2bfc496"},
"telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"},
Expand Down
4 changes: 0 additions & 4 deletions test/kafka_ex/compression_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ defmodule KafkaEx.CompressionTest do
232>> <>
String.duplicate("ABCDEFGHIJ", 100)

## enable :snappy module, and test it
Application.put_env(:kafka_ex, :snappy_module, :snappy)
assert expected == KafkaEx.Compression.decompress(2, data)

## enable :snappyer module, and test it
Application.put_env(:kafka_ex, :snappy_module, :snappyer)
assert expected == KafkaEx.Compression.decompress(2, data)
Expand Down

0 comments on commit d5e7364

Please sign in to comment.