Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Junming
jio
Commits
20e2156e
Commit
20e2156e
authored
Mar 03, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jslint s3 files
parent
59b36505
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
28 deletions
+21
-28
src/jio.storage/multisplitstorage.js
src/jio.storage/multisplitstorage.js
+1
-5
src/jio.storage/s3storage.js
src/jio.storage/s3storage.js
+1
-6
test/jio.storage/multi.split.s3storage.tests.js
test/jio.storage/multi.split.s3storage.tests.js
+17
-14
test/jio.storage/s3storage.tests.js
test/jio.storage/s3storage.tests.js
+2
-2
test/jio.storage/split.s3storage.tests.js
test/jio.storage/split.s3storage.tests.js
+0
-1
No files found.
src/jio.storage/multisplitstorage.js
View file @
20e2156e
...
@@ -206,7 +206,6 @@
...
@@ -206,7 +206,6 @@
* @class MultiSplitStorage
* @class MultiSplitStorage
*/
*/
function
MultiSplitStorage
(
spec
)
{
function
MultiSplitStorage
(
spec
)
{
console
.
info
(
'
mutli creation
'
);
var
that
=
this
,
priv
=
{};
var
that
=
this
,
priv
=
{};
/**
/**
...
@@ -310,7 +309,7 @@
...
@@ -310,7 +309,7 @@
//re-init
//re-init
i
=
0
;
i
=
0
;
}
;
}
/**
/**
* Split document metadata then store them to the sub storages.
* Split document metadata then store them to the sub storages.
...
@@ -322,7 +321,6 @@
...
@@ -322,7 +321,6 @@
* @param {String} method The command method ('post' or 'put')
* @param {String} method The command method ('post' or 'put')
*/
*/
priv
.
postOrPut
=
function
(
command
,
doc
,
option
,
method
)
{
priv
.
postOrPut
=
function
(
command
,
doc
,
option
,
method
)
{
console
.
log
(
"
multi post or put
"
);
var
i
,
data
,
doc_list
=
[],
doc_underscores
=
{};
var
i
,
data
,
doc_list
=
[],
doc_underscores
=
{};
for
(
i
in
doc
)
{
for
(
i
in
doc
)
{
if
(
doc
.
hasOwnProperty
(
i
))
{
if
(
doc
.
hasOwnProperty
(
i
))
{
...
@@ -359,7 +357,6 @@
...
@@ -359,7 +357,6 @@
delete
err
.
index
;
delete
err
.
index
;
return
command
.
error
(
err
);
return
command
.
error
(
err
);
}
}
console
.
log
(
"
post or put succes
"
,
doc_underscores
.
_id
);
command
.
success
({
"
id
"
:
doc_underscores
.
_id
});
command
.
success
({
"
id
"
:
doc_underscores
.
_id
});
});
});
};
};
...
@@ -579,7 +576,6 @@
...
@@ -579,7 +576,6 @@
}
}
);
);
};
};
console
.
info
(
'
mutli created
'
);
}
// end of MultiplitStorage
}
// end of MultiplitStorage
jIO
.
addStorage
(
'
multisplit
'
,
MultiSplitStorage
);
jIO
.
addStorage
(
'
multisplit
'
,
MultiSplitStorage
);
...
...
src/jio.storage/s3storage.js
View file @
20e2156e
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
jIO
.
addStorage
(
"
s3
"
,
function
(
spec
)
{
jIO
.
addStorage
(
"
s3
"
,
function
(
spec
)
{
console
.
info
(
'
S3 creation
'
);
var
that
,
priv
=
{},
lastDigest
,
isDelete
;
var
that
,
priv
=
{},
lastDigest
,
isDelete
;
that
=
this
;
that
=
this
;
...
@@ -78,6 +77,7 @@
...
@@ -78,6 +77,7 @@
last
=
false
;
last
=
false
;
return
'
.
'
;
return
'
.
'
;
}
}
/*jslint ass: true */
while
((
el
=
split
.
shift
())
!==
undefined
)
{
while
((
el
=
split
.
shift
())
!==
undefined
)
{
last
=
true
;
last
=
true
;
el
=
el
.
replace
(
/__/g
,
'
%2595
'
);
el
=
el
.
replace
(
/__/g
,
'
%2595
'
);
...
@@ -510,7 +510,6 @@
...
@@ -510,7 +510,6 @@
function
postDocument
()
{
function
postDocument
()
{
var
fd
,
Signature
,
xhr
;
var
fd
,
Signature
,
xhr
;
doc_id
=
priv
.
idsToFileName
(
doc_id
);
doc_id
=
priv
.
idsToFileName
(
doc_id
);
console
.
log
(
doc_id
);
//Meant to deep-serialize in order to avoid
//Meant to deep-serialize in order to avoid
//conflicts due to the multipart enctype
//conflicts due to the multipart enctype
doc
=
JSON
.
stringify
(
doc
);
doc
=
JSON
.
stringify
(
doc
);
...
@@ -660,7 +659,6 @@
...
@@ -660,7 +659,6 @@
};
};
that
.
putAttachment
=
function
(
command
,
param
)
{
that
.
putAttachment
=
function
(
command
,
param
)
{
console
.
info
(
'
S3 putAttachment
'
);
var
my_document
,
var
my_document
,
docId
,
docId
,
attachId
,
attachId
,
...
@@ -871,7 +869,6 @@
...
@@ -871,7 +869,6 @@
var
_succ
,
my_document
,
mime
;
var
_succ
,
my_document
,
mime
;
_succ
=
command
.
success
;
_succ
=
command
.
success
;
command
.
success
=
function
()
{
command
.
success
=
function
()
{
console
.
log
.
apply
(
console
,
arguments
);
_succ
.
apply
(
this
,
arguments
);
_succ
.
apply
(
this
,
arguments
);
};
};
my_document
=
null
;
my_document
=
null
;
...
@@ -989,7 +986,6 @@
...
@@ -989,7 +986,6 @@
}
else
{
}
else
{
for
(
i
;
i
>=
0
;
i
-=
1
)
{
for
(
i
;
i
>=
0
;
i
-=
1
)
{
keyId
=
resultTable
[
i
];
keyId
=
resultTable
[
i
];
console
.
log
(
keyId
);
allDocResponse
.
rows
[
i
]
=
{
allDocResponse
.
rows
[
i
]
=
{
"
id
"
:
priv
.
fileNameToIds
(
keyId
)[
0
],
"
id
"
:
priv
.
fileNameToIds
(
keyId
)[
0
],
"
value
"
:
{}
"
value
"
:
{}
...
@@ -1014,6 +1010,5 @@
...
@@ -1014,6 +1010,5 @@
//fin alldocs
//fin alldocs
};
};
console
.
info
(
'
S3 created
'
);
});
});
}));
}));
test/jio.storage/multi.split.s3storage.tests.js
View file @
20e2156e
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
'
gidstorage
'
,
'
gidstorage
'
,
'
s3storage
'
,
'
s3storage
'
,
'
multisplitstorage
'
'
multisplitstorage
'
],
function
(
jIO
,
util
,
RSVP
)
{
],
function
(
jIO
,
util
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
...
@@ -58,25 +57,29 @@
...
@@ -58,25 +57,29 @@
"
password
"
:
"
/YHoa5r2X6EUHfvP31jdYx6t75h81pAjIZ4Mt94y
"
"
password
"
:
"
/YHoa5r2X6EUHfvP31jdYx6t75h81pAjIZ4Mt94y
"
};
};
var
jio_gid_description
=
{},
jio_gid_description2
=
{};
shared
.
jio_gid_description
=
{};
jio_gid_description
.
type
=
jio_gid_description2
.
type
=
"
gid
"
;
shared
.
jio_gid_description2
=
{};
jio_gid_description
.
constraints
=
jio_gid_description2
.
constraints
=
{
shared
.
jio_gid_description
.
type
=
shared
.
jio_gid_description2
.
type
=
"
gid
"
;
shared
.
jio_gid_description
.
constraints
=
shared
.
jio_gid_description2
.
constraints
=
{
"
default
"
:
{
"
default
"
:
{
"
title
"
:
"
string
"
"
title
"
:
"
string
"
}
}
};
};
jio_gid_description
.
sub_storage
=
shared
.
s3_storage_description1
;
shared
.
jio_gid_description
.
sub_storage
=
shared
.
s3_storage_description1
;
jio_gid_description2
.
sub_storage
=
shared
.
s3_storage_description2
;
shared
.
jio_gid_description2
.
sub_storage
=
shared
.
s3_storage_description2
;
var
jio_multisplit_description
=
{
shared
.
jio_multisplit_description
=
{
"
type
"
:
"
multisplit
"
,
"
type
"
:
"
multisplit
"
,
"
storage_list
"
:
[
"
storage_list
"
:
[
jio_gid_description
,
shared
.
jio_gid_description
,
jio_gid_description2
shared
.
jio_gid_description2
]
]
};
};
jio
=
jIO
.
createJIO
(
jio_multisplit_description
,
{
"
workspace
"
:
shared
.
workspace
});
jio
=
jIO
.
createJIO
(
shared
.
jio_multisplit_description
,
{
"
workspace
"
:
shared
.
workspace
});
jio_s3_list
[
0
]
=
jIO
.
createJIO
(
shared
.
s3_storage_description1
,
{
jio_s3_list
[
0
]
=
jIO
.
createJIO
(
shared
.
s3_storage_description1
,
{
"
workspace
"
:
shared
.
workspace
"
workspace
"
:
shared
.
workspace
});
});
...
...
test/jio.storage/s3storage.tests.js
View file @
20e2156e
test/jio.storage/split.s3storage.tests.js
View file @
20e2156e
...
@@ -109,7 +109,6 @@
...
@@ -109,7 +109,6 @@
jio_s3_list
[
0
]
=
jIO
.
createJIO
(
shared
.
s3_storage_description1
,
{
jio_s3_list
[
0
]
=
jIO
.
createJIO
(
shared
.
s3_storage_description1
,
{
"
workspace
"
:
shared
.
workspace
"
workspace
"
:
shared
.
workspace
});
});
console
.
log
(
jio_s3_list
[
0
])
jio_s3_list
[
1
]
=
jIO
.
createJIO
(
shared
.
s3_storage_description2
,
{
jio_s3_list
[
1
]
=
jIO
.
createJIO
(
shared
.
s3_storage_description2
,
{
"
workspace
"
:
shared
.
workspace
"
workspace
"
:
shared
.
workspace
});
});
...
...
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