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

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

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

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.bytesToHex(buf);
  }
}
origin: hector-client/hector

 @Test
 public void testInsertSyntaxHex() {
  CqlQuery<String,String,Long> cqlQuery = new CqlQuery<String,String,Long>(keyspace, se, se, le);
  String query = String.format("update Standard1 set '%s' = '%s' WHERE KEY = '%s'",
    ByteBufferUtil.bytesToHex(se.toByteBuffer("birthyear")),
    ByteBufferUtil.bytesToHex(se.toByteBuffer("1976")),
    ByteBufferUtil.bytesToHex(se.toByteBuffer("mykey1")));
  cqlQuery.setQuery(query);
  cqlQuery.execute();
 }
}
origin: org.apache.cassandra/cassandra-all

  @Override
  public String toString()
  {
    return mark == null ? "null" : ByteBufferUtil.bytesToHex(mark);
  }
}
origin: jsevellec/cassandra-unit

  @Override
  public String toString()
  {
    return mark == null ? "null" : ByteBufferUtil.bytesToHex(mark);
  }
}
origin: jsevellec/cassandra-unit

@Override
public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion)
{
  return "\"0x" + ByteBufferUtil.bytesToHex(buffer) + '"';
}
origin: org.apache.cassandra/cassandra-all

  @Override
  public String toString()
  {
    return String.format("LegacyCell(%s, name=%s, v=%s, ts=%s, ldt=%s, ttl=%s)", kind, name, ByteBufferUtil.bytesToHex(value), timestamp, localDeletionTime, ttl);
  }
}
origin: jsevellec/cassandra-unit

  @Override
  public String toString()
  {
    return String.format("LegacyCell(%s, name=%s, v=%s, ts=%s, ldt=%s, ttl=%s)", kind, name, ByteBufferUtil.bytesToHex(value), timestamp, localDeletionTime, ttl);
  }
}
origin: jsevellec/cassandra-unit

@Override
public String toString()
{
  return String.format("CounterCacheKey(%s, %s, %s)",
             ksAndCFName,
             ByteBufferUtil.bytesToHex(ByteBuffer.wrap(partitionKey)),
             ByteBufferUtil.bytesToHex(ByteBuffer.wrap(cellName)));
}
origin: org.apache.cassandra/cassandra-all

  public DigestMismatchException(DecoratedKey key, ByteBuffer digest1, ByteBuffer digest2)
  {
    super(String.format("Mismatch for key %s (%s vs %s)",
              key.toString(),
              ByteBufferUtil.bytesToHex(digest1),
              ByteBufferUtil.bytesToHex(digest2)));
  }
}
origin: jsevellec/cassandra-unit

  public DigestMismatchException(DecoratedKey key, ByteBuffer digest1, ByteBuffer digest2)
  {
    super(String.format("Mismatch for key %s (%s vs %s)",
              key.toString(),
              ByteBufferUtil.bytesToHex(digest1),
              ByteBufferUtil.bytesToHex(digest2)));
  }
}
origin: org.apache.cassandra/cassandra-all

  private static String stringify(ByteBuffer name)
  {
    try
    {
      return UTF8Type.instance.getString(name);
    }
    catch (Exception e)
    {
      return ByteBufferUtil.bytesToHex(name);
    }
  }
}
origin: jsevellec/cassandra-unit

  @Override
  public String toString()
  {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < clustering.size(); i++)
      sb.append(i > 0 ? ":" : "").append(clustering.get(i) == null ? "null" : ByteBufferUtil.bytesToHex(clustering.get(i)));
    return String.format("Cellname(clustering=%s, column=%s, collElt=%s)", sb.toString(), column == null ? "null" : column.name, collectionElement == null ? "null" : ByteBufferUtil.bytesToHex(collectionElement));
  }
}
origin: org.apache.cassandra/cassandra-all

  @Override
  public String toString()
  {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < clustering.size(); i++)
      sb.append(i > 0 ? ":" : "").append(clustering.get(i) == null ? "null" : ByteBufferUtil.bytesToHex(clustering.get(i)));
    return String.format("Cellname(clustering=%s, column=%s, collElt=%s)", sb.toString(), column == null ? "null" : column.name, collectionElement == null ? "null" : ByteBufferUtil.bytesToHex(collectionElement));
  }
}
origin: org.apache.cassandra/cassandra-all

  @Override
  public String toString()
  {
    StringBuilder sb = new StringBuilder();
    sb.append(bound.kind()).append('(');
    for (int i = 0; i < bound.size(); i++)
      sb.append(i > 0 ? ":" : "").append(bound.get(i) == null ? "null" : ByteBufferUtil.bytesToHex(bound.get(i)));
    sb.append(')');
    return String.format("Bound(%s, collection=%s)", sb.toString(), collectionName == null ? "null" : collectionName.name);
  }
}
origin: jsevellec/cassandra-unit

public String deserialize(ByteBuffer bytes)
{
  try
  {
    return ByteBufferUtil.string(bytes, charset);
  }
  catch (CharacterCodingException e)
  {
    throw new MarshalException("Invalid " + charset + " bytes " + ByteBufferUtil.bytesToHex(bytes));
  }
}
origin: org.apache.cassandra/cassandra-all

public String deserialize(ByteBuffer bytes)
{
  try
  {
    return ByteBufferUtil.string(bytes, charset);
  }
  catch (CharacterCodingException e)
  {
    throw new MarshalException("Invalid " + charset + " bytes " + ByteBufferUtil.bytesToHex(bytes));
  }
}
origin: jsevellec/cassandra-unit

public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException
{
  CollectionType t = defined.get(collectionName);
  if (t == null)
    throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection");
  t.nameComparator().validate(bytes);
}
origin: org.apache.cassandra/cassandra-all

public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException
{
  CollectionType t = defined.get(collectionName);
  if (t == null)
    throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection");
  t.nameComparator().validate(bytes);
}
origin: org.apache.cassandra/cassandra-all

@Override
public String toString()
{
  String keystring = getKey() == null ? "null" : ByteBufferUtil.bytesToHex(getKey());
  return "DecoratedKey(" + getToken() + ", " + keystring + ")";
}
origin: jsevellec/cassandra-unit

@Override
public String toString()
{
  String keystring = getKey() == null ? "null" : ByteBufferUtil.bytesToHex(getKey());
  return "DecoratedKey(" + getToken() + ", " + keystring + ")";
}
org.apache.cassandra.utilsByteBufferUtilbytesToHex

Popular methods of ByteBufferUtil

  • bytes
  • string
    Decode a String representation.
  • 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.
  • toLong
  • toDouble
  • readBytes
  • arrayCopy
  • compareUnsigned
  • arrayCopy,
  • compareUnsigned,
  • read,
  • readShortLength,
  • compareSubArrays,
  • ensureCapacity,
  • getShortLength,
  • minimalBufferFor,
  • readBytesWithShortLength

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • JLabel (javax.swing)
  • JTable (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
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