Tabnine Logo
LedgerMetadata.getEnsembles
Code IndexAdd Tabnine to your IDE (free)

How to use
getEnsembles
method
in
org.apache.bookkeeper.client.LedgerMetadata

Best Java code snippets using org.apache.bookkeeper.client.LedgerMetadata.getEnsembles (Showing top 4 results out of 315)

origin: twitter/distributedlog

@Override
public String[] getLocations()
    throws IOException, InterruptedException {
  Set<String> locations = Sets.newHashSet();
  for (ArrayList<BookieSocketAddress> ensemble : ledgerMetadata.getEnsembles().values()) {
    for (BookieSocketAddress host : ensemble) {
      locations.add(host.getHostName());
    }
  }
  return locations.toArray(new String[locations.size()]);
}
origin: twitter/distributedlog

static public SortedMap<Long, ArrayList<BookieSocketAddress>> bookiesForLedger(final LedgerHandle lh) {
  return lh.getLedgerMetadata().getEnsembles();
}
origin: twitter/distributedlog

private Map<Long, Integer> inspectLedger(LedgerMetadata metadata, Set<BookieSocketAddress> bookiesToInspect) {
  Map<Long, Integer> numBookiesToReplacePerEnsemble = new TreeMap<Long, Integer>();
  for (Map.Entry<Long, ArrayList<BookieSocketAddress>> ensemble : metadata.getEnsembles().entrySet()) {
    ArrayList<BookieSocketAddress> bookieList = ensemble.getValue();
    System.out.print(ensemble.getKey() + ":\t");
    int numBookiesToReplace = 0;
    for (BookieSocketAddress bookie: bookieList) {
      System.out.print(bookie.toString());
      if (bookiesToInspect.contains(bookie)) {
        System.out.print("*");
        ++numBookiesToReplace;
      } else {
        System.out.print(" ");
      }
      System.out.print(" ");
    }
    System.out.println();
    numBookiesToReplacePerEnsemble.put(ensemble.getKey(), numBookiesToReplace);
  }
  return numBookiesToReplacePerEnsemble;
}
origin: pravega/pravega

private String getEnsembleDescription(org.apache.bookkeeper.client.LedgerMetadata bkLm) {
  return bkLm.getEnsembles().entrySet().stream()
        .map(e -> String.format("%d:[%s]", e.getKey(), e.getValue().stream().map(Object::toString).collect(Collectors.joining(","))))
        .collect(Collectors.joining(","));
}
org.apache.bookkeeper.clientLedgerMetadatagetEnsembles

Popular methods of LedgerMetadata

  • getEnsembleSize
  • <init>
  • getAckQuorumSize
  • getEnsemble
  • getState
  • getWriteQuorumSize
  • parseConfig
  • serialize

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JList (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
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