Codota Logo
BookieClient
Code IndexAdd Codota to your IDE (free)

How to use
BookieClient
in
org.apache.bookkeeper.proto

Best Java code snippets using org.apache.bookkeeper.proto.BookieClient (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: twitter/distributedlog

bookieClient.readEntry(ensemble.get(idx), lh.getId(), eid, readEntryCallback, ensemble.get(idx));
origin: org.apache.bookkeeper/bookkeeper-server

  CompletableFuture<Void> future = new CompletableFuture<>();
  bookieClient.readEntry(bookie, ledgerId, entryId,
    (rc, ledgerId1, entryId1, buffer, ctx) -> {
      if (rc != BKException.Code.OK) {
bookieClient.close();
origin: org.apache.bookkeeper/bookkeeper-server

void sendWriteRequest(List<BookieSocketAddress> ensemble, int bookieIndex) {
  int flags = isRecoveryAdd ? FLAG_RECOVERY_ADD | FLAG_HIGH_PRIORITY : FLAG_NONE;
  clientCtx.getBookieClient().addEntry(ensemble.get(bookieIndex),
                     lh.ledgerId, lh.ledgerKey, entryId, toSend, this, bookieIndex,
                     flags, allowFailFast, lh.writeFlags);
  ++pendingWriteRequests;
}
origin: org.apache.bookkeeper/bookkeeper-server

bkc.getBookieInfo(b, requested, new GetBookieInfoCallback() {
      @Override
      public void getBookieInfoComplete(int rc, BookieInfo bInfo, Object ctx) {
origin: org.apache.bookkeeper/bookkeeper-server

static int getReturnRc(BookieClient bookieClient, int rc) {
  if (BKException.Code.OK == rc) {
    return rc;
  } else {
    if (bookieClient.isClosed()) {
      return BKException.Code.ClientClosedException;
    } else {
      return rc;
    }
  }
}
origin: org.apache.bookkeeper/bookkeeper-server

void sendForceLedgerRequest(int bookieIndex) {
  bookieClient.forceLedger(currentEnsemble.get(bookieIndex), lh.ledgerId, this, bookieIndex);
}
origin: org.apache.bookkeeper/bookkeeper-server

  @Override
  public long getBookiePendingRequests(BookieSocketAddress bookieSocketAddress) {
    return clientCtx.getBookieClient().getNumPendingRequests(bookieSocketAddress, ledgerId);
  }
};
origin: org.apache.bookkeeper/bookkeeper-server

void checkForFaultyBookies() {
  List<BookieSocketAddress> faultyBookies = bookieClient.getFaultyBookies();
  for (BookieSocketAddress faultyBookie : faultyBookies) {
    bookieWatcher.quarantineBookie(faultyBookie);
  }
}
origin: org.apache.bookkeeper/bookkeeper-server

private boolean isWritesetWritable(DistributionSchedule.WriteSet writeSet,
                  long key, int allowedNonWritableCount) {
  if (allowedNonWritableCount < 0) {
    allowedNonWritableCount = 0;
  }
  final int sz = writeSet.size();
  final int requiredWritable = sz - allowedNonWritableCount;
  int nonWritableCount = 0;
  List<BookieSocketAddress> currentEnsemble = getCurrentEnsemble();
  for (int i = 0; i < sz; i++) {
    if (!clientCtx.getBookieClient().isWritable(currentEnsemble.get(i), key)) {
      nonWritableCount++;
      if (nonWritableCount >= allowedNonWritableCount) {
        return false;
      }
    } else {
      final int knownWritable = i - nonWritableCount;
      if (knownWritable >= requiredWritable) {
        return true;
      }
    }
  }
  return true;
}
origin: org.apache.bookkeeper/bookkeeper-server

bookieClient.close();
try {
origin: org.apache.bookkeeper/bookkeeper-server

        Unpooled.wrappedBuffer(data, 0, data.length));
for (BookieSocketAddress newBookie : newBookies) {
  bkc.getBookieClient().addEntry(newBookie, lh.getId(),
      lh.getLedgerKey(), entryId, ByteBufList.clone(toSend),
      multiWriteCallback, dataLength, BookieProtocol.FLAG_RECOVERY_ADD,
origin: org.apache.bookkeeper/bookkeeper-server

bkc.getBookieInfo(b, requested,
    new GetBookieInfoCallback() {
      void processReadInfoComplete(int rc, BookieInfo bInfo, Object ctx) {
origin: twitter/distributedlog

bookieClient.readEntry(ensemble.get(idx), lh.getId(), eid, readEntryCallback, ensemble.get(idx));
origin: org.apache.bookkeeper/bookkeeper-server

/**
 * Read entry with a null masterkey, disallowing failfast.
 * @see #readEntry(BookieSocketAddress,long,long,ReadEntryCallback,Object,int,byte[],boolean)
 */
default void readEntry(BookieSocketAddress address, long ledgerId, long entryId,
            ReadEntryCallback cb, Object ctx, int flags) {
  readEntry(address, ledgerId, entryId, cb, ctx, flags, null);
}
origin: org.apache.bookkeeper/bookkeeper-server

/**
 * Read entry, disallowing failfast.
 * @see #readEntry(BookieSocketAddress,long,long,ReadEntryCallback,Object,int,byte[],boolean)
 */
default void readEntry(BookieSocketAddress address, long ledgerId, long entryId,
            ReadEntryCallback cb, Object ctx, int flags, byte[] masterKey) {
  readEntry(address, ledgerId, entryId, cb, ctx, flags, masterKey, false);
}
origin: org.apache.bookkeeper/bookkeeper-server

public void initiate() {
  for (int i = 0; i < currentEnsemble.size(); i++) {
    bookieClient.readEntry(currentEnsemble.get(i),
                lh.ledgerId,
                BookieProtocol.LAST_ADD_CONFIRMED,
                this, i, BookieProtocol.FLAG_NONE);
  }
}
origin: org.apache.bookkeeper/bookkeeper-server

public void initiate() {
  for (int i = 0; i < currentEnsemble.size(); i++) {
    bookieClient.readEntry(currentEnsemble.get(i),
                lh.ledgerId,
                BookieProtocol.LAST_ADD_CONFIRMED,
                this, i, BookieProtocol.FLAG_NONE);
  }
}
origin: org.apache.bookkeeper/bookkeeper-server

public void initiateWithFencing() {
  for (int i = 0; i < currentEnsemble.size(); i++) {
    bookieClient.readEntry(currentEnsemble.get(i),
                lh.ledgerId,
                BookieProtocol.LAST_ADD_CONFIRMED,
                this, i, BookieProtocol.FLAG_DO_FENCING,
                lh.ledgerKey);
  }
}
origin: org.apache.bookkeeper/bookkeeper-server

void sendReadTo(int bookieIndex, BookieSocketAddress to, LedgerEntryRequest entry) throws InterruptedException {
  if (lh.throttler != null) {
    lh.throttler.acquire();
  }
  int flags = isRecoveryRead ? BookieProtocol.FLAG_HIGH_PRIORITY : BookieProtocol.FLAG_NONE;
  clientCtx.getBookieClient().readEntry(to, lh.ledgerId, entry.eId,
                     this, new ReadContext(bookieIndex, to, entry), flags);
}
origin: org.apache.distributedlog/distributedlog-core

for (int i = 0; i < writeSet.size(); i++) {
  int idx = writeSet.get(i);
  clientCtx.getBookieClient().readEntry(ensemble.get(idx), lh.getId(), eid, readEntryCallback,
              ensemble.get(idx), BookieProtocol.FLAG_NONE);
org.apache.bookkeeper.protoBookieClient

Javadoc

Low level client for talking to bookies.

Most used methods

  • readEntry
  • addEntry
    Add an entry for ledger ledgerId on the bookie at address address.
  • close
    Close the bookie client object.
  • forceLedger
    Send a force request to the server. When complete all entries which have been written for ledgerId t
  • getBookieInfo
    Read information about the bookie, from the bookie.
  • getFaultyBookies
    Get the list of bookies which have exhibited more error responses than a configured threshold.
  • getNumPendingRequests
    Get the number of outstanding requests on the channel used to connect to a bookie at address for a l
  • isClosed
  • isWritable
    Check whether the channel used to write to a bookie channel is writable. A channel becomes non-writa
  • readEntryWaitForLACUpdate
    Send a long poll request to bookie, waiting for the last add confirmed to be updated. The client can
  • readLac
    Read the last add confirmed for ledger ledgerId from the bookie at address.
  • writeLac
    Explicitly write the last add confirmed for ledger ledgerId to the bookie at address.
  • readLac,
  • writeLac

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now