Codota Logo
ByteBufferUtil.toLong
Code IndexAdd Codota to your IDE (free)

How to use
toLong
method
in
org.apache.cassandra.utils.ByteBufferUtil

Best Java code snippets using org.apache.cassandra.utils.ByteBufferUtil.toLong (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: Impetus/Kundera

  /**
   * Decompose.
   * 
   * @param value
   *            the value
   * @param clazz
   *            the clazz
   * @return the object
   */
  private static Object decompose(Object value, Class clazz)
  {
    ByteBuffer buf = ByteBuffer.wrap((byte[]) value, 0, ((byte[]) value).length);
    return ByteBufferUtil.toLong(buf);
  }
}
origin: Impetus/Kundera

latestCount = ByteBufferUtil.toLong(ByteBuffer.wrap(row.getColumns().get(0).getValue()));
origin: jsevellec/cassandra-unit

public Long deserialize(ByteBuffer bytes)
{
  return bytes.remaining() == 0 ? null : ByteBufferUtil.toLong(bytes);
}
origin: com.impetus.client/kundera-cassandra

  private static Object decompose(Object value, Class clazz)
  {
    ByteBuffer buf = ByteBuffer.wrap((byte[]) value, 0, ((byte[]) value).length);
    return ByteBufferUtil.toLong(buf);
  }
}
origin: org.apache.cassandra/cassandra-all

public Long deserialize(ByteBuffer bytes)
{
  return bytes.remaining() == 0 ? null : ByteBufferUtil.toLong(bytes);
}
origin: org.apache.cassandra/cassandra-all

public Long deserialize(ByteBuffer bytes)
{
  return bytes.remaining() == 0 ? null : ByteBufferUtil.toLong(bytes);
}
origin: adejanovski/cassandra-jdbc-wrapper

@Override
public Long deserialize(ByteBuffer paramByteBuffer, ProtocolVersion paramProtocolVersion) throws InvalidTypeException {
  if (paramByteBuffer == null) {
    return null;
  }
  // always duplicate the ByteBuffer instance before consuming it!
  return ByteBufferUtil.toLong(paramByteBuffer.duplicate());
}
origin: com.facebook.presto.cassandra/cassandra-server

public Date deserialize(ByteBuffer bytes)
{
  return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes));
}
origin: org.apache.cassandra/cassandra-all

public Date deserialize(ByteBuffer bytes)
{
  return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes));
}
origin: jsevellec/cassandra-unit

public Date deserialize(ByteBuffer bytes)
{
  return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes));
}
origin: com.strapdata.cassandra/cassandra-all

public Token fromByteArray(ByteBuffer bytes)
{
  return new LongToken(ByteBufferUtil.toLong(bytes));
}
origin: org.apache.cassandra/cassandra-all

public Token fromByteArray(ByteBuffer bytes)
{
  return new LongToken(ByteBufferUtil.toLong(bytes));
}
origin: com.facebook.presto.cassandra/cassandra-server

  @Override
  public String getString(CellNameType comparator)
  {
    return String.format("%s:%s@%d", comparator.getString(name()), ByteBufferUtil.toLong(value), timestamp());
  }
}
origin: jsevellec/cassandra-unit

  public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER)
      return;
    long increment = ByteBufferUtil.toLong(bytes);
    params.addCounter(column, increment);
  }
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

  public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER)
      return;
    long increment = ByteBufferUtil.toLong(bytes);
    params.addCounter(column, increment);
  }
}
origin: org.apache.cassandra/cassandra-all

  public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER)
      return;
    long increment = ByteBufferUtil.toLong(bytes);
    params.addCounter(column, increment);
  }
}
origin: com.strapdata.cassandra/cassandra-all

  public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER)
      return;
    long increment = ByteBufferUtil.toLong(bytes);
    params.addCounter(column, increment);
  }
}
origin: org.apache.cassandra/cassandra-all

  public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER)
      return;
    long increment = ByteBufferUtil.toLong(bytes);
    if (increment == Long.MIN_VALUE)
      throw new InvalidRequestException("The negation of " + increment + " overflows supported counter precision (signed 8 bytes integer)");
    params.addCounter(column, -increment);
  }
}
origin: com.facebook.presto.cassandra/cassandra-server

  public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    long increment = ByteBufferUtil.toLong(bytes);
    CellName cname = cf.getComparator().create(prefix, column);
    cf.addColumn(params.makeCounter(cname, increment));
  }
}
origin: com.facebook.presto.cassandra/cassandra-server

  public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException
  {
    ByteBuffer bytes = t.bindAndGet(params.options);
    if (bytes == null)
      throw new InvalidRequestException("Invalid null value for counter increment");
    long increment = ByteBufferUtil.toLong(bytes);
    if (increment == Long.MIN_VALUE)
      throw new InvalidRequestException("The negation of " + increment + " overflows supported counter precision (signed 8 bytes integer)");
    CellName cname = cf.getComparator().create(prefix, column);
    cf.addColumn(params.makeCounter(cname, -increment));
  }
}
org.apache.cassandra.utilsByteBufferUtiltoLong

Popular methods of ByteBufferUtil

  • bytes
  • string
    Decode a String representation.
  • bytesToHex
  • getArray
    You should almost never use this. Instead, use the write* methods to avoid copies.
  • clone
  • hexToBytes
  • toFloat
  • toInt
    Convert a byte buffer to an integer. Does not change the byte buffer position.
  • toDouble
  • readBytes
  • arrayCopy
  • compareUnsigned
  • arrayCopy,
  • compareUnsigned,
  • read,
  • readShortLength,
  • compareSubArrays,
  • ensureCapacity,
  • getShortLength,
  • minimalBufferFor,
  • readBytesWithShortLength

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
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