Codota Logo
ByteSlot
Code IndexAdd Codota to your IDE (free)

How to use
ByteSlot
in
org.apache.hadoop.hbase.procedure2.util

Best Java code snippets using org.apache.hadoop.hbase.procedure2.util.ByteSlot (Showing top 20 results out of 315)

  • Common ways to obtain ByteSlot
private void myMethod () {
ByteSlot b =
  • Codota Iconnew ByteSlot()
  • Codota IconLinkedTransferQueue linkedTransferQueue;linkedTransferQueue.poll()
  • Smart code suggestions by Codota
}
origin: apache/hbase

private ByteSlot acquireSlot() {
 ByteSlot slot = slotsCache.poll();
 return slot != null ? slot : new ByteSlot();
}
origin: apache/hbase

@Override
public void write(int b) {
 ensureCapacity(size + 1);
 buf[size++] = (byte)b;
}
origin: apache/hbase

private void releaseSlot(final ByteSlot slot) {
 slot.reset();
 slotsCache.offer(slot);
}
origin: apache/hbase

protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots,
  final int offset, final int count) throws IOException {
 long totalSynced = 0;
 for (int i = 0; i < count; ++i) {
  final ByteSlot data = slots[offset + i];
  data.writeTo(stream);
  totalSynced += data.size();
 }
 syncStream(stream);
 sendPostSyncSignal();
 if (LOG.isTraceEnabled()) {
  LOG.trace("Sync slots=" + count + '/' + syncMaxSlot +
       ", flushed=" + StringUtils.humanSize(totalSynced));
 }
 return totalSynced;
}
origin: org.apache.hbase/hbase-procedure

protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots,
  final int offset, final int count) throws IOException {
 long totalSynced = 0;
 for (int i = 0; i < count; ++i) {
  final ByteSlot data = slots[offset + i];
  data.writeTo(stream);
  totalSynced += data.size();
 }
 syncStream(stream);
 sendPostSyncSignal();
 if (LOG.isTraceEnabled()) {
  LOG.trace("Sync slots=" + count + '/' + syncMaxSlot +
       ", flushed=" + StringUtils.humanSize(totalSynced));
 }
 return totalSynced;
}
origin: com.aliyun.hbase/alihbase-procedure

protected long syncSlots(final FSDataOutputStream stream, final ByteSlot[] slots,
  final int offset, final int count) throws IOException {
 long totalSynced = 0;
 for (int i = 0; i < count; ++i) {
  final ByteSlot data = slots[offset + i];
  data.writeTo(stream);
  totalSynced += data.size();
 }
 syncStream(stream);
 sendPostSyncSignal();
 if (LOG.isTraceEnabled()) {
  LOG.trace("Sync slots=" + count + '/' + syncMaxSlot +
       ", flushed=" + StringUtils.humanSize(totalSynced));
 }
 return totalSynced;
}
origin: apache/hbase

@Override
public void write(byte[] b, int off, int len) {
 ensureCapacity(size + len);
 System.arraycopy(b, off, buf, size, len);
 size += len;
}
origin: apache/hbase

slotsCache = new LinkedTransferQueue<>();
while (slotsCache.size() < numSlots) {
 slotsCache.offer(new ByteSlot());
origin: com.aliyun.hbase/alihbase-procedure

private void releaseSlot(final ByteSlot slot) {
 slot.reset();
 slotsCache.offer(slot);
}
origin: harbby/presto-connectors

protected long syncSlots(FSDataOutputStream stream, ByteSlot[] slots, int offset, int count)
  throws IOException {
 long totalSynced = 0;
 for (int i = 0; i < count; ++i) {
  ByteSlot data = slots[offset + i];
  data.writeTo(stream);
  totalSynced += data.size();
 }
 if (useHsync) {
  stream.hsync();
 } else {
  stream.hflush();
 }
 sendPostSyncSignal();
 if (LOG.isTraceEnabled()) {
  LOG.trace("Sync slots=" + count + '/' + slots.length +
       ", flushed=" + StringUtils.humanSize(totalSynced));
 }
 return totalSynced;
}
origin: org.apache.hbase/hbase-procedure

@Override
public void write(int b) {
 ensureCapacity(size + 1);
 buf[size++] = (byte)b;
}
origin: org.apache.hbase/hbase-procedure

private ByteSlot acquireSlot() {
 ByteSlot slot = slotsCache.poll();
 return slot != null ? slot : new ByteSlot();
}
origin: org.apache.hbase/hbase-procedure

private void releaseSlot(final ByteSlot slot) {
 slot.reset();
 slotsCache.offer(slot);
}
origin: com.aliyun.hbase/alihbase-procedure

@Override
public void write(int b) {
 ensureCapacity(size + 1);
 buf[size++] = (byte)b;
}
origin: com.aliyun.hbase/alihbase-procedure

private ByteSlot acquireSlot() {
 ByteSlot slot = slotsCache.poll();
 return slot != null ? slot : new ByteSlot();
}
origin: harbby/presto-connectors

private void releaseSlot(final ByteSlot slot) {
 slot.reset();
 slotsCache.offer(slot);
}
origin: harbby/presto-connectors

public void write(int b) {
 ensureCapacity(size + 1);
 buf[size++] = (byte)b;
}
origin: harbby/presto-connectors

private ByteSlot acquireSlot() {
 ByteSlot slot = slotsCache.poll();
 return slot != null ? slot : new ByteSlot();
}
origin: org.apache.hbase/hbase-procedure

@Override
public void write(byte[] b, int off, int len) {
 ensureCapacity(size + len);
 System.arraycopy(b, off, buf, size, len);
 size += len;
}
origin: harbby/presto-connectors

slotsCache = new LinkedTransferQueue();
while (slotsCache.size() < numSlots) {
 slotsCache.offer(new ByteSlot());
org.apache.hadoop.hbase.procedure2.utilByteSlot

Javadoc

Similar to the ByteArrayOutputStream, with the exception that we can prepend an header. e.g. you write some data and you want to prepend an header that contains the data len or cksum. ByteSlot slot = new ByteSlot(); // write data slot.write(...); slot.write(...); // write header with the size of the written data slot.markHead(); slot.write(Bytes.toBytes(slot.size())); // flush to stream as [header, data] slot.writeTo(stream);

Most used methods

  • <init>
  • ensureCapacity
  • reset
  • size
  • writeTo

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • notifyDataSetChanged (ArrayAdapter)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now