Source file kinetic_config.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
(*
  Copyright (C) iNuron - info@openvstorage.com
  This file is part of Open vStorage. For license information, see <LICENSE.txt>
 *)

open Kinetic_util

module Config = struct
    type t = {
        vendor: string;
        model:string;
        serial_number: bytes;
        world_wide_name: bytes;
        version: string;
        ipv4_addresses : bytes list;
        max_key_size: int;
        max_value_size: int;
        max_version_size: int;
        max_tag_size: int;
        max_connections: int;
        max_outstanding_read_requests: int;
        max_outstanding_write_requests: int;
        max_message_size: int;
        max_key_range_count: int;
        max_operation_count_per_batch: int option;
        max_batch_size : int option;
        max_deletes_per_batch : int option;
        (* max_batch_count_per_device: int; *)
        timeout : float;
      } [@@deriving show {with_path = false}]

    let make ~vendor ~world_wide_name ~model
             ~serial_number
             ~version
             ~ipv4_addresses
             ~max_key_size
             ~max_value_size
             ~max_version_size
             ~max_tag_size
             ~max_connections
             ~max_outstanding_read_requests
             ~max_outstanding_write_requests
             ~max_message_size
             ~max_key_range_count
             ~max_operation_count_per_batch
             ~timeout
             ~max_batch_size
             ~max_deletes_per_batch
             (* ~max_batch_count_per_device *)

      = {
        vendor;
        model;
        serial_number;
        world_wide_name;
        version;
        ipv4_addresses;
        max_key_size;
        max_value_size;
        max_version_size;
        max_tag_size;
        max_connections;
        max_outstanding_read_requests;
        max_outstanding_write_requests;
        max_message_size;
        max_key_range_count;
        max_operation_count_per_batch;
        (* max_batch_count_per_device; *)
        max_batch_size;
        max_deletes_per_batch;
        timeout;
      }

end