X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=cleaner%2Fcleaner;h=7b50c73e7a1113317f822b963739b66ca254f2de;hb=8ff0fd08d6e1cc97cdb7e94b7cd97dc28c29e674;hp=60c91f501d229e93510b37e3629e8471b9a3ba02;hpb=5551523de35c1abaf24d77654928e2c748fd95aa;p=bluesky.git diff --git a/cleaner/cleaner b/cleaner/cleaner index 60c91f5..7b50c73 100755 --- a/cleaner/cleaner +++ b/cleaner/cleaner @@ -7,6 +7,30 @@ # # Copyright (C) 2010 The Regents of the University of California # Written by Michael Vrable +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. import base64, os, re, struct, sys, time import boto @@ -21,6 +45,15 @@ HEADER_SIZE = struct.calcsize(HEADER_FORMAT) CHECKPOINT_MAGIC = struct.pack('>sys.stderr, "S3 operation failed, retrying..." + print >>sys.stderr, " %s %s %s" % (method, args, kwargs) self.connect() time.sleep(1.0) return method(self, *args, **kwargs) @@ -98,7 +132,7 @@ class S3Backend(Backend): self.cache = {} for f in os.listdir(cachedir): self.cache[f] = True - print "Initial cache contents:", list(self.cache.keys()) + #print "Initial cache contents:", list(self.cache.keys()) self.connect() self.stats_get = [0, 0] self.stats_put = [0, 0] @@ -162,6 +196,8 @@ class S3Backend(Backend): print "S3 statistics:" print "GET: %d ops / %d bytes" % tuple(self.stats_get) print "PUT: %d ops / %d bytes" % tuple(self.stats_put) + benchlog_write("s3_get: %d", self.stats_get[1]) + benchlog_write("s3_put: %d", self.stats_put[1]) class SimpleBackend(Backend): """An interface to the simple BlueSky test network server.""" @@ -284,7 +320,7 @@ class LogDirectory: self.dir_num = dir self.seq_num = 0 for logname in backend.list(dir): - print "Old log file:", logname + #print "Old log file:", logname loc = backend.name_to_loc(logname[0]) if loc is not None and loc[0] == dir: self.seq_num = max(self.seq_num, loc[1] + 1) @@ -443,12 +479,12 @@ class InodeMap: data = data[self.vvsize:] - print "Inode map:" + #print "Inode map:" for i in range(len(data) // 16): (start, end) = struct.unpack_from("