Tabnine Logo
MappedBytes.reserve
Code IndexAdd Tabnine to your IDE (free)

How to use
reserve
method
in
net.openhft.chronicle.bytes.MappedBytes

Best Java code snippets using net.openhft.chronicle.bytes.MappedBytes.reserve (Showing top 4 results out of 315)

origin: OpenHFT/Chronicle-Queue

public synchronized LongValue acquireValueFor(CharSequence key, long defaultValue) { // TODO Change to ThreadLocal values if performance is a problem.
  StringBuilder sb = Wires.acquireStringBuilder();
  mappedBytes.reserve();
  try {
    mappedBytes.readPosition(0);
origin: OpenHFT/Chronicle-Queue

private void removeEOF(Path path) throws IOException {
  long blockSize = 64 << 10;
  long chunkSize = OS.pageAlign(blockSize);
  long overlapSize = OS.pageAlign(blockSize / 4);
  final MappedBytes mappedBytes = MappedBytes.mappedBytes(path.toFile(), chunkSize, overlapSize, false);
  mappedBytes.reserve();
  try {
    final Wire wire = WireType.BINARY_LIGHT.apply(mappedBytes);
    final Bytes<?> bytes = wire.bytes();
    bytes.readLimit(bytes.capacity());
    bytes.readSkip(4);
    // move past header
    try (final SingleChronicleQueueStore qs = loadStore(wire)) {
      assertNotNull(qs);
      long l = qs.writePosition();
      long len = Wires.lengthOf(bytes.readVolatileInt(l));
      long eofOffset = l + len + 4L;
      bytes.writePosition(eofOffset);
      bytes.writeInt(0);
    }
  } finally {
    mappedBytes.release();
  }
}
origin: net.openhft/chronicle-bytes

protected MappedBytes(@NotNull MappedFile mappedFile, String name) throws IllegalStateException {
  super(NoBytesStore.noBytesStore(), NoBytesStore.noBytesStore().writePosition(),
      NoBytesStore.noBytesStore().writeLimit(), name);
  this.mappedFile = reserve(mappedFile);
  this.backingFileIsReadOnly = !mappedFile.file().canWrite();
  assert !mappedFile.isClosed();
  clear();
}
origin: net.openhft/chronicle-queue

public synchronized LongValue acquireValueFor(CharSequence key, long defaultValue) { // TODO Change to ThreadLocal values if performance is a problem.
  StringBuilder sb = Wires.acquireStringBuilder();
  mappedBytes.reserve();
  try {
    mappedBytes.readPosition(0);
net.openhft.chronicle.bytesMappedBytesreserve

Popular methods of MappedBytes

  • mappedBytes
  • addressForWrite
  • readLimit
  • readPosition
  • release
  • writePosition
  • writeSkip
  • mappedFile
  • readRemaining
  • realCapacity
  • start
  • writeLimit
  • start,
  • writeLimit,
  • writeLong,
  • <init>,
  • acquireNextByteStore,
  • acquireNextByteStore0,
  • append8bit0,
  • appendUtf8,
  • bytesStore

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • JButton (javax.swing)
  • Top Vim 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