1 # -*- encoding: binary -*-
3 # To read more about \MogileFS, go to http://mogilefs.org/
5 # Client usage information is available in MogileFS::MogileFS.
8 # Standard error class for most MogileFS-specific errors
9 class Error < StandardError; end
11 # Raised when a socket remains unreadable for too long.
12 class UnreadableSocketError < Error; end
14 # Raised when a response is truncated while reading
15 # due to network/server # errors)
16 class SizeMismatchError < Error; end
18 # Raised when checksum verification fails (only while reading deprecated
19 # "bigfiles" from the deprecated mogtool(1).
20 class ChecksumMismatchError < RuntimeError; end
22 # Raised when a backend is in read-only mode
23 class ReadOnlyError < Error
24 def message; 'readonly mogilefs'; end
27 # Raised when an upload is impossible
28 class EmptyPathError < Error; end
30 # Raised when we are given an unsupported protocol to upload to.
31 # Currently, the \MogileFS (2.55) server only supports HTTP and
32 # this library is only capable of HTTP.
33 class UnsupportedPathError < Error; end
35 # Raised when a request (HTTP or tracker) was truncated due to a network or
36 # server error. It may be possible to retry idempotent requests from this.
37 class RequestTruncatedError < Error; end
39 # Raised when a response from a server (HTTP or tracker) is not in a format
40 # that we expected (or truncated..
41 class InvalidResponseError < Error; end
43 # Raised when all known backends have failed.
44 class UnreachableBackendError < Error; end
46 # There was an error as a result of the use of the (experimental)
47 # pipelining code to the tracker backend
48 class PipelineError < Error; end
52 # somebody could use IO::Splice from the "io_splice" RubyGem, too
53 # don't consider this a stable API, though...
57 # IO.copy_stream was buggy in Ruby 1.9.2 and earlier
58 if RUBY_VERSION >= "1.9.3"
61 require "mogilefs/copy_stream"
62 @io = MogileFS::CopyStream
65 # autoload rarely-used things:
66 autoload :Mysql, 'mogilefs/mysql'
67 autoload :Pool, 'mogilefs/pool'
68 autoload :Admin, 'mogilefs/admin'
72 require 'mogilefs/util'
73 require 'mogilefs/socket'
74 require 'mogilefs/backend'
75 require 'mogilefs/http_file'
76 require 'mogilefs/http_reader'
77 require 'mogilefs/client'
78 require 'mogilefs/bigfile'
79 require 'mogilefs/mogilefs'
80 require 'mogilefs/version' # generated by ./GIT-VERSION-GEN