1 # ============LICENSE_START=======================================================
3 # ================================================================================
4 # Copyright (C) 2020-2021 Nokia. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
17 function first_fit(v, file) {
18 # find first bin that can accomodate the volume
19 for (i=1; i<=n; ++i) {
23 cmd="mkdir -p "tmpLocation"/"schema"-subdir-"i"/OpenAPI"
25 cmd="mv "file" " tmpLocation"/"schema "-subdir-" i "/OpenAPI"
30 # no bin found, create new bin
34 cmd="mkdir -p "tmpLocation"/"schema"-subdir-"n"/OpenAPI"
36 cmd="mv "file" " tmpLocation"/"schema "-subdir-"n"/OpenAPI"
41 BEGIN{ if( (c+0) == 0) exit }
44 print "Created",n,"directories"
46 print "- "tmpLocation"/"schema"-subdir-"i,":", c-b[i],"bytes",bc[i],"files"