4
;;; Copyright (c) 2007-2011 Gluster Inc. <http://www.gluster.com>
6
;;; This program is free software; you can redistribute it and/or modify
7
;;; it under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 2 of the License, or
9
;;; (at your option) any later version.
11
;;; This program is distributed in the hope that it will be useful,
12
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
;;; GNU General Public License for more details.
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with this program; if not, write to the Free Software
18
;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
;;; This script lets you specify the xlator graph as a Scheme list
22
;;; and provides a function to generate the spec file for the graph.
27
(lambda (name type options)
29
(display "volume ") (display name) (newline)
30
(display " type ") (display type) (newline)
31
(map (lambda (key-value-cons)
32
(let ((key (car key-value-cons))
33
(value (cdr key-value-cons)))
34
(display " option ") (display key) (display " ")
35
(display value) (newline)))
37
(if (> (length args) 0)
39
(display " subvolumes ")
41
(display subvol) (display " "))
44
(display "end-volume") (newline) (newline)
48
;; define volumes with names/type/options and bind to a symbol
49
;; relate them seperately (see below)
50
;; more convinient to seperate volume definition and relation
52
(define wb (volume '(wb0
53
performance/write-behind
58
(define ra (volume '(ra0
59
performance/read-ahead
64
(define ioc (volume '(ioc0
70
(define iot (volume '(iot0
71
performance/io-threads
75
(define client1 (volume '(client1
77
((transport-type . tcp/client)
78
(remote-host . localhost)
79
(remote-subvolume . brick1)
82
(define client2 (volume '(client2
84
((transport-type . tcp/client)
85
(remote-host . localhost)
86
(remote-subvolume . brick2)
89
(define unify (volume '(unify0
94
;; relate the symbols to output a spec file
95
;; note: relating with symbols lets you change volume name in one place
97
(wb (ra (ioc (iot (unify (client1)