Code example for Supplier

Methods: get

0
        this.monitor = monitor;
        return this;
    } 
 
    public C isUnique(K key) throws ConnectionException {
        C unique = uniqueColumnSupplier.get();
 
        // Phase 1: Write a unique column 
        MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
        m.withRow(columnFamily, key).putEmptyColumn(unique, ttl);
        m.execute();
 
        // Phase 2: Read back all columns. There should be only 1 
        ColumnList<C> result = keyspace.prepareQuery(columnFamily).setConsistencyLevel(consistencyLevel).getKey(key)
                .execute().getResult(); 
 
        if (result.size() == 1) {
            return unique;
        } 
 
Experience pair programming with AI  Get Codota for Java