infinispan 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +7 -6
- package/.eslintrc +0 -25
- package/.flowconfig +0 -6
- package/Jenkinsfile +0 -50
- package/Jenkinsfile-release +0 -63
- package/documentation/asciidoc/stories/assembly_client_usage_examples.adoc +0 -10
- package/documentation/asciidoc/stories/assembly_installation_configuration.adoc +0 -20
- package/documentation/asciidoc/titles/js_client.asciidoc +0 -28
- package/documentation/asciidoc/titles/stories.adoc +0 -5
- package/documentation/asciidoc/topics/attributes/community-attributes.adoc +0 -9
- package/documentation/asciidoc/topics/attributes/downstream-attributes.adoc +0 -2
- package/documentation/asciidoc/topics/code_examples/authentication-digest.js +0 -12
- package/documentation/asciidoc/topics/code_examples/authentication-external.js +0 -15
- package/documentation/asciidoc/topics/code_examples/authentication-oauthbearer.js +0 -10
- package/documentation/asciidoc/topics/code_examples/authentication-plain.js +0 -11
- package/documentation/asciidoc/topics/code_examples/authentication-scram.js +0 -11
- package/documentation/asciidoc/topics/code_examples/await-multiple-entries.js +0 -36
- package/documentation/asciidoc/topics/code_examples/await-single-entries.js +0 -29
- package/documentation/asciidoc/topics/code_examples/conditional-operations.js +0 -57
- package/documentation/asciidoc/topics/code_examples/connection-multiple-servers.js +0 -23
- package/documentation/asciidoc/topics/code_examples/connection-xsite-cluster-switch.js +0 -39
- package/documentation/asciidoc/topics/code_examples/connection-xsite.js +0 -13
- package/documentation/asciidoc/topics/code_examples/data-types.js +0 -30
- package/documentation/asciidoc/topics/code_examples/encryption-crypto-store.js +0 -11
- package/documentation/asciidoc/topics/code_examples/encryption-private-key.js +0 -13
- package/documentation/asciidoc/topics/code_examples/encryption-sni-hostname.js +0 -9
- package/documentation/asciidoc/topics/code_examples/encryption-trust-certs.js +0 -8
- package/documentation/asciidoc/topics/code_examples/ephemeral-data.js +0 -52
- package/documentation/asciidoc/topics/code_examples/hello-world.js +0 -42
- package/documentation/asciidoc/topics/code_examples/key-value-converter.js +0 -67
- package/documentation/asciidoc/topics/code_examples/logging-configuration.js +0 -2
- package/documentation/asciidoc/topics/code_examples/multiple-entries.js +0 -64
- package/documentation/asciidoc/topics/code_examples/queries.js +0 -92
- package/documentation/asciidoc/topics/code_examples/register-event-listener.js +0 -64
- package/documentation/asciidoc/topics/code_examples/sample-script-execute.js +0 -33
- package/documentation/asciidoc/topics/code_examples/sample-script.js +0 -3
- package/documentation/asciidoc/topics/code_examples/single-entries.js +0 -49
- package/documentation/asciidoc/topics/config_examples/logging.json +0 -14
- package/documentation/asciidoc/topics/proc_configuring_authentication.adoc +0 -16
- package/documentation/asciidoc/topics/proc_configuring_connections.adoc +0 -25
- package/documentation/asciidoc/topics/proc_configuring_connections_xsite.adoc +0 -18
- package/documentation/asciidoc/topics/proc_configuring_data_formats.adoc +0 -30
- package/documentation/asciidoc/topics/proc_configuring_encryption.adoc +0 -15
- package/documentation/asciidoc/topics/proc_configuring_logging.adoc +0 -28
- package/documentation/asciidoc/topics/proc_installing_clients.adoc +0 -58
- package/documentation/asciidoc/topics/proc_switching_clusters.adoc +0 -17
- package/documentation/asciidoc/topics/ref_authentication_mechanisms.adoc +0 -68
- package/documentation/asciidoc/topics/ref_client_usage.adoc +0 -128
- package/documentation/asciidoc/topics/ref_encryption.adoc +0 -71
- package/gen-jsdoc.sh +0 -6
- package/make-ssl.sh +0 -335
- package/memory-profiling/helper.js +0 -9
- package/memory-profiling/infinispan_memory_many_get.js +0 -50
- package/memory-profiling/infinispan_memory_one_get.js +0 -56
- package/release.sh +0 -19
- package/run-servers.sh +0 -171
- package/run-testsuite.sh +0 -6
- package/server/.keep +0 -0
- package/set-npm-auth-token.sh +0 -4
- package/smoke-tests.sh +0 -21
- package/spec/codec_spec.js +0 -224
- package/spec/configs/clean/infinispan.xml +0 -55
- package/spec/configs/infinispan-clustered.xml +0 -63
- package/spec/configs/infinispan-ssl.xml +0 -115
- package/spec/configs/infinispan-xsite-EARTH.xml +0 -187
- package/spec/configs/infinispan-xsite-MOON.xml +0 -189
- package/spec/configs/infinispan.xml +0 -77
- package/spec/functional_spec.js +0 -73
- package/spec/infinispan_auth_spec.js +0 -19
- package/spec/infinispan_cluster_spec.js +0 -176
- package/spec/infinispan_expiry_spec.js +0 -218
- package/spec/infinispan_failover_listener_spec.js +0 -52
- package/spec/infinispan_failover_spec.js +0 -63
- package/spec/infinispan_json_spec.js +0 -182
- package/spec/infinispan_local_spec.js +0 -354
- package/spec/infinispan_ssl_spec.js +0 -442
- package/spec/infinispan_stress_spec.js +0 -32
- package/spec/infinispan_xsite_spec.js +0 -99
- package/spec/protocols_spec.js +0 -82
- package/spec/protostream_spec.js +0 -237
- package/spec/tests.js +0 -28
- package/spec/utils/test-log4js.json +0 -14
- package/spec/utils/testing.js +0 -762
- package/spec/utils/typed-cachemanager-put-get.js +0 -3
- package/spec/utils/typed-null-return-dist.js +0 -2
- package/spec/utils/typed-null-return.js +0 -2
- package/spec/utils/typed-put-get-dist.js +0 -3
- package/spec/utils/typed-put-get-unicode.js +0 -3
- package/spec/utils/typed-put-get.js +0 -3
- package/spec/utils/typed-size.js +0 -2
- package/spec/utils_spec.js +0 -154
- package/spec-manual/infinispan_manual_stress_get_spec.js +0 -50
- package/spec-manual/infinispan_manual_stress_iterate_spec.js +0 -86
package/spec/protostream_spec.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
//'use strict';
|
|
2
|
-
|
|
3
|
-
var _ = require('underscore');
|
|
4
|
-
var path = require('path');
|
|
5
|
-
var long = require('long');
|
|
6
|
-
|
|
7
|
-
var t = require('./utils/testing'); // Testing dependency
|
|
8
|
-
var protobuf = require('protobufjs');
|
|
9
|
-
const { iteratee } = require('underscore');
|
|
10
|
-
var ispn = require('../lib/infinispan');
|
|
11
|
-
|
|
12
|
-
var myMsg = `package awesomepackage;
|
|
13
|
-
syntax = "proto3";
|
|
14
|
-
/**
|
|
15
|
-
* @TypeId(1000043)
|
|
16
|
-
*/
|
|
17
|
-
message AwesomeMessage {
|
|
18
|
-
string awesome_field = 1;
|
|
19
|
-
}`
|
|
20
|
-
|
|
21
|
-
var myMsg2 = `package awesomepackage;
|
|
22
|
-
/**
|
|
23
|
-
* @TypeId(1000043)
|
|
24
|
-
*/
|
|
25
|
-
message AwesomeMessage {
|
|
26
|
-
required string awesome_field = 1;
|
|
27
|
-
}`
|
|
28
|
-
|
|
29
|
-
var myMsg3 = `package awesomepackage;
|
|
30
|
-
/**
|
|
31
|
-
* @TypeId(1000044)
|
|
32
|
-
*/
|
|
33
|
-
message AwesomeUser {
|
|
34
|
-
required string name = 1;
|
|
35
|
-
required int64 age = 2;
|
|
36
|
-
required bool isVerified =3;
|
|
37
|
-
}`
|
|
38
|
-
|
|
39
|
-
var p30 = t.protocol30({
|
|
40
|
-
dataFormat: {
|
|
41
|
-
keyType: 'text/plain',
|
|
42
|
-
valueType: 'application/x-protostream'
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe('Protobuf encoding', function () {
|
|
47
|
-
var expectedArray = [0x0a, 0x0d, 0x41, 0x77, 0x65, 0x73, 0x6f, 0x6d, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67];
|
|
48
|
-
var expectedBuffer = Buffer.from(expectedArray);
|
|
49
|
-
it("Encodes a proto message", function () {
|
|
50
|
-
root = protobuf.parse(myMsg).root;
|
|
51
|
-
|
|
52
|
-
// Obtain a message type
|
|
53
|
-
var AwesomeMessage = root.lookupType(".awesomepackage.AwesomeMessage");
|
|
54
|
-
var payload = { awesomeField: "AwesomeString" };
|
|
55
|
-
var errMsg = AwesomeMessage.verify(payload);
|
|
56
|
-
expect(errMsg === null).toBeTruthy();
|
|
57
|
-
var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary
|
|
58
|
-
var buffer = AwesomeMessage.encode(message).finish();
|
|
59
|
-
expect(Buffer.compare(buffer, expectedBuffer)).toBe(0);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
describe('Protostream encoding', function () {
|
|
65
|
-
p30.registerProtostreamType(".awesomepackage.AwesomeMessage", 1000043);
|
|
66
|
-
|
|
67
|
-
it("Returns the Protostream type", function () {
|
|
68
|
-
var psType = p30.lookupProtostreamTypeByName(".awesomepackage.AwesomeMessage");
|
|
69
|
-
expect(psType).toBe(1000043);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("Encodes a Protostream message", function () {
|
|
73
|
-
root = protobuf.parse(myMsg).root;
|
|
74
|
-
protobuf.loadSync(path.join(__dirname + '/../lib/protostream/message-wrapping.proto'), root);
|
|
75
|
-
// Obtain message types
|
|
76
|
-
var AwesomeMessage = root.lookupType(".awesomepackage.AwesomeMessage");
|
|
77
|
-
var WrappedMessage = root.lookupType(".org.infinispan.protostream.WrappedMessage");
|
|
78
|
-
// Build input message
|
|
79
|
-
var payload = { awesomeField: "AwesomeString" };
|
|
80
|
-
var errMsg = AwesomeMessage.verify(payload);
|
|
81
|
-
expect(errMsg === null).toBeTruthy();
|
|
82
|
-
var message = AwesomeMessage.create(payload);
|
|
83
|
-
// Build manually WrappedMessage
|
|
84
|
-
var buffer = AwesomeMessage.encode(message).finish();
|
|
85
|
-
var wmPayload = {
|
|
86
|
-
wrappedMessage: buffer,
|
|
87
|
-
wrappedTypeId: 1000043
|
|
88
|
-
};
|
|
89
|
-
errMsg = WrappedMessage.verify(wmPayload);
|
|
90
|
-
expect(errMsg === null).toBeTruthy();
|
|
91
|
-
var wmMessage = WrappedMessage.create(wmPayload);
|
|
92
|
-
var expectedWMBuffer = WrappedMessage.encode(wmMessage).finish();
|
|
93
|
-
|
|
94
|
-
// Call client API for encoding
|
|
95
|
-
var outBuf = t.newByteBuf(32);
|
|
96
|
-
p30.encodeMediaValue(message)(outBuf);
|
|
97
|
-
// outBuf contains the WM encoded by the client
|
|
98
|
-
|
|
99
|
-
// Removing buf length at the beginning for comparison
|
|
100
|
-
var trimmed = outBuf.buf.slice(1, outBuf.offset);
|
|
101
|
-
// check the client produces same byte buffer
|
|
102
|
-
expect(Buffer.compare(trimmed, expectedWMBuffer)).toBe(0);
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
describe("Put/Get protostream object to/from Infinispan", function () {
|
|
109
|
-
it("Puts protostream on Infinispan", async function (done) {
|
|
110
|
-
var root = protobuf.parse(myMsg).root;
|
|
111
|
-
var AwesomeMessage = root.lookupType(".awesomepackage.AwesomeMessage");
|
|
112
|
-
try {
|
|
113
|
-
var protoMetaClient = await ispn.client(t.local, { authentication: t.authOpts.authentication, cacheName: '___protobuf_metadata', dataFormat: { keyType: "text/plain", valueType: "text/plain" } });
|
|
114
|
-
var client = await t.client(t.local, { authentication: t.authOpts.authentication, cacheName: 'protoStreamCache', dataFormat: { keyType: "text/plain", valueType: "application/x-protostream" } });
|
|
115
|
-
var payload = { awesomeField: "AwesomeString" };
|
|
116
|
-
var errMsg = AwesomeMessage.verify(payload);
|
|
117
|
-
expect(errMsg === null).toBeTruthy();
|
|
118
|
-
var message = AwesomeMessage.create(payload);
|
|
119
|
-
|
|
120
|
-
await protoMetaClient.put("awesomepackage/AwesomeMessage.proto", myMsg2);
|
|
121
|
-
|
|
122
|
-
await client.clear();
|
|
123
|
-
expect(await client.size()).toBe(0);
|
|
124
|
-
await client.put("myKey", message);
|
|
125
|
-
expect(await client.size()).toBe(1);
|
|
126
|
-
await client.put("myKey1", 1.2);
|
|
127
|
-
await client.put("myKey2","string");
|
|
128
|
-
await client.put("myKey3",true);
|
|
129
|
-
await client.put("myKey4",new ArrayBuffer(8));
|
|
130
|
-
expect(await client.size()).toBe(5);
|
|
131
|
-
|
|
132
|
-
protoMetaClient.disconnect();
|
|
133
|
-
client.disconnect();
|
|
134
|
-
done();
|
|
135
|
-
} catch (error) {
|
|
136
|
-
protoMetaClient.disconnect();
|
|
137
|
-
client.disconnect();
|
|
138
|
-
done(new Error(error));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
it("Gets protostream on Infinispan", async function (done) {
|
|
144
|
-
try {
|
|
145
|
-
var protoMetaClient = await ispn.client(t.local, { authentication: t.authOpts.authentication, cacheName: '___protobuf_metadata', dataFormat: { keyType: "text/plain", valueType: "text/plain" } });
|
|
146
|
-
var client = await t.client(t.local, { authentication: t.authOpts.authentication, cacheName: 'protoStreamCache', dataFormat: { keyType: "text/plain", valueType: "application/x-protostream" } });
|
|
147
|
-
client.registerProtostreamRoot(root);
|
|
148
|
-
var myObj=await client.get("myKey");
|
|
149
|
-
var myObj1=await client.get("myKey1");
|
|
150
|
-
var myObj2=await client.get("myKey2");
|
|
151
|
-
var myObj3=await client.get("myKey3");
|
|
152
|
-
var myObj4=await client.get("myKey4");
|
|
153
|
-
protoMetaClient.disconnect();
|
|
154
|
-
await client.clear();
|
|
155
|
-
client.disconnect();
|
|
156
|
-
done();
|
|
157
|
-
} catch (error) {
|
|
158
|
-
protoMetaClient.disconnect();
|
|
159
|
-
client.disconnect();
|
|
160
|
-
done(new Error(error));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
describe('Querying in application/x-protostream format',function () {
|
|
167
|
-
var root = protobuf.parse(myMsg).root;
|
|
168
|
-
var AwesomeMessage = root.lookupType(".awesomepackage.AwesomeMessage");
|
|
169
|
-
var root2 = protobuf.parse(myMsg3).root;
|
|
170
|
-
var AwesomeUser = root2.lookupType(".awesomepackage.AwesomeUser");
|
|
171
|
-
it("Queries the server without projection", async function (done) {
|
|
172
|
-
try{
|
|
173
|
-
var protoMetaClient = await ispn.client(t.local, { authentication: t.authOpts.authentication, cacheName: '___protobuf_metadata', dataFormat: { keyType: "text/plain", valueType: "text/plain" } });
|
|
174
|
-
var client = await t.client(t.local, { authentication: t.authOpts.authentication, cacheName: 'protoStreamCache', dataFormat: { keyType: "application/x-protostream", valueType: "application/x-protostream" } });
|
|
175
|
-
await protoMetaClient.put("awesomepackage/AwesomeMessage.proto", myMsg2);
|
|
176
|
-
await client.clear();
|
|
177
|
-
for(let i=0;i<10;i++){
|
|
178
|
-
var payload = { awesomeField: "AwesomeString"+i };
|
|
179
|
-
var message = AwesomeMessage.create(payload);
|
|
180
|
-
await client.put(i,message)
|
|
181
|
-
}
|
|
182
|
-
var queryResp1 = await client.query({queryString:`from awesomepackage.AwesomeMessage ORDER BY awesome_field`});
|
|
183
|
-
expect(queryResp1.length).toBe(10);
|
|
184
|
-
var queryResp2 = await client.query({queryString:`from awesomepackage.AwesomeMessage a where a.awesome_field='AwesomeString1'`});
|
|
185
|
-
expect(queryResp2.length).toBe(1);
|
|
186
|
-
expect(queryResp2[0].awesomeField).toEqual('AwesomeString1');
|
|
187
|
-
var queryResp3 = await client.query({queryString:`from awesomepackage.AwesomeMessage a where a.awesome_field='AwesomeString100'`});
|
|
188
|
-
expect(queryResp3.length).toEqual(0);
|
|
189
|
-
protoMetaClient.disconnect();
|
|
190
|
-
await client.clear();
|
|
191
|
-
client.disconnect();
|
|
192
|
-
done();
|
|
193
|
-
}catch (error) {
|
|
194
|
-
protoMetaClient.disconnect();
|
|
195
|
-
client.disconnect();
|
|
196
|
-
done(new Error(error));
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
it("Queries the server with projection", async function (done) {
|
|
201
|
-
try{
|
|
202
|
-
var protoMetaClient = await ispn.client(t.local, { authentication: t.authOpts.authentication, cacheName: '___protobuf_metadata', dataFormat: { keyType: "text/plain", valueType: "text/plain" } });
|
|
203
|
-
var client = await t.client(t.local, { authentication: t.authOpts.authentication, cacheName: 'protoStreamCache', dataFormat: { keyType: "application/x-protostream", valueType: "application/x-protostream" } });
|
|
204
|
-
await protoMetaClient.put("awesomepackage/AwesomeUser.proto", myMsg3);
|
|
205
|
-
client.registerProtostreamRoot(root2);
|
|
206
|
-
client.registerProtostreamType(".awesomepackage.AwesomeUser",1000044);
|
|
207
|
-
await client.clear();
|
|
208
|
-
for (let i = 0; i < 10; i++){
|
|
209
|
-
var payload = { name: "AwesomeString"+i , age : i , isVerified: (Math.random()<0.5)};
|
|
210
|
-
var message = AwesomeUser.create(payload);
|
|
211
|
-
await client.put(i,message)
|
|
212
|
-
}
|
|
213
|
-
var query1 = await client.query({ queryString: `select u.name,u.age from awesomepackage.AwesomeUser u where u.age<20 order by u.name asc` });
|
|
214
|
-
expect(query1.length).toBe(10);
|
|
215
|
-
expect(query1[0].length).toBe(2);
|
|
216
|
-
for (let i = 0; i < 10; i++) {
|
|
217
|
-
expect(_.isEqual(query1[i][1], long.fromValue(i))).toBeTruthy();
|
|
218
|
-
}
|
|
219
|
-
var query2 = await client.query({queryString:`select u.name from awesomepackage.AwesomeUser u where u.age=2`});
|
|
220
|
-
expect(query2[0][0]).toBe("AwesomeString2");
|
|
221
|
-
|
|
222
|
-
var query3 = await client.query({queryString:`select u.name from awesomepackage.AwesomeUser u where u.age>20`});
|
|
223
|
-
expect(query3.length).toBe(0);
|
|
224
|
-
|
|
225
|
-
protoMetaClient.disconnect();
|
|
226
|
-
await client.clear();
|
|
227
|
-
client.disconnect();
|
|
228
|
-
done();
|
|
229
|
-
}catch (error) {
|
|
230
|
-
protoMetaClient.disconnect();
|
|
231
|
-
client.disconnect();
|
|
232
|
-
done(new Error(error));
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
);
|
package/spec/tests.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var t = require('./utils/testing'); // Testing dependency
|
|
2
|
-
|
|
3
|
-
exports.execPutGet = function(path, prefix, client, expectFun) {
|
|
4
|
-
return function(done) {
|
|
5
|
-
var scriptName = prefix + '-typed-put-get.js';
|
|
6
|
-
var params = {k: prefix + '-typed-key', v: prefix + '-typed-value'};
|
|
7
|
-
client
|
|
8
|
-
.then(t.loadAndExec(path, scriptName))
|
|
9
|
-
.then(t.assert(t.exec(scriptName, params), expectFun))
|
|
10
|
-
.then(t.assert(t.get(prefix + "-typed-key"), t.toBe(prefix + "-typed-value")))
|
|
11
|
-
.catch(t.failed(done)).finally(done);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.iterateEntries = function(prefix, batchSize, client) {
|
|
16
|
-
return function(done) {
|
|
17
|
-
var pairs = [
|
|
18
|
-
{key: prefix + '-it1', value: 'v1', done: false},
|
|
19
|
-
{key: prefix + '-it2', value: 'v2', done: false},
|
|
20
|
-
{key: prefix + '-it3', value: 'v3', done: false}];
|
|
21
|
-
client
|
|
22
|
-
.then(t.assert(t.clear()))
|
|
23
|
-
.then(t.assert(t.putAll(pairs), t.toBeUndefined))
|
|
24
|
-
.then(t.seqIterator('key', batchSize, pairs))
|
|
25
|
-
.catch(t.failed(done))
|
|
26
|
-
.finally(done);
|
|
27
|
-
}
|
|
28
|
-
};
|