Package me.prettyprint.hector.api.beans

Examples of me.prettyprint.hector.api.beans.DynamicComposite.addComponent()


    }

    private DynamicComposite entryKey(K itemKey) {
        DynamicComposite entryKey = new DynamicComposite();
        entryKey.addComponent(itemKey, keySerializer);
        entryKey.addComponent(indexName, STRING_SERIALIZER);
        return entryKey;
    }

    private List<HColumn<Long, DynamicComposite>> getEntries(DynamicComposite entryKey) {
        final SliceQuery<DynamicComposite, Long, DynamicComposite> entryQuery = HFactory.createSliceQuery(keyspace, DYNAMIC_COMPOSITE_SERIALIZER, LONG_SERIALIZER, DYNAMIC_COMPOSITE_SERIALIZER);
View Full Code Here


    }

    @Override
    public ColumnValueDefinition<?> toColumnDefinition() {
        final DynamicComposite dynamicComposite = new DynamicComposite();
        dynamicComposite.addComponent(value, CassidyUtils.inferSerializer(value));
        return new ColumnValueDefinition<>(dynamicComposite, DynamicCompositeSerializer.get());
    }
}
View Full Code Here

                value = NULL_VALUE;
                serializer = (Serializer<Object>)NULL_VALUE_SERIALIZER;
            }
            final String comparator = serializer.getComparatorType().getTypeName();
            start.addComponent(value, serializer, comparator, AbstractComposite.ComponentEquality.EQUAL);
            end.addComponent(value, serializer, comparator, i == values.length - 1 ? AbstractComposite.ComponentEquality.GREATER_THAN_EQUAL : AbstractComposite.ComponentEquality.EQUAL);
        }
        LOGGER.debug("Searching for '{}' index columns with names between {} and {}...", indexName, start, end);
        final SliceQuery<String, DynamicComposite, K> query = HFactory.createSliceQuery(keyspace, StringSerializer.get(), DynamicCompositeSerializer.get(), keySerializer);
        query.setKey(indexName);
        query.setColumnFamily(indexColumnFamily);
View Full Code Here

    private void insertIndexColumn(K itemKey, long timestamp, List<IndexValue<?>> indexValues, Mutator<String> indexMutator) {
        LOGGER.debug("Indexing key {} with values {}...", itemKey, indexValues);
        DynamicComposite indexColumnName = new DynamicComposite();
        IndexValue.addAll(indexValues, indexColumnName);
        indexColumnName.addComponent(itemKey, keySerializer);
        indexColumnName.addComponent(timestamp, LONG_SERIALIZER);
        LOGGER.debug("Creating '{}' index column with name {} and value {}...", indexName, indexColumnName, itemKey);
        final HColumn<DynamicComposite, K> indexColumn = HFactory.createColumn(indexColumnName, itemKey, DYNAMIC_COMPOSITE_SERIALIZER, keySerializer);
        indexMutator.addInsertion(indexName, indexColumnFamily, indexColumn);
    }
View Full Code Here

    private void insertIndexColumn(K itemKey, long timestamp, List<IndexValue<?>> indexValues, Mutator<String> indexMutator) {
        LOGGER.debug("Indexing key {} with values {}...", itemKey, indexValues);
        DynamicComposite indexColumnName = new DynamicComposite();
        IndexValue.addAll(indexValues, indexColumnName);
        indexColumnName.addComponent(itemKey, keySerializer);
        indexColumnName.addComponent(timestamp, LONG_SERIALIZER);
        LOGGER.debug("Creating '{}' index column with name {} and value {}...", indexName, indexColumnName, itemKey);
        final HColumn<DynamicComposite, K> indexColumn = HFactory.createColumn(indexColumnName, itemKey, DYNAMIC_COMPOSITE_SERIALIZER, keySerializer);
        indexMutator.addInsertion(indexName, indexColumnFamily, indexColumn);
    }
View Full Code Here

        for (HColumn<Long, DynamicComposite> entry : entries) {
            final Long entryTimestamp = entry.getName();

            DynamicComposite indexColumnName = new DynamicComposite();
            appendComponents(entry.getValue(), indexColumnName);
            indexColumnName.addComponent(key, keySerializer);
            indexColumnName.addComponent(entryTimestamp, LONG_SERIALIZER);

            indexMutator.addDeletion(indexName, indexColumnFamily, indexColumnName, DYNAMIC_COMPOSITE_SERIALIZER);
            entryMutator.addDeletion(entryKey, entryColumnFamily, entryTimestamp, LONG_SERIALIZER);
        }
View Full Code Here

            final Long entryTimestamp = entry.getName();

            DynamicComposite indexColumnName = new DynamicComposite();
            appendComponents(entry.getValue(), indexColumnName);
            indexColumnName.addComponent(key, keySerializer);
            indexColumnName.addComponent(entryTimestamp, LONG_SERIALIZER);

            indexMutator.addDeletion(indexName, indexColumnFamily, indexColumnName, DYNAMIC_COMPOSITE_SERIALIZER);
            entryMutator.addDeletion(entryKey, entryColumnFamily, entryTimestamp, LONG_SERIALIZER);
        }
    }
View Full Code Here

        }
    }

    private DynamicComposite entryKey(K itemKey) {
        DynamicComposite entryKey = new DynamicComposite();
        entryKey.addComponent(itemKey, keySerializer);
        entryKey.addComponent(indexName, STRING_SERIALIZER);
        return entryKey;
    }

    private List<HColumn<Long, DynamicComposite>> getEntries(DynamicComposite entryKey) {
View Full Code Here

    }

    private DynamicComposite entryKey(K itemKey) {
        DynamicComposite entryKey = new DynamicComposite();
        entryKey.addComponent(itemKey, keySerializer);
        entryKey.addComponent(indexName, STRING_SERIALIZER);
        return entryKey;
    }

    private List<HColumn<Long, DynamicComposite>> getEntries(DynamicComposite entryKey) {
        final SliceQuery<DynamicComposite, Long, DynamicComposite> entryQuery = HFactory.createSliceQuery(keyspace, DYNAMIC_COMPOSITE_SERIALIZER, LONG_SERIALIZER, DYNAMIC_COMPOSITE_SERIALIZER);
View Full Code Here

   
   
    DynamicComposite endRange = new DynamicComposite();   
    //endRange.add(0, "225" + Character.MAX_VALUE);
    endRange.add(0, "Austin");
    endRange.addComponent(new Long(5830), LongSerializer.get(), "LongType", AbstractComposite.ComponentEquality.GREATER_THAN_EQUAL);
   
    sliceQuery.setRange(startRange, endRange, false, 10);

    QueryResult<ColumnSlice<DynamicComposite, String>> result = sliceQuery.execute();
    return result;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.