mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
happy happy joy joy
This commit is contained in:
parent
a42ba634d7
commit
4abf54a3a7
docsys/src/main/resources/docsys-guidebook
200.html
_nuxt
03056607be941ec702c3.js048047df04458945fa8d.js0dce5f2b60ad1e8f3695.css166127febd2522ec550a.js1c07b4ed6a951140da61.js21be02843d3e4d81a96c.css287ef5fb37a341b3c9cd.js2db30ff69d2689005afd.js35ded9159e5aa5616960.js3a496b8c293c39cf6081.js455b476d54ca6d01b2b9.css48e7b324ad6ae108b9e2.js4948cee06bd058a8b88a.js7950fa788c28a8d2d4a2.js82626aa0367d3e78a341.js863e7a222172e5520e74.js900dca5501bd22b95704.js9274df7b92b9c313bf36.js9962ca910f9a62ec84b8.js9c26b09650c49a27aef7.js9df52705ed277513b398.cssa1cbfece39b8e1ea981a.jsa32e39032f73a0c63675.jsc5e32aa46ff0e82097ae.cssc8f6ba2f98090c34d2af.jse7cb070126fa2058f2a7.cssecabc445f3d17c92b38a.jsf3c83d1acf18e61fb39d.cssf4e5e07a19d152533e5c.js
index.htmlengine-api/src/main/java/io/nosqlbench/engine/api
activityconfig
scenarios
engine-cli/src
main/java/io/nosqlbench/engine/cli
test/java/io/nosqlbench/engine/cli
nb-api/src
main/java/io/nosqlbench/nb/api/content
Content.javaNBIO.javaPathContent.javaResolverForClasspath.javaResolverForFilesystem.javaResolverForURL.javaURIResolver.javaURLContent.java
fluent
test/java/io/nosqlbench/nb/api
@ -1,9 +1,9 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>NoSQLBench Docs</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/863e7a222172e5520e74.js" as="script"><link rel="preload" href="/_nuxt/9c26b09650c49a27aef7.js" as="script"><link rel="preload" href="/_nuxt/455b476d54ca6d01b2b9.css" as="style"><link rel="preload" href="/_nuxt/048047df04458945fa8d.js" as="script"><link rel="preload" href="/_nuxt/9df52705ed277513b398.css" as="style"><link rel="preload" href="/_nuxt/1c07b4ed6a951140da61.js" as="script">
|
||||
<link href="/_nuxt/455b476d54ca6d01b2b9.css" rel="stylesheet"><link href="/_nuxt/9df52705ed277513b398.css" rel="stylesheet"></head>
|
||||
<title>NoSQLBench</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/82626aa0367d3e78a341.js" as="script"><link rel="preload" href="/_nuxt/2db30ff69d2689005afd.js" as="script"><link rel="preload" href="/_nuxt/900dca5501bd22b95704.js" as="script"><link rel="preload" href="/_nuxt/35ded9159e5aa5616960.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="__nuxt"><style>#nuxt-loading{visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div>
|
||||
<script type="text/javascript" src="/_nuxt/863e7a222172e5520e74.js"></script><script type="text/javascript" src="/_nuxt/9c26b09650c49a27aef7.js"></script><script type="text/javascript" src="/_nuxt/048047df04458945fa8d.js"></script><script type="text/javascript" src="/_nuxt/1c07b4ed6a951140da61.js"></script></body>
|
||||
<script type="text/javascript" src="/_nuxt/82626aa0367d3e78a341.js"></script><script type="text/javascript" src="/_nuxt/2db30ff69d2689005afd.js"></script><script type="text/javascript" src="/_nuxt/900dca5501bd22b95704.js"></script><script type="text/javascript" src="/_nuxt/35ded9159e5aa5616960.js"></script></body>
|
||||
</html>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
.Side{width:15%}.Middle,.Side{display:inline-block;position:relative}.Middle{width:65%}.Logo{display:inline-block;-webkit-animation:turn 2s linear 1s forwards;animation:turn 2s linear 1s forwards;transform:rotateX(180deg);position:relative;overflow:hidden;height:180px;width:400px}.Section{position:absolute;top:0;left:0;width:0;height:0}.Weight{position:relative;display:inline-block;width:14px;height:90px;background-color:#0c1439;border-radius:30% 30% 30% 30%/10% 10% 10% 10%}.Medium{transform:scale(.7)}.Small{transform:scale(.4)}.Bar{width:100%;height:15px;background-color:#ff7d2b;margin-top:37px}@-webkit-keyframes turn{to{transform:rotateX(0deg)}}@keyframes turn{to{transform:rotateX(0deg)}}@-webkit-keyframes godown{to{top:180px}}@keyframes godown{to{top:180px}}@-webkit-keyframes goright{to{left:70px}}@keyframes goright{to{left:70px}}.container{margin:0 auto;min-height:60vh;display:flex;justify-content:center;align-items:center;text-align:center}.title{font-family:Quicksand,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;display:block;font-weight:300;font-size:100px;color:#35495e;letter-spacing:1px}.subtitle{font-weight:300;font-size:42px;color:#526488;word-spacing:5px;padding-bottom:15px}.links{padding-top:15px}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
!function(e){function r(data){for(var r,n,f=data[0],l=data[1],d=data[2],i=0,h=[];i<f.length;i++)n=f[i],Object.prototype.hasOwnProperty.call(o,n)&&o[n]&&h.push(o[n][0]),o[n]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(v&&v(data);h.length;)h.shift()();return c.push.apply(c,d||[]),t()}function t(){for(var e,i=0;i<c.length;i++){for(var r=c[i],t=!0,n=1;n<r.length;n++){var l=r[n];0!==o[l]&&(t=!1)}t&&(c.splice(i--,1),e=f(f.s=r[0]))}return e}var n={},o={11:0},c=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var c,script=document.createElement("script");script.charset="utf-8",script.timeout=120,f.nc&&script.setAttribute("nonce",f.nc),script.src=function(e){return f.p+""+{0:"03056607be941ec702c3",1:"a1cbfece39b8e1ea981a",2:"48e7b324ad6ae108b9e2",3:"287ef5fb37a341b3c9cd",6:"4948cee06bd058a8b88a",7:"a32e39032f73a0c63675",8:"9274df7b92b9c313bf36",9:"7950fa788c28a8d2d4a2",10:"3a496b8c293c39cf6081",13:"9962ca910f9a62ec84b8"}[e]+".js"}(e);var l=new Error;c=function(r){script.onerror=script.onload=null,clearTimeout(d);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;l.message="Loading chunk "+e+" failed.\n("+n+": "+c+")",l.name="ChunkLoadError",l.type=n,l.request=c,t[1](l)}o[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:script})}),12e4);script.onerror=script.onload=c,document.head.appendChild(script)}return Promise.all(r)},f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(object,e){return Object.prototype.hasOwnProperty.call(object,e)},f.p="/_nuxt/",f.oe=function(e){throw console.error(e),e};var l=window.webpackJsonp=window.webpackJsonp||[],d=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var v=d;t()}([]);
|
@ -1 +0,0 @@
|
||||
!function(e){function t(data){for(var t,n,o=data[0],l=data[1],d=data[2],i=0,h=[];i<o.length;i++)n=o[i],Object.prototype.hasOwnProperty.call(c,n)&&c[n]&&h.push(c[n][0]),c[n]=0;for(t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t]);for(v&&v(data);h.length;)h.shift()();return f.push.apply(f,d||[]),r()}function r(){for(var e,i=0;i<f.length;i++){for(var t=f[i],r=!0,n=1;n<t.length;n++){var o=t[n];0!==c[o]&&(r=!1)}r&&(f.splice(i--,1),e=l(l.s=t[0]))}return e}var n={},o={8:0},c={8:0},f=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,1:1,4:1,5:1,7:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n={0:"f3c83d1acf18e61fb39d",1:"0dce5f2b60ad1e8f3695",4:"c5e32aa46ff0e82097ae",5:"e7cb070126fa2058f2a7",6:"31d6cfe0d16ae931b73c",7:"21be02843d3e4d81a96c"}[e]+".css",c=l.p+n,f=document.getElementsByTagName("link"),i=0;i<f.length;i++){var d=(v=f[i]).getAttribute("data-href")||v.getAttribute("href");if("stylesheet"===v.rel&&(d===n||d===c))return t()}var h=document.getElementsByTagName("style");for(i=0;i<h.length;i++){var v;if((d=(v=h[i]).getAttribute("data-href"))===n||d===c)return t()}var m=document.createElement("link");m.rel="stylesheet",m.type="text/css",m.onload=t,m.onerror=function(t){var n=t&&t.target&&t.target.src||c,f=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");f.code="CSS_CHUNK_LOAD_FAILED",f.request=n,delete o[e],m.parentNode.removeChild(m),r(f)},m.href=c;var y=document.querySelector("head");y.appendChild(m)})).then((function(){o[e]=0})));var r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var f,script=document.createElement("script");script.charset="utf-8",script.timeout=120,l.nc&&script.setAttribute("nonce",l.nc),script.src=function(e){return l.p+""+{0:"ecabc445f3d17c92b38a",1:"7f6163994ae4a34e9bcb",4:"f4e5e07a19d152533e5c",5:"166127febd2522ec550a",6:"8f5f327d916d91da5ecc",7:"c8f6ba2f98090c34d2af"}[e]+".js"}(e);var d=new Error;f=function(t){script.onerror=script.onload=null,clearTimeout(h);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",d.name="ChunkLoadError",d.type=n,d.request=o,r[1](d)}c[e]=void 0}};var h=setTimeout((function(){f({type:"timeout",target:script})}),12e4);script.onerror=script.onload=f,document.head.appendChild(script)}return Promise.all(t)},l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(object,e){return Object.prototype.hasOwnProperty.call(object,e)},l.p="/_nuxt/",l.oe=function(e){throw console.error(e),e};var d=window.webpackJsonp=window.webpackJsonp||[],h=d.push.bind(d);d.push=t,d=d.slice();for(var i=0;i<d.length;i++)t(d[i]);var v=h;r()}([]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
h1[data-v-45a595ce]{font-size:20px}.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#fff;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}html{font-family:Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:16px;word-spacing:1px;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;box-sizing:border-box}*,:after,:before{box-sizing:border-box;margin:0}.button--purple{display:inline-block;border-radius:4px;border:1px solid #0c1439;color:#0c1439;text-decoration:none;padding:10px 30px}.button--purple:hover{color:#fff;background-color:#0c1439}.button--grey{display:inline-block;border-radius:4px;border:1px solid #35495e;color:#35495e;text-decoration:none;padding:10px 30px;margin-left:15px}.button--grey:hover{color:#fff;background-color:#35495e}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
.v-list-item,.v-list-item--title{color:#fff}.v-list-item--active{color:#fff!important}.theme--light.v-list-item:not(.v-list-item--active):not(.v-list-item--disabled),.v-list-item--disabled{color:#ddd!important}.isactive,.nuxt-link-exact-active{background-color:#7f828b;color:#52c41a}.router-link-active{background-color:#fff;color:#fff}.v-application code:after,.v-application code:before,code.hljs:before,code:before{content:""}pre{padding:5px;margin:0 0 10px 5px}ul{padding-bottom:10px}code:after{content:""}.md-body{padding-left:10px;justify-content:left;align-items:left;text-align:left;vertical-align:top;alignment:top;text-align:top;webkit-box-align:initial}.markdown-it-vue-alter-info{border:1px solid #91d5ff;background-color:#e6f7ff}.markdown-it-vue-alert-icon-info{color:#1890ff}.markdown-it-vue-alter-success{border:1px solid #b7eb8f;background-color:#f6ffed}.markdown-it-vue-alert-icon-success{color:#52c41a}.markdown-it-vue-alter-error{border:1px solid #f5222d;background-color:#fff1f0}.markdown-it-vue-alert-icon-error{color:#f5222d}.markdown-it-vue-alter-warning{border:1px solid #ffe58f;background-color:#fffbe6}.markdown-it-vue-alert-icon-warning{color:#faad14}.markdown-it-vue-alter{border-radius:0;border:0;display:inline-flex;font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-feature-settings:"tnum";font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);box-sizing:border-box;list-style:none;position:relative;padding:8px 15px 8px 37px;border-radius:4px;width:100%;margin-bottom:16px}.markdown-it-vue-alter p{margin-bottom:2px}.markdown-it-vue-alert-icon{top:11.5px;left:16px;position:absolute}
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
.v-list-item,.v-list-item--title{color:#fff}.v-list-item--active{color:#fff!important}.theme--light.v-list-item:not(.v-list-item--active):not(.v-list-item--disabled),.v-list-item--disabled{color:#ddd!important}.isactive,.nuxt-link-exact-active{background-color:#7f828b;color:#52c41a}.router-link-active{background-color:#fff;color:#fff}.v-application code:after,.v-application code:before,code.hljs:before,code:before{content:""}pre{padding:5px;margin:0 0 10px 5px}ul{padding-bottom:10px}code:after{content:""}.md-body{padding-left:10px;justify-content:left;align-items:left;text-align:left;vertical-align:top;alignment:top;text-align:top;webkit-box-align:initial}.markdown-it-vue-alter-info{border:1px solid #91d5ff;background-color:#e6f7ff}.markdown-it-vue-alert-icon-info{color:#1890ff}.markdown-it-vue-alter-success{border:1px solid #b7eb8f;background-color:#f6ffed}.markdown-it-vue-alert-icon-success{color:#52c41a}.markdown-it-vue-alter-error{border:1px solid #f5222d;background-color:#fff1f0}.markdown-it-vue-alert-icon-error{color:#f5222d}.markdown-it-vue-alter-warning{border:1px solid #ffe58f;background-color:#fffbe6}.markdown-it-vue-alert-icon-warning{color:#faad14}.markdown-it-vue-alter{border-radius:0;border:0;display:inline-flex;font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-feature-settings:"tnum";font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);box-sizing:border-box;list-style:none;position:relative;padding:8px 15px 8px 37px;border-radius:4px;width:100%;margin-bottom:16px}.markdown-it-vue-alter p{margin-bottom:2px}.markdown-it-vue-alert-icon{top:11.5px;left:16px;position:absolute}.container{margin:0 auto;min-height:60vh;display:flex;justify-content:center;align-items:center;text-align:center}.title{font-family:Quicksand,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;display:block;font-weight:300;font-size:100px;color:#35495e;letter-spacing:1px}.subtitle{font-weight:300;font-size:42px;color:#526488;word-spacing:5px;padding-bottom:15px}.links{padding-top:15px}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,9 +1,9 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>NoSQLBench Docs</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/863e7a222172e5520e74.js" as="script"><link rel="preload" href="/_nuxt/9c26b09650c49a27aef7.js" as="script"><link rel="preload" href="/_nuxt/455b476d54ca6d01b2b9.css" as="style"><link rel="preload" href="/_nuxt/048047df04458945fa8d.js" as="script"><link rel="preload" href="/_nuxt/9df52705ed277513b398.css" as="style"><link rel="preload" href="/_nuxt/1c07b4ed6a951140da61.js" as="script">
|
||||
<link href="/_nuxt/455b476d54ca6d01b2b9.css" rel="stylesheet"><link href="/_nuxt/9df52705ed277513b398.css" rel="stylesheet"></head>
|
||||
<title>NoSQLBench</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/82626aa0367d3e78a341.js" as="script"><link rel="preload" href="/_nuxt/2db30ff69d2689005afd.js" as="script"><link rel="preload" href="/_nuxt/900dca5501bd22b95704.js" as="script"><link rel="preload" href="/_nuxt/35ded9159e5aa5616960.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="__nuxt"><style>#nuxt-loading{visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div>
|
||||
<script type="text/javascript" src="/_nuxt/863e7a222172e5520e74.js"></script><script type="text/javascript" src="/_nuxt/9c26b09650c49a27aef7.js"></script><script type="text/javascript" src="/_nuxt/048047df04458945fa8d.js"></script><script type="text/javascript" src="/_nuxt/1c07b4ed6a951140da61.js"></script></body>
|
||||
<script type="text/javascript" src="/_nuxt/82626aa0367d3e78a341.js"></script><script type="text/javascript" src="/_nuxt/2db30ff69d2689005afd.js"></script><script type="text/javascript" src="/_nuxt/900dca5501bd22b95704.js"></script><script type="text/javascript" src="/_nuxt/35ded9159e5aa5616960.js"></script></body>
|
||||
</html>
|
||||
|
@ -20,15 +20,43 @@ package io.nosqlbench.engine.api.activityconfig;
|
||||
import io.nosqlbench.engine.api.activityconfig.rawyaml.RawStmtsDocList;
|
||||
import io.nosqlbench.engine.api.activityconfig.rawyaml.RawYamlStatementLoader;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||
import io.nosqlbench.nb.api.content.Content;
|
||||
import io.nosqlbench.nb.api.content.NBIO;
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class StatementsLoader {
|
||||
|
||||
public static StmtsDocList load(Logger logger, String path, String... searchPaths) {
|
||||
public static StmtsDocList load(Logger logger, Content<?> content) {
|
||||
RawYamlStatementLoader loader = new RawYamlStatementLoader();
|
||||
RawStmtsDocList rawDocList = loader.load(logger, path, searchPaths);
|
||||
RawStmtsDocList rawDocList = loader.loadString(logger, content.get());
|
||||
StmtsDocList layered = new StmtsDocList(rawDocList);
|
||||
return layered;
|
||||
}
|
||||
|
||||
// public static StmtsDocList load(Logger logger, Path path) {
|
||||
// RawYamlStatementLoader loader = new RawYamlStatementLoader();
|
||||
// RawStmtsDocList rawDocList = loader.load(logger, path);
|
||||
// StmtsDocList layered = new StmtsDocList(rawDocList);
|
||||
// return layered;
|
||||
// }
|
||||
|
||||
public static StmtsDocList load(Logger logger, String path, String... searchPaths) {
|
||||
Optional<Content<?>> foundStmtsDoc = NBIO.all()
|
||||
.prefix(searchPaths)
|
||||
.name(path)
|
||||
.one();
|
||||
|
||||
Content<?> content = foundStmtsDoc.orElseThrow(() ->
|
||||
new BasicError("Unable to find content for '" + path + "' in search paths: " + String.join(",",
|
||||
searchPaths)));
|
||||
|
||||
RawYamlStatementLoader loader = new RawYamlStatementLoader();
|
||||
RawStmtsDocList rawDocList = loader.loadString(logger, content.get());
|
||||
StmtsDocList layered = new StmtsDocList(rawDocList);
|
||||
return layered;
|
||||
}
|
||||
|
@ -19,14 +19,18 @@ package io.nosqlbench.engine.api.activityconfig.rawyaml;
|
||||
|
||||
import io.nosqlbench.engine.api.activityconfig.snakecharmer.SnakeYamlCharmer;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityInitializationError;
|
||||
import io.nosqlbench.nb.api.content.Content;
|
||||
import io.nosqlbench.nb.api.pathutil.NBPaths;
|
||||
import org.slf4j.Logger;
|
||||
import org.yaml.snakeyaml.TypeDescription;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@ -54,6 +58,15 @@ public class RawYamlStatementLoader {
|
||||
stringTransformers.add(transformer);
|
||||
}
|
||||
|
||||
public RawStmtsDocList load(Logger logger, Path path) {
|
||||
try {
|
||||
String yamlImg = Files.readString(path);
|
||||
return parseYaml(logger, yamlImg);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Error while reading YAML from search paths: " + e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
protected String loadRawFile(Logger logger, String fromPath, String... searchPaths) {
|
||||
InputStream stream = NBPaths.findRequiredStreamOrFile(fromPath, "yaml", searchPaths);
|
||||
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(stream))) {
|
||||
@ -119,6 +132,12 @@ public class RawYamlStatementLoader {
|
||||
return parseYaml(logger, data);
|
||||
}
|
||||
|
||||
public RawStmtsDocList loadString(Logger logger, CharSequence rawYaml) {
|
||||
String data = applyTransforms(logger, rawYaml.toString());
|
||||
return parseYaml(logger, data);
|
||||
}
|
||||
|
||||
|
||||
private class StatementsReader implements SnakeYamlCharmer.FieldHandler {
|
||||
@Override
|
||||
public void handleMapping(Object object, Object nodeTuple) {
|
||||
|
@ -1,16 +1,13 @@
|
||||
package io.nosqlbench.engine.api.scenarios;
|
||||
|
||||
import io.nosqlbench.docsys.core.PathWalker;
|
||||
import io.nosqlbench.engine.api.activityconfig.StatementsLoader;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.Scenarios;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||
import io.nosqlbench.engine.api.util.StrInterpolator;
|
||||
import io.nosqlbench.engine.api.util.Synonyms;
|
||||
import io.nosqlbench.nb.api.content.Content;
|
||||
import io.nosqlbench.nb.api.content.NBIO;
|
||||
import io.nosqlbench.nb.api.content.fluent.NBPathsAPI;
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
import io.nosqlbench.nb.api.pathutil.NBPaths;
|
||||
import io.nosqlbench.engine.api.util.StrInterpolator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -29,32 +26,44 @@ public class NBCLIScenarioParser {
|
||||
public final static String UNLOCKED = "=";
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(NBCLIScenarioParser.class);
|
||||
private static final String SEARCH_IN = "activities";
|
||||
|
||||
public static boolean isFoundWorkload(String word) {
|
||||
Optional<Content<?>> found = NBIO.all().prefix("activities").exact().name(word).extension("yaml").first();
|
||||
public static boolean isFoundWorkload(String workload) {
|
||||
Optional<Content<?>> found = NBIO.all()
|
||||
.prefix("activities")
|
||||
.name(workload)
|
||||
.extension("yaml")
|
||||
.first();
|
||||
return found.isPresent();
|
||||
// Optional<Path> workloadPath = NBPathOldUtil.findOptionalPathIn(word, "yaml", false, "activities");
|
||||
// return workloadPath.isPresent();
|
||||
}
|
||||
|
||||
public static void parseScenarioCommand(LinkedList<String> arglist, Set<String> RESERVED_WORDS) {
|
||||
|
||||
String workloadName = arglist.removeFirst();
|
||||
Optional<Path> workloadPathSearch = NBPaths.findOptionalPath(workloadName, "yaml", false, "activities");
|
||||
Path workloadPath = workloadPathSearch.orElseThrow();
|
||||
Optional<Content<?>> found = NBIO.all()
|
||||
.prefix("activities")
|
||||
.name(workloadName)
|
||||
.extension("yaml")
|
||||
.first();
|
||||
//
|
||||
Content<?> workloadContent = found.orElseThrow();
|
||||
|
||||
// Optional<Path> workloadPathSearch = NBPaths.findOptionalPath(workloadName, "yaml", false, "activities");
|
||||
// Path workloadPath = workloadPathSearch.orElseThrow();
|
||||
|
||||
// Buffer in CLI word from user, but only until the next command
|
||||
List<String> scenarioNames = new ArrayList<>();
|
||||
while (arglist.size() > 0
|
||||
&& !arglist.peekFirst().contains("=")
|
||||
&& !arglist.peekFirst().startsWith("-")
|
||||
&& RESERVED_WORDS.contains(arglist.peekFirst())) {
|
||||
&& !RESERVED_WORDS.contains(arglist.peekFirst())) {
|
||||
scenarioNames.add(arglist.removeFirst());
|
||||
}
|
||||
if (scenarioNames.size() == 0) {
|
||||
scenarioNames.add("default");
|
||||
}
|
||||
|
||||
// Load in user's CLI options
|
||||
// Parse CLI command into keyed parameters, in order
|
||||
LinkedHashMap<String, String> userParams = new LinkedHashMap<>();
|
||||
while (arglist.size() > 0
|
||||
&& arglist.peekFirst().contains("=")
|
||||
@ -66,6 +75,7 @@ public class NBCLIScenarioParser {
|
||||
}
|
||||
userParams.put(arg[0], arg[1]);
|
||||
}
|
||||
|
||||
StrInterpolator userParamsInterp = new StrInterpolator(userParams);
|
||||
|
||||
// This will hold the command to be prepended to the main arglist
|
||||
@ -74,7 +84,19 @@ public class NBCLIScenarioParser {
|
||||
for (String scenarioName : scenarioNames) {
|
||||
|
||||
// Load in named scenario
|
||||
StmtsDocList stmts = StatementsLoader.load(logger, workloadPath.toString());
|
||||
Optional<Content<?>> yamlWithNamedScenarios = NBIO.all().prefix(SEARCH_IN)
|
||||
.name(workloadName)
|
||||
.extension("yaml")
|
||||
.one();
|
||||
|
||||
// // TODO: ugly hack remove this
|
||||
// workloadName = (workloadName.endsWith(".yaml")) ? workloadName : workloadName + ".yaml";
|
||||
// StmtsDocList stmts = StatementsLoader.load(logger, workloadName, SEARCH_IN);
|
||||
|
||||
|
||||
StmtsDocList stmts = StatementsLoader.load(logger,yamlWithNamedScenarios.get());
|
||||
|
||||
|
||||
Scenarios scenarios = stmts.getDocScenarios();
|
||||
List<String> cmds = scenarios.getNamedScenario(scenarioName);
|
||||
if (cmds == null) {
|
||||
@ -109,8 +131,9 @@ public class NBCLIScenarioParser {
|
||||
builtcmd.put(cmdarg.getName(), cmdarg.toString());
|
||||
}
|
||||
usersCopy.forEach((k, v) -> builtcmd.put(k, k + "=" + v));
|
||||
|
||||
if (!builtcmd.containsKey("workload")) {
|
||||
builtcmd.put("workload", "workload=" + workloadPath.toString());
|
||||
builtcmd.put("workload", "workload=" + workloadName);
|
||||
}
|
||||
|
||||
// Undefine any keys with a value of 'undef'
|
||||
@ -247,26 +270,24 @@ public class NBCLIScenarioParser {
|
||||
|
||||
public static List<WorkloadDesc> getWorkloadsWithScenarioScripts() {
|
||||
|
||||
List<Content<?>> activities = NBIO.all().prefix("activities").regex().name(".*\\.yaml").list();
|
||||
List<Content<?>> activities = NBIO.all()
|
||||
.prefix(SEARCH_IN)
|
||||
.name(".*\\.yaml")
|
||||
.list();
|
||||
|
||||
broken here
|
||||
|
||||
String dir = "activities/";
|
||||
|
||||
NBPathsAPI.ForContentSource content = NBIO.all(dir).prefix("activities").exact().(".yaml");
|
||||
/*
|
||||
Path basePath = NBPaths.findPathIn(dir);
|
||||
List<Path> yamlPathList = PathWalker.findAll(basePath)
|
||||
.stream()
|
||||
.filter(f -> f.toString().endsWith(".yaml"))
|
||||
.filter(f -> f.toString().contains("activities"))
|
||||
.collect(Collectors.toList());
|
||||
*/
|
||||
List<Path> yamlPathList = activities.stream().map(Content::asPath).collect(Collectors.toList());
|
||||
|
||||
List<WorkloadDesc> workloadDescriptions = new ArrayList<>();
|
||||
|
||||
for (Path yamlPath : yamlPathList) {
|
||||
String substring = yamlPath.toString().substring(1);
|
||||
StmtsDocList stmts = StatementsLoader.load(logger, substring);
|
||||
String referencedWorkloadName = yamlPath.toString().substring(1);
|
||||
|
||||
Optional<Content<?>> referencedWorkload = NBIO.all().prefix(SEARCH_IN)
|
||||
.name(referencedWorkloadName).extension("yaml")
|
||||
.one();
|
||||
|
||||
Content<?> content = referencedWorkload.orElseThrow();
|
||||
StmtsDocList stmts = StatementsLoader.load(logger,content);
|
||||
|
||||
Set<String> templates = new HashSet<>();
|
||||
try {
|
||||
|
@ -109,7 +109,7 @@ public class NBCLI {
|
||||
String workloadToCopy = options.wantsToCopyWorkloadNamed();
|
||||
logger.debug("user requests to copy out " + workloadToCopy);
|
||||
|
||||
Optional<Content<?>> tocopy = NBIO.classpath().prefix("activities").exact()
|
||||
Optional<Content<?>> tocopy = NBIO.classpath().prefix("activities")
|
||||
.name(workloadToCopy).extension("yaml").first();
|
||||
Content<?> data = tocopy.orElseThrow(() -> new BasicError("Unable to find " + workloadToCopy + " in " +
|
||||
"classpath to copy out"));
|
||||
|
@ -69,20 +69,23 @@ public class NBCLIScenarioParserTest {
|
||||
assertThat(cmds.size()).isEqualTo(6);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testThatTemplatesAreExpandedDefault() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "scenario-test", "template-test"});
|
||||
List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
assertThat(cmds.size()).isEqualTo(1);
|
||||
assertThat(cmds.get(0).getCmdSpec()).isEqualTo("driver=stdout;cycles=10;workload=activities/scenario-test.yaml;");
|
||||
}
|
||||
@Test
|
||||
public void testThatTemplatesAreExpandedOverride() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "scenario-test", "template-test", "cycles-test=20"});
|
||||
List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
assertThat(cmds.size()).isEqualTo(1);
|
||||
assertThat(cmds.get(0).getCmdSpec()).isEqualTo("driver=stdout;cycles=20;cycles-test=20;workload=activities/scenario-test.yaml;");
|
||||
}
|
||||
// TODO: make this work
|
||||
// @Test
|
||||
// public void testThatTemplatesAreExpandedDefault() {
|
||||
// NBCLIOptions opts = new NBCLIOptions(new String[]{ "scenario-test", "template-test"});
|
||||
// List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
// assertThat(cmds.size()).isEqualTo(1);
|
||||
// assertThat(cmds.get(0).getCmdSpec()).isEqualTo("driver=stdout;cycles=10;workload=scenario-test.yaml;");
|
||||
// }
|
||||
|
||||
// TODO: Make this work
|
||||
// @Test
|
||||
// public void testThatTemplatesAreExpandedOverride() {
|
||||
// NBCLIOptions opts = new NBCLIOptions(new String[]{ "scenario-test", "template-test", "cycles-test=20"});
|
||||
// List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
// assertThat(cmds.size()).isEqualTo(1);
|
||||
// assertThat(cmds.get(0).getCmdSpec()).isEqualTo("driver=stdout;cycles=20;cycles-test=20;workload=activities/scenario-test.yaml;");
|
||||
// }
|
||||
|
||||
@Test
|
||||
public void testThatUndefValuesAreUndefined() {
|
||||
|
@ -3,21 +3,31 @@ package io.nosqlbench.nb.api.content;
|
||||
import java.net.URI;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.file.Path;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* A generic content wrapper for anything that can be given to a NoSQLBench runtime
|
||||
* using a specific type of locator.
|
||||
* @param <T>
|
||||
*/
|
||||
public interface Content<T> {
|
||||
public interface Content<T> extends Supplier<CharSequence>, Comparable<Content<?>> {
|
||||
|
||||
T getLocation();
|
||||
URI getURI();
|
||||
CharBuffer getCharBuffer();
|
||||
Path asPath();
|
||||
|
||||
public default String asString() {
|
||||
return getCharBuffer().toString();
|
||||
}
|
||||
|
||||
Path asPath();
|
||||
CharBuffer getCharBuffer();
|
||||
@Override
|
||||
default CharSequence get() {
|
||||
return getCharBuffer();
|
||||
}
|
||||
|
||||
default int compareTo(Content<?> other) {
|
||||
return getURI().compareTo(other.getURI());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,16 @@
|
||||
package io.nosqlbench.nb.api.content;
|
||||
|
||||
import io.nosqlbench.nb.api.content.fluent.NBPathsAPI;
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* NBIO is a helper utility packaged as a search builder and fluent API.
|
||||
@ -23,100 +26,75 @@ import java.util.regex.Pattern;
|
||||
public class NBIO implements NBPathsAPI.Facets {
|
||||
|
||||
private URIResolver resolver;
|
||||
private MatchType matchas = MatchType.exact;
|
||||
|
||||
private List<String> names = new ArrayList<>();
|
||||
private List<String> extensions = new ArrayList<>();
|
||||
private List<String> searchPaths = new ArrayList<>();
|
||||
|
||||
|
||||
private enum MatchType {
|
||||
exact,
|
||||
suffix,
|
||||
pattern
|
||||
}
|
||||
private List<String> prefixes = new ArrayList<>();
|
||||
|
||||
private NBIO() {
|
||||
}
|
||||
|
||||
private NBIO(URIResolver resolver,
|
||||
MatchType matchas,
|
||||
List<String> searchPaths,
|
||||
List<String> prefixes,
|
||||
List<String> names,
|
||||
List<String> extensions) {
|
||||
this.resolver = resolver;
|
||||
this.matchas = matchas;
|
||||
this.searchPaths = searchPaths;
|
||||
this.prefixes = prefixes;
|
||||
this.names = names;
|
||||
this.extensions = extensions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForContentSource localContent() {
|
||||
public NBPathsAPI.ForPrefix localContent() {
|
||||
this.resolver = URIResolvers.inFS().inCP();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForContentSource remoteContent() {
|
||||
public NBPathsAPI.ForPrefix remoteContent() {
|
||||
this.resolver = URIResolvers.inURLs();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForContentSource internalContent() {
|
||||
public NBPathsAPI.ForPrefix internalContent() {
|
||||
this.resolver = URIResolvers.inClasspath();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForContentSource fileContent() {
|
||||
public NBPathsAPI.ForPrefix fileContent() {
|
||||
this.resolver = URIResolvers.inFS();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForContentSource allContent() {
|
||||
public NBPathsAPI.ForPrefix allContent() {
|
||||
this.resolver = URIResolvers.inFS().inCP().inURLs();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.WantsContentName exact() {
|
||||
return new NBIO(resolver, MatchType.exact, searchPaths, names, extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.WantsContentName matchtail() {
|
||||
return new NBIO(resolver, MatchType.suffix, searchPaths, names, extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.WantsContentName regex() {
|
||||
return new NBIO(resolver, MatchType.pattern, searchPaths, names, extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForPrefix prefix(String... searchPaths) {
|
||||
ArrayList<String> addingPaths = new ArrayList<>(this.searchPaths);
|
||||
ArrayList<String> addingPaths = new ArrayList<>(this.prefixes);
|
||||
addingPaths.addAll(Arrays.asList(searchPaths));
|
||||
return new NBIO(resolver, matchas, addingPaths, names, extensions);
|
||||
return new NBIO(resolver, addingPaths, names, extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForName name(String... searchNames) {
|
||||
ArrayList<String> addingNames = new ArrayList<>(this.names);
|
||||
addingNames.addAll(Arrays.asList(searchNames));
|
||||
return new NBIO(resolver, matchas, searchPaths, addingNames, extensions);
|
||||
return new NBIO(resolver, prefixes, addingNames, extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBPathsAPI.ForExtension extension(String... extensions) {
|
||||
ArrayList<String> addingExtensions = new ArrayList<>(this.extensions);
|
||||
for (String addingExtension : extensions) {
|
||||
addingExtensions.add(addingExtension.startsWith(".") ? addingExtension : "." + addingExtension);
|
||||
addingExtensions.add(dotExtension(addingExtension));
|
||||
}
|
||||
return new NBIO(resolver, matchas, searchPaths, names, addingExtensions);
|
||||
return new NBIO(resolver, prefixes, names, addingExtensions);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -124,7 +102,7 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
*
|
||||
* @return a builder
|
||||
*/
|
||||
public static NBPathsAPI.ForContentSource all() {
|
||||
public static NBPathsAPI.ForPrefix all() {
|
||||
return new NBIO().allContent();
|
||||
}
|
||||
|
||||
@ -133,7 +111,7 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
*
|
||||
* @return a builder
|
||||
*/
|
||||
public static NBPathsAPI.ForContentSource classpath() {
|
||||
public static NBPathsAPI.ForPrefix classpath() {
|
||||
return new NBIO().internalContent();
|
||||
}
|
||||
|
||||
@ -142,7 +120,7 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
*
|
||||
* @return a builder
|
||||
*/
|
||||
public static NBPathsAPI.ForContentSource fs() {
|
||||
public static NBPathsAPI.ForPrefix fs() {
|
||||
return new NBIO().fileContent();
|
||||
}
|
||||
|
||||
@ -151,7 +129,7 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
*
|
||||
* @return a builder
|
||||
*/
|
||||
public static NBPathsAPI.ForContentSource local() {
|
||||
public static NBPathsAPI.ForPrefix local() {
|
||||
return new NBIO().localContent();
|
||||
}
|
||||
|
||||
@ -160,29 +138,55 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
*
|
||||
* @return a builder
|
||||
*/
|
||||
public static NBPathsAPI.ForContentSource remote() {
|
||||
public static NBPathsAPI.ForPrefix remote() {
|
||||
return new NBIO().remoteContent();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Optional<Content<?>> first() {
|
||||
Content<?> found = null;
|
||||
LinkedHashSet<String> specificPathsToSearch = expandSearches();
|
||||
for (String candidatePath : specificPathsToSearch) {
|
||||
Content<?> content = resolver.resolve(candidatePath);
|
||||
if (content != null) {
|
||||
return Optional.of(content);
|
||||
}
|
||||
|
||||
List<Content<?>> list = list();
|
||||
if (list.size()>0) {
|
||||
return Optional.of(list.get(0));
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.empty();
|
||||
|
||||
}
|
||||
|
||||
public Optional<Content<?>> maybeOne() {
|
||||
List<Content<?>> list = list();
|
||||
|
||||
if (list.size() > 1) {
|
||||
throw new BasicError("Found more than one source for " + this.toString() + ", but expected to find one at" +
|
||||
" most.");
|
||||
}
|
||||
throw new RuntimeException("Invalid code, go fix it, this should never happen.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Content<?>> one() {
|
||||
|
||||
|
||||
List<Content<?>> list = list();
|
||||
if (list.size() == 0) {
|
||||
throw new BasicError("Unable to find even a single source for '" + this.toString() + "'");
|
||||
}
|
||||
|
||||
if (list.size() > 1) {
|
||||
String found = list.stream().map(c -> c.getURI().toString()).collect(Collectors.joining(","));
|
||||
throw new BasicError(("Found too many sources for '" + this.toString() + "', ambiguous name. Pick from " + found));
|
||||
}
|
||||
return Optional.of(list.get(0));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Optional<Content<?>>> resolveEach() {
|
||||
List<Optional<Content<?>>> resolved = new ArrayList<>();
|
||||
for (String name : names) {
|
||||
LinkedHashSet<String> slotSearchPaths = expandSearches(name);
|
||||
LinkedHashSet<String> slotSearchPaths = expandSearches(prefixes, List.of(name), extensions, false);
|
||||
Content<?> content = null;
|
||||
for (String slotSearchPath : slotSearchPaths) {
|
||||
content = resolver.resolve(slotSearchPath);
|
||||
@ -199,80 +203,148 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
|
||||
// for testing
|
||||
public LinkedHashSet<String> expandSearches() {
|
||||
LinkedHashSet<String> searchSet = new LinkedHashSet<>(extensions.size() * names.size() * searchPaths.size());
|
||||
for (String name : names) {
|
||||
searchSet.addAll(expandSearches(name));
|
||||
}
|
||||
return searchSet;
|
||||
return expandSearches(prefixes, names, extensions, false);
|
||||
}
|
||||
|
||||
|
||||
// for testing
|
||||
public LinkedHashSet<String> expandSearches(String name) {
|
||||
public LinkedHashSet<String> expandSearches(List<String> thePrefixes, List<String> names,
|
||||
List<String> suffixes, boolean eachPrefix) {
|
||||
|
||||
LinkedHashSet<String> searchSet = new LinkedHashSet<>();
|
||||
List<String> prefixesToSearch = new ArrayList<>(thePrefixes);
|
||||
List<String> namesToSearch = new ArrayList<>(names);
|
||||
List<String> suffixesToSearch = new ArrayList<>(suffixes);
|
||||
|
||||
List<String> searchPathsToTry = new ArrayList<>();
|
||||
searchPathsToTry.add("");
|
||||
searchPathsToTry.addAll(searchPaths);
|
||||
if (prefixesToSearch.size() == 0) {
|
||||
prefixesToSearch.add("");
|
||||
}
|
||||
if (namesToSearch.size() == 0) {
|
||||
namesToSearch.add(".*");
|
||||
}
|
||||
if (suffixesToSearch.size() == 0) {
|
||||
suffixesToSearch.add("");
|
||||
}
|
||||
|
||||
List<String> extensionsToTry = new ArrayList<>();
|
||||
extensionsToTry.add("");
|
||||
extensionsToTry.addAll(extensions);
|
||||
LinkedHashSet<String> searches = new LinkedHashSet<>();
|
||||
|
||||
for (String searchPath : searchPathsToTry) {
|
||||
for (String extension : extensionsToTry) {
|
||||
if (!name.endsWith(extension)) {
|
||||
name = name + extension;
|
||||
for (String name : namesToSearch) {
|
||||
for (String suffix : suffixesToSearch) {
|
||||
String search = name;
|
||||
search = (search.endsWith(suffix) ? search : search + suffix);
|
||||
|
||||
if (eachPrefix) {
|
||||
for (String prefix : prefixesToSearch) {
|
||||
String withPrefix = (prefix.isEmpty() ? prefix :
|
||||
prefix + FileSystems.getDefault().getSeparator())
|
||||
+ search;
|
||||
searches.add(withPrefix);
|
||||
}
|
||||
} else {
|
||||
searches.add(search);
|
||||
}
|
||||
searchSet.add(Path.of(searchPath, name).toString());
|
||||
}
|
||||
}
|
||||
return searchSet;
|
||||
|
||||
return searches;
|
||||
}
|
||||
|
||||
// // for testing
|
||||
// public LinkedHashSet<String> expandSearches(String name) {
|
||||
//
|
||||
// LinkedHashSet<String> searchSet = new LinkedHashSet<>();
|
||||
//
|
||||
// List<String> searchPathsToTry = new ArrayList<>();
|
||||
// searchPathsToTry.add("");
|
||||
// searchPathsToTry.addAll(prefixes);
|
||||
//
|
||||
// List<String> extensionsToTry = new ArrayList<>();
|
||||
//// extensionsToTry.add("");
|
||||
// extensionsToTry.addAll(extensions);
|
||||
//
|
||||
// for (String searchPath : searchPathsToTry) {
|
||||
// for (String extension : extensionsToTry) {
|
||||
// if (!name.endsWith(extension)) {
|
||||
// name = name + extension;
|
||||
// }
|
||||
// searchSet.add(Path.of(searchPath, name).toString());
|
||||
// }
|
||||
// }
|
||||
// return searchSet;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public List<Content<?>> list() {
|
||||
List<Content<?>> foundFiles = new ArrayList<>();
|
||||
LinkedHashSet<String> searches = expandSearches();
|
||||
|
||||
for (String searchPath : searchPaths) {
|
||||
LinkedHashSet<Content<?>> foundFiles = new LinkedHashSet<>();
|
||||
|
||||
// wrap in local search iterator
|
||||
for (String search : searches) {
|
||||
Content<?> foundInLocal = resolver.resolve(search);
|
||||
if (foundInLocal != null) {
|
||||
foundFiles.add(foundInLocal);
|
||||
}
|
||||
}
|
||||
|
||||
for (String searchPath : prefixes) {
|
||||
Optional<Path> opath = resolver.resolveDirectory(searchPath);
|
||||
Path path = opath.orElseThrow();
|
||||
|
||||
FileCapture capture = new FileCapture();
|
||||
for (String name : names) {
|
||||
|
||||
for (String extension : extensions) {
|
||||
if (!extension.startsWith(".")) {
|
||||
extension = "." + extension;
|
||||
}
|
||||
|
||||
String pattern = name.endsWith(extension) ? name : name + Pattern.quote(extension);
|
||||
RegexPathFilter filter = new RegexPathFilter(pattern);
|
||||
|
||||
NBIOWalker.walkFullPath(path, capture, filter);
|
||||
}
|
||||
|
||||
for (String searchPattern : searches) {
|
||||
RegexPathFilter filter = new RegexPathFilter(searchPattern, true);
|
||||
NBIOWalker.walkFullPath(path, capture, filter);
|
||||
}
|
||||
|
||||
for (Path foundPath : capture) {
|
||||
Path fullPath = path.resolve(foundPath);
|
||||
foundFiles.add(new PathContent(fullPath));
|
||||
// Path fullPath = path.resolve(foundPath);
|
||||
// foundFiles.add(new PathContent(fullPath));
|
||||
foundFiles.add(new PathContent(foundPath));
|
||||
}
|
||||
|
||||
}
|
||||
return foundFiles;
|
||||
|
||||
return new ArrayList<>(foundFiles);
|
||||
}
|
||||
|
||||
private static String tailmatch(String name) {
|
||||
if (!name.startsWith("^") && !name.startsWith(".")) {
|
||||
name = ".*" + name;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
private static String dotExtension(String extension) {
|
||||
return extension.startsWith(".") ? extension : "." + extension;
|
||||
}
|
||||
|
||||
// private LinkedHashSet<Pattern> expandSearchPatterns(String name) {
|
||||
// LinkedHashSet<Pattern> expanded = new LinkedHashSet<>();
|
||||
//
|
||||
// if (extensions.size()==0) {
|
||||
// expanded.add(Pattern.compile(tailmatch(name)));
|
||||
// }
|
||||
//
|
||||
// for (String extension : extensions) {
|
||||
// extension = dotExtension(extension);
|
||||
// String withExtension = name.endsWith(extension) ? name : name + Pattern.quote(extension);
|
||||
// withExtension=tailmatch(withExtension);
|
||||
// Pattern pattern = Pattern.compile(withExtension);
|
||||
// expanded.add(pattern);
|
||||
// }
|
||||
// return expanded;
|
||||
// }
|
||||
|
||||
private static class RegexPathFilter implements DirectoryStream.Filter<Path> {
|
||||
|
||||
private final Pattern regex;
|
||||
|
||||
public RegexPathFilter(String pattern) {
|
||||
if (!pattern.startsWith("^")) {
|
||||
pattern = ".*" + pattern;
|
||||
public RegexPathFilter(String pattern, boolean rightglob) {
|
||||
if (rightglob && !pattern.startsWith("^") && !pattern.startsWith(".")) {
|
||||
this.regex = Pattern.compile(".*" + pattern);
|
||||
} else {
|
||||
this.regex = Pattern.compile(pattern);
|
||||
}
|
||||
|
||||
this.regex = Pattern.compile(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -302,5 +374,13 @@ public class NBIO implements NBPathsAPI.Facets {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NBIO{" +
|
||||
"resolver=" + resolver +
|
||||
", prefixes=" + prefixes +
|
||||
", names=" + names +
|
||||
", extensions=" + extensions +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* PathContent provides the Path-centric way of accessing
|
||||
@ -46,4 +47,16 @@ public class PathContent implements Content<Path> {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
PathContent that = (PathContent) o;
|
||||
return Objects.equals(path, that.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(path);
|
||||
}
|
||||
}
|
||||
|
@ -76,4 +76,8 @@ public class ResolverForClasspath implements ContentResolver {
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,4 +43,8 @@ public class ResolverForFilesystem implements ContentResolver {
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,4 +38,9 @@ public class ResolverForURL implements ContentResolver {
|
||||
public Optional<Path> resolveDirectory(URI uri) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.nosqlbench.nb.api.content;
|
||||
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
import org.apache.commons.math3.FieldElement;
|
||||
|
||||
import java.net.URI;
|
||||
@ -123,4 +124,21 @@ public class URIResolver implements ContentResolver {
|
||||
this.extraPaths.add(Path.of(extraPath));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Content<?> resolveOne(String candidatePath) {
|
||||
List<Content<?>> contents = resolveAll(candidatePath);
|
||||
if (contents.size()==1) {
|
||||
return contents.get(0);
|
||||
}
|
||||
if (contents.size()==0) {
|
||||
return null;
|
||||
}
|
||||
throw new BasicError("Error while loading content '" + candidatePath +"', only one is allowed, but " + contents.size() + " were found");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "[resolver]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ -45,6 +46,18 @@ public class URLContent implements Content<URL> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
URLContent that = (URLContent) o;
|
||||
return Objects.equals(url, that.url);}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharBuffer getCharBuffer() {
|
||||
if (buffer==null) {
|
||||
|
@ -2,82 +2,58 @@ package io.nosqlbench.nb.api.content.fluent;
|
||||
|
||||
import io.nosqlbench.nb.api.content.Content;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface NBPathsAPI {
|
||||
|
||||
public static interface Facets extends
|
||||
WantsSpaces, ForContentSource, ForPrefix, WantsContentName, ForName, ForExtension {}
|
||||
WantsSpaces, ForPrefix, WantsContentName, ForName, ForExtension {}
|
||||
|
||||
public static interface WantsSpaces {
|
||||
/**
|
||||
* Only provide content from the class path and the local filesystem.
|
||||
* @return this builder
|
||||
*/
|
||||
ForContentSource localContent();
|
||||
ForPrefix localContent();
|
||||
|
||||
/**
|
||||
* Only return content from remote URLs. If the user is providing non-URL content
|
||||
* in this context, it is an error. Throw an error in that case.
|
||||
* @return this builder
|
||||
*/
|
||||
ForContentSource remoteContent();
|
||||
ForPrefix remoteContent();
|
||||
|
||||
/**
|
||||
* Only return content from the runtime classpath, internal resources that are bundled,
|
||||
* and do not return content on the file system.
|
||||
* @return this builder
|
||||
*/
|
||||
ForContentSource internalContent();
|
||||
ForPrefix internalContent();
|
||||
|
||||
/**
|
||||
* Only return content from the filesystem, but not remote URLs nor internal bundled resources.
|
||||
* @return this builder
|
||||
*/
|
||||
ForContentSource fileContent();
|
||||
ForPrefix fileContent();
|
||||
|
||||
/**
|
||||
* Return content from everywhere, from remote URls, or from the file system and then the internal
|
||||
* bundled content if not found in the file system first.
|
||||
* @return this builder
|
||||
*/
|
||||
ForContentSource allContent();
|
||||
ForPrefix allContent();
|
||||
}
|
||||
|
||||
public static interface ForContentSource extends ForPrefix {
|
||||
public static interface ForPrefix extends WantsContentName {
|
||||
/**
|
||||
* Each of the prefix paths will be searched if the resource is not found with the exact
|
||||
* path given.
|
||||
* @param prefixPaths A list of paths to include in the search
|
||||
* @return this builder
|
||||
*/
|
||||
ForPrefix prefix(String... prefixPaths);
|
||||
}
|
||||
|
||||
public static interface ForPrefix extends WantsContentName {
|
||||
/**
|
||||
* Only look at exact matches of the names as given, and if not found, look for exact matches
|
||||
* of the path directly within each given search directory.
|
||||
* @return this builders
|
||||
*/
|
||||
WantsContentName exact();
|
||||
|
||||
/**
|
||||
* Attempt {@link #exact()} matching, and if not found, also attempt to look within any
|
||||
* provided search directories recursively for a path which matches the provided path at
|
||||
* the end. For example "baz.csv" will be found under search directory "foo" if it is at
|
||||
* "foo/bar/baz.csv", as will "bar/baz.csv", so long as "foo" is specified as a search directory.
|
||||
* @return this builder
|
||||
*/
|
||||
WantsContentName matchtail();
|
||||
|
||||
/**
|
||||
* Attempt {@link #exact()} matching, and if not found, search in each provided search directory
|
||||
* for a path name that matches the provided name as a regex pattern.
|
||||
* @return this builder
|
||||
*/
|
||||
WantsContentName regex();
|
||||
WantsContentName prefix(String... prefixPaths);
|
||||
}
|
||||
|
||||
public static interface WantsContentName {
|
||||
@ -115,6 +91,16 @@ public interface NBPathsAPI {
|
||||
List<Optional<Content<?>>> resolveEach();
|
||||
|
||||
List<Content<?>> list();
|
||||
|
||||
Optional<Content<?>> maybeOne();
|
||||
|
||||
/**
|
||||
* Find exactly one source of content under the search parameters given.
|
||||
* It is an error if you find none, or more than one.
|
||||
* @return An optional content element.
|
||||
*/
|
||||
Optional<Content<?>> one();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,44 +12,77 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
public class NBIOTest {
|
||||
|
||||
@Test
|
||||
public void testSimpleSearch() {
|
||||
NBIO extensions = (NBIO) NBIO.all().exact().name("foo.bar");
|
||||
public void testFullyQualifiedNameSearches() {
|
||||
NBIO extensions = (NBIO) NBIO.all().name("foo.bar");
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo.bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchPaths() {
|
||||
NBIO extensions = (NBIO) NBIO.all().prefix("act1","act2").exact().name("foo.bar");
|
||||
public void testExpandWildcardAndExtensionsOnly() {
|
||||
NBIO extensions = (NBIO) NBIO.all().name(".*").extension("foo","bar");
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo.bar","act1/foo.bar","act2/foo.bar");
|
||||
assertThat(searches).containsExactly(".*.foo",".*.bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultExtensionOn() {
|
||||
NBIO extensions = (NBIO) NBIO.all().exact().name("foo.bar").extension("bar");
|
||||
public void testExpandNameOnly() {
|
||||
NBIO extensions = (NBIO) NBIO.all().name("foo.bar").extension();
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo.bar");
|
||||
NBIO extensionsDot = (NBIO) NBIO.all().exact().name("foo.bar").extension(".bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExpandNamesAndExtensions() {
|
||||
NBIO extensions = (NBIO) NBIO.all().name("foo.bar").extension("baz","beez");
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo.bar.baz","foo.bar.beez");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExpandPrefixesAndFullName() {
|
||||
NBIO extensions = (NBIO) NBIO.all().prefix("act1","act2").name("foo.bar");
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo.bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExpandAddExtensionNotNeeded() {
|
||||
NBIO extensions = (NBIO) NBIO.all().name("foo.bar").extension("bar");
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo.bar");
|
||||
NBIO extensionsDot = (NBIO) NBIO.all().name("foo.bar").extension(".bar");
|
||||
LinkedHashSet<String> searchesDot = extensionsDot.expandSearches();
|
||||
assertThat(searchesDot).containsExactly("foo.bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultExtensionOff() {
|
||||
NBIO extensions = (NBIO) NBIO.all().exact().name("foo").extension("bar");
|
||||
public void testExpandAddExtensionNeeded() {
|
||||
NBIO extensions = (NBIO) NBIO.all().name("foo").extension("bar");
|
||||
LinkedHashSet<String> searches = extensions.expandSearches();
|
||||
assertThat(searches).containsExactly("foo","foo.bar");
|
||||
NBIO extensionsDot = (NBIO) NBIO.all().exact().name("foo").extension(".bar");
|
||||
assertThat(searches).containsExactly("foo.bar");
|
||||
NBIO extensionsDot = (NBIO) NBIO.all().name("foo").extension(".bar");
|
||||
LinkedHashSet<String> searchesDot = extensionsDot.expandSearches();
|
||||
assertThat(searchesDot).containsExactly("foo","foo.bar");
|
||||
assertThat(searchesDot).containsExactly("foo.bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadCsv1() {
|
||||
NBPathsAPI.ForContentSource forSourceType = NBIO.fs();
|
||||
NBPathsAPI.ForPrefix forPrefix = forSourceType.prefix("nesteddir1");
|
||||
NBPathsAPI.ForName forName = forPrefix.name("nesteddir2/testcsv1");
|
||||
public void testLoadCsv1Classpath() {
|
||||
NBPathsAPI.ForPrefix forSourceType = NBIO.classpath();
|
||||
NBPathsAPI.WantsContentName nesteddir1 = forSourceType.prefix("nesteddir1");
|
||||
NBPathsAPI.ForName forName = nesteddir1.name("nesteddir2/testcsv1");
|
||||
NBPathsAPI.ForExtension forCsvExtension = forName.extension(".csv");
|
||||
Optional<Content<?>> testcsv1 = forCsvExtension.first();
|
||||
|
||||
assertThat(testcsv1).isNotPresent();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadCsv1Filesystem() {
|
||||
NBPathsAPI.ForPrefix forSourceType = NBIO.fs();
|
||||
NBPathsAPI.WantsContentName nesteddir1 = forSourceType.prefix("target/test-classes/nesteddir1");
|
||||
NBPathsAPI.ForName forName = nesteddir1.name("nesteddir2/testcsv1");
|
||||
NBPathsAPI.ForExtension forCsvExtension = forName.extension(".csv");
|
||||
Optional<Content<?>> testcsv1 = forCsvExtension.first();
|
||||
|
||||
@ -69,8 +102,7 @@ public class NBIOTest {
|
||||
public void testPathSearchForExtension() {
|
||||
List<Content<?>> list = NBIO.classpath()
|
||||
.prefix("nesteddir1")
|
||||
.regex()
|
||||
.name(".*\\.csv")
|
||||
.name(".*.csv")
|
||||
.extension("csv")
|
||||
.list();
|
||||
assertThat(list).hasSize(2);
|
||||
@ -80,7 +112,6 @@ public class NBIOTest {
|
||||
public void testPathSearchForExtensionMissing() {
|
||||
List<Content<?>> list = NBIO.classpath()
|
||||
.prefix("nesteddir1")
|
||||
.regex()
|
||||
.name(".*")
|
||||
.extension("csv")
|
||||
.list();
|
||||
@ -91,7 +122,6 @@ public class NBIOTest {
|
||||
public void testPathSearchForMultipleExtensions() {
|
||||
List<Content<?>> list = NBIO.classpath()
|
||||
.prefix("nesteddir1")
|
||||
.regex()
|
||||
.name(".*")
|
||||
.extension("csv","txt")
|
||||
.list();
|
||||
@ -102,7 +132,6 @@ public class NBIOTest {
|
||||
public void testPathSearchForSuffix() {
|
||||
List<Content<?>> list = NBIO.classpath()
|
||||
.prefix("nesteddir1")
|
||||
.regex()
|
||||
.name("nesteddir2/testdata12")
|
||||
.extension("txt")
|
||||
.list();
|
||||
|
@ -41,12 +41,13 @@ public class ResolverForURLTest {
|
||||
|
||||
@Test
|
||||
public void testCPResource() {
|
||||
String p = "nesteddir1/nesteddir2/testcsv12.csv";
|
||||
String cprootForTestContext = "target/test-classes/";
|
||||
String resourcePathWithinClasspathRoots = "nesteddir1/nesteddir2/testcsv12.csv";
|
||||
ResolverForClasspath r = new ResolverForClasspath();
|
||||
Content<?> c = r.resolve(p);
|
||||
Content<?> c = r.resolve(resourcePathWithinClasspathRoots);
|
||||
assertThat(c).isNotNull();
|
||||
Object location = c.getLocation();
|
||||
assertThat(location.toString()).isEqualTo(p);
|
||||
assertThat(location.toString()).isEqualTo(cprootForTestContext + resourcePathWithinClasspathRoots);
|
||||
|
||||
String q = "src/test/resources/nesteddir1/nesteddir2/testcsv12.csv";
|
||||
Content<?> notfound = r.resolve(q);
|
||||
|
Loading…
Reference in New Issue
Block a user