Skip to content

Commit

Permalink
Merge pull request #2572 from kuzzleio/feat/remove-murmurhash
Browse files Browse the repository at this point in the history
feat: remove murmurhash native in favor of murmurhashJS
  • Loading branch information
rolljee authored Jan 7, 2025
2 parents 278de99 + 345563e commit ba37acb
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 352 deletions.
2 changes: 0 additions & 2 deletions .ci/services-7.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
kuzzle:
build:
Expand Down
2 changes: 0 additions & 2 deletions .ci/services-8.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
kuzzle:
build:
Expand Down
2 changes: 0 additions & 2 deletions .ci/test-cluster-7.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

x-kuzzle-config: &kuzzle-config
image: kuzzleio/kuzzle-runner:${NODE_VERSION:-20}
command: >
Expand Down
2 changes: 0 additions & 2 deletions .ci/test-cluster-8.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

x-kuzzle-config: &kuzzle-config
image: kuzzleio/kuzzle-runner:${NODE_VERSION:-20}
command: >
Expand Down
2 changes: 0 additions & 2 deletions doc/2/guides/elasticsearch/v8/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Once the version is set to 8, Kuzzle will use the Elasticsearch 8 API to communi
You will find below an example of a `docker-compose.yml` file to run Kuzzle with Elasticsearch 8.

```yaml
version: '3.8'

services:
node:
image: kuzzleio/kuzzle:2
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
elasticsearch:
image: elasticsearch:8.11.3
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

x-kuzzle-config: &kuzzle-config
image: kuzzleio/core-dev:2
command: sh -c 'chmod 755 /run-dev.sh && /run-dev.sh'
Expand Down
2 changes: 0 additions & 2 deletions docker/images/plugin-dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ It contain a complete build toolchain to install and update NPM modules.
The easiest way is to use this image in a `docker-compose.yml` file:

```yml
version: '3'

services:
kuzzle:
image: kuzzleio/plugin-dev:2
Expand Down
11 changes: 6 additions & 5 deletions features-legacy/step_definitions/profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const
Then
} = require('cucumber'),
async = require('async'),
_ = require('lodash'),
stringify = require('json-stable-stringify');

When(/^I get the profile mapping$/, function () {
Expand Down Expand Up @@ -132,12 +133,12 @@ Then(/^I'm ?(not)* able to find rights for profile "([^"]*)"$/, { timeout: 20 *
throw new Error(body.error.message);
}

const
policies = stringify(body.result.hits),
expected = stringify(this.policies[id]);
const policies = body.result.hits;
const expected = this.policies[id];
const diff = _.differenceWith(policies, expected, _.isEqual);

if (policies !== expected) {
throw new Error(`Bad profileRights for ${id}.\nExpected: ${expected}\nGot: ${policies}`);
if (diff.length > 0) {
throw new Error(`Bad profileRights for ${id}.\nExpected: ${JSON.stringify(expected)}\nGot: ${JSON.stringify(policies)}`);
}

if (not) {
Expand Down
5 changes: 2 additions & 3 deletions lib/kuzzle/kuzzle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Bluebird from "bluebird";
import stringify from "json-stable-stringify";
import { Koncorde } from "koncorde";
import _ from "lodash";
import { murmurHash128 as murmur } from "murmurhash-native";
import murmur from "murmurhash";
import segfaultHandler from "node-segfault-handler";

import { version } from "../../package.json";
Expand Down Expand Up @@ -823,9 +823,8 @@ class Kuzzle extends KuzzleEventEmitter {
inString = stringify(input);
}

return murmur(
return murmur.v3(
Buffer.from(inString),
"hex",
this.config.internal.hash.seed as number,
);
}
Expand Down
Loading

0 comments on commit ba37acb

Please sign in to comment.