public void readEntriesFromAllBookies(final LedgerHandle lh, long eid, final GenericCallback<Set<ReadResult<InputStream>>> callback) { List<Integer> writeSet = lh.distributionSchedule.getWriteSet(eid); final AtomicInteger numBookies = new AtomicInteger(writeSet.size()); final Set<ReadResult<InputStream>> readResults = new HashSet<ReadResult<InputStream>>();
public void readLacs(final LedgerHandle lh, long eid, final GenericCallback<Set<ReadResult<Long>>> callback) { List<Integer> writeSet = lh.distributionSchedule.getWriteSet(eid); final AtomicInteger numBookies = new AtomicInteger(writeSet.size()); final Set<ReadResult<Long>> readResults = new HashSet<ReadResult<Long>>();
/** * Return a {@link WriteSet} suitable for reading a particular entry. * This will include all bookies that are cotna */ WriteSet getWriteSetForReadOperation(long entryId) { if (stickyBookieIndex != -1) { // When sticky reads are enabled we want to make sure to take // advantage of read-ahead (or, anyway, from efficiencies in // reading sequential data from disk through the page cache). // For this, all the entries that a given bookie prefetches, // should read from that bookie. // For example, with e=2, w=2, a=2 we would have // B-1 B-2 // e-0 X X // e-1 X X // e-2 X X // // In this case we want all the requests to be issued to B-1 (by // preference), so that cache hits will be maximized. // // We can only enable sticky reads if the ensemble==writeQuorum // otherwise the same bookie will not have all the entries // stored return distributionSchedule.getWriteSet(stickyBookieIndex); } else { return distributionSchedule.getWriteSet(entryId); } } }
void initiate(ByteBufList toSend) { this.toSend = toSend; DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSet(lac); try { for (int i = 0; i < writeSet.size(); i++) { sendWriteLacRequest(writeSet.get(i)); } } finally { writeSet.recycle(); } }
DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSet(entryId); try { if (!writeSet.contains(bookieIndex)) {
public void readEntriesFromAllBookies(final LedgerHandle lh, long eid, final GenericCallback<Set<ReadResult<ByteBuf>>> callback) { WriteSet writeSet = lh.distributionSchedule.getWriteSet(eid); final AtomicInteger numBookies = new AtomicInteger(writeSet.size()); final Set<ReadResult<ByteBuf>> readResults = new HashSet<>();
DistributionSchedule.WriteSet writeSet = lh.getDistributionSchedule().getWriteSet(entryToRead); for (int i = 0; i < writeSet.size(); i++) { BookieSocketAddress addr = curEnsemble.get(writeSet.get(i));
public void readLacs(final LedgerHandle lh, long eid, final GenericCallback<Set<ReadResult<Long>>> callback) { WriteSet writeSet = lh.distributionSchedule.getWriteSet(eid); final AtomicInteger numBookies = new AtomicInteger(writeSet.size()); final Set<ReadResult<Long>> readResults = new HashSet<ReadResult<Long>>();
DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSet(entryId);
DistributionSchedule.WriteSet ws = distributionSchedule.getWriteSet(firstEntry); try { if (!waitForWritable(ws, firstEntry, ws.size() - 1, clientCtx.getConf().waitForWriteSetMs)) {
if (!waitForWritable(distributionSchedule.getWriteSet(op.getEntryId()), op.getEntryId(), 0, clientCtx.getConf().waitForWriteSetMs)) { op.allowFailFastOnUnwritableChannel();
DistributionSchedule.WriteSet ws = distributionSchedule.getWriteSet(op.getEntryId()); try { if (!waitForWritable(ws, op.getEntryId(), 0, clientCtx.getConf().waitForWriteSetMs)) {