Class: Couchbase::Options::Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/options.rb
more...

Overview

Options for Cluster.connect

Examples:

Pass authenticator object to Options

Cluster.connect("couchbase://localhost",
  Options::Cluster(authenticator: PasswordAuthenticator.new("Administrator", "password")))

Shorter version, more useful for interactive sessions

Cluster.connect("couchbase://localhost", "Administrator", "password")

Authentication with TLS client certificate (note couchbases:// schema)

Cluster.connect("couchbases://localhost?trust_certificate=/tmp/ca.pem",
  Options::Cluster(authenticator: CertificateAuthenticator.new("/tmp/certificate.pem", "/tmp/private.key")))

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authenticator: nil, enable_metrics: nil, metrics_emit_interval: nil, enable_tracing: nil, orphaned_emit_interval: nil, orphaned_sample_size: nil, threshold_emit_interval: nil, threshold_sample_size: nil, key_value_threshold: nil, query_threshold: nil, view_threshold: nil, search_threshold: nil, analytics_threshold: nil, management_threshold: nil, bootstrap_timeout: nil, resolve_timeout: nil, connect_timeout: nil, key_value_timeout: nil, view_timeout: nil, query_timeout: nil, analytics_timeout: nil, search_timeout: nil, management_timeout: nil, dns_srv_timeout: nil, tcp_keep_alive_interval: nil, config_poll_interval: nil, config_poll_floor: nil, config_idle_redial_timeout: nil, idle_http_connection_timeout: nil) {|self| ... } ⇒ Cluster

Creates an instance of options for Cluster.connect

Parameters:

  • authenticator (PasswordAuthenticator, CertificateAuthenticator) (defaults to: nil)
  • key_value_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    default timeout for Key/Value operations, e.g. Collection#get

  • view_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    default timeout for View query

  • query_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    default timeout for N1QL query

  • analytics_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    default timeout for Analytics query

  • search_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    default timeout for Search query

  • management_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    default timeout for management operations

Yield Parameters:

See Also:

[View source]

1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
# File 'lib/couchbase/options.rb', line 1544

def initialize(authenticator: nil,
               enable_metrics: nil,
               metrics_emit_interval: nil,
               enable_tracing: nil,
               orphaned_emit_interval: nil,
               orphaned_sample_size: nil,
               threshold_emit_interval: nil,
               threshold_sample_size: nil,
               key_value_threshold: nil,
               query_threshold: nil,
               view_threshold: nil,
               search_threshold: nil,
               analytics_threshold: nil,
               management_threshold: nil,
               bootstrap_timeout: nil,
               resolve_timeout: nil,
               connect_timeout: nil,
               key_value_timeout: nil,
               view_timeout: nil,
               query_timeout: nil,
               analytics_timeout: nil,
               search_timeout: nil,
               management_timeout: nil,
               dns_srv_timeout: nil,
               tcp_keep_alive_interval: nil,
               config_poll_interval: nil,
               config_poll_floor: nil,
               config_idle_redial_timeout: nil,
               idle_http_connection_timeout: nil)
  @authenticator = authenticator
  @enable_metrics = enable_metrics
  @metrics_emit_interval = metrics_emit_interval
  @enable_tracing = enable_tracing
  @orphaned_emit_interval = orphaned_emit_interval
  @orphaned_sample_size = orphaned_sample_size
  @threshold_emit_interval = threshold_emit_interval
  @threshold_sample_size = threshold_sample_size
  @key_value_threshold = key_value_threshold
  @query_threshold = query_threshold
  @view_threshold = view_threshold
  @search_threshold = search_threshold
  @analytics_threshold = analytics_threshold
  @management_threshold = management_threshold
  @bootstrap_timeout = bootstrap_timeout
  @resolve_timeout = resolve_timeout
  @connect_timeout = connect_timeout
  @key_value_timeout = key_value_timeout
  @view_timeout = view_timeout
  @query_timeout = query_timeout
  @analytics_timeout = analytics_timeout
  @search_timeout = search_timeout
  @management_timeout = management_timeout
  @dns_srv_timeout = dns_srv_timeout
  @tcp_keep_alive_interval = tcp_keep_alive_interval
  @config_poll_interval = config_poll_interval
  @config_poll_floor = config_poll_floor
  @config_idle_redial_timeout = config_idle_redial_timeout
  @idle_http_connection_timeout = idle_http_connection_timeout
  yield self if block_given?
end

Instance Attribute Details

#analytics_thresholdnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1512
1513
1514
# File 'lib/couchbase/options.rb', line 1512

def analytics_threshold
  @analytics_threshold
end

#analytics_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1521
1522
1523
# File 'lib/couchbase/options.rb', line 1521

def analytics_timeout
  @analytics_timeout
end

#authenticatorPasswordAuthenticator, CertificateAuthenticator


1499
1500
1501
# File 'lib/couchbase/options.rb', line 1499

def authenticator
  @authenticator
