Tabnine Logo
BookKeeperConfig.getZkAddress
Code IndexAdd Tabnine to your IDE (free)

How to use
getZkAddress
method
in
io.pravega.segmentstore.storage.impl.bookkeeper.BookKeeperConfig

Best Java code snippets using io.pravega.segmentstore.storage.impl.bookkeeper.BookKeeperConfig.getZkAddress (Showing top 3 results out of 315)

origin: pravega/pravega

private BookKeeper startBookKeeperClient() throws Exception {
  // These two are in Seconds, not Millis.
  int writeTimeout = (int) Math.ceil(this.config.getBkWriteTimeoutMillis() / 1000.0);
  int readTimeout = (int) Math.ceil(this.config.getBkReadTimeoutMillis() / 1000.0);
  ClientConfiguration config = new ClientConfiguration()
      .setClientTcpNoDelay(true)
      .setAddEntryTimeout(writeTimeout)
      .setReadEntryTimeout(readTimeout)
      .setGetBookieInfoTimeout(readTimeout)
      .setClientConnectTimeoutMillis((int) this.config.getZkConnectionTimeout().toMillis())
      .setZkTimeout((int) this.config.getZkConnectionTimeout().toMillis());
  if (this.config.isTLSEnabled()) {
    config = (ClientConfiguration) config.setTLSProvider("OpenSSL");
    config = config.setTLSTrustStore(this.config.getTlsTrustStore());
    config.setTLSTrustStorePasswordPath(this.config.getTlsTrustStorePasswordPath());
  }
  String metadataServiceUri = "zk://" + this.config.getZkAddress();
  if (this.config.getBkLedgerPath().isEmpty()) {
    metadataServiceUri += "/" + this.namespace + "/bookkeeper/ledgers";
  } else {
    metadataServiceUri += this.config.getBkLedgerPath();
  }
  config.setMetadataServiceUri(metadataServiceUri);
  return new BookKeeper(config);
}
origin: pravega/pravega

@Test
public void testZkServers() {
  // When multiple servers are specified and separated by comma, it should replace it by semicolon
  BookKeeperConfig cfg1 = BookKeeperConfig.builder()
      .with(BookKeeperConfig.ZK_ADDRESS, "foo:12345,bar:54321")
      .build();
  Assert.assertEquals("foo:12345;bar:54321", cfg1.getZkAddress());
  // No changes should be made to the following configs
  BookKeeperConfig cfg2 = BookKeeperConfig.builder()
      .with(BookKeeperConfig.ZK_ADDRESS, "foo:12345")
      .build();
  Assert.assertEquals("foo:12345", cfg2.getZkAddress());
  BookKeeperConfig cfg3 = BookKeeperConfig.builder()
      .with(BookKeeperConfig.ZK_ADDRESS, "10.20.30.40:12345;bar:2181")
      .build();
  Assert.assertEquals("10.20.30.40:12345;bar:2181", cfg3.getZkAddress());
}
origin: pravega/pravega

@Test
public void testDefaultValues() {
  BookKeeperConfig cfg = BookKeeperConfig.builder()
      .build();
  Assert.assertEquals("localhost:2181", cfg.getZkAddress());
  Assert.assertEquals(Duration.ofMillis(10000), cfg.getZkSessionTimeout());
  Assert.assertEquals(Duration.ofMillis(10000), cfg.getZkConnectionTimeout());
  Assert.assertEquals("/segmentstore/containers", cfg.getZkMetadataPath());
  Assert.assertEquals(2, cfg.getZkHierarchyDepth());
  Assert.assertEquals(5, cfg.getMaxWriteAttempts());
  Assert.assertEquals(3, cfg.getBkEnsembleSize());
  Assert.assertEquals(2, cfg.getBkAckQuorumSize());
  Assert.assertEquals(3, cfg.getBkWriteQuorumSize());
  Assert.assertEquals(5000, cfg.getBkWriteTimeoutMillis());
  Assert.assertEquals(5000, cfg.getBkReadTimeoutMillis());
  Assert.assertEquals(1024 * 1024 * 1024, cfg.getBkLedgerMaxSize());
  Assert.assertEquals(0, cfg.getBKPassword().length);
  Assert.assertEquals("", cfg.getBkLedgerPath());
  Assert.assertEquals(false, cfg.isTLSEnabled());
  Assert.assertEquals("config/client.truststore.jks", cfg.getTlsTrustStore());
  Assert.assertEquals("", cfg.getTlsTrustStorePasswordPath());
}
io.pravega.segmentstore.storage.impl.bookkeeperBookKeeperConfiggetZkAddress

Popular methods of BookKeeperConfig

  • builder
    Creates a new ConfigBuilder that can be used to create instances of this class.
  • getBKPassword
    Gets a value representing the Password to use for the creation and access of each BK Ledger.
  • getBkAckQuorumSize
  • getBkEnsembleSize
  • getBkLedgerMaxSize
  • getBkLedgerPath
  • getBkReadTimeoutMillis
  • getBkWriteQuorumSize
  • getBkWriteTimeoutMillis
  • getMaxWriteAttempts
  • getTlsTrustStore
  • getTlsTrustStorePasswordPath
  • getTlsTrustStore,
  • getTlsTrustStorePasswordPath,
  • getZkConnectionTimeout,
  • getZkHierarchyDepth,
  • getZkMetadataPath,
  • isTLSEnabled,
  • getZkSessionTimeout

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JLabel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now