protected void maybeWaitForSync(CommitLogSegment.Allocation alloc) { // wait until record has been safely persisted to disk pending.incrementAndGet(); requestExtraSync(); alloc.awaitDiskSync(commitLog.metrics.waitingOnCommit); pending.decrementAndGet(); } }
final ByteBuffer buffer = alloc.getBuffer(); try (BufferedDataOutputStreamPlus dos = new DataOutputBufferFixed(buffer)) throw new FSWriteError(e, alloc.getSegment().getPath()); alloc.markWritten(); return alloc.getCommitLogPosition();
final ByteBuffer buffer = alloc.getBuffer(); try (BufferedDataOutputStreamPlus dos = new DataOutputBufferFixed(buffer)) throw new FSWriteError(e, alloc.getSegment().getPath()); alloc.markWritten(); return alloc.getCommitLogPosition();
final ByteBuffer buffer = alloc.getBuffer(); try (BufferedDataOutputStreamPlus dos = new DataOutputBufferFixed(buffer)) throw new FSWriteError(e, alloc.getSegment().getPath()); alloc.markWritten(); return alloc.getCommitLogPosition();
final ByteBuffer buffer = alloc.getBuffer(); DataOutputByteBuffer dos = new DataOutputByteBuffer(buffer); throw new FSWriteError(e, alloc.getSegment().getPath()); alloc.markWritten(); return alloc.getReplayPosition();
/** * Allocate space in this buffer for the provided mutation, and return the allocated Allocation object. * Returns null if there is not enough space in this segment, and a new segment is needed. */ @SuppressWarnings("resource") //we pass the op order around Allocation allocate(Mutation mutation, int size) { final OpOrder.Group opGroup = appendOrder.start(); try { int position = allocate(size); if (position < 0) { opGroup.close(); return null; } markDirty(mutation, position); return new Allocation(this, opGroup, position, (ByteBuffer) buffer.duplicate().position(position).limit(position + size)); } catch (Throwable t) { opGroup.close(); throw t; } }
/** * Allocate space in this buffer for the provided mutation, and return the allocated Allocation object. * Returns null if there is not enough space in this segment, and a new segment is needed. */ @SuppressWarnings("resource") //we pass the op order around Allocation allocate(Mutation mutation, int size) { final OpOrder.Group opGroup = appendOrder.start(); try { int position = allocate(size); if (position < 0) { opGroup.close(); return null; } markDirty(mutation, position); return new Allocation(this, opGroup, position, (ByteBuffer) buffer.duplicate().position(position).limit(position + size)); } catch (Throwable t) { opGroup.close(); throw t; } }
/** * Allocate space in this buffer for the provided mutation, and return the allocated Allocation object. * Returns null if there is not enough space in this segment, and a new segment is needed. */ Allocation allocate(Mutation mutation, int size) { final OpOrder.Group opGroup = appendOrder.start(); try { int position = allocate(size); if (position < 0) { opGroup.close(); return null; } markDirty(mutation, position); return new Allocation(this, opGroup, position, (ByteBuffer) buffer.duplicate().position(position).limit(position + size)); } catch (Throwable t) { opGroup.close(); throw t; } }
/** * Allocate space in this buffer for the provided mutation, and return the allocated Allocation object. * Returns null if there is not enough space in this segment, and a new segment is needed. */ @SuppressWarnings("resource") //we pass the op order around Allocation allocate(Mutation mutation, int size) { final OpOrder.Group opGroup = appendOrder.start(); try { int position = allocate(size); if (position < 0) { opGroup.close(); return null; } markDirty(mutation, position); return new Allocation(this, opGroup, position, (ByteBuffer) buffer.duplicate().position(position).limit(position + size)); } catch (Throwable t) { opGroup.close(); throw t; } }
protected void maybeWaitForSync(CommitLogSegment.Allocation alloc) { // wait until record has been safely persisted to disk pending.incrementAndGet(); haveWork.release(); alloc.awaitDiskSync(); pending.decrementAndGet(); } }
protected void maybeWaitForSync(CommitLogSegment.Allocation alloc) { // wait until record has been safely persisted to disk pending.incrementAndGet(); requestExtraSync(); alloc.awaitDiskSync(commitLog.metrics.waitingOnCommit); pending.decrementAndGet(); } }
protected void maybeWaitForSync(CommitLogSegment.Allocation alloc) { // wait until record has been safely persisted to disk pending.incrementAndGet(); requestExtraSync(); alloc.awaitDiskSync(commitLog.metrics.waitingOnCommit); pending.decrementAndGet(); } }