end

#bootstrap_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1515
1516
1517
# File 'lib/couchbase/options.rb', line 1515

def bootstrap_timeout
  @bootstrap_timeout
end

#config_idle_redial_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1528
1529
1530
# File 'lib/couchbase/options.rb', line 1528

def config_idle_redial_timeout
  @config_idle_redial_timeout
end

#config_poll_floornil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1527
1528
1529
# File 'lib/couchbase/options.rb', line 1527

def config_poll_floor
  @config_poll_floor
end

#config_poll_intervalnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1526
1527
1528
# File 'lib/couchbase/options.rb', line 1526

def config_poll_interval
  @config_poll_interval
end

#connect_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1517
1518
1519
# File 'lib/couchbase/options.rb', line 1517

def connect_timeout
  @connect_timeout
end

#dns_srv_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1524
1525
1526
# File 'lib/couchbase/options.rb', line 1524

def dns_srv_timeout
  @dns_srv_timeout
end

#enable_metricsBoolean

Returns:

  • (Boolean)

1501
1502
1503
# File 'lib/couchbase/options.rb', line 1501

def enable_metrics
  @enable_metrics
end

#enable_tracingBoolean

Returns:

  • (Boolean)

1503
1504
1505
# File 'lib/couchbase/options.rb', line 1503

def enable_tracing
  @enable_tracing
end

#idle_http_connection_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1529
1530
1531
# File 'lib/couchbase/options.rb', line 1529

def idle_http_connection_timeout
  @idle_http_connection_timeout
end

#key_value_thresholdnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1508
1509
1510
# File 'lib/couchbase/options.rb', line 1508

def key_value_threshold
  @key_value_threshold
end

#key_value_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1518
1519
1520
# File 'lib/couchbase/options.rb', line 1518

def key_value_timeout
  @key_value_timeout
end

#management_thresholdnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1513
1514
1515
# File 'lib/couchbase/options.rb', line 1513

def management_threshold
  @management_threshold
end

#management_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1523
1524
1525
# File 'lib/couchbase/options.rb', line 1523

def management_timeout
  @management_timeout
end

#metrics_emit_intervalnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1502
1503
1504
# File 'lib/couchbase/options.rb', line 1502

def metrics_emit_interval
  @metrics_emit_interval
end

#orphaned_emit_intervalnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1504
1505
1506
# File 'lib/couchbase/options.rb', line 1504

def orphaned_emit_interval
  @orphaned_emit_interval
end

#orphaned_sample_sizenil, Integer

Returns:

  • (nil, Integer)

1505
1506
1507
# File 'lib/couchbase/options.rb', line 1505

def orphaned_sample_size
  @orphaned_sample_size
end

#query_thresholdnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1509
1510
1511
# File 'lib/couchbase/options.rb', line 1509

def query_threshold
  @query_threshold
end

#query_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1520
1521
1522
# File 'lib/couchbase/options.rb', line 1520

def query_timeout
  @query_timeout
end

#resolve_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1516
1517
1518
# File 'lib/couchbase/options.rb', line 1516

def resolve_timeout
  @resolve_timeout
end

#search_thresholdnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1511
1512
1513
# File 'lib/couchbase/options.rb', line 1511

def search_threshold
  @search_threshold
end

#search_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1522
1523
1524
# File 'lib/couchbase/options.rb', line 1522

def search_timeout
  @search_timeout
end

#tcp_keep_alive_intervalnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1525
1526
1527
# File 'lib/couchbase/options.rb', line 1525

def tcp_keep_alive_interval
  @tcp_keep_alive_interval
end

#threshold_emit_intervalnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1506
1507
1508
# File 'lib/couchbase/options.rb', line 1506

def threshold_emit_interval
  @threshold_emit_interval
end

#threshold_sample_sizenil, Integer

Returns:

  • (nil, Integer)

1507
1508
1509
# File 'lib/couchbase/options.rb', line 1507

def threshold_sample_size
  @threshold_sample_size
end

#view_thresholdnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1510
1511
1512
# File 'lib/couchbase/options.rb', line 1510

def view_threshold
  @view_threshold
end

#view_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)

1519
1520
1521
# File 'lib/couchbase/options.rb', line 1519

def view_timeout
  @view_timeout
end

Instance Method Details

#apply_profile(profile_name) ⇒ Object

Parameters:

  • profile_name (String)

    The name of the configuration profile to apply (e.g. “wan_development”)

[View source]

1612
1613
1614
# File 'lib/couchbase/options.rb', line 1612

def apply_profile(profile_name)
  ConfigProfiles::KNOWN_PROFILES.apply(profile_name, self)
end

#authenticate(username, password) ⇒ Object

Parameters:

  • username (String)
  • password (String)
[View source]

1607
1608
1609
# File 'lib/couchbase/options.rb', line 1607

def authenticate(username, password)
  @authenticator = PasswordAuthenticator.new(username, password)
end