com.netflix.astyanax.serializers.ByteBufferSerializer Java Examples

The following examples show how to use com.netflix.astyanax.serializers.ByteBufferSerializer. 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: AbstractPlacementFactory.java    From emodb with Apache License 2.0 6 votes vote down vote up
protected <C> ColumnFamily<ByteBuffer, C> getColumnFamily(KeyspaceDefinition keyspaceDef,
                                                          String prefix, String suffix, String placement,
                                                          Serializer<C> columnSerializer) throws IllegalArgumentException {
    // Create the column family object.  It must be keyed by a ByteBuffer because that's what
    // the AstyanaxTable.getRowKey() method returns.
    ColumnFamily<ByteBuffer, C> cf = new ColumnFamily<>(prefix + "_" + suffix,
            ByteBufferSerializer.get(), columnSerializer);

    // Verify that the column family exists in the Cassandra schema.
    ColumnFamilyDefinition cfDef = keyspaceDef.getColumnFamily(cf.getName());
    if (cfDef == null) {
        throw new UnknownPlacementException(format(
                "Placement string '%s' refers to unknown Cassandra %s column family in keyspace '%s': %s",
                placement, suffix, keyspaceDef.getName(), cf.getName()), placement);
    }
    return cf;
}
 
Example #2
Source File: AstyanaxKeyColumnValueStore.java    From titan1withtp3.1 with Apache License 2.0 6 votes vote down vote up
AstyanaxKeyColumnValueStore(String columnFamilyName,
                            Keyspace keyspace,
                            AstyanaxStoreManager storeManager,
                            RetryPolicy retryPolicy) {
    this.keyspace = keyspace;
    this.columnFamilyName = columnFamilyName;
    this.retryPolicy = retryPolicy;
    this.storeManager = storeManager;

    entryGetter = new AstyanaxGetter(storeManager.getMetaDataSchema(columnFamilyName));

    columnFamily = new ColumnFamily<ByteBuffer, ByteBuffer>(
            this.columnFamilyName,
            ByteBufferSerializer.get(),
            ByteBufferSerializer.get());

}
 
Example #3
Source File: AstyanaxThriftDataTableResource.java    From staash with Apache License 2.0 4 votes vote down vote up
public AstyanaxThriftDataTableResource(Keyspace keyspace, String name) {
    this.keyspace = keyspace;
    this.columnFamily = ColumnFamily.newColumnFamily(name, ByteBufferSerializer.get(), ByteBufferSerializer.get());
}