Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
568e7914
Commit
568e7914
authored
Mar 10, 2017
by
project
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
dca03c18
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
memstore.js
jobexecutor/lib/memstore.js
+9
-2
gistda-water.json
test/jobs/gistda-water.json
+1
-1
test.js
test/test.js
+11
-0
No files found.
jobexecutor/lib/memstore.js
View file @
568e7914
...
@@ -13,13 +13,20 @@ function memstore(conf){
...
@@ -13,13 +13,20 @@ function memstore(conf){
memstore
.
prototype
.
setItem
=
function
(
k
,
v
,
cb
){
memstore
.
prototype
.
setItem
=
function
(
k
,
v
,
cb
){
var
key
=
this
.
prefix
+
":"
+
k
;
var
key
=
this
.
prefix
+
":"
+
k
;
this
.
mem
.
set
(
key
,
v
,
cb
);
var
value
=
JSON
.
stringify
(
v
);
this
.
mem
.
set
(
key
,
value
,
cb
);
}
}
memstore
.
prototype
.
getItem
=
function
(
k
,
cb
)
memstore
.
prototype
.
getItem
=
function
(
k
,
cb
)
{
{
var
key
=
this
.
prefix
+
":"
+
k
;
var
key
=
this
.
prefix
+
":"
+
k
;
this
.
mem
.
get
(
key
,
cb
);
this
.
mem
.
get
(
key
,
function
(
err
,
v
){
var
value
=
null
;
if
(
!
err
){
value
=
JSON
.
parse
(
v
);
}
cb
(
err
,
value
);
});
}
}
module
.
exports
=
memstore
;
module
.
exports
=
memstore
;
test/jobs/gistda-water.json
View file @
568e7914
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
}
}
},
},
"data_transform"
:
{
"data_transform"
:
{
"type"
:
"
noop
"
"type"
:
"
gistda-water
"
},
},
"data_out"
:
{
"data_out"
:
{
"type"
:
"storage"
,
"type"
:
"storage"
,
...
...
test/test.js
View file @
568e7914
...
@@ -109,3 +109,14 @@ const crypto = require("crypto");
...
@@ -109,3 +109,14 @@ const crypto = require("crypto");
// evs.sub('storage.sds.#',function(err,msg){
// evs.sub('storage.sds.#',function(err,msg){
// console.log(msg);
// console.log(msg);
// });
// });
var
memstore
=
ctx
.
getLib
(
'jobexecutor/lib/memstore'
);
var
ms
=
new
memstore
({
'job_id'
:
'job01'
,
'cat'
:
'global'
,
'conn'
:
'redis://:@bigmaster.igridproject.info:6379/1'
})
var
txt
=
"kamron
\n
aroonrua"
ms
.
setItem
(
'test1'
,{
't'
:
txt
});
ms
.
getItem
(
'test1'
,
function
(
err
,
val
){
console
.
log
(
val
.
t
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment