Tabnine Logo
RollingStorage.ensureNotSealed
Code IndexAdd Tabnine to your IDE (free)

How to use
ensureNotSealed
method
in
io.pravega.segmentstore.storage.rolling.RollingStorage

Best Java code snippets using io.pravega.segmentstore.storage.rolling.RollingStorage.ensureNotSealed (Showing top 2 results out of 315)

origin: pravega/pravega

@Override
public void write(SegmentHandle handle, long offset, InputStream data, int length) throws StreamSegmentException {
  val h = asWritableHandle(handle);
  ensureNotDeleted(h);
  ensureNotSealed(h);
  ensureOffset(h, offset);
  long traceId = LoggerHelpers.traceEnter(log, "write", handle, offset, length);
  // We run this in a loop because we may have to split the write over multiple SegmentChunks in order to avoid exceeding
  // any SegmentChunk's maximum length.
  int bytesWritten = 0;
  while (bytesWritten < length) {
    if (h.getActiveChunkHandle() == null || h.lastChunk().getLength() >= h.getRollingPolicy().getMaxLength()) {
      rollover(h);
    }
    SegmentChunk last = h.lastChunk();
    int writeLength = (int) Math.min(length - bytesWritten, h.getRollingPolicy().getMaxLength() - last.getLength());
    assert writeLength > 0 : "non-positive write length";
    long chunkOffset = offset + bytesWritten - last.getStartOffset();
    this.baseStorage.write(h.getActiveChunkHandle(), chunkOffset, data, writeLength);
    last.increaseLength(writeLength);
    bytesWritten += writeLength;
  }
  LoggerHelpers.traceLeave(log, "write", traceId, handle, offset, bytesWritten);
}
origin: pravega/pravega

ensureOffset(target, targetOffset);
ensureNotDeleted(target);
ensureNotSealed(target);
long traceId = LoggerHelpers.traceEnter(log, "concat", target, targetOffset, sourceSegment);
io.pravega.segmentstore.storage.rollingRollingStorageensureNotSealed

Popular methods of RollingStorage

  • <init>
    Creates a new instance of the RollingStorage class.
  • create
  • delete
  • openRead
  • openWrite
  • seal
  • asReadableHandle
  • asWritableHandle
  • canTruncate
  • checkIfEmptyAndNotSealed
  • checkTruncatedSegment
  • concat
  • checkTruncatedSegment,
  • concat,
  • createChunk,
  • createHeader,
  • deleteChunks,
  • ensureNotDeleted,
  • ensureOffset,
  • exists,
  • getHeaderInfo

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • JButton (javax.swing)
  • JPanel (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best IntelliJ plugins
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