Java Code Examples for org.apache.cassandra.db.marshal.CompositeType#isStaticName()
The following examples show how to use
org.apache.cassandra.db.marshal.CompositeType#isStaticName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompoundCType.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public Composite fromByteBuffer(ByteBuffer bytes) { if (!bytes.hasRemaining()) return Composites.EMPTY; ByteBuffer[] elements = new ByteBuffer[size()]; int idx = bytes.position(), i = 0; byte eoc = 0; boolean isStatic = false; if (CompositeType.isStaticName(bytes)) { isStatic = true; idx += 2; } while (idx < bytes.limit()) { checkRemaining(bytes, idx, 2); int length = bytes.getShort(idx) & 0xFFFF; idx += 2; checkRemaining(bytes, idx, length + 1); elements[i++] = sliceBytes(bytes, idx, length); idx += length; eoc = bytes.get(idx++); } return new CompoundComposite(elements, i, isStatic).withEOC(Composite.EOC.from(eoc)); }
Example 2
Source File: AbstractCompoundCellNameType.java From stratio-cassandra with Apache License 2.0 | 5 votes |
@Override public Composite fromByteBuffer(ByteBuffer bytes) { if (!bytes.hasRemaining()) return Composites.EMPTY; ByteBuffer[] elements = new ByteBuffer[fullSize]; int idx = bytes.position(), i = 0; byte eoc = 0; boolean isStatic = false; if (CompositeType.isStaticName(bytes)) { isStatic = true; idx += 2; } while (idx < bytes.limit()) { checkRemaining(bytes, idx, 2); int length = bytes.getShort(idx) & 0xFFFF; idx += 2; checkRemaining(bytes, idx, length + 1); elements[i++] = sliceBytes(bytes, idx, length); idx += length; eoc = bytes.get(idx++); } return makeWith(elements, i, Composite.EOC.from(eoc), isStatic); }