bookieClient.readEntry(ensemble.get(idx), lh.getId(), eid, readEntryCallback, ensemble.get(idx));
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; }
bkc.getBookieInfo(b, requested, new GetBookieInfoCallback() { @Override public void getBookieInfoComplete(int rc, BookieInfo bInfo, Object ctx) {
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; } } }
void sendForceLedgerRequest(int bookieIndex) { bookieClient.forceLedger(currentEnsemble.get(bookieIndex), lh.ledgerId, this, bookieIndex); }
@Override public long getBookiePendingRequests(BookieSocketAddress bookieSocketAddress) { return clientCtx.getBookieClient().getNumPendingRequests(bookieSocketAddress, ledgerId); } };
void checkForFaultyBookies() { List<BookieSocketAddress> faultyBookies = bookieClient.getFaultyBookies(); for (BookieSocketAddress faultyBookie : faultyBookies) { bookieWatcher.quarantineBookie(faultyBookie); } }
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; }
bookieClient.close(); try {
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,
bkc.getBookieInfo(b, requested, new GetBookieInfoCallback() { void processReadInfoComplete(int rc, BookieInfo bInfo, Object ctx) {
bookieClient.readEntry(ensemble.get(idx), lh.getId(), eid, readEntryCallback, ensemble.get(idx));
/** * 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); }
/** * 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); }
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); } }
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); } }
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); } }
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); }
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